Repository navigation
feat(standards): audit the organisation against a written standard - #13
Merged
Merged
Conversation
Read every repository of the organisation and print each deviation as an error, a warning or an info: branch deletion after merge, Dependabot, CODEOWNERS, secret scanning and a recognised license on public repositories, a CI that calls the shared gate pinned by a full SHA with a version comment, leftover branches, and the two-factor requirement. Exceptions name a repository and a rule, give a reason and expire, and an expired one is itself an error. The report can append the audit with --audit, and --fail-on makes the exit code usable in a CI step.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Task T21 of
specs/next-ci-reliability(contrast3d-platform), requirement FR15: the standardsaudit as code, so that a new or changed repository cannot drift unnoticed.
standards/audit.pyreads every repository of the organisation (gh) and prints each deviationas
error,warningorinfo. Rules:delete-branch-on-merge,dependabot-config,codeowners,secret-scanningandlicense(public repositories),has-ci,shared-gate,gate-pin(fullSHA with a
# vX.Y.Zcomment, what online zizmor verifies),topic-branches,org-2faandorg-2fa-method. Archived repositories are skipped; commented examples are not calls.standards/standards.json: thresholds, severity overrides and exceptions. An exception names arepository and a rule, gives a reason and expires; an expired one stops silencing the rule and
is itself an error. Current ones:
contrast-hub(ownsello),ci-shared(the source of thegate),
dseuntil 2026-11-15 (T23), and the organisation profile repository.--fail-on error|warningsets the exit code;report/ci_report.py --auditappends the audit tothe weekly report.
Verification
gh(every rule, exceptions, severities, rendering, the realcommands); 102 in total. The tests were written first;
ruff,actionlint,gitleaksclean.(viewer still pins the gate by
# main, platform and bot lack CODEOWNERS,dselacks Dependabot,gha-local-runnershas no CI, the 2FA requirement is off) and one false positive that a test nowcovers (a commented example read as a call).