ci: stop a workflow-only edit from republishing the images - #581
Conversation
This workflow listed itself in its push paths, and docker-push runs on push events — so editing a comment in it rebuilt and republished :latest and :full. Not a no-op either: BUILD_NUMBER is baked in as an ENV, so identical application code still lands a fresh digest on both rolling tags, which is exactly the churn renovate.json's own-image rule already complains about. The pull_request trigger keeps the self-reference, so a workflow edit is still exercised end to end (including Docker Validate) before it lands, and validate-workflows.yml runs actionlint on it independently. workflow_dispatch is there to force a run. Verified by replaying the path filter over the commit that prompted this (docs/deployment.md + renovate.json + this file): matches nothing now, while backend/frontend/tests/Dockerfile/requirements-*.txt all still match.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour. 📝 WalkthroughWalkthroughThe CodeQL workflow no longer includes its own file in push path filters. Pull-request coverage remains enabled, and comments document Docker publishing behavior and manual dispatch. ChangesCodeQL workflow triggers
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to This change prevents workflow-only edits from republishing rolling images while preserving pull-request validation and publishing for image-affecting changes. No actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
This workflow listed itself in its own
pushpaths, anddocker-pushruns on push events — so a comment-level edit to this file rebuilt and republished:latestand:full. That is what happened oneec28cd(a docs commit), which is what prompted this.It is not a harmless no-op either:
BUILD_NUMBER=$(git rev-list --count HEAD)is baked in as anENV, so identical application code still lands a fresh digest on both rolling tags — the exact churnrenovate.json's own-image rule already complains about.Related issue
N/A — fallout from
eec28cd.Type of change
What is deliberately kept
The
pull_requesttrigger keeps the self-reference, so a workflow edit is still exercised end to end — includingDocker Validate (PR), which builds the image without pushing it — before it lands.validate-workflows.ymlruns actionlint on it independently, andworkflow_dispatchis there to force a run.The alternative shape — a paths-filter step gating
docker-push— was rejected: it adds conditional logic plus a fail-safe branch to a publishing job, where a wrong filter means images silently stop publishing. Removing one trigger entry cannot fail that way.Testing
Replayed the real path filter (GitHub glob semantics:
**spans separators,*does not) over two known-answer cases:eec28cd, the docs commit that caused the needless republish —.github/workflows/codeql-lint.yml,docs/deployment.md,renovate.json— now matches nothing.backend/util/cl2k/renderer.py,frontend/src/pages/poster/Cl2kMakerPage.jsx,tests/test_cl2k_mirror.py,deploy/docker/Dockerfile,requirements-cl2k.txt— still matches all five, so publishing is untouched for anything that can change the image.Downstream consumers audited for the loosened trigger: nothing chains off this workflow (no
workflow_runanywhere);notify-failureonlyneeds:its siblings; branch-protection required checks are evaluated on pull requests, whose trigger is unchanged; CodeQL still runs on every code push plus the weekly cron; and release images are unaffected becauserelease-please.ymltriggers onpush: [main]with no paths filter and its owndocker-versionjob.actionlintreports the same 4 pre-existing shellcheck infos before and after — none introduced.Screenshots
N/A.
Checklist
DAPSreferences introducedci:is not user-visibleSummary by CodeRabbit