Skip to content

feat: Add release promote command - #749

Merged
APErebus merged 27 commits into
mainfrom
ap/promote-release-cmd
Oct 15, 2026
Merged

APErebus merged 27 commits into
mainfrom
ap/promote-release-cmd

Conversation

@APErebus

@APErebus APErebus commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Background

The deprecated CLI has a command, promote-release which 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 the release deploy command.

Results

There is now a new command, release promote with required flags: project, from, to, latest-successful. There is also the common flags with the release deploy

Example: release promote --project MyProject --from "Development" --to "Staging"

The releasePromote function 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 releaseDeploy command, which then executes the deployment as per normal.

NOTE: The new command currently doesn't have the AskQuestions flow as I'm primarily doing this for the TeamCity plugin, so I didn't think it was worth it currently

@github-actions github-actions Bot added the feat label Oct 13, 2026
Comment thread pkg/executor/release.go Outdated
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]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have a GetByIdentifier for environments... I'll look to add one in the future

Comment thread pkg/executor/release.go Outdated
@APErebus
APErebus marked this pull request as ready for review October 15, 2026 01:31

@liam-mackie liam-mackie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly LGTM, but want to verify the Take behaviour before merging.

Comment thread pkg/executor/release.go Outdated
@APErebus
APErebus requested a review from liam-mackie October 15, 2026 04:55

@liam-mackie liam-mackie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nits but spoke about it and good to go!

Comment thread pkg/executor/release.go Outdated
Comment thread pkg/executor/release.go Outdated
Comment thread pkg/executor/release.go Outdated
@APErebus
APErebus merged commit c3c2e27 into main Oct 15, 2026
4 checks passed
@APErebus
APErebus deleted the ap/promote-release-cmd branch October 15, 2026 22:30
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants