Skip to content

feat(standards): audit the organisation against a written standard - #13

Merged
Nain9Dev merged 1 commit into
mainfrom
feat/standards-audit
Oct 14, 2026
Merged

Nain9Dev merged 1 commit into
mainfrom
feat/standards-audit

Conversation

@Nain9Dev

Copy link
Copy Markdown
Member

Summary

Task T21 of specs/next-ci-reliability (contrast3d-platform), requirement FR15: the standards
audit as code, so that a new or changed repository cannot drift unnoticed.

  • standards/audit.py reads every repository of the organisation (gh) and prints each deviation
    as error, warning or info. Rules: delete-branch-on-merge, dependabot-config, codeowners,
    secret-scanning and license (public repositories), has-ci, shared-gate, gate-pin (full
    SHA with a # vX.Y.Z comment, what online zizmor verifies), topic-branches, org-2fa and
    org-2fa-method. Archived repositories are skipped; commented examples are not calls.
  • standards/standards.json: thresholds, severity overrides and exceptions. An exception names a
    repository and a rule, gives a reason and expires; an expired one stops silencing the rule and
    is itself an error. Current ones: contrast-hub (own sello), ci-shared (the source of the
    gate), dse until 2026-11-15 (T23), and the organisation profile repository.
  • --fail-on error|warning sets the exit code; report/ci_report.py --audit appends the audit to
    the weekly report.

Verification

  • 41 new tests with a simulated gh (every rule, exceptions, severities, rendering, the real
    commands); 102 in total. The tests were written first; ruff, actionlint, gitleaks clean.
  • Run read-only against the real organisation: it reported what the audit of today found by hand
    (viewer still pins the gate by # main, platform and bot lack CODEOWNERS, dse lacks Dependabot,
    gha-local-runners has no CI, the 2FA requirement is off) and one false positive that a test now
    covers (a commented example read as a call).

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.
@Nain9Dev
Nain9Dev merged commit 50bad2b into main Oct 14, 2026
5 checks passed
@Nain9Dev
Nain9Dev deleted the feat/standards-audit branch October 14, 2026 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant