Fix: interactive runbook snapshot create drops --package overrides#599
Draft
HuyPhanNguyen wants to merge 1 commit into
Draft
Fix: interactive runbook snapshot create drops --package overrides#599HuyPhanNguyen wants to merge 1 commit into
HuyPhanNguyen wants to merge 1 commit into
Conversation
…he interactive flow wrote resolved overrides to opts.PackageVersionOverrides while the build loop read from opts.PackageVersionSpec.Value, so overrides typed at the package prompt never reached the server.
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.
What
Fixes a pre-existing bug where
octopus runbook snapshot createin interactive mode silently drops package version overrides typed at the wizard's package prompt.Symptom
Running
octopus runbook snapshot create --project=X --runbook=Yinteractively:Package override stringpromptyto acceptNo error, no warning, exit code 0. The user only discovers the silent drop by inspecting the snapshot afterwards.
Root cause
In
pkg/cmd/runbook/snapshot/create/create.go:opts.PackageVersionSpec.Value(line 178)AskPackageOverrideLoopwas writing its resolved results toopts.PackageVersionOverrides— a separate field onCreateOptionsthat is never read by the build phase and never seeded fromPackageVersionSpecSo overrides typed interactively flowed into a dead-end field. Compare with the git-resource block in the same file (
opts.GitResourceRefsSpec.Valueis read at build time and written by the interactive loop — same field, no bug). Compare withrelease createwhich initialisesoptions.PackageVersionOverrides = flags.PackageVersionSpec.Valueand uses one field consistently.Fix
Remove the duplicate
PackageVersionOverridesfield fromCreateOptionsand useopts.PackageVersionSpec.Valuethroughout — matching the git-resource pattern in the same file. Three lines change.Scope
This bug is not related to FD-135 — verified by diffing the affected code against
v2.19.1, where the bug is identical. Splitting it out so cli#584 stays focused on the escape-syntax change.Test plan
runbook snapshot createwith an override, verify resulting snapshot has the typed version (not baseline) via APIrunbook snapshot create --package ... --no-promptstill works (regression check on the path that already worked)No unit-test addition —
pkg/cmd/runbook/snapshot/create/has no existing test file and adding the mock infrastructure forIClient,Asker, etc. is significant scope beyond the fix.