Repository navigation
feat: jq in the image, and a stated boundary for the shell test toolbox #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,8 +25,23 @@ | |
| - cron: "0 6 * * 1" | ||
| workflow_dispatch: | ||
|
|
||
| # Keyed on the COMMIT, not the run, so the push-to-main run and the tag run of | ||
| # the same commit SERIALIZE instead of racing. `github.run_id` is unique per | ||
| # run, so the old group put every run in a group of its own and controlled | ||
| # nothing: both builds pushed the same `:<sha>` tag, the second replaced the | ||
| # first's manifest, and the loser's "Verify the pushed digest" step then failed | ||
| # with `manifest unknown` on a digest that no longer existed. | ||
| # | ||
| # That is not theoretical. It cost v0.3.5 its image: the main run won, `latest` | ||
| # moved, the tag run lost, and the `0.3.5` tag was never created -- a GitHub | ||
| # release with no image behind it, which is the one state a pinned fleet cannot | ||
| # survive. v0.3.4 hit the same race and happened to win it. Serialized, the | ||
| # second run pushes and then verifies its own digest, which is the current one. | ||
| # | ||
| # cancel-in-progress stays false off pull requests: cancelling the main run | ||
| # when its tag arrives would abandon a push half-done. | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }} | ||
| group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.sha }} | ||
|
Check failure on line 44 in .github/workflows/container.yml
|
||
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
|
|
||
| permissions: {} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 0.3.5 | ||
| 0.3.6 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,3 +31,25 @@ | |
| this image produces, and all of those are pinned exactly -- the contract test \ | ||
| asserts each reported version equals the version pinned at build time. | ||
| """ | ||
|
|
||
| [[findings]] | ||
| agent = "constitution" | ||
| category = "constitution" | ||
| file = "Containerfile" | ||
| evidence = "RUN dnf install -y git-core tar zstd which jq \\" | ||
|
Check failure on line 39 in gatehouse-findings.toml
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MEDIUM (Ledger): This branch silences a constitution finding in Containerfile as not-a-bug: Same reasoning as the base-image finding above, and the same four unpinned neighbours: git-core, tar, zstd and which have never carried exact RPM versions on this line. The Container Image profile requires a weekly rebuild ( Suggestion: Confirm the judgement is right, or drop the entry and fix the finding. The entry stops applying on its own once the code it quotes is gone. Evidence:
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not a bug: the ledger is right to stop on it, and here is the reasoning for the record. The silenced finding asks for
Reproducibility is not lost either: consumers pin this image by exact release ( The one thing that would change my mind is jq becoming load-bearing for a verdict rather than for a test fixture. It is not, and the comment above the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MEDIUM (Ledger): This branch silences a constitution finding in Containerfile as not-a-bug: Same reasoning as the base-image finding above, and the same four unpinned neighbours: git-core, tar, zstd and which have never carried exact RPM versions on this line. The Container Image profile requires a weekly rebuild ( Suggestion: Confirm the judgement is right, or drop the entry and fix the finding. The entry stops applying on its own once the code it quotes is gone. Evidence:
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not a bug: the ledger is right to stop on it, and here is the reasoning for the record. The silenced finding asks for
Reproducibility is not lost either: consumers pin this image by exact release ( The one thing that would change my mind is jq becoming load-bearing for a verdict rather than for a test fixture. It is not, and the comment above the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MEDIUM (Ledger): This branch silences a constitution finding in Containerfile as not-a-bug: Same reasoning as the base-image finding above, and the same four unpinned neighbours: git-core, tar, zstd and which have never carried exact RPM versions on this line. The Container Image profile requires a weekly rebuild ( Suggestion: Confirm the judgement is right, or drop the entry and fix the finding. The entry stops applying on its own once the code it quotes is gone. Evidence:
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not a bug: the ledger is right to stop on it, and here is the reasoning for the record. The silenced finding asks for
Reproducibility is not lost either: consumers pin this image by exact release ( The one thing that would change my mind is jq becoming load-bearing for a verdict rather than for a test fixture. It is not, and the comment above the |
||
| status = "not-a-bug" | ||
| reason = """ | ||
| Same reasoning as the base-image finding above, and the same four unpinned \ | ||
| neighbours: git-core, tar, zstd and which have never carried exact RPM \ | ||
| versions on this line. The Container Image profile requires a weekly rebuild \ | ||
| (`0 6 * * 1`) whose entire purpose is to pick up OS security updates; pinning \ | ||
| an OS package to an exact version is how you build an image that stops \ | ||
| receiving them, which is the opposite of what the cron is for. What the \ | ||
| constitution pins to exact versions is the CHECK tools -- ruff, mypy, semgrep, \ | ||
| pip-audit, CodeQL, Gourmand, Gatehouse -- because a verdict that changes under \ | ||
| you is not a verdict; those are pinned by ARG and reported by `sdlc versions`. \ | ||
| jq is not a check, it is part of the shell test toolbox, and its filter \ | ||
| language is stable across every version the fleet ships. Pinning it would \ | ||
| freeze a CVE-bearing RPM into the gate image for no gain in reproducibility \ | ||
| that the digest-addressed release does not already provide. | ||
| """ | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MEDIUM (Bug Hunter): GitHub Actions keeps at most one pending run per concurrency group; when another run enters the same group, it cancels and replaces the existing pending run, even with
cancel-in-progress: false. If the main build is running and the tag build is pending, a workflow_dispatch or scheduled run for the same SHA can replace the tag build, leaving the release tag without its image.Suggestion: Ensure required tag builds cannot be displaced by other runs in the same group—for example, consolidate the main and tag handling into one run or use a queuing design that preserves every required run.
Evidence:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a bug for the path this fixes, and you are right about the limit. Worth being precise about both.
You are correct that a concurrency group holds at most one PENDING run and a third entrant cancels the one waiting. The release path has exactly two: the push to main, and the tag
release.ymlcreates from that same commit. Two runs, so one runs and one pends, and nothing is cancelled. A third run on the SAME sha would have to be a manual re-run or a schedule firing on a head that has not moved — and today that third run does not queue, it races, which is how v0.3.5 lost its image. Serialized-and-possibly-cancelled is a better failure than concurrent-and-silently-overwritten.On the end state, which matters more:
promotealready has its own fixed group (promote-python-sdlc, never cancelled) and a backwards-move guard, so promotions cannot interleave. Serialized, the main run builds and promotes, then the tag run builds, verifies ITS digest, and promotes that one — solatest,:0.3.6and:<sha>all end at the second build. Consistent, with one orphaned digest from the first build as the cost.What this does NOT fix, and what you have really put your finger on: the same commit is built twice at all. The workflow's own header says the design is "the build pushes ONLY the commit SHA tag...
latestplus the semver tags move in a separate promote job that copies that tested digest without rebuilding" — and a tag event should therefore promote the:<sha>image that already exists rather than rebuild it. That removes the second build, the orphaned digest and the pending-run question in one go. It is a restructure ofbuild/promotewiring rather than a one-line group change, so I am not folding it into a pull request whose subject is jq; filing it as the follow-up.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a bug: the two-run release path cannot hit the pending-run cancellation, and the end state is consistent.
Restating in the form the triage check accepts — my earlier reply on this thread opened "not a bug for the path this fixes", without the colon, so it did not count as an answer. Same content.
You are right that a concurrency group holds at most one PENDING run and a third entrant cancels the one waiting. The release path has exactly two runs: the push to main, and the tag release.yml creates from that same commit. One runs, one pends, nothing is cancelled. A third run on the same sha would need a manual re-run or a schedule firing on an unmoved head — and today that third run does not queue at all, it races, which is how v0.3.5 lost its image.
On the end state, which matters more than the queue: promote already has its own fixed group (promote-python-sdlc, never cancelled) and a backwards-move guard, so promotions cannot interleave. Serialized, the main run builds and promotes, then the tag run builds, verifies its own digest and promotes that — so latest, 0.3.6 and the sha tag all land on the second build. One orphaned digest from the first build is the cost.
What this does not fix is the real thing you found: the same commit is built twice at all. The workflow header already says a tag should promote the digest the main run built rather than rebuild it, and doing that removes the second build, the orphan and this question together. It is a restructure of the build/promote wiring, not a one-line group change, so it is #14 rather than this pull request, whose subject is jq.