Repository navigation
feat: Add release promote command - #749
Merged
Merged
Conversation
APErebus
commented
Oct 14, 2026
Comment on lines
+277
to
+289
| envs, err := environments.Get(octopus, space.ID, environments.EnvironmentQuery{IDs: []string{params.FromEnvironment}}) | ||
| if err != nil { | ||
| return errors.New("environment not found") | ||
| } | ||
| // | ||
| if len(envs.Items) == 0 { | ||
| envs, err = environments.Get(octopus, space.ID, environments.EnvironmentQuery{Name: params.FromEnvironment}) | ||
| if err != nil || len(envs.Items) == 0 { | ||
| return errors.New("environment not found") | ||
| } | ||
| } | ||
| //just grab the first environment | ||
| sourceEnv := envs.Items[0] |
Contributor
Author
There was a problem hiding this comment.
We don't have a GetByIdentifier for environments... I'll look to add one in the future
APErebus
marked this pull request as ready for review
October 15, 2026 01:31
liam-mackie
reviewed
Oct 15, 2026
liam-mackie
left a comment
Contributor
There was a problem hiding this comment.
Mostly LGTM, but want to verify the Take behaviour before merging.
liam-mackie
approved these changes
Oct 15, 2026
liam-mackie
left a comment
Contributor
There was a problem hiding this comment.
Minor nits but spoke about it and good to go!
Co-authored-by: Liam Mackie <liam@mackie.sh>
APErebus
pushed a commit
that referenced
this pull request
Oct 15, 2026
🤖 I have created a release *beep* *boop* --- ## [2.29.0](v2.28.0...v2.29.0) (2026-10-15) ### Features * Add release promote command ([#749](#749)) ([c3c2e27](c3c2e27)) ### Bug Fixes * Return errors from NewDependencies instead of panicking ([#756](#756)) ([82f7bc9](82f7bc9)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: team-integrations-fnm-bot <integrationsfnmbot@octopus.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
The deprecated CLI has a command,
promote-releasewhich is used to promote the latest (or latest successful) release from an environment to another environment.As opposed to
release deploy, we don't know the release number, so this command looks at the dashboard items for a project & the source environment to find the latest (based on version number) release. This release is then deployed to the target environment with all the same common parameters as therelease deploycommand.Results
There is now a new command,
release promotewith required flags:project,from,to,latest-successful. There is also the common flags with therelease deployExample:
release promote --project MyProject --from "Development" --to "Staging"The
releasePromotefunction in the executor then retrieves the correct data and pulls the dynamic dashboard for the project. We then filter and order the dashboard items to find either the latest item based on version or latest successful item.We then pass this directly on the
releaseDeploycommand, which then executes the deployment as per normal.NOTE: The new command currently doesn't have the
AskQuestionsflow as I'm primarily doing this for the TeamCity plugin, so I didn't think it was worth it currently