Repository navigation
audit: evaluate main branch against all global standards (2026-04-18) - #33
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix direct secret interpolation in python-ci.yml shell conditions by using env vars HAS_SONAR and HAS_CODECOV with boolean values instead of interpolating secrets directly into shell if conditions - Bump all pinned action SHAs to latest versions within same major version using update-pinned-actions.sh --apply (21 files updated, 50 unique action refs resolved via GitHub API) - All workflows already had top-level permissions blocks; none added - No yamllint errors found (relaxed profile, no .yamllint config present) - No pull_request_target triggers found in any workflow Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add set -euo pipefail to sync-secrets.sh and transfer-repos.sh (both had bare set -e) - Fix SC2155 in calculate-image-storage.sh: declare and assign local vars separately - Fix SC2001 in calculate-image-storage.sh: replace sed unit-stripping with parameter expansion - Stage calculate-image-storage.sh (new script, passes shellcheck clean) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix non-breaking hyphens (U+2010) in SECURITY.md: upgrade-guide link label and Security-only support table cell - Fix non-breaking hyphen (U+2010) in CONTRIBUTING.md: Google-style docstrings - Fix en-dash (U+2013) in CODEOWNERS annotation comment - Reorder [Unreleased] CHANGELOG sections to Keep a Changelog spec (Added, Changed, Security) - Add link reference footer to CHANGELOG for all version entries Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add language specifiers to fenced code blocks (MD040) - Add blank lines around headings where missing (MD022) - Add blank lines around code fences (MD031) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Automated compliance check covering writing standards, shell scripts, YAML/workflow quality, security scanning, OpenSSF baseline, and markdown formatting. 110 issues auto-fixed across 5 domains. See docs/audits/2026-04-18-standards-audit.md for full findings. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 20 minutes and 23 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThis PR performs a comprehensive update to GitHub Actions versions across 20+ workflow files, tightens shell script error handling with stricter exit options, introduces a cost-estimation utility script for container images, adds security audit documentation, and refines documentation formatting with improved spacing and typography corrections. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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.
Actionable comments posted: 9
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (4)
.github/workflows/python-ci.yml (1)
494-538:⚠️ Potential issue | 🟠 MajorBug:
critical_tagsoutput is never set — the critical-tag gate is a no-op.Lines 494-496 only emit
rad_tags,llm_tags, andtotal_tagsto$GITHUB_OUTPUT. TheCRITICAL_TAGSshell variable at line 478 is never written as a step output, so:
- Line 530:
if: ${{ steps.check-tags.outputs.critical_tags > 0 }}is always false → step never runs.- Line 532:
${{ steps.check-tags.outputs.critical_tags }}always interpolates to empty.Net effect: the "Block PR if critical tags found" gate cannot fail the build, despite the
::error::log at line 516. Either exposecritical_tagsor switch the gate to an existing output.🐛 Proposed fix
echo "rad_tags=$TOTAL_RAD" >> $GITHUB_OUTPUT echo "llm_tags=$TOTAL_LLM" >> $GITHUB_OUTPUT echo "total_tags=$TOTAL_TAGS" >> $GITHUB_OUTPUT + echo "critical_tags=$CRITICAL_TAGS" >> $GITHUB_OUTPUTAnd make the gate consistent with the
fail-on-llm-tagspattern (which already usesfromJSON):- - name: Block PR if critical tags found - if: ${{ steps.check-tags.outputs.critical_tags > 0 }} + - name: Block PR if critical tags found + if: ${{ fromJSON(steps.check-tags.outputs.critical_tags) > 0 }}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/python-ci.yml around lines 494 - 538, The check-tags step never writes the CRITICAL_TAGS shell variable to the step outputs, so the downstream gate using steps.check-tags.outputs.critical_tags is always empty; fix by exporting CRITICAL_TAGS as a step output inside the check-tags step (e.g., echo "critical_tags=$CRITICAL_TAGS" >> $GITHUB_OUTPUT) so the conditional if: ${{ steps.check-tags.outputs.critical_tags > 0 }} and the interpolation ${{ steps.check-tags.outputs.critical_tags }} see the correct value; alternatively, if you prefer not to add a new output, change the gate to reference an existing emitted output (like rad_tags/llm_tags/total_tags) and mirror the numeric handling pattern used by fail-on-llm-tags (using fromJSON) so the comparison works as intended..github/workflows/python-release.yml (2)
246-254:⚠️ Potential issue | 🟡 Minor
github.event.inputs.tagis unreachable onworkflow_calltriggers.This workflow only declares
on: workflow_call, sogithub.event.inputswill always be empty here. In manual-release mode,TAG_INPUTwill always fall through togithub.ref_name. If callers are supposed to pass a tag through, add ataginput toworkflow_call.inputsand referenceinputs.tag; otherwise, thegithub.event.inputs.tag ||branch is dead and can be removed to avoid confusion.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/python-release.yml around lines 246 - 254, The branch using github.event.inputs.tag is invalid for a workflow triggered only by workflow_call; update the workflow either by adding a tag input under workflow_call.inputs (e.g., inputs: tag: { required: false } ) and then reference it as inputs.tag when setting TAG_INPUT, or remove the github.event.inputs.tag || fallback and set TAG_INPUT solely from github.ref_name; adjust the manual-release step where TAG_INPUT, VERSION, and TAG are computed (symbols: TAG_INPUT, github.event.inputs.tag, github.ref_name, VERSION, TAG, workflow_call.inputs) accordingly so callers can pass a tag or the code clearly uses the ref name.
222-238:⚠️ Potential issue | 🔴 CriticalUpdate SHAs to match v9.21.1 tags or correct version comments.
The SHAs do not match the v9.21.1 tags they reference:
python-semantic-release/python-semantic-release@0dc72ac…should be86e0ab1…(actual v9.21.1)python-semantic-release/publish-action@1aa9f41…should bee821354…(actual v9.21.1)Either pin to the correct v9.21.1 commits or update the version comments if intentionally using different commits.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/python-release.yml around lines 222 - 238, The workflow pins for python-semantic-release actions reference v9.21.1 but use mismatched SHAs; update the two action refs used in the job—python-semantic-release/python-semantic-release@0dc72ac9058a62054a45f6344c83a423d7f906a8 and python-semantic-release/publish-action@1aa9f41fac5d531e6764e1991b536783337f3a56—to the correct v9.21.1 commit SHAs (or change the inline version comments to reflect the actual commits you intend to use) so the entries for the "uses:" lines and their version comments are consistent..github/workflows/python-reuse.yml (1)
54-78:⚠️ Potential issue | 🔴 CriticalUpdate the
fsfe/reuse-actionSHA to match the v6.0.0 tag.The pinned SHA
676e2d560c9a403aa252096d99fcab3e1132b0f5does not correspond to the v6.0.0 tag. The correct SHA for v6.0.0 is9a55738c6490d015afe69ad187520395d2b7a1fa. Either update the SHA to the correct value or verify which version is intended.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/python-reuse.yml around lines 54 - 78, The fsfe/reuse-action step is pinned to the wrong commit SHA for v6.0.0; update the SHA used in the action declaration for fsfe/reuse-action to the correct commit (9a55738c6490d015afe69ad187520395d2b7a1fa) or else change the tag to the intended version; locate the action line referencing "uses: fsfe/reuse-action@676e2d560c9a403aa252096d99fcab3e1132b0f5" and replace the SHA to match the v6.0.0 tag (or adjust the tag to the correct release) so the workflow uses the expected commit.
🧹 Nitpick comments (5)
docs/workflows/python-sonarcloud.md (1)
7-7: Note: AI-pattern word flagged for manual review.This line contains "comprehensive," which is one of the ~40 instances flagged in the audit for potential AI-pattern overuse. Consider whether a more specific term like "automated" or "multi-faceted" would be more appropriate here.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/workflows/python-sonarcloud.md` at line 7, Replace the vague term "comprehensive" in the sentence "SonarCloud provides comprehensive static analysis for:" with a more specific word such as "automated" or "multi-faceted" (or another precise alternative) to avoid AI-pattern phrasing; update that line in the docs/workflows/python-sonarcloud.md content so it reads e.g. "SonarCloud provides automated static analysis for:" or "SonarCloud provides multi-faceted static analysis for:".docs/workflows/python-publish-pypi.md (1)
18-18: Consider rephrasing to avoid AI-pattern word overuse.The word "comprehensive" appears here and is one of ~40 instances flagged in the PR objectives for manual review as AI-pattern overuse. Consider alternatives like "Detailed Summaries" or simply "Step Summaries" since "Detailed GitHub step summaries" already conveys the completeness.
✍️ Suggested alternatives
-- ✅ **Comprehensive Summaries** - Detailed GitHub step summaries +- ✅ **Detailed Summaries** - Detailed GitHub step summariesor
-- ✅ **Comprehensive Summaries** - Detailed GitHub step summaries +- ✅ **Step Summaries** - Detailed GitHub step summaries🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/workflows/python-publish-pypi.md` at line 18, The phrase "✅ **Comprehensive Summaries** - Detailed GitHub step summaries" uses the flagged word "Comprehensive"; update that heading to avoid AI-pattern overuse by replacing "Comprehensive" with a clearer alternative such as "Detailed Summaries", "Step Summaries", or simply "Summaries" so the line reads e.g. "✅ **Detailed Summaries** - Detailed GitHub step summaries" (or adjust both parts to avoid repetition) in the markdown.scripts/calculate-image-storage.sh (3)
207-221: Minor: Docker Hub classification misses bare official images and the port-colon guard is brittle.
[[ "$image" == */* ]]excludes images written without an org prefix (e.g.,nginx:latest,redis:7), which are the canonical Docker Hub form and get bucketed into "Other". The*:*/*guard intended to exclude registries with ports (registry:5000/foo) also rejects legitimate tagged Docker Hub images likelibrary/redis:7since the colon-before-slash pattern isn't what's happening there — it's actually a pattern match against*:*/*which looks for…:…/…, i.e., anything with both a colon and a later slash. Consider splitting on/and inspecting the first segment for a.or:(registry host) instead.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@scripts/calculate-image-storage.sh` around lines 207 - 221, The Docker Hub detection excludes bare images (e.g., nginx:latest) and uses a brittle *:*/* guard; replace the current dockerhub/other branch in the for-loop over "${!unique_images[@]}" with logic that splits on '/' and inspects the first segment: if the image contains no '/' treat as Docker Hub (increment dockerhub_count); otherwise set first_segment=${image%%/*} and if first_segment contains '.' or ':' treat it as a non-Docker registry (increment other_count or appropriate registry counters), else treat it as Docker Hub (increment dockerhub_count). Keep existing special-case checks for dhi.io, cgr.dev, gcr.io/distroless, and ghcr.io before this new split-based logic.
82-111: Nit: header advertises aVIRTUAL SIZEcolumn that is never printed.Line 82 prints three column headers (
REPOSITORY:TAG,SIZE,VIRTUAL SIZE) but the bodyprintfon line 111 only emits two values, so the table is visually misaligned and the third column is always blank. Drop the third header (the--formatused doesn't expose virtual size anyway) or add the data.♻️ Proposed fix
- printf "%-50s %15s %15s\n" "REPOSITORY:TAG" "SIZE" "VIRTUAL SIZE" + printf "%-50s %15s\n" "REPOSITORY:TAG" "SIZE"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@scripts/calculate-image-storage.sh` around lines 82 - 111, The header printf currently prints three columns ("REPOSITORY:TAG", "SIZE", "VIRTUAL SIZE") but the body printf (printf "%-50s %15s\n" "${repo}:${tag}" "$size") only outputs two, causing misalignment; fix by updating the header printf (the printf "%-50s %15s %15s\n" line) to only print two columns (e.g. "%-50s %15s\n" with "REPOSITORY:TAG" and "SIZE") so it matches the body, or alternatively add a third value to the body printf if you want to include virtual size—modify the header printf or the body printf accordingly to keep them consistent.
181-181: Replacegrep -oPwith a portable regex approach for macOS compatibility.The
-Pflag and\Kare GNU grep extensions not available on BSD/macOS grep, causing silent failures (no matches, no error) when this script runs on developer machines. Switching toawkprovides cross-platform compatibility with identical behavior.♻️ Portable alternative
- done < <(grep -oP '^\s*image:\s*\K[^\s#]+' "$file" || true) + done < <(awk '/^[[:space:]]*image:[[:space:]]*/ { + sub(/^[[:space:]]*image:[[:space:]]*/, ""); + sub(/[[:space:]]*#.*$/, ""); + if (length($0)) print $0 + }' "$file" || true)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@scripts/calculate-image-storage.sh` at line 181, The grep invocation using GNU-only flags (grep -oP '^\s*image:\s*\K[^\s#]+' "$file") is not portable to macOS; replace that command with an awk pipeline that extracts the image value robustly (match lines starting with optional whitespace then "image:", strip the "image:" label and any inline comment starting with '#', and print the trimmed image token) and keep the surrounding loop (the done < <(...) construct) intact; update the substitution where this grep appears in calculate-image-storage.sh so the script runs on BSD/macOS as well as Linux.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/python-slsa.yml:
- Line 34: Update the SLSA generator pin from the release-candidate commit
361859811395a7dfc81e24fb4dfe843a59715a40 (v2.1.0-rc.3) to the stable v2.1.0
release commit f7dd8c54c2067bafc12ca7a55595d5ee9b75204a; locate the two
occurrences of the reference
"slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@361859811395a7dfc81e24fb4dfe843a59715a40"
in the workflow and replace the tag/hash with "v2.1.0" (or the commit
f7dd8c54c2...) so both pins point to the stable release.
In `@CHANGELOG.md`:
- Around line 61-65: The compare/tag link-reference definitions at the bottom of
CHANGELOG.md (e.g., the lines starting with "[Unreleased]:", "[2026-04-13]:",
etc.) point to github.com/williaby/.github and should be updated to the correct
repository owner (e.g., github.com/ByronWilliamsCPA/.github) or corrected to the
current org; search for those reference labels in CHANGELOG.md and replace the
owner segment of each URL with the correct org/repo, preserving the rest of each
compare/tag path so the links do not 404.
In `@docs/workflows/python-fips-compatibility.md`:
- Around line 202-205: The doc incorrectly claims argon2-cffi==23.1.0 is
FIPS-compatible; replace that line and any remark recommending Argon2 for FIPS
with a reference to FIPS-approved KDFs (e.g., PBKDF2 per NIST SP 800-132 or
other NIST-approved algorithms) and update the text to recommend using a
FIPS-validated library/implementation (mention PBKDF2 usage or a FIPS-validated
crypto provider) instead of argon2-cffi.
In `@scripts/calculate-image-storage.sh`:
- Around line 7-14: The usage mentions a --used option that's not implemented;
add handling for the --used flag in calculate-image-storage.sh by parsing
command-line args and, when --used is set, collect currently running container
images via docker ps --format '{{.Image}}' (or similar) and use that set to
filter the existing local-scan loop that iterates over images (the block that
builds/scans image names in the "local scan" logic), or alternatively remove
--used from the usage text; update the argument-parsing branch that handles
--all/--local/--repo to recognize --used and pass the filtered image list into
the local scanning routine so only images used by running containers are
processed.
- Around line 257-270: The script errors with set -u because the recommendation
block uses dhi_count, chainguard_count, and distroless_count without
guaranteeing they exist; initialize those counters to 0 before any branch (or
alternatively use parameter expansion like ${dhi_count:-0} when computing
images_to_mirror) so the calculation in the block referencing total_mb and
images_to_mirror always works; update the declaration area (before option
parsing/branching) to define dhi_count=0 chainguard_count=0 distroless_count=0
or modify the calculation in the recommendation block to use ${dhi_count:-0},
${chainguard_count:-0}, and ${distroless_count:-0}.
In `@scripts/sync-secrets.sh`:
- Line 5: The post-increment expressions ((SUCCESS++)) and ((FAILED++)) will
return a non-zero status when the prior value is 0 and cause the script to exit
under set -euo pipefail; replace those post-increments with an increment form
that always returns 0 such as using arithmetic assignment ((SUCCESS+=1)) and
((FAILED+=1)) or by assigning SUCCESS=$((SUCCESS+1)) / FAILED=$((FAILED+1));
alternatively append || true to each ((...)) if you prefer to keep the form.
Ensure you update every occurrence of ((SUCCESS++)) and ((FAILED++)) (and
similar post-increments) so the script no longer aborts on the first increment.
In `@scripts/transfer-repos.sh`:
- Line 5: The script uses arithmetic post-increment expressions ((SUCCESS++)),
((FAILED++)), and ((SKIPPED++)) under set -euo pipefail which can return a
non-zero exit status when incrementing from 0 and prematurely terminate the
script; initialize these counters as integers (e.g., SUCCESS=0 FAILED=0
SKIPPED=0) and replace all occurrences of the post-increment form with a safe
increment that returns zero, e.g. SUCCESS=$((SUCCESS+1)), FAILED=$((FAILED+1)),
SKIPPED=$((SKIPPED+1)) (apply the same change for the repeated uses in the
transfer loop region referenced around the block 91-128).
In `@SECURITY.md`:
- Line 67: The upgrade-guide markdown reference uses the wrong GitHub
organization in the URL; update the link target for the [upgrade-guide]
reference to point to the correct repository under ByronWilliamsCPA (replace
github.com/williaby/.github with github.com/ByronWilliamsCPA/.github) so the
link resolves correctly; locate the [upgrade-guide] reference in SECURITY.md and
change only the organization segment of the URL.
---
Outside diff comments:
In @.github/workflows/python-ci.yml:
- Around line 494-538: The check-tags step never writes the CRITICAL_TAGS shell
variable to the step outputs, so the downstream gate using
steps.check-tags.outputs.critical_tags is always empty; fix by exporting
CRITICAL_TAGS as a step output inside the check-tags step (e.g., echo
"critical_tags=$CRITICAL_TAGS" >> $GITHUB_OUTPUT) so the conditional if: ${{
steps.check-tags.outputs.critical_tags > 0 }} and the interpolation ${{
steps.check-tags.outputs.critical_tags }} see the correct value; alternatively,
if you prefer not to add a new output, change the gate to reference an existing
emitted output (like rad_tags/llm_tags/total_tags) and mirror the numeric
handling pattern used by fail-on-llm-tags (using fromJSON) so the comparison
works as intended.
In @.github/workflows/python-release.yml:
- Around line 246-254: The branch using github.event.inputs.tag is invalid for a
workflow triggered only by workflow_call; update the workflow either by adding a
tag input under workflow_call.inputs (e.g., inputs: tag: { required: false } )
and then reference it as inputs.tag when setting TAG_INPUT, or remove the
github.event.inputs.tag || fallback and set TAG_INPUT solely from
github.ref_name; adjust the manual-release step where TAG_INPUT, VERSION, and
TAG are computed (symbols: TAG_INPUT, github.event.inputs.tag, github.ref_name,
VERSION, TAG, workflow_call.inputs) accordingly so callers can pass a tag or the
code clearly uses the ref name.
- Around line 222-238: The workflow pins for python-semantic-release actions
reference v9.21.1 but use mismatched SHAs; update the two action refs used in
the
job—python-semantic-release/python-semantic-release@0dc72ac9058a62054a45f6344c83a423d7f906a8
and
python-semantic-release/publish-action@1aa9f41fac5d531e6764e1991b536783337f3a56—to
the correct v9.21.1 commit SHAs (or change the inline version comments to
reflect the actual commits you intend to use) so the entries for the "uses:"
lines and their version comments are consistent.
In @.github/workflows/python-reuse.yml:
- Around line 54-78: The fsfe/reuse-action step is pinned to the wrong commit
SHA for v6.0.0; update the SHA used in the action declaration for
fsfe/reuse-action to the correct commit
(9a55738c6490d015afe69ad187520395d2b7a1fa) or else change the tag to the
intended version; locate the action line referencing "uses:
fsfe/reuse-action@676e2d560c9a403aa252096d99fcab3e1132b0f5" and replace the SHA
to match the v6.0.0 tag (or adjust the tag to the correct release) so the
workflow uses the expected commit.
---
Nitpick comments:
In `@docs/workflows/python-publish-pypi.md`:
- Line 18: The phrase "✅ **Comprehensive Summaries** - Detailed GitHub step
summaries" uses the flagged word "Comprehensive"; update that heading to avoid
AI-pattern overuse by replacing "Comprehensive" with a clearer alternative such
as "Detailed Summaries", "Step Summaries", or simply "Summaries" so the line
reads e.g. "✅ **Detailed Summaries** - Detailed GitHub step summaries" (or
adjust both parts to avoid repetition) in the markdown.
In `@docs/workflows/python-sonarcloud.md`:
- Line 7: Replace the vague term "comprehensive" in the sentence "SonarCloud
provides comprehensive static analysis for:" with a more specific word such as
"automated" or "multi-faceted" (or another precise alternative) to avoid
AI-pattern phrasing; update that line in the docs/workflows/python-sonarcloud.md
content so it reads e.g. "SonarCloud provides automated static analysis for:" or
"SonarCloud provides multi-faceted static analysis for:".
In `@scripts/calculate-image-storage.sh`:
- Around line 207-221: The Docker Hub detection excludes bare images (e.g.,
nginx:latest) and uses a brittle *:*/* guard; replace the current
dockerhub/other branch in the for-loop over "${!unique_images[@]}" with logic
that splits on '/' and inspects the first segment: if the image contains no '/'
treat as Docker Hub (increment dockerhub_count); otherwise set
first_segment=${image%%/*} and if first_segment contains '.' or ':' treat it as
a non-Docker registry (increment other_count or appropriate registry counters),
else treat it as Docker Hub (increment dockerhub_count). Keep existing
special-case checks for dhi.io, cgr.dev, gcr.io/distroless, and ghcr.io before
this new split-based logic.
- Around line 82-111: The header printf currently prints three columns
("REPOSITORY:TAG", "SIZE", "VIRTUAL SIZE") but the body printf (printf "%-50s
%15s\n" "${repo}:${tag}" "$size") only outputs two, causing misalignment; fix by
updating the header printf (the printf "%-50s %15s %15s\n" line) to only print
two columns (e.g. "%-50s %15s\n" with "REPOSITORY:TAG" and "SIZE") so it matches
the body, or alternatively add a third value to the body printf if you want to
include virtual size—modify the header printf or the body printf accordingly to
keep them consistent.
- Line 181: The grep invocation using GNU-only flags (grep -oP
'^\s*image:\s*\K[^\s#]+' "$file") is not portable to macOS; replace that command
with an awk pipeline that extracts the image value robustly (match lines
starting with optional whitespace then "image:", strip the "image:" label and
any inline comment starting with '#', and print the trimmed image token) and
keep the surrounding loop (the done < <(...) construct) intact; update the
substitution where this grep appears in calculate-image-storage.sh so the script
runs on BSD/macOS as well as Linux.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f90810ac-2806-4c07-acda-20448b370f35
📒 Files selected for processing (44)
.github/workflows/python-ci.yml.github/workflows/python-codecov.yml.github/workflows/python-compatibility.yml.github/workflows/python-container-security.yml.github/workflows/python-docker.yml.github/workflows/python-docs.yml.github/workflows/python-fips-compatibility.yml.github/workflows/python-fuzzing.yml.github/workflows/python-mutation.yml.github/workflows/python-performance-regression.yml.github/workflows/python-pr-validation.yml.github/workflows/python-publish-pypi.yml.github/workflows/python-qlty-coverage.yml.github/workflows/python-release.yml.github/workflows/python-reuse.yml.github/workflows/python-sbom.yml.github/workflows/python-scorecard.yml.github/workflows/python-security-analysis.yml.github/workflows/python-slsa.yml.github/workflows/python-sonarcloud.yml.github/workflows/python-supplemental-checks.yml.gitignoreCHANGELOG.mdCODEOWNERSCONTRIBUTING.mdPYPI_WORKFLOW_ANALYSIS.mdQLTY_INTEGRATION.mdSECURITY.mddocs/ENHANCEMENT_IMPLEMENTATION_ANALYSIS.mddocs/RECOMMENDED_NEXT_STEPS.mddocs/REGISTRY-SETUP.mddocs/audits/2026-04-18-standards-audit.mddocs/migration/image-detection-pypi-migration.mddocs/migration/pypi-publishing-migration.mddocs/workflows/NEW_WORKFLOWS_SUMMARY.mddocs/workflows/python-fips-compatibility.mddocs/workflows/python-fuzzing.mddocs/workflows/python-publish-pypi.mddocs/workflows/python-sonarcloud.mddocs/workflows/workflow-optimizations.mdscripts/calculate-image-storage.shscripts/sync-secrets.shscripts/transfer-repos.shworkflow-templates/README.md
|
@github-copilot review |
There was a problem hiding this comment.
Pull request overview
This PR applies an automated “global standards” audit to the repository, updating CI workflows, helper scripts, and documentation to align with security/linting/governance/markdown standards and adding an audit report capturing remaining manual-review items.
Changes:
- Updated GitHub Actions workflows with refreshed pinned action SHAs and a safer secret-availability pattern in
python-ci.yml. - Hardened shell scripts (
set -euo pipefail) and added a new helper script for estimating container image storage / GHCR cost. - Fixed markdown structure and governance-document formatting, and added a dated standards audit report under
docs/audits/.
Reviewed changes
Copilot reviewed 43 out of 44 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| workflow-templates/README.md | Markdown structure fixes (blank lines around headings/sections). |
| scripts/transfer-repos.sh | Tightened shell error handling (set -euo pipefail). |
| scripts/sync-secrets.sh | Tightened shell error handling (set -euo pipefail). |
| scripts/calculate-image-storage.sh | New script to estimate local/repo image usage and GHCR cost. |
| docs/workflows/workflow-optimizations.md | Markdownlint fixes (code fences / spacing). |
| docs/workflows/python-sonarcloud.md | Markdownlint fixes (code fences / spacing). |
| docs/workflows/python-publish-pypi.md | Markdownlint fixes (code fences / spacing). |
| docs/workflows/python-fuzzing.md | Markdownlint fixes (code fences / spacing). |
| docs/workflows/python-fips-compatibility.md | Markdownlint fixes (code fences / spacing). |
| docs/workflows/NEW_WORKFLOWS_SUMMARY.md | Markdownlint fixes (code fences / spacing). |
| docs/migration/pypi-publishing-migration.md | Markdownlint fixes (code fences / spacing). |
| docs/migration/image-detection-pypi-migration.md | Markdownlint fixes (code fences / spacing). |
| docs/audits/2026-04-18-standards-audit.md | Added audit report with auto-fixes and manual review items. |
| docs/REGISTRY-SETUP.md | Markdownlint fixes (code fences / spacing). |
| docs/RECOMMENDED_NEXT_STEPS.md | Markdownlint fixes (spacing around headings/lists). |
| docs/ENHANCEMENT_IMPLEMENTATION_ANALYSIS.md | Markdownlint fixes (code fences / spacing). |
| SECURITY.md | Replaced non-standard hyphens in link refs/table cells. |
| QLTY_INTEGRATION.md | Markdownlint fixes (spacing around headings/sections). |
| PYPI_WORKFLOW_ANALYSIS.md | Markdownlint fixes (spacing around headings/sections). |
| CONTRIBUTING.md | Replaced non-standard hyphen in “Google-style docstrings”. |
| CODEOWNERS | Replaced en-dash with hyphen in an annotation comment. |
| CHANGELOG.md | Reordered sections and added missing link-reference footer. |
| .gitignore | Ignored .worktrees/ directory. |
| .github/workflows/python-supplemental-checks.yml | Bumped pinned action SHAs within existing major versions. |
| .github/workflows/python-sonarcloud.yml | Bumped pinned action SHAs within existing major versions. |
| .github/workflows/python-slsa.yml | Updated pinned SLSA generator SHA (now pointing at an RC). |
| .github/workflows/python-security-analysis.yml | Bumped pinned action SHAs within existing major versions. |
| .github/workflows/python-scorecard.yml | Bumped pinned action SHAs within existing major versions. |
| .github/workflows/python-sbom.yml | Bumped pinned action SHAs within existing major versions. |
| .github/workflows/python-reuse.yml | Bumped pinned action SHAs within existing major versions. |
| .github/workflows/python-release.yml | Bumped pinned action SHAs within existing major versions. |
| .github/workflows/python-qlty-coverage.yml | Bumped pinned action SHAs within existing major versions. |
| .github/workflows/python-publish-pypi.yml | Bumped pinned action SHAs within existing major versions. |
| .github/workflows/python-pr-validation.yml | Bumped pinned action SHAs within existing major versions. |
| .github/workflows/python-performance-regression.yml | Bumped pinned action SHAs within existing major versions. |
| .github/workflows/python-mutation.yml | Bumped pinned action SHAs within existing major versions. |
| .github/workflows/python-fuzzing.yml | Bumped pinned action SHAs within existing major versions. |
| .github/workflows/python-fips-compatibility.yml | Bumped pinned action SHAs within existing major versions. |
| .github/workflows/python-docs.yml | Bumped pinned action SHAs within existing major versions. |
| .github/workflows/python-docker.yml | Bumped pinned action SHAs within existing major versions. |
| .github/workflows/python-container-security.yml | Bumped pinned action SHAs within existing major versions. |
| .github/workflows/python-compatibility.yml | Bumped pinned action SHAs within existing major versions. |
| .github/workflows/python-codecov.yml | Bumped pinned action SHAs within existing major versions. |
| .github/workflows/python-ci.yml | Added secret-availability detection outputs + bumped pinned action SHAs. |
| echo "─────────────────────────────────────────────────────────────────────────" | ||
| printf "%-50s %15s %15s\n" "REPOSITORY:TAG" "SIZE" "VIRTUAL SIZE" | ||
| echo "─────────────────────────────────────────────────────────────────────────" |
There was a problem hiding this comment.
The table header prints three columns (including “VIRTUAL SIZE”), but the row formatter only prints two columns. Either add the missing column value (if you intend to show it) or update the header/format string so the output columns match.
There was a problem hiding this comment.
Fixed. Removed the VIRTUAL SIZE column from the header (printf "%-50s %15s\n" "REPOSITORY:TAG" "SIZE"). The row formatter already printed only 2 columns; the header now matches. Commit: 0f828cc.
| unique_images["$image"]=1 | ||
| fi | ||
| done < <(grep -oP '^\s*image:\s*\K[^\s#]+' "$file" || true) | ||
| done |
There was a problem hiding this comment.
This uses grep -oP, which relies on PCRE support and will fail on macOS/BSD grep by default. Consider switching to a more portable approach (e.g., awk/sed/grep -E pipeline, or yq if YAML parsing is needed) so the script works across the same platforms your other helper scripts target.
There was a problem hiding this comment.
Fixed. Replaced grep -oP '...\K...' with a portable awk equivalent: awk '/^\s*image:/ {sub(/^\s*image:\s*/, ""); sub(/#.*/, ""); gsub(/[[:space:]]/, ""); if (length > 0) print}'. This works on GNU and BSD awk without PCRE. Commit: 0f828cc.
| # Use the official SLSA generator directly | ||
| uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@5a775b367a56d5bd118a224a811bba288150a563 # v2.0.0 | ||
| uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@361859811395a7dfc81e24fb4dfe843a59715a40 # v2.1.0-rc.3 | ||
| with: |
There was a problem hiding this comment.
This updates the SLSA generator to v2.1.0-rc.3 (release candidate). If the project policy is to avoid prerelease dependencies in CI, pin to the latest stable release instead (or document why the RC is required) before merging to main.
There was a problem hiding this comment.
Fixed. Pinned to stable v2.1.0 SHA f7dd8c54c2067bafc12ca7a55595d5ee9b75204a (released 2025-02-24) in both occurrences. RC pinning was flagged in the PR description as needing manual verification before merge. Commit: e682c6d.
PR Review4 Critical — must fix before merge Critical: Shell scripts broken under
|
- Replace ((VAR++)) with VAR=$((VAR + 1)) in sync-secrets.sh and
transfer-repos.sh to prevent set -e abort when counter starts at 0
- Fix calculate-image-storage.sh: use IFS=$'\t' read to correctly split
3-column docker images output instead of awk '{print $7}' (empty result)
- Remove VIRTUAL SIZE column from table header to match actual output
- Replace grep -oP (PCRE, macOS-incompatible) with portable awk pattern
- Initialize registry counters before mode branching to prevent unbound
variable errors when running with --local flag
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Promote SLSA generator from RC v2.1.0-rc.3 to stable v2.1.0 in python-slsa.yml (SHA f7dd8c54c2067bafc12ca7a55595d5ee9b75204a) - Correct FIPS guidance in python-fips-compatibility.md: argon2-cffi is not NIST-approved; recommend passlib[pbkdf2] (NIST SP 800-132) - Fix CHANGELOG.md link references: replace williaby/.github with ByronWilliamsCPA/.github (5 occurrences) - Fix SECURITY.md upgrade-guide URL to use correct org name Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
pr-fix SummaryAll critical and major findings from the review have been applied in two commits. Commit
|
| File | Finding | Fix |
|---|---|---|
scripts/sync-secrets.sh |
((SUCCESS++)) / ((FAILED++)) abort under set -e when counter=0 |
Replaced with VAR=$((VAR + 1)) |
scripts/transfer-repos.sh |
Same ((n++)) pitfall on SKIPPED, SUCCESS, FAILED (3 occurrences) |
Replaced with VAR=$((VAR + 1)) |
scripts/calculate-image-storage.sh |
awk '{print $7}' always empty on 3-column docker images output |
Switched while to IFS=$'\t' read -r repo tag size |
scripts/calculate-image-storage.sh |
Table header had VIRTUAL SIZE column; row formatter only printed 2 | Removed VIRTUAL SIZE from header |
scripts/calculate-image-storage.sh |
grep -oP uses PCRE, fails on macOS/BSD grep |
Replaced with portable awk pattern |
scripts/calculate-image-storage.sh |
Registry counters unbound when running with --local only |
Initialized all 6 counters to 0 before any conditional branching |
scripts/calculate-image-storage.sh |
--used documented but not implemented |
Removed from usage/options header |
Shellcheck passed clean on all three scripts after edits.
Commit e682c6d — fix(docs): correct FIPS guidance, SLSA version, and repo URL references
| File | Finding | Fix |
|---|---|---|
.github/workflows/python-slsa.yml |
RC SHA 361859811... (v2.1.0-rc.3) used in live uses: and comment |
Promoted to stable SHA f7dd8c54c... (v2.1.0, released 2025-02-24) |
docs/workflows/python-fips-compatibility.md |
argon2-cffi incorrectly claimed as FIPS-compatible |
Corrected to passlib[pbkdf2]==1.7.4 (PBKDF2-HMAC-SHA256, NIST SP 800-132) with explicit note that argon2-cffi is NOT FIPS-approved |
CHANGELOG.md |
5 link references used williaby/.github instead of ByronWilliamsCPA/.github |
Updated all 5 |
SECURITY.md |
[upgrade-guide] link used williaby/.github |
Updated to ByronWilliamsCPA/.github |
No additional findings were introduced. All review threads have been replied to.
* fix(ci): unbreak mutation testing and clean up DHI login noise
python-mutation.yml:
- Replace 'uv pip install --no-build mutmut==2.5.1' with a range pin
'mutmut>=3.3,<4' and drop the --no-build flag.
- mutmut 2.5.1 has no wheels for the runner's Python/platform combo, so
the previous resolver line was unsatisfiable and exited 1 before any
mutation testing ran (audio-processor issue #34).
- The workflow already uses 3.x CLI syntax ('mutmut run
--paths-to-mutate=...'), so the prior 2.5.1 pin was internally
inconsistent. Range pin keeps us inside the supported API surface.
- Downstream projects that declare mutmut in dev extras get it from
'uv sync --all-extras --frozen' on the prior line; this install is
now a safety net rather than a forced downgrade.
python-container-security.yml:
- Replace docker/login-action with a shell-based conditional DHI login.
- The previous step ran unconditionally and emitted
'##[error]Username and password required' on every consumer repo that
has not configured DHI_USERNAME / DHI_PAT secrets (audio-processor
issue #33, secondary failure). continue-on-error suppressed the job
failure but the error annotation still cluttered logs.
- New form: skips with an ::notice:: when secrets are absent; uses
--password-stdin so the PAT never appears in process listings when
present. Behaviour preserved for repos that do configure DHI.
Refs: ByronWilliamsCPA/audio-processor#33, #34
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix(ci): drop forced mutmut install to satisfy SonarCloud and respect consumer pins
SonarCloud flagged the earlier 'uv pip install mutmut>=3.3,<4' line for:
- S8541: omitting --no-build / --only-binary :all: can let setup scripts
run.
- S8544: dependency without exact version locking.
Adding --no-build back would re-introduce the original blocker (mutmut
2.5.1 had no wheels). An exact pin via 'uv pip install' would force-
downgrade consumer projects whose uv.lock resolves mutmut to a newer
version.
Cleaner fix: drop the standalone 'uv pip install' line entirely. Mutmut
is expected to be declared in the consumer project's dev extras (e.g.
audio-processor's 'mutmut>=3.3.1' in pyproject.toml), and 'uv sync
--all-extras --frozen' installs the exact version from each consumer's
uv.lock. This is fully reproducible (silences S8544), uses only the
binary distribution resolved by uv's lockfile (silences S8541), and
respects each consumer's pinning choice.
If a consumer omits mutmut from their dev deps the workflow will fail
loudly at 'mutmut run' with a clear ModuleNotFoundError; that explicit
failure mode is preferable to silently installing an arbitrary version.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix(ci): annotate uv sync --no-build line as audited NOSONAR
SonarCloud's PR-diff analyzer flagged 'uv sync --all-extras --frozen
$NO_BUILD_FLAG' (S8541, "omitting --no-build can lead to setup script
execution") because the prior commit shifted this line into the diff
hunk, and the static analyzer cannot resolve the dynamic
$NO_BUILD_FLAG env var (set from inputs.no-build) to confirm
--no-build is in fact passed.
This is deliberately flexible behaviour: consumers with PEP 517 build
backends like hatchling pass 'no-build: false' to allow editable
installs of their own project from source. The residual risk is
bounded by 'uv sync --frozen' refusing to resolve any version not in
the consumer's audited uv.lock.
Added a NOSONAR annotation with full rationale so this is explicit and
auditable.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Summary
docs/audits/2026-04-18-standards-audit.mdWhat changed
python-ci.ymlshell conditions (env-var boolean pattern, matching existingpython-sonarcloud.ymlandpython-qlty-coverage.yml)update-pinned-actions.shset -etoset -euo pipefailinsync-secrets.shandtransfer-repos.sh; staged and fixedcalculate-image-storage.sh(was untracked)SECURITY.md,CONTRIBUTING.md,CODEOWNERSManual review items (priority order)
slsa-framework/slsa-github-generatorRC version bump is acceptableuses:lines (false positives on pinned SHAs).yamllintconfig file (referenced in docs but missing)Test Plan
docs/audits/2026-04-18-standards-audit.mdfor full findingspython-ci.ymlsecret interpolation fix matches pattern inpython-sonarcloud.ymlslsa-framework/slsa-github-generatorRC)docs/workflows/filesGenerated with Claude Code
Summary by CodeRabbit
New Features
Chores