Skip to content

Fix: interactive runbook snapshot create drops --package overrides#599

Draft
HuyPhanNguyen wants to merge 1 commit into
mainfrom
huy/2026/runbook-snapshot-interactive-override
Draft

Fix: interactive runbook snapshot create drops --package overrides#599
HuyPhanNguyen wants to merge 1 commit into
mainfrom
huy/2026/runbook-snapshot-interactive-override

Conversation

@HuyPhanNguyen
Copy link
Copy Markdown
Contributor

What

Fixes a pre-existing bug where octopus runbook snapshot create in interactive mode silently drops package version overrides typed at the wizard's package prompt.

Symptom

Running octopus runbook snapshot create --project=X --runbook=Y interactively:

  1. CLI shows the package table with baseline versions
  2. User types an override at the Package override string prompt
  3. CLI's local table updates and shows the new version — user thinks the override took effect
  4. User presses y to accept
  5. Snapshot is created on the server with the baseline versions, not the typed overrides

No 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:

  • The non-interactive build loop reads from opts.PackageVersionSpec.Value (line 178)
  • The interactive AskPackageOverrideLoop was writing its resolved results to opts.PackageVersionOverrides — a separate field on CreateOptions that is never read by the build phase and never seeded from PackageVersionSpec

So overrides typed interactively flowed into a dead-end field. Compare with the git-resource block in the same file (opts.GitResourceRefsSpec.Value is read at build time and written by the interactive loop — same field, no bug). Compare with release create which initialises options.PackageVersionOverrides = flags.PackageVersionSpec.Value and uses one field consistently.

Fix

Remove the duplicate PackageVersionOverrides field from CreateOptions and use opts.PackageVersionSpec.Value throughout — 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

  • Manual: interactive runbook snapshot create with an override, verify resulting snapshot has the typed version (not baseline) via API
  • Manual: non-interactive runbook snapshot create --package ... --no-prompt still 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 for IClient, Asker, etc. is significant scope beyond the fix.

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant