Skip to content

chore(legacy): subtree merge legacy-cli 5.x updates#19

Merged
miguelsanchez-upsun merged 3 commits intomainfrom
chore/legacy-subtree-update
Apr 28, 2026
Merged

chore(legacy): subtree merge legacy-cli 5.x updates#19
miguelsanchez-upsun merged 3 commits intomainfrom
chore/legacy-subtree-update

Conversation

@pjcdawkins
Copy link
Copy Markdown
Contributor

@pjcdawkins pjcdawkins commented Feb 5, 2026

Subtree merge of platformsh/legacy-cli 5.x (adb14ee..08be158).

The legacy phar in this fork now matches upstream legacy-cli 5.x, catching up on releases v4.28.0 through v4.30.0 plus a few post-release fixes from the 5.x branch.

Catch-up to upstream releases

From v4.30.0:

  • var:create / var:update: new --app-scope option to scope variables to specific applications.
  • db:dump: avoid PROCESS privilege error on oracle-mysql databases. (Upstream's fix had its condition inverted; corrected on this PR.)
  • New environment.alert activity type.

From v4.29.0:

  • autoscaling:get / autoscaling:set: support configuring autoscaling for services that declare horizontal scaling, in addition to apps and workers.
  • org:create: skip the interactive "type" question.
  • metrics: restore the --interval option.
  • push (rolling): return a non-zero exit code when a rolling deployment fails.

From v4.28.2:

  • resources:build:get: hidden when sizing is disabled on the project.
  • push: fix error when pushing a new local branch.

From v4.28.0:

  • Activities with non-zero exit codes are displayed as failed.
  • push: new --deploy-strategy option (rolling or stopstart).
  • Metrics now query the Observability Pipeline endpoints, with some default-column changes documented in the upstream notes.
  • Error earlier in non-interactive mode when an organization ID is required.
  • activity:list: help text gains an example for adding the activity-type column.
  • org:billing-profile: security_contact removed from the writable properties.
  • metrics: don't throw when the backend returns no values for a timestamp.

Unreleased upstream fixes (5.x branch, post-v4.30.0)

  • api:curl: don't write the raw 401 response body to stdout when transparently retrying after a token refresh.
  • var:create / var:update: handle EnvironmentStateException when listing apps for --app-scope validation.

New (upsun/cli only) fixes

  • db:dump (oracle-mysql): correct the inverted --no-tablespaces condition from upstream's fix (to be sent upstream).
  • var:create / var:update: guard against a null default_branch when validating --app-scope.
  • autoscaling:get / autoscaling:set: command descriptions updated to mention services.

🤖 Generated with Claude Code

@pjcdawkins pjcdawkins force-pushed the chore/legacy-subtree-update branch from 444c3f3 to 247c263 Compare February 5, 2026 22:46
@pjcdawkins pjcdawkins requested a review from Copilot February 5, 2026 22:47
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 merges 31 commits from the platformsh/legacy-cli 5.x branch and ports upstream variable app-scope tests to integration-tests/. It includes bug fixes for CurlCli stdout handling during 401 retries and data race issues in api_curl_test, plus additions to the mockapi Variable struct.

Changes:

  • Added ApplicationScope field to mockapi Variable struct and ported upstream app-scope tests
  • Fixed CurlCli stdout double-write bug in 401 retry path and data race in api_curl_test
  • Updated legacy-cli configuration files to reflect Upsun branding and removed legacy test file

Reviewed changes

Copilot reviewed 22 out of 24 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/mockapi/model.go Added ApplicationScope field to Variable struct
legacy/tests/Local/LocalProjectTest.php Removed legacy project test file
legacy/src/Service/VariableCommandUtil.php Added application_scope field with validation for variable commands
legacy/src/Service/Relationships.php Added isOracleDB method for database type checking
legacy/src/Service/CurlCli.php Fixed stdout buffering to prevent double-write during 401 retries
legacy/src/Service/ActivityMonitor.php Fixed result name reference to use RESULT_NAMES constant
legacy/src/Service/ActivityLoader.php Added environment.alert activity type
legacy/src/Command/Organization/OrganizationCreateCommand.php Added avoidQuestion flag to organization type field
legacy/src/Command/Organization/Billing/OrganizationProfileCommand.php Removed security_contact from writable properties
legacy/src/Command/Metrics/MetricsCommandBase.php Added blank line formatting
legacy/src/Command/Environment/EnvironmentPushCommand.php Added deploy-strategy option with validation
legacy/src/Command/Db/DbDumpCommand.php Added --no-tablespaces flag for non-Oracle MySQL databases
legacy/src/Command/Autoscaling/AutoscalingSettingsSetCommand.php Extended autoscaling support to services with capability checks
legacy/src/Command/Autoscaling/AutoscalingSettingsGetCommand.php Added filtering for autoscaling settings display
legacy/src/Command/Activity/ActivityListCommand.php Added example for including activity type in output
legacy/config.yaml Updated branding from Platform.sh to Upsun with new URLs
legacy/config-defaults.yaml Updated logo to SVG format and added rolling deployment error message
legacy/README.md Updated references from Platform.sh to Upsun
legacy/Makefile Removed Go test targets
legacy/CONTRIBUTING.md Updated repository references and formatting
integration-tests/variable_write_test.go Added comprehensive tests for variable app-scope functionality
integration-tests/api_curl_test.go Fixed data race with tokenState struct and mutex protection

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

Comment thread legacy/src/Command/Environment/EnvironmentPushCommand.php
Comment thread legacy/src/Service/Relationships.php Outdated
pjcdawkins and others added 2 commits April 27, 2026 20:55
Merge 31 commits from platformsh/legacy-cli 5.x (adb14ee..08be158).

Notable upstream changes:
- Autoscaling settings: expanded get/set commands
- Variable app-scope: new --app-scope option for var:create/update
- CurlCli: stdout buffering for 401 retry
- Environment push: additional options
- Db dump: new options
- Various config and metadata updates

Conflicts resolved:
- legacy/src/Service/CurlCli.php: took upstream changes, fixed stdout
  double-write bug in retry block
- legacy/go-tests/: removed (moved to integration-tests/ in this repo)

Additional changes in this repo:
- Port variable app-scope tests to integration-tests/ with
  setupVariableTest helper and two new test functions
- Add ApplicationScope field to mockapi Variable struct
- Remove legacy Makefile go-tests targets (now in integration-tests/)
- Fix data race in api_curl_test with tokenState struct
- Suppress phpstan false positive in CurlCli.php

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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

Copilot reviewed 21 out of 23 changed files in this pull request and generated 4 comments.


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

Comment thread legacy/src/Command/Db/DbDumpCommand.php Outdated
Comment thread legacy/src/Service/VariableCommandUtil.php
Comment thread legacy/src/Command/Autoscaling/AutoscalingSettingsGetCommand.php
Comment thread legacy/src/Command/Autoscaling/AutoscalingSettingsSetCommand.php
- DbDumpCommand: invert --no-tablespaces condition so the flag is
  applied for oracle-mysql (where mysqldump lacks the PROCESS
  privilege to dump tablespaces). The upstream fix in
  platformsh/legacy-cli#1593 has the inverse condition: it adds the
  flag for non-Oracle DBs, leaving oracle-mysql still failing with
  "Access denied; you need (at least one of) the PROCESS privilege(s)
  for this operation". This local fix should also be sent upstream.

- VariableCommandUtil::listApps: guard against a null default_branch
  before calling Api::getEnvironment(string), which would otherwise
  TypeError. Matches the existing null check in DomainCommandBase.

- AutoscalingSettingsGet/Set: update AsCommand descriptions to
  mention services. Upstream PR #1587 added service-level autoscaling
  but left the help text saying "apps and workers" only.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@miguelsanchez-upsun miguelsanchez-upsun merged commit da4b206 into main Apr 28, 2026
4 checks passed
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