Repository navigation
feat: implement issue #1343 — Compliance audit — 2026-10-16 #1426
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
Open
don-petry
wants to merge
32
commits into
main
Choose a base branch
from
dev-lead/issue-1343-20261029-0103
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
cb22231
feat: implement issue #1343 — Compliance audit — 2026-10-16
don-petry 5210ba8
Merge branch 'main' into dev-lead/issue-1343-20261029-0103
don-petry 127f5ec
Merge branch 'main' into dev-lead/issue-1343-20261029-0103
don-petry 09f54b2
Merge branch 'main' into dev-lead/issue-1343-20261029-0103
don-petry bfb6bda
Merge branch 'main' into dev-lead/issue-1343-20261029-0103
don-petry ad94d68
Merge branch 'main' into dev-lead/issue-1343-20261029-0103
don-petry 967d7b4
Merge branch 'main' into dev-lead/issue-1343-20261029-0103
don-petry f76d4bf
Merge branch 'main' into dev-lead/issue-1343-20261029-0103
don-petry ee4eb8c
Merge branch 'main' into dev-lead/issue-1343-20261029-0103
don-petry ba5b74f
Merge branch 'main' into dev-lead/issue-1343-20261029-0103
don-petry 1dbc815
Merge branch 'main' into dev-lead/issue-1343-20261029-0103
don-petry c2c90f4
Merge branch 'main' into dev-lead/issue-1343-20261029-0103
don-petry b41f1e6
Merge branch 'main' into dev-lead/issue-1343-20261029-0103
don-petry 99eb987
Merge branch 'main' into dev-lead/issue-1343-20261029-0103
don-petry aec2c38
Merge branch 'main' into dev-lead/issue-1343-20261029-0103
don-petry 2497c97
Merge branch 'main' into dev-lead/issue-1343-20261029-0103
don-petry a54b98c
Merge branch 'main' into dev-lead/issue-1343-20261029-0103
don-petry fa0ea60
Merge branch 'main' into dev-lead/issue-1343-20261029-0103
don-petry ee05a46
Merge branch 'main' into dev-lead/issue-1343-20261029-0103
don-petry 9348c3f
Merge branch 'main' into dev-lead/issue-1343-20261029-0103
don-petry 543d5d3
Merge branch 'main' into dev-lead/issue-1343-20261029-0103
don-petry d10e64c
Merge branch 'main' into dev-lead/issue-1343-20261029-0103
don-petry 84eab71
Merge branch 'main' into dev-lead/issue-1343-20261029-0103
don-petry f0ee88a
Merge branch 'main' into dev-lead/issue-1343-20261029-0103
don-petry f6b31d2
Merge branch 'main' into dev-lead/issue-1343-20261029-0103
don-petry 542ae45
Merge branch 'main' into dev-lead/issue-1343-20261029-0103
don-petry 90826ab
Merge branch 'main' into dev-lead/issue-1343-20261029-0103
don-petry db58972
Merge branch 'main' into dev-lead/issue-1343-20261029-0103
don-petry a1d101f
Merge branch 'main' into dev-lead/issue-1343-20261029-0103
don-petry 6df15ad
Merge branch 'main' into dev-lead/issue-1343-20261029-0103
don-petry 987d8f6
Merge branch 'main' into dev-lead/issue-1343-20261029-0103
don-petry 9e51c5a
Merge branch 'main' into dev-lead/issue-1343-20261029-0103
don-petry File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| #!/usr/bin/env bash | ||
| # Repos the org standard does not serve at all — shared by | ||
| # deploy-standard-workflows.sh (the sweep never touches them, #1334) and | ||
| # compliance-audit.sh (the audit files no findings or issues there, #1343, | ||
| # #1352), so the two never disagree about which repos are in scope. | ||
| # | ||
| # This is a different thing from the deploy sweep's SKIP_REPOS. A SKIP_REPO is | ||
| # inside the standard and self-manages it, so every required workflow on it must | ||
| # be reconciled (SKIP_OVERRIDES or SKIP_SELF_MANAGED, see | ||
| # reconcile_skip_repo_required_workflows). A repo here is outside the standard by | ||
| # a recorded decision of the Maintainer: it receives no stub, takes no opt-in, is | ||
| # not part of that reconciliation, and is not audited. | ||
| # software-factory — where the replacement for this fleet is built. Its | ||
| # design keeps the two apart (no owner-account token, | ||
| # none of the fleet's workflows), and its own workflow | ||
| # rules refuse every stub. A sync PR opened there on | ||
| # 2026-10-12 was closed unmerged; its departures are | ||
| # recorded in its docs/decisions/0014. | ||
| # software-factory-canary — throwaway repo for that project's platform trials. | ||
| # The Scorecard and SonarCloud audits do not read this list yet. | ||
| NOT_SERVED_REPOS=("software-factory" "software-factory-canary") | ||
|
|
||
| # True if <repo> is in NOT_SERVED_REPOS. | ||
| is_not_served_repo() { | ||
| local repo s | ||
| # GitHub repo names are case-insensitive; compare lowercased. | ||
| repo=$(printf '%s' "$1" | tr '[:upper:]' '[:lower:]') | ||
| for s in "${NOT_SERVED_REPOS[@]}"; do | ||
| [[ "$repo" == "$(printf '%s' "$s" | tr '[:upper:]' '[:lower:]')" ]] && return 0 | ||
| done | ||
| return 1 | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| #!/usr/bin/env bats | ||
| # The compliance audit skips NOT_SERVED_REPOS (scripts/lib/not-served-repos.sh). | ||
| # | ||
| # software-factory and software-factory-canary are outside the org standard by a | ||
| # recorded decision of the Maintainer. The deploy sweep already leaves them alone | ||
| # (#1334); the audit kept filing findings and issues there (#1343: 43 of 67 | ||
| # findings, #1352). main() must drop them from the org listing, so they are not | ||
| # audited and the issue-management loop never creates issues or labels there. | ||
|
|
||
| bats_require_minimum_version 1.5.0 | ||
|
|
||
| setup() { | ||
| REPO_ROOT="$(cd -- "${BATS_TEST_DIRNAME}/../../.." && pwd)" | ||
| SCRIPT="${REPO_ROOT}/scripts/compliance-audit.sh" | ||
| REPORT_DIR="$(mktemp -d "$BATS_TEST_TMPDIR/nsr.XXXXXX")" | ||
| export REPORT_DIR SCRIPT | ||
| } | ||
|
|
||
| # _run_main <apply:true|false> — source the audit, stub every gh call and every | ||
| # per-repo check, feed main() an org listing with served and not-served repos, | ||
| # and echo which repos were audited and which reached issue management. | ||
| _run_main() { | ||
| APPLY_FLAG="$1" run bash -c ' | ||
| source "$SCRIPT" >/dev/null 2>&1 | ||
| gh() { | ||
| case "$1 $2" in | ||
| "auth status") return 0 ;; | ||
| "repo list") printf "%s\n" markets software-factory Software-Factory-Canary broodly ;; | ||
| *) return 0 ;; | ||
| esac | ||
| } | ||
| gh_api() { echo "{\"name\":\"x\"}"; } | ||
| for f in $(declare -F | awk "{print \$3}" | grep -E "^(check_|pp_run_all_checks$|detect_ecosystems$)"); do | ||
| eval "$f() { :; }" | ||
| done | ||
| detect_ecosystems() { ECOSYSTEMS=(); } | ||
| check_required_workflows() { echo "AUDITED $1"; } | ||
| ensure_audit_label() { echo "MANAGED $1"; } | ||
| ensure_required_labels() { :; } | ||
| create_issue_for_finding() { :; } | ||
| close_resolved_issues() { :; } | ||
| create_umbrella_issue() { :; } | ||
| append_issue_pr_links() { :; } | ||
| export GH_TOKEN=dummy | ||
| if [ "$APPLY_FLAG" = true ]; then main --apply; else main; fi | ||
| ' | ||
| } | ||
|
|
||
| @test "main audits served repos and skips not-served ones" { | ||
| _run_main false | ||
| [[ "$output" == *"AUDITED markets"* ]] | ||
| [[ "$output" == *"AUDITED broodly"* ]] | ||
| [[ "$output" != *"AUDITED software-factory"* ]] | ||
| [[ "$output" != *"AUDITED Software-Factory-Canary"* ]] | ||
| } | ||
|
|
||
| @test "the issue-management loop never reaches a not-served repo" { | ||
| _run_main true | ||
| [[ "$output" == *"MANAGED markets"* ]] | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
| [[ "$output" != *"MANAGED software-factory"* ]] | ||
| [[ "$output" != *"MANAGED Software-Factory-Canary"* ]] | ||
| } | ||
|
|
||
| @test "not-served repos are not counted in the audited-repos record" { | ||
| _run_main false | ||
| run cat "$REPORT_DIR/audited-repos.txt" | ||
| [[ "$output" == *"markets"* ]] | ||
| [[ "$output" != *"software-factory"* ]] | ||
| [[ "$output" != *"Software-Factory-Canary"* ]] | ||
| } | ||
|
|
||
| # The shared list itself (scripts/lib/not-served-repos.sh). This file runs on any | ||
| # scripts/lib/** change (compliance-audit-tests.yml), so the lib is covered here. | ||
| @test "is_not_served_repo: software-factory and its canary, case-insensitively" { | ||
| run bash -c 'source "$1"; is_not_served_repo software-factory && is_not_served_repo SOFTWARE-FACTORY-CANARY' _ "${REPO_ROOT}/scripts/lib/not-served-repos.sh" | ||
| [ "$status" -eq 0 ] | ||
| } | ||
|
|
||
| @test "is_not_served_repo: ordinary repos, .github and .github-private are served" { | ||
| run bash -c 'source "$1"; for r in markets .github .github-private software-factory-other ""; do is_not_served_repo "$r" && { echo "$r"; exit 1; }; done; exit 0' _ "${REPO_ROOT}/scripts/lib/not-served-repos.sh" | ||
| [ "$status" -eq 0 ] | ||
| [ -z "$output" ] | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
Script executed:
Repository: combsmith/.github
Length of output: 10931
Script executed:
Repository: combsmith/.github
Length of output: 7269
Script executed:
Repository: combsmith/.github
Length of output: 7269
Script executed:
Repository: combsmith/.github
Length of output: 7175
Script executed:
Repository: combsmith/.github
Length of output: 42020
Script executed:
Repository: combsmith/.github
Length of output: 41831
Exclude not-served repositories from both retrigger sweeps.
The audit filter leaves existing findings in
software-factory-canaryuntouched. The retrigger script then searches all organization repositories without applyingis_not_served_repo. A stale issue without an active dev-lead engagement can therefore receive anotherdev-leadtrigger.Apply the shared
NOT_SERVED_REPOSguard to both the primary and legacy-label sweeps. Retire existing machine-owned findings safely.Uh oh!
There was an error while loading. Please reload this page.
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-on-ref). This reply's claim could not be verified as a fix produced and pushed by this pass (its commit was not produced by this pass, or the push did not land), so it no longer counts as addressed. The thread stays open; the next dev-lead pass re-verifies against the pushed diff.Original reply, kept for the record (unverified — it does not count as a fix):
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.
🧩 Analysis chain
🏁 Script executed:
Length of output: 37518
@don-petryThe repository check did not verify the fix. At inspected commit5210ba8cce1abfa02ec38c2fd9c4d7fc5ee50fde,scripts/compliance-retrigger.shstill:lib/dev-lead-retrigger.shnear Line 58.is_not_served_repoguard in either sweep before the trigger actions.This differs from your reported commit
a419fa881454f11b3b02248c90b89294f8635f1b. Please confirm that the fix is on this PR branch, then request another check. The finding remains unresolved because verification is inconclusive.I accept keeping automatic closure out of this change. Skipping a repository does not establish that its findings are resolved. Would you like a separate follow-up issue for maintainer-reviewed cleanup?
🧠 Learnings used
If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!
You are interacting with an AI system.