fix(legacy): clarify why certain functions are not available on fixed plans#50
fix(legacy): clarify why certain functions are not available on fixed plans#50pjcdawkins wants to merge 2 commits intomainfrom
Conversation
There was a problem hiding this comment.
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.
| '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/', |
There was a problem hiding this comment.
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).
| '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.', |
| $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/', |
There was a problem hiding this comment.
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.
| . 'Please refer to the Fixed documentation: https://fixed.docs.upsun.com/', | |
| . 'Please refer to the Fixed documentation: https://docs.upsun.com/anchors/fixed/', |
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$selectionand$this->api), and the original\nliterals inside a single-quoted string were rewritten as concatenated"\n"so the newlines actually render. The URLhttps://fixed.docs.upsun.com/is preserved verbatim from the source PR — please verify it points at the right docs target before merging.