Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
2b667e5
Release v4.23.0
pjcdawkins Mar 12, 2025
b4bd0f9
Add mark_unwrapped_legacy config option
pjcdawkins May 2, 2025
514bbcb
Update Go test dependencies (#1533)
pjcdawkins May 13, 2025
ac5cce2
Stop bypassing the organization endpoint for subscriptions (#1532)
pjcdawkins May 13, 2025
5b16579
Increase the default limits for finding activities
pjcdawkins Jun 4, 2025
b1618a4
Add environment deploy command and staged activities (#1530)
vitolkachova Jun 6, 2025
53306b0
Merge pull request #1539 from platformsh/bump-activity-default-limits
vitolkachova Jun 6, 2025
8d4db4e
fix activity result breaks (#1541)
vitolkachova Jun 18, 2025
24d8726
Bump github.com/go-chi/chi/v5 from 5.2.1 to 5.2.2 in /go-tests (#1542)
dependabot[bot] Jul 3, 2025
6b2c7a4
Guaranteed resources support. (#1531)
shahinam Jul 15, 2025
4b42242
Remove "deploy" alias from env:deploy command
pjcdawkins Jul 18, 2025
ec7226c
Merge pull request #1545 from platformsh/env-deploy-remove-alias
vitolkachova Jul 18, 2025
ac82212
Add an environment:deploy:type command
vitolkachova Jul 31, 2025
3691a50
Add read-only "deployment_type" to env:info (#1540)
vitolkachova Jul 31, 2025
aaef1b8
Release v4.24.0
pjcdawkins Jul 31, 2025
c1ad124
Fix Drush site URL when there is no app route (e.g. with Varnish)
pjcdawkins Aug 4, 2025
5dd0a3b
Initial support for listing environment autoscaling settings (#1549)
ricardokirkner Aug 12, 2025
1fc6d1d
Fix command recommendation when there are staged activities
pjcdawkins Aug 14, 2025
3d57db7
Changing instance count on services where autoscaling is enabled is n…
ricardokirkner Aug 20, 2025
edf0fe6
fix: let getAutoscalingSettings return empty settings when autoscalin…
ricardokirkner Aug 28, 2025
795cd72
Allow strategy for environment deploy command (#1559)
vitolkachova Aug 29, 2025
5b9701d
Include a badge next to the service name when autoscaling is enabled …
ricardokirkner Aug 29, 2025
8ac92ee
Treat upsun and platfomsh vendors as equivalent in project list from …
pjcdawkins Sep 8, 2025
b03cfd1
Avoid writing to stdout when opening a URL
pjcdawkins Sep 9, 2025
88a244c
Merge pull request #1561 from platformsh/url-open-avoid-writing-stdout
akalipetis Sep 9, 2025
e290d42
Add e:deploy as alias to environment:deploy (#1560)
ovv Sep 9, 2025
e4f9c58
feat: enable otlp integration (#1543)
mharacewiat Sep 9, 2025
23f5c02
Update embedded docs links to new permalink structure (#1555)
gilzow Sep 9, 2025
2989288
Show confirmation message on env branch/activate for guaranteed resou…
shahinam Sep 9, 2025
d0a09e3
Fix PHP < 7 compatibility (for this branch) in Api.php
pjcdawkins Sep 9, 2025
d258bbe
Release v4.25.0
pjcdawkins Sep 10, 2025
176dc4c
Add 'deploy' alias for env:deploy
vitolkachova Sep 12, 2025
abb87d2
Add autoscaling:set command to configure CPU-based autoscaling
ricardokirkner Sep 12, 2025
d0b1eb7
Fix "This environment is inactive" during activation if the deploymen…
pjcdawkins Sep 15, 2025
937ddf6
Merge pull request #1563 from platformsh/fix-gc-causes-state-issue-on…
shahinam Sep 17, 2025
a796724
Support organization types (#1565)
pjcdawkins Sep 19, 2025
c50db92
Release v4.26.0
pjcdawkins Sep 19, 2025
ffd1e65
feat: rename otlp integration (#1567)
mharacewiat Sep 23, 2025
9c68b65
Set --fail-with-body by default in curl commands
pjcdawkins Sep 27, 2025
e72fd23
Merge pull request #1569 from platformsh/curl-fail-with-body
akalipetis Sep 29, 2025
1c9d58a
feat: support memory as a trigger for autoscaling (#1564)
ricardokirkner Oct 6, 2025
8221419
Release v4.27.0
pjcdawkins Oct 6, 2025
874e82b
Merge 4.x into 5.x, with basic conflict resolution
pjcdawkins Oct 19, 2025
67e0385
Port autoscaling settings and guaranteed resources commands to 5.x fo…
pjcdawkins Oct 19, 2025
fe5bd02
Port deploy-related changes to 5.x format
pjcdawkins Oct 19, 2025
9bf9915
Various 5.x porting changes
pjcdawkins Oct 19, 2025
38ba0c5
Apply PHP CS Fixer
pjcdawkins Oct 19, 2025
2865e6d
Apply some phpstan fixes
pjcdawkins Oct 19, 2025
846a00b
Fix PHPStan lint warnings
pjcdawkins Oct 19, 2025
8904683
Fix more phpstan lint errors
pjcdawkins Oct 20, 2025
00068a7
Add missing autoscaling:set options
pjcdawkins Oct 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ jobs:
./scripts/test/unit.sh

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: 1.22
go-version: 1.25
cache-dependency-path: cli/go.sum

- name: Lint Go files
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
go-version: stable

- name: golangci-lint
uses: golangci/golangci-lint-action@v6
uses: golangci/golangci-lint-action@v8
with:
version: v1.64
version: v2.4
working-directory: go-tests
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ There are two ways to authenticate:

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.

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

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

Expand Down
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions config-defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ application:
# Disabled commands (a list of full command names).
disabled_commands: []

# Whether to mark this CLI as a 'legacy' version if not under the Go wrapper.
mark_unwrapped_legacy: false

# Disabled commands under the Go wrapper (a list of full command names).
wrapped_disabled_commands: []

Expand Down Expand Up @@ -241,6 +244,12 @@ api:
# Whether the Organizations API is enabled.
organizations: false

# A list of supported organization types.
organization_types: []

# The default type when creating an organization.
default_organization_type: ~

# Whether Centralized User Management is available.
# Ignored if "organizations" is disabled.
centralized_permissions: true
Expand Down Expand Up @@ -389,6 +398,12 @@ warnings:
# without the capability.
non_production_domains_msg: null

# The message shown when configuring guaranteed resources.
guaranteed_resources_msg: null

# The message shown when branching/activating an environment with resources init strategy parent.
guaranteed_resources_branch_msg: null

# Configuration for informational messages.
messages:
# A message about discounts where a region choice is displayed.
Expand Down
21 changes: 17 additions & 4 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ application:
manifest_url: 'https://platform.sh/cli/manifest.json'
github_repo: 'platformsh/legacy-cli'

mark_unwrapped_legacy: true
wrapped_disabled_commands:
- self:install
- self:update
Expand All @@ -37,16 +38,19 @@ service:

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

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

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

api:
base_url: 'https://api.platform.sh'

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

organization_types: [flexible, fixed]
default_organization_type: flexible

organizations: true
user_verification: true
metrics: true
Expand All @@ -65,12 +69,21 @@ detection:

migrate:
prompt: true
docs_url: https://docs.platform.sh/administration/cli.html
docs_url: https://docs.upsun.com/anchors/fixed/cli/

warnings:
non_production_domains_msg: |
This feature is only available to Enterprise and Elite customers.
If you're an Enterprise or Elite customer, contact support to enable the feature.
Otherwise contact sales first to upgrade your plan.

See: https://docs.platform.sh/overview/get-support.html
See: https://docs.upsun.com/anchors/fixed/get-support/

guaranteed_resources_msg: |
You have chosen to allocate guaranteed resources for app(s) and/or service(s).
This change may affect resource costs. See: <info>https://upsun.com/pricing/</info>

This process requires a redeployment of containers on their own host, which may take a few minutes to complete.

guaranteed_resources_branch_msg: |
Guaranteed resources from the parent will be provisioned, impacting your bill.
4 changes: 2 additions & 2 deletions dist/installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @deprecated
* The CLI no longer requires a local PHP installation or this installer.
* See https://docs.platform.sh/administration/cli.html
* See https://docs.upsun.com/anchors/fixed/cli/
*
* This script will check requirements, download the CLI, move it into place,
* and run the self:install command (to set up the PATH and autocompletion).
Expand Down Expand Up @@ -82,7 +82,7 @@ public function __construct(array $args = [])
'userAgent' => 'platformsh-cli',
'serviceEnvPrefix' => 'PLATFORM_',
'migratePrompt' => true,
'migrateDocsUrl' => 'https://docs.platform.sh/administration/cli.html',
'migrateDocsUrl' => 'https://docs.upsun.com/anchors/fixed/cli/',
)/* END_CONFIG */;

$required = ['envPrefix', 'manifestUrl', 'configDir', 'executable', 'cliName'];
Expand Down
15 changes: 10 additions & 5 deletions dist/manifest.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[
{
"version": "4.22.0",
"sha1": "ec4359c0c6f353190466bab61901ca30fad2f86b",
"sha256": "911a4b3420533b2eeecd5fa6e54c7c5bcb1baf41c170627f1c29ea3b6c7f7cf5",
"version": "4.27.0",
"sha1": "62e5f46d69cf191324b2baa4a0ee9aa1487d564a",
"sha256": "77b998915dc64a2141809dec08a7e9988045376e4bbcb99005512249813b9c61",
"name": "platform.phar",
"url": "https://github.com/platformsh/legacy-cli/releases/download/v4.22.0/platform.phar",
"url": "https://github.com/platformsh/legacy-cli/releases/download/v4.27.0/platform.phar",
"php": {
"min": "5.5.9"
},
Expand Down Expand Up @@ -72,7 +72,12 @@
"4.20.5": "* Fix environments listing by ID",
"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)",
"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",
"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."
"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.",
"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",
"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`).",
"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).",
"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.",
"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`"
}
},
{
Expand Down
48 changes: 48 additions & 0 deletions go-tests/activity_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package tests

import (
"net/http/httptest"
"strconv"
"testing"
"time"

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

assertTrimmed(t, "complete", f.Run("act:get", "-p", projectID, "-e", ".", "act1", "-P", "state"))
assertTrimmed(t, "2014-04-01T10:00:00+00:00", f.Run("act:get", "-p", projectID, "-e", ".", "act1", "-P", "created_at"))

// Generate a longer list of activities.
var activities = make([]*mockapi.Activity, 30)
for i := range activities {
num := i + 1
createdAt := aprilFoolsDay10am.Add(time.Duration(i) * time.Minute)
varName := "X" + strconv.Itoa(num)
activities[i] = &mockapi.Activity{
ID: "act" + strconv.Itoa(num),
Type: "environment.variable.create",
State: "complete",
Result: "success",
CompletionPercent: 100,
Project: projectID,
Environments: []string{"main"},
Description: "<user>Mock User</user> created variable <variable>" + varName + "</variable> on environment <environment>main</environment>",
Text: "Mock User created variable " + varName + " on environment main",
CreatedAt: createdAt,
UpdatedAt: createdAt,
}
}
apiHandler.SetProjectActivities(projectID, activities)

assertTrimmed(t, `
ID Created Description Progress State Result
act30 2014-04-01T10:29:00+00:00 Mock User created variable X30 on environment main 100% complete success
act29 2014-04-01T10:28:00+00:00 Mock User created variable X29 on environment main 100% complete success
act28 2014-04-01T10:27:00+00:00 Mock User created variable X28 on environment main 100% complete success
act27 2014-04-01T10:26:00+00:00 Mock User created variable X27 on environment main 100% complete success
act26 2014-04-01T10:25:00+00:00 Mock User created variable X26 on environment main 100% complete success`,
f.Run("act", "-p", projectID, "-e", ".", "--format", "plain", "--limit", "5"))

assertTrimmed(t, `
ID Created Description Progress State Result
act30 2014-04-01T10:29:00+00:00 Mock User created variable X30 on environment main 100% complete success
act29 2014-04-01T10:28:00+00:00 Mock User created variable X29 on environment main 100% complete success
act28 2014-04-01T10:27:00+00:00 Mock User created variable X28 on environment main 100% complete success
act27 2014-04-01T10:26:00+00:00 Mock User created variable X27 on environment main 100% complete success
act26 2014-04-01T10:25:00+00:00 Mock User created variable X26 on environment main 100% complete success
act25 2014-04-01T10:24:00+00:00 Mock User created variable X25 on environment main 100% complete success
act24 2014-04-01T10:23:00+00:00 Mock User created variable X24 on environment main 100% complete success
act23 2014-04-01T10:22:00+00:00 Mock User created variable X23 on environment main 100% complete success
act22 2014-04-01T10:21:00+00:00 Mock User created variable X22 on environment main 100% complete success
act21 2014-04-01T10:20:00+00:00 Mock User created variable X21 on environment main 100% complete success
act20 2014-04-01T10:19:00+00:00 Mock User created variable X20 on environment main 100% complete success
act19 2014-04-01T10:18:00+00:00 Mock User created variable X19 on environment main 100% complete success`,
f.Run("act", "-p", projectID, "-e", ".", "--format", "plain", "--limit", "12"))
}
3 changes: 3 additions & 0 deletions go-tests/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ api:

disable_credential_helpers: true

organization_types: [flexible, fixed]
default_organization_type: flexible

organizations: true
centralized_permissions: true
teams: true
Expand Down
Loading
Loading