Skip to content

fix(legacy): clarify why certain functions are not available on fixed plans#50

Open
pjcdawkins wants to merge 2 commits intomainfrom
migrate/legacy-pr-1598
Open

fix(legacy): clarify why certain functions are not available on fixed plans#50
pjcdawkins wants to merge 2 commits intomainfrom
migrate/legacy-pr-1598

Conversation

@pjcdawkins
Copy link
Copy Markdown
Contributor

Migrated from platformsh/legacy-cli#1598 (original author: @matthiaz). Two upstream commits squashed in order on this branch: the initial fix and the wording follow-up.

Customer context (from the original PR): a user saw The flexible resources API is not enabled for the project ... on a fixed plan and tried to follow the suggestion to enable it. The new message clarifies that the function is not available on fixed plans and links to the Fixed docs.

Adapted to the 5.x architecture in legacy/ (DI-based $selection and $this->api), and the original \n literals inside a single-quoted string were rewritten as concatenated "\n" so the newlines actually render. The URL https://fixed.docs.upsun.com/ is preserved verbatim from the source PR — please verify it points at the right docs target before merging.

Copilot AI review requested due to automatic review settings April 27, 2026 19:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the legacy resources:build:get command’s error output when the Flexible Resources (Sizing) API is unavailable, aiming to clarify that the attempted functionality isn’t available on fixed plans and to point users to Fixed documentation.

Changes:

  • Expanded the “flexible resources API is not enabled” error into a multi-line message.
  • Added wording indicating the command is not available on fixed plans and included a Fixed docs URL.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +46 to +48
'The flexible resources API is not enabled for the project %s.' . "\n"
. 'The function you attempted to use is not available on fixed plans.' . "\n"
. 'Please refer to the Fixed documentation: https://fixed.docs.upsun.com/',
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition here is !$this->api->supportsSizingApi($project), which only checks the sizing_api_enabled project setting (legacy/src/Service/Api.php:1631-1638). That doesn’t necessarily imply the project is on a fixed plan, so the added sentence “not available on fixed plans” may be inaccurate/misleading for other cases where the sizing API is simply disabled. Consider rewording the message to avoid asserting the plan type (or add an explicit fixed-plan check before mentioning fixed plans).

Suggested change
'The flexible resources API is not enabled for the project %s.' . "\n"
. 'The function you attempted to use is not available on fixed plans.' . "\n"
. 'Please refer to the Fixed documentation: https://fixed.docs.upsun.com/',
'The flexible resources API is not enabled for the project %s.',

Copilot uses AI. Check for mistakes.
$this->stdErr->writeln(sprintf(
'The flexible resources API is not enabled for the project %s.' . "\n"
. 'The function you attempted to use is not available on fixed plans.' . "\n"
. 'Please refer to the Fixed documentation: https://fixed.docs.upsun.com/',
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This introduces a new hard-coded docs URL (https://fixed.docs.upsun.com/). Elsewhere in legacy/ the Upsun Fixed docs links use the https://docs.upsun.com/anchors/fixed/... pattern (e.g. legacy/src/Service/Relationships.php:400-401, legacy/src/Local/ApplicationFinder.php:123). To keep links consistent (and easier to update), consider switching to the established docs domain/path or making this URL configurable similarly to service.resources_help_url.

Suggested change
. 'Please refer to the Fixed documentation: https://fixed.docs.upsun.com/',
. 'Please refer to the Fixed documentation: https://docs.upsun.com/anchors/fixed/',

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants