Repository navigation
Test the Docker Task Workflow's Credential Check, Login, and Hook Inputs - #3154
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ordered Steps Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ntial Check, and a Miswired Hook Input Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved findings leave important workflow validation gaps.
1 open finding
What changed in this PR
Adds stdlib-only structural regression tests for Docker workflow credential checks, login ordering, and hook inputs.
Changes:
- Parses workflow jobs and steps by indentation.
- Validates safeguards before push-capable steps.
- Adds mutation tests for missing, reordered, gated, or miswired elements.
| File | Summary |
|---|---|
tests/test_docker_task_workflow.py |
Adds workflow validation and mutation coverage; unresolved gaps remain in credential wiring, login inputs, failure semantics, and valid YAML shapes. |
🧠 Review effort: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3154 +/- ##
==========================================
Coverage ? 63.97%
==========================================
Files ? 17
Lines ? 9151
Branches ? 0
==========================================
Hits ? 5854
Misses ? 3297
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
… Dash-Name Refusal to Main (#3164) - #3162 makes `gh-write-guard` read the gh write targets it still missed: an inherited `GH_REPO` from the session environment, a run-time word before gh's command, a gh write behind a run-time command word, a positional repository and the missing write subcommands, `gh api` write targets outside `repos/`, and the `GH_REPO` gaps #3135 introduced. It adds no new allow. - #3156 makes both bootstrap loaders reject a dash-prefixed `-Agents`/`--agents` name before the handoff, so `-All` can no longer bind install-agents' switch. Verified natively under pwsh 7 and Windows PowerShell 5.1 in #3161. - #3153 lets a manual dispatch bypass the smoke build's paths filter, in the catalog snippet and the reusable-workflows example together. - #3154 tests the Docker task workflow's credential check, login, and hook inputs. - #3150 bumps the actions-deps group. After this merges, the host-safety installer payload changes, so the maintainer runs the installer after promotion. Closes #3129 Closes #3131 Closes #3132 Closes #3133 Closes #3136 Closes #3147 Closes #3148 Closes #3149 🤖 Generated with [Claude Code](https://claude.com/claude-code)

Fixes #3148
Change
Adds
tests/test_docker_task_workflow.py, a stdlib-only structural test of.github/workflows/build-docker-task.yml. The job and step sets are read from the workflow by indentation, with no hard-coded indexes. Every job with a push-capable step (a step passingpush, or a caller build hook) must:exit 1, noiforcontinue-on-error) before its first push-capable step;docker/login-actionstep fed both secrets, ungated, before its first push-capable step, and after the check;push,ref,branch, andplatformsto the caller hook, withpush,ref, andbranchwired to the same-named input.It also requires at least two pushing jobs, so a parse that silently loses a job fails.
Mutation proof
The test file holds these mutations in-memory against the real workflow text, and each asserts the specific violation. Also run once against a scratch copy:
no login before the first push stepin docker-build-base and build-dockerno credential check before the first push stepin bothdocker-build-base: no login before the first push stepbuild-docker: no login before the first push stepdocker-build-base: login before the credential checkpush,ref,branch,platforms(each)hook ... lacks <key>refwired toinputs.branchdoes not forward inputs.refcontinue-on-error,ifgate, commented-out passwordLocal review
Three passes. Rounds 1 and 2 findings were fixed (move-helper newline glue, substring false passes on comments and gating, a mutation test that gated the wrong job's identical step, missing check-after-login and half-check mutations, hook input values). The third pass raised five findings, left unfixed per the two-round budget and handed here as known limits of an indentation-based reader:
||joining the two empty tests is not checked (&&would pass).username/passwordwiring or a non-Hubregistry:.- name:at the same indent assteps:) and flow-stylewith: {push: true}are not parsed, so a new job written that way is unjudged beyond the two-job floor.run:step that pushes is not push-capable, and a step whose first key is notname:is unsupported.Verified: ruff format and check, pyright,
prose_lint,repo_gate --check eol,eol-coverage,spec/validate.py, 12 tests pass.Co-authored in a Claude Code session.
🤖 Generated with Claude Code