Repository navigation
Fix readable-alias backfill workflow command rendering - #534
Merged
Merged
Conversation
Use a single-line validate command so YAML cannot fold a trailing backslash into an escaped space, and replace the falsy-empty-string ALIAS_ARG idiom with an explicit shell branch so confirmed runs apply without --dry-run. Add contract tests that parse each step, shlex-tokenize the selected command for both gate outcomes, execute validate, and verify alias digests after apply.
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.
Fixes the failed backfill workflow (run 44272525192)
Two source-visible bugs in
.github/workflows/docker-readable-aliases.yml:\; YAML foldedthe newline into a literal escaped space, so argparse never received
--input. It is now a single-line command:python3 scripts/docker_readable_aliases.py validate --input docs/docker-readable-aliases.json.ALIAS_ARG: ${{ ... && '' || '--dry-run' }}always yielded--dry-runbecause GitHub treats
''as falsy. Replaced with an explicit shell branch onPUBLISH_ALIASESso a confirmed run applies with no--dry-run.Executed-command evidence
Actual rendered validate command executed from the repo root:
Commands extracted by the new contract test (shlex-tokenized per gate outcome):
validate --input docs/docker-readable-aliases.jsonapply --mapping docs/docker-readable-aliases.jsonvalidate --input docs/docker-readable-aliases.jsonapply --mapping docs/docker-readable-aliases.json --dry-runThe contract test also asserts no
run:step in the file ends in a plain-scalarbackslash and that the
&& '' ||idiom is gone.Safety gates unchanged
Dispatch-only,
confirmdefault false, trusted-main pinned SHA with HEADassertion, exact main CI verification, gate, strict observation, idempotence,
conflict/unknown zero-write refusal,
imagetools createonly (no rebuild,platform change or channel move), original sha refs and channels untouched.
New fixture
test_apply_verifies_each_target_digest_and_preserves_sha_and_channel_refsobserves every alias after apply, asserts its digest and both platforms, and
checks original sha/channel refs are unchanged; conflict still refuses with zero
writes.
Verification
python3 -B -m unittest scripts.test_docker_readable_aliases scripts.test_release -q— 80 tests OKknowledge-lint -fixthen final: OK, 38/38 queriesNo registry write or workflow dispatch occurred. Do not merge until independent
review and release-free CI are green; backfill remains a separate authorized step.