You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(cli): no silent allowOverride downgrade; surface comma hint; harden dry-run
Four follow-ups on PR #602:
1. **`apply_variable_set`: silent `allowOverride` downgrade on
secret rotation.** Previously, running `secrets set TOKEN <new>`
without `--allow-override` would re-emit the variable with
`allowOverride: false`, silently downgrading any variable that
was previously created (manually or by another tool) with
`allowOverride: true`. The legacy `configure` code in
src/configure.rs had explicit preservation logic; the
consolidated `apply_variable_set` had lost it.
Changed the signature from `allow_override: bool` to
`allow_override: Option<bool>`:
- `Some(true)` / `Some(false)` — force the flag (CLI
`--allow-override` passes `Some(true)`).
- `None` — **preserve** existing variable's `allowOverride`
when overwriting; default to `false` when creating.
`run_set` translates the CLI flag: `--allow-override` → `Some(true)`;
absence → `None`. The deprecation alias (`run_set_github_token`)
stays at `allow_override: false` on the CLI side, which now maps
to `None` (preserve) — restoring parity with the pre-consolidation
`configure` body. Help text in `src/main.rs` and `docs/cli.md`
updated. Five new unit tests pin the matrix:
- `Some(true)` / `Some(false)` / `None` × create/overwrite
- Specifically asserts `None` preserves `allowOverride: true`
(the silent-downgrade regression guard).
2. **`run.rs::print_queue_plan` silent serialize-failure.**
`serde_json::to_string_pretty(&body).unwrap_or_default()` would
have printed blank output if serialization ever failed. The
value is provably JSON-safe, but defensive code should surface
regressions instead of silently swallowing them. Switched to
`unwrap_or_else(|e| format!("<serialization error: {e}>"))`.
3. **`run.rs::parse_parameters` opaque comma-in-value error.**
When a user writes `--parameters urls=https://a,b`, the error
was `Invalid --parameters pair 'b': expected key=value (no '='
found).` — technically accurate but doesn't hint at the comma
constraint documented above the function. Added a
raw-argument-contains-comma detection branch that produces a
self-diagnosable hint: `... Hint: values must not contain
commas. The raw argument '...' was split on ',' before the
'=' split; use a separate --parameters flag per pair.`
4. **`run.rs::dispatch` deliberate partial-queue + `--wait`
behaviour.** When `--wait` is set and some builds fail to
queue, the code polls the successfully-queued ones rather than
bailing early; `queue_failure` is folded into the final exit
code. This is intentional and the only sensible UX, but lacked
a comment. Added a multi-paragraph block explaining all three
cases (partial queue, zero queued, all queued) and why
`poll_until_complete` is called with the partial slice.
Not addressed (acknowledged follow-ups, tracked elsewhere):
- Sequential `get_latest_build` fanout in `list`/`status`. Already
documented inline; tracked as a future improvement.
`cargo test` (1572 unit + 14 integration crates, all green) and
`cargo clippy --all-targets --all-features` pass.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: docs/cli.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ Global flags (apply to all subcommands): `--verbose, -v` (enable info-level logg
38
38
-`configure`*(deprecated; hidden in --help)* - Alias forwarding to `secrets set GITHUB_TOKEN`. Existing scripts keep working but get a stderr warning. The alias will be removed in the next minor release.
39
39
40
40
-`secrets set <name> [<value>] [PATH]` - Set a pipeline variable (with `isSecret=true`) on every matched ADO definition. Value resolution: positional `<value>` → `--value-stdin` (one line) → interactive tty prompt with echo off.
41
-
-`--allow-override` - Mark the variable as `allowOverride=true` (default: false).
41
+
-`--allow-override` - Force `allowOverride=true` on the set variable. When omitted, `allowOverride` is **preserved** on existing variables (so secret rotation does not silently downgrade an existing `allowOverride=true`) and defaults to `false` for new variables.
42
42
-`--value-stdin` - Read the value from a single line on stdin.
43
43
-`--dry-run` - Print the planned set without calling the ADO API.
44
44
-`--org / --project / --pat` - ADO context overrides (same semantics as the other lifecycle commands).
0 commit comments