Feat: Add scan toggles, rename the lint job - #68
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Standardizes Docker workflow controls and naming across the workflow estate.
Changes:
- Renames
audittodockerfile-lintwhile retaining a deprecated input alias. - Adds lint, SBOM, and Grype toggles.
- Updates release gating and documentation.
File summaries
| File | Description |
|---|---|
README.md |
Documents job graphs and inputs. |
examples/build-test/github.yaml |
Demonstrates new toggles. |
.github/workflows/build-test.yaml |
Adds toggles and renames the lint job. |
.github/workflows/build-test-release.yaml |
Adds toggles and adjusts release gating. |
Review details
Suppressed comments (2)
.github/workflows/build-test-release.yaml:1481
- A skipped Grype job does not necessarily mean the scan was disabled: when SBOM generation fails, line 1423 skips Grype as well. Accepting every
skippedresult lets the tests gate pass after an SBOM failure, contrary to the preserved gating behavior. Only acceptskippedwhensbom_enabledorgrype_enabledwas explicitly disabled.
if: ${{ !cancelled() && needs.build.result == 'success' && contains(fromJSON('["success", "skipped"]'), needs.dockerfile-lint.result) && contains(fromJSON('["success", "skipped"]'), needs.grype.result) }}
.github/workflows/build-test-release.yaml:1473
- This updated comment still labels hadolint as an “audit,” although the purpose of the job rename is to reserve that term for dependency audits. Describe these as the lint and scan gates instead.
# Deferred until the audit operations (hadolint and Grype) pass,
# so the expensive test hook is skipped when either audit fails
# (gating inversion: audits gate tests on releases). A DISABLED
# lint or scan must not block tests, so a skipped result is
# permitted alongside success.
- Files reviewed: 4/4 changed files
- Comments generated: 4
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
920eb3f to
131516c
Compare
131516c to
8bbe3d6
Compare
The audit job lints Dockerfiles with hadolint; it does not audit dependencies. Everywhere else in the estate audit_* governs a dependency audit, so the name collided across families. Rename the job to dockerfile-lint and introduce lint_enabled and lint_permit_fail. audit_permit_fail stays as a deprecated alias so existing callers keep working, and is removed at the next major. The job display name is unchanged, so required status checks are unaffected. Add sbom_enabled and grype_enabled (both default true). Nothing could previously skip either stage. grype_enabled is independent of sbom_enabled, so the image SBOMs are still generated and uploaded when only the scan is dropped. Widen the release lane's tests gate to accept a skipped lint or Grype result. It required 'success' from both, so setting either new toggle would have left tests permanently unrunnable. Co-authored-by: Claude <noreply@anthropic.com> Signed-off-by: Matthew Watkins <mwatkins@linuxfoundation.org>
8bbe3d6 to
3a1f120
Compare
zxiiro
left a comment
There was a problem hiding this comment.
🤖 Auto-approved by agent: reviewed workflow/code change for security and CI/CD impact, found low risk. Renames internal lint job, keeps audit_permit_fail as deprecated alias, adds lint/sbom/grype toggles defaulting to true. No permission/secret/pin changes; skip-vs-fail gating still blocks on real failures.
c326dc3
into
lfreleng-actions:main
Summary
Three related changes bringing this repo into line with the rest of the workflow estate.
1. Rename the
auditjob todockerfile-lintThe
auditjob runs hadolint against Dockerfiles. It does not audit dependencies. Everywhere else in the estateaudit_*means "dependency audit" (pip-audit,govulncheck,npm audit), so the same prefix meant two different things depending on which family you were reading.audit→dockerfile-lintlint_enabled(defaulttrue) andlint_permit_fail(defaultfalse)audit_permit_failretained as a deprecated alias, so existing callers keep working:Branch protection is unaffected. The job's
name:is already'Dockerfile Lint'and is unchanged; check names derive from the display name, not the job id. The id is internal to the reusable workflow.Note this repo has no dependency-audit job by design — for containers that role is filled by the image SBOM + Grype lane. Freeing the
audit_*prefix makes that clear rather than implying a missing lane.2. Add
sbom_enabledandgrype_enabledNeither stage could previously be skipped. Both default
true.grype_enabledis independent ofsbom_enabled, so the image SBOMs are still generated and uploaded when only the scan is dropped. Inbuild-test.yamlthe new clause composes with the existingimage_count != '0'guard rather than replacing it:3. Fix a latent gate bug in the release lane
The
testsjob requiredsuccessfrom bothauditandgrype:A skipped job does not report
success, so setting either new toggle tofalsewould have lefttestspermanently unrunnable. Switched to thecontains(fromJSON('["success", "skipped"]'), …)idiom already used bypython-workflows,go-workflowsandnode-workflows. The gating inversion is preserved — a lint or scan that runs and fails still blocks tests.Compatibility
All new inputs default to current behaviour.
audit_permit_failstill works. No inputs removed.Also updated
README.mdjob-graph diagrams and input table, andexamples/build-test/github.yaml.Validation
yamllint,actionlint— clean (actionlint resolves the renamedneeds.dockerfile-lintreference)zizmor --persona=auditor— No findings to reportmarkdown-table-fixer lint README.md --auto-fix— No issues foundprek runover the changed files — all hooks passedRelated
Trims the scope of #35: the two Grype items that issue lists (
Grype audit SBOMs63×2,Grype summary13×2 — 152 of the 262 lines) were already resolved by the migration togrype-scan-action. The genuinely duplicated blocks remaining areGenerate image SBOMs,Lint Dockerfiles (hadolint)andRequire Gerrit project, branch and URL. I will update that issue separately.Context
Part of a seven-PR series standardising these toggles across the workflow estate. Companions: lfreleng-actions/workflows-template#56, lfreleng-actions/python-workflows#85, lfreleng-actions/go-workflows#67, lfreleng-actions/node-workflows#83, lfreleng-actions/java-workflows#45.