Skip to content

Commit dcef40f

Browse files
committed
Merge 4.x into 5.x, with basic conflict resolution
2 parents dbe0dec + 8221419 commit dcef40f

File tree

63 files changed

+2342
-231
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+2342
-231
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ jobs:
5454
./scripts/test/unit.sh
5555
5656
- name: Set up Go
57-
uses: actions/setup-go@v4
57+
uses: actions/setup-go@v5
5858
with:
59-
go-version: 1.22
59+
go-version: 1.25
6060
cache-dependency-path: cli/go.sum
6161

6262
- name: Lint Go files

.github/workflows/golangci-lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
go-version: stable
1919

2020
- name: golangci-lint
21-
uses: golangci/golangci-lint-action@v6
21+
uses: golangci/golangci-lint-action@v8
2222
with:
23-
version: v1.64
23+
version: v2.4
2424
working-directory: go-tests

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ There are two ways to authenticate:
6767

6868
1. The recommended way is `platform login`, which lets you log in via a web browser, including via third-party providers such as Google, GitHub, GitLab and Bitbucket.
6969

70-
2. If using a browser is not possible, use an [API token](https://docs.platform.sh/gettingstarted/cli/api-tokens.html).
70+
2. If using a browser is not possible, use an [API token](https://docs.upsun.com/anchors/fixed/cli/api-token/).
7171

7272
An interactive command is available for this: `platform auth:api-token-login`
7373

composer.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config-defaults.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ application:
6767
# Disabled commands (a list of full command names).
6868
disabled_commands: []
6969

70+
# Whether to mark this CLI as a 'legacy' version if not under the Go wrapper.
71+
mark_unwrapped_legacy: false
72+
7073
# Disabled commands under the Go wrapper (a list of full command names).
7174
wrapped_disabled_commands: []
7275

@@ -241,6 +244,12 @@ api:
241244
# Whether the Organizations API is enabled.
242245
organizations: false
243246

247+
# A list of supported organization types.
248+
organization_types: []
249+
250+
# The default type when creating an organization.
251+
default_organization_type: ~
252+
244253
# Whether Centralized User Management is available.
245254
# Ignored if "organizations" is disabled.
246255
centralized_permissions: true
@@ -389,6 +398,12 @@ warnings:
389398
# without the capability.
390399
non_production_domains_msg: null
391400

401+
# The message shown when configuring guaranteed resources.
402+
guaranteed_resources_msg: null
403+
404+
# The message shown when branching/activating an environment with resources init strategy parent.
405+
guaranteed_resources_branch_msg: null
406+
392407
# Configuration for informational messages.
393408
messages:
394409
# A message about discounts where a region choice is displayed.

config.yaml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ application:
1212
manifest_url: 'https://platform.sh/cli/manifest.json'
1313
github_repo: 'platformsh/legacy-cli'
1414

15+
mark_unwrapped_legacy: true
1516
wrapped_disabled_commands:
1617
- self:install
1718
- self:update
@@ -37,16 +38,19 @@ service:
3738

3839
pricing_url: 'https://platform.sh/pricing'
3940

40-
activity_type_list_url: 'https://docs.platform.sh/integrations/activity/reference.html#type'
41+
activity_type_list_url: 'https://docs.upsun.com/anchors/fixed/integrations/activity-scripts/type/'
4142

42-
runtime_operations_help_url: 'https://docs.platform.sh/create-apps/runtime-operations.html'
43+
runtime_operations_help_url: 'https://docs.upsun.com/anchors/fixed/app/runtime-operations/'
4344

4445
api:
4546
base_url: 'https://api.platform.sh'
4647

4748
auth_url: 'https://auth.api.platform.sh'
4849
oauth2_client_id: 'platform-cli'
4950

51+
organization_types: [flexible, fixed]
52+
default_organization_type: flexible
53+
5054
organizations: true
5155
user_verification: true
5256
metrics: true
@@ -65,12 +69,21 @@ detection:
6569

6670
migrate:
6771
prompt: true
68-
docs_url: https://docs.platform.sh/administration/cli.html
72+
docs_url: https://docs.upsun.com/anchors/fixed/cli/
6973

7074
warnings:
7175
non_production_domains_msg: |
7276
This feature is only available to Enterprise and Elite customers.
7377
If you're an Enterprise or Elite customer, contact support to enable the feature.
7478
Otherwise contact sales first to upgrade your plan.
7579
76-
See: https://docs.platform.sh/overview/get-support.html
80+
See: https://docs.upsun.com/anchors/fixed/get-support/
81+
82+
guaranteed_resources_msg: |
83+
You have chosen to allocate guaranteed resources for app(s) and/or service(s).
84+
This change may affect resource costs. See: <info>https://upsun.com/pricing/</info>
85+
86+
This process requires a redeployment of containers on their own host, which may take a few minutes to complete.
87+
88+
guaranteed_resources_branch_msg: |
89+
Guaranteed resources from the parent will be provisioned, impacting your bill.

dist/installer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* @deprecated
88
* The CLI no longer requires a local PHP installation or this installer.
9-
* See https://docs.platform.sh/administration/cli.html
9+
* See https://docs.upsun.com/anchors/fixed/cli/
1010
*
1111
* This script will check requirements, download the CLI, move it into place,
1212
* and run the self:install command (to set up the PATH and autocompletion).
@@ -82,7 +82,7 @@ public function __construct(array $args = [])
8282
'userAgent' => 'platformsh-cli',
8383
'serviceEnvPrefix' => 'PLATFORM_',
8484
'migratePrompt' => true,
85-
'migrateDocsUrl' => 'https://docs.platform.sh/administration/cli.html',
85+
'migrateDocsUrl' => 'https://docs.upsun.com/anchors/fixed/cli/',
8686
)/* END_CONFIG */;
8787

8888
$required = ['envPrefix', 'manifestUrl', 'configDir', 'executable', 'cliName'];

dist/manifest.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[
22
{
3-
"version": "4.22.0",
4-
"sha1": "ec4359c0c6f353190466bab61901ca30fad2f86b",
5-
"sha256": "911a4b3420533b2eeecd5fa6e54c7c5bcb1baf41c170627f1c29ea3b6c7f7cf5",
3+
"version": "4.27.0",
4+
"sha1": "62e5f46d69cf191324b2baa4a0ee9aa1487d564a",
5+
"sha256": "77b998915dc64a2141809dec08a7e9988045376e4bbcb99005512249813b9c61",
66
"name": "platform.phar",
7-
"url": "https://github.com/platformsh/legacy-cli/releases/download/v4.22.0/platform.phar",
7+
"url": "https://github.com/platformsh/legacy-cli/releases/download/v4.27.0/platform.phar",
88
"php": {
99
"min": "5.5.9"
1010
},
@@ -72,7 +72,12 @@
7272
"4.20.5": "* Fix environments listing by ID",
7373
"4.21.0": "New features:\n\n* Support listing teams for a single project.\n - The `team:list` (`teams`) command will now filter the teams list to those \n with access to the selected project, if any. The project is selected in the \n normal way, e.g. by `--project` (`-p`), or the current Git repository.\n - Use the `--all` option to list all the teams in the organization.\n - Add the `granted_at` column (`--columns +granted_at`) to see when the team \n was added to the project.\n\nOther changes:\n\n* Print necessary output in `--quiet` mode: \n Previously, the `--quiet` (`-q`) flag hid ALL output, on stderr and stdout. \n It now only hides message/error output (stderr), and continues to print \n necessary output (stdout).\n* Cache organization data locally (for up to 10 minutes by default).\n* Display the project's organization in the welcome command.\n* Silence output from `ssh-cert:load --refresh-only` (in non-verbose mode).\n* Add debug info for session storage.\n* Explain various actions being unavailable with a code source integration:\n synchronizing code, branching and merging.\n* Explain synchronizing being unavailable when the env or its parent is inactive.\n* Explain SSH unavailability when an env is paused.\n* Fix and improve project suspension warnings.\n* Improve formatting of Solr and PostgreSQL URLs.\n* Bump giggsey/libphonenumber-for-php from 8.13.45 to 8.13.46 (#1490)",
7474
"4.21.1": "* Re-allow output from \"ssh-cert:load --refresh-only\", now that quiet mode works (#1491)\n This partially reverts 29a92850a2ce8a4f583e23bba75dcf1fdaad44c3\n* After branching, only set the upstream if the remote exists\n* Skip the cache when updating an org via the org:info command\n* Do not require SSH permission to list mounts\n* Handle old envs with outdated \"has_remote\" in the env:delete command",
75-
"4.22.0": "New features:\n\n* Add `--init-repo` option for the `create` (`project:create`) command, as a \n shortcut for creating a project from code in a public repository.\n* Before creating a project, check the organization's permissions. This uses the \n `can-create` API endpoint, which supports more potential action prompts than \n the previous version (which only supported phone verification), e.g. to create \n a support ticket or to update the organization's billing details.\n\nOther changes:\n\n* Make `redis` and `ssh` args consistent; allow multiple args in the `redis` command.\n* Fix error after creating a new organization from a project directory.\n* Fix the project list cache not clearing automatically."
75+
"4.22.0": "New features:\n\n* Add `--init-repo` option for the `create` (`project:create`) command, as a \n shortcut for creating a project from code in a public repository.\n* Before creating a project, check the organization's permissions. This uses the \n `can-create` API endpoint, which supports more potential action prompts than \n the previous version (which only supported phone verification), e.g. to create \n a support ticket or to update the organization's billing details.\n\nOther changes:\n\n* Make `redis` and `ssh` args consistent; allow multiple args in the `redis` command.\n* Fix error after creating a new organization from a project directory.\n* Fix the project list cache not clearing automatically.",
76+
"4.23.0": "New features:\n\n* Add Valkey support\n* Refresh the token and retry requests on a 401 error in :curl commands\n\nOther functional changes:\n\n* Rename \"web\" command to \"console\" (\"web\" remains as an alias)\n* Show \"(legacy)\" in the version output, if not wrapped.\n* Fix the console URL in the project:create (create) command\n* Fix duplication of commands in Markdown-formatted list\n* installer: fix use of GitHub credentials on container where available\n* Update composer/ca-bundle and drush/drush dependencies\n\nDevelopment-related changes:\n\n* Add Golang integration tests in `/go-tests`\n* Run tests and security checks in GitHub Actions\n* Use Composer 2 in dev builds\n* Remove composer-bin-plugin\n* Update countries script for new CLDR format",
77+
"4.24.0": "New features:\n\n* Support guaranteed resources, adding a new CPU type concept (`shared` or\n `guaranteed`) to the `resources` commands.\n* Support manual deployments:\n - Add an `environment:deploy` command to deploy staged changes.\n - Add an `environment:deploy:type` command to view or change the deployment\n type (between `manual` and `automatic`).\n - Add a `deployment_type` property (read-only) to the `environment:info`\n command.\n - Support the `staged` activity state in activity-related commands.\n\nOther changes:\n\n* Increase the default limits for finding activities.\n* Stop bypassing the organization endpoint for subscriptions.\n* Update Go test dependencies.\n* Add `mark_unwrapped_legacy` config option (defaults to `false`).",
78+
"4.25.0": "New features:\n\n* Autoscaling-related features:\n - Add an `autoscaling` command to read autoscaling settings.\n - Mark services with autoscaling in the `resources` command.\n - Disallow changing the instance count in `resources:set` when autoscaling is enabled.\n* Support the OpenTelemetry Protocol (`otlp`) integration, when available on the project.\n* Add a `--strategy` (`-s`) option to the `env:deploy` command (`stopstart` or `rolling`).\n* Require confirmation on `branch` or `env:activate` commands when guaranteed resources are configured.\n\nOther changes:\n\n* Update embedded docs links to the new permalink structure.\n* Avoid writing to stdout when opening a URL.\n* Treat `upsun` and `platformsh` vendors as equivalent in the project list from 2025-09-23.\n* Fix the command recommendation when there are staged activities.\n* Fix the Drush site URL when there is no app route (e.g. with Varnish).",
79+
"4.26.0": "New features:\n\n* Add `autoscaling:set` command, to configure CPU-based autoscaling\n* Add support for organization types\n - Display the organization type in the `orgs` list\n - Add a `--type` filter in the `orgs` list\n - Add a `--type` option to `org:create`\n - Display the organization type in the `projects` list\n - Add an `--org-type` filter in the `projects` list\n* Add a `deploy` alias for the `env:deploy` command\n\nOther changes:\n\n* Fix \"This environment is inactive\" during activation, if the deployment cannot \n be fetched.",
80+
"4.27.0": "* Support `memory` as a trigger for autoscaling\n* Set `--fail-with-body` by default in `:curl` commands\n* Update name of `otlp` integration to `otlplog`"
7681
}
7782
},
7883
{

go-tests/activity_list_test.go

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package tests
22

33
import (
44
"net/http/httptest"
5+
"strconv"
56
"testing"
67
"time"
78

@@ -87,4 +88,51 @@ func TestActivityList(t *testing.T) {
8788

8889
assertTrimmed(t, "complete", f.Run("act:get", "-p", projectID, "-e", ".", "act1", "-P", "state"))
8990
assertTrimmed(t, "2014-04-01T10:00:00+00:00", f.Run("act:get", "-p", projectID, "-e", ".", "act1", "-P", "created_at"))
91+
92+
// Generate a longer list of activities.
93+
var activities = make([]*mockapi.Activity, 30)
94+
for i := range activities {
95+
num := i + 1
96+
createdAt := aprilFoolsDay10am.Add(time.Duration(i) * time.Minute)
97+
varName := "X" + strconv.Itoa(num)
98+
activities[i] = &mockapi.Activity{
99+
ID: "act" + strconv.Itoa(num),
100+
Type: "environment.variable.create",
101+
State: "complete",
102+
Result: "success",
103+
CompletionPercent: 100,
104+
Project: projectID,
105+
Environments: []string{"main"},
106+
Description: "<user>Mock User</user> created variable <variable>" + varName + "</variable> on environment <environment>main</environment>",
107+
Text: "Mock User created variable " + varName + " on environment main",
108+
CreatedAt: createdAt,
109+
UpdatedAt: createdAt,
110+
}
111+
}
112+
apiHandler.SetProjectActivities(projectID, activities)
113+
114+
assertTrimmed(t, `
115+
ID Created Description Progress State Result
116+
act30 2014-04-01T10:29:00+00:00 Mock User created variable X30 on environment main 100% complete success
117+
act29 2014-04-01T10:28:00+00:00 Mock User created variable X29 on environment main 100% complete success
118+
act28 2014-04-01T10:27:00+00:00 Mock User created variable X28 on environment main 100% complete success
119+
act27 2014-04-01T10:26:00+00:00 Mock User created variable X27 on environment main 100% complete success
120+
act26 2014-04-01T10:25:00+00:00 Mock User created variable X26 on environment main 100% complete success`,
121+
f.Run("act", "-p", projectID, "-e", ".", "--format", "plain", "--limit", "5"))
122+
123+
assertTrimmed(t, `
124+
ID Created Description Progress State Result
125+
act30 2014-04-01T10:29:00+00:00 Mock User created variable X30 on environment main 100% complete success
126+
act29 2014-04-01T10:28:00+00:00 Mock User created variable X29 on environment main 100% complete success
127+
act28 2014-04-01T10:27:00+00:00 Mock User created variable X28 on environment main 100% complete success
128+
act27 2014-04-01T10:26:00+00:00 Mock User created variable X27 on environment main 100% complete success
129+
act26 2014-04-01T10:25:00+00:00 Mock User created variable X26 on environment main 100% complete success
130+
act25 2014-04-01T10:24:00+00:00 Mock User created variable X25 on environment main 100% complete success
131+
act24 2014-04-01T10:23:00+00:00 Mock User created variable X24 on environment main 100% complete success
132+
act23 2014-04-01T10:22:00+00:00 Mock User created variable X23 on environment main 100% complete success
133+
act22 2014-04-01T10:21:00+00:00 Mock User created variable X22 on environment main 100% complete success
134+
act21 2014-04-01T10:20:00+00:00 Mock User created variable X21 on environment main 100% complete success
135+
act20 2014-04-01T10:19:00+00:00 Mock User created variable X20 on environment main 100% complete success
136+
act19 2014-04-01T10:18:00+00:00 Mock User created variable X19 on environment main 100% complete success`,
137+
f.Run("act", "-p", projectID, "-e", ".", "--format", "plain", "--limit", "12"))
90138
}

go-tests/config.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ api:
2020

2121
disable_credential_helpers: true
2222

23+
organization_types: [flexible, fixed]
24+
default_organization_type: flexible
25+
2326
organizations: true
2427
centralized_permissions: true
2528
teams: true

0 commit comments

Comments
 (0)