Feature: Add --priority to release deploy and runbook run - #708
Open
HuyPhanNguyen wants to merge 7 commits into
Open
Feature: Add --priority to release deploy and runbook run#708HuyPhanNguyen wants to merge 7 commits into
HuyPhanNguyen wants to merge 7 commits into
Conversation
Mirrors the existing --guided-failure tri-state flag and maps true/false/default onto the server's PriorityMode. Needs the go-octopusdeploy Priority field, so it won't build until that lands and go.mod is bumped. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The summary listed every other advanced option but not priority, so passing --priority read as if the flag had been ignored. Also drops the permission claim from the help text, since the server only enforces it on deployments, and says what valid values are when one is rejected. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Temporary pseudo-version pin. Swap to the tagged release once go-octopusdeploy#460 is merged, before this comes out of draft. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The pseudo-version bump added the new hashes without dropping the v2.114.1 ones. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The body comparison deserialises through the same struct tags, so an absent field and an empty one both land on "". The test proves default maps to empty rather than to LifecycleDefault, which is the useful part, but the old name claimed more than that. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
release deploy really does assert TaskPrioritize, so putting the permission back there and only dropping it from runbook run. The summary said "Use default setting" on both, which contradicted the runbook help saying default behaves as false, so each command now supplies its own wording. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The summary hand-listed six values while the parser accepted ParseBool's full set, so --priority 1 printed "Unknown 1" and then worked. It now shares the parser, which also moves to executionscommon alongside the guided-failure lookups. Validating in the command means a bad value fails immediately instead of after the whole interactive prompt and a generated command that could not work. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
HuyPhanNguyen
marked this pull request as ready for review
August 20, 2026 23:34
hnrkndrssn
approved these changes
Aug 21, 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.
Background
Task priority has been a server feature for a while, but there was no way to set it from the CLI. A customer asked about triggering priority deployments from automation they already had, and there was nothing to point them at.
Two gaps:
release deployandrunbook runhad no flag, and the SDK command struct had no field to put one in.Results
Adds
--prioritytorelease deployandrunbook run. It behaves like--guided-failure:true,falseordefault.Fixes HPY-1553
Depends on OctopusDeploy/go-octopusdeploy#460.
go.mod is pinned to a pseudo-version built from that branch (
v2.115.1-0.20260819065856-b6f0f290712d), so CI compiles and exercises this change rather than sitting red onabstractCmd.Priority undefined. Swap it for the tagged release before this leaves draft — it must not merge on a pseudo-version.Before
After
--priority true"priority": "On"--priority false"priority": "Off"--priority defaultPriority also now appears in the Additional Options summary that interactive mode prints. It listed every other advanced option, so passing
--priorityread as though the flag had been ignored. There is still no prompt for it; the flag is aimed at automation, and adding a sixth advanced question for an Enterprise-gated setting seemed like the wrong trade.Checked against a local server with the priority feature licensed. Deployments read back as
On,OffandLifecycleDefault.Two things worth knowing about the runbook side
defaultis the same asfalsefor runbooks.RunbookRun.ChangePriorityseedsOffand then collapsesLifecycleDefaulttoOff, because runbooks have no lifecycle phase to defer to.Deployment.ChangePriorityseedsLifecycleDefaultand does not collapse. So the tri-state is only genuinely tri-state onrelease deploy. The flag help onrunbook runsays so.Git-stored runbooks drop the priority server-side.
CreateGitRunbookRunCommandV1Handlernever copiedPriorityontoRunGitRunbookRun, so the value was accepted and discarded. Fixed in https://github.com/OctopusDeploy/OctopusDeploy/pull/46537. This is pre-existing and also affects the REST API and the MCP tool, but it does mean--priorityonrunbook runis only fully honoured against a server carrying that fix.On licence and permission enforcement
An earlier version of this description claimed the server rejects the request when the licence or permission is missing, so the CLI needs no check of its own. That is true for
release deployonly.PriorityTaskLicenseCheckerhas no runbook overload andTaskPriority.IsPriorityRunbookRundoes no access check, so runbook runs skip both gates. The flag help no longer asserts a permission requirement it cannot keep, and I have raised the enforcement asymmetry separately rather than paper over it here.Pre-requisites