Implement deploy rollback - #1744
Merged
Merged
Conversation
gcirclest
marked this pull request as ready for review
August 17, 2026 08:41
Add `circleci deploy rollback <target-version>` over the V3 project rollback
endpoint, POST /api/v3/projects/{id}/rollback.
--component and --environment accept a name or a UUID. The endpoint addresses
both by id, so a name is resolved through the component and environment list
endpoints first; an ambiguous component name reports the candidate ids rather
than picking one.
--from (current_version) is optional. Omitted, it is read from the component's
versions filtered by the environment, which the API returns most recently
deployed first. The API re-checks it, so a stale inference fails the rollback
instead of moving the wrong version.
The response's id is the pipeline run or the release-agent command carrying the
rollback out, and rollback_type says which, so the output points at the right
place to follow it.
gcirclest
force-pushed
the
rollback-comm
branch
from
August 17, 2026 08:42
8078023 to
f20f963
Compare
pete-woods
approved these changes
Aug 17, 2026
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.
Adds
circleci deploy rollback <target-version>overPOST /api/v3/projects/{id}/rollback, covering every request field.--component/--environmenttake a name or a UUID. The endpoint is id-only, so names resolve through the deploy list endpoints; an ambiguous name reports the candidates rather than picking one.--from(current_version) defaults to the version the API reports as deployed there. The API re-checks it, so a wrong inference fails the rollback instead of moving the wrong version.--forceplus a prompt, likerun cancel. Non-interactive without it exits 6 and never sends the request.data.idis either a pipeline run or a release-agent command, polled in different places, so the output names which one and how to follow it.--dry-run, and the version is positional rather than a--toflag:--helpsits at exactly the 40-line budget andoverBudgetis at its 25-entry cap.--namespacehint (exit 5).12 acceptance tests cover name resolution with an inferred
--from, every optional field asserted through the request recorder, both rollback types,--json, bad input and each error status. The--force-refused case asserts the POST never left the CLI.