Skip to content

Compliance: check-suite-prefs-unreadable #799

Closed

Description

@don-petry

Compliance Finding

Category: settings
Severity: warning
Check: check-suite-prefs-unreadable

Detail

Could not read check-suite preferences — verify GH_TOKEN has repo scope and the repo is accessible. Check-suite auto-trigger compliance was not evaluated.

Standard Reference

standards/github-settings.md

Remediation

Run scripts/apply-repo-settings.sh .github-private with a token that has admin access to the repository (requires a classic PAT with repo scope or equivalent):

GH_TOKEN=<admin-pat> bash scripts/apply-repo-settings.sh .github-private

This script applies all standard settings defined in standards/github-settings.md in one pass.
For a dry run to preview changes without applying: DRY_RUN=true GH_TOKEN=<admin-pat> bash scripts/apply-repo-settings.sh .github-private


This issue was automatically created by the weekly compliance audit.

Activity

  1. don-petry commented on Jun 19, 2026

    @don-petry
    CollaboratorAuthor

    Dev-Lead Implementation Plan

    Issue: #799 — Compliance: check-suite-prefs-unreadable

    Scope

    The compliance audit could not read this repo's check-suite preferences (root cause: the audit token lacked repo scope / repo access). The remediation is operational — an admin runs scripts/apply-repo-settings.sh with an admin PAT — which the dev-lead agent cannot perform and must not (shared infrastructure). The actionable, in-repo improvement is that rs_apply_repo hits the same unreadable-prefs wall but emits a generic failed to get check-suite preferences warning that doesn't point the operator at the root cause. This change makes that diagnostic actionable, mirroring the finding's guidance (verify token scope + repo accessibility), so an operator running the remediation gets a self-explanatory error instead of a dead end.

    Implementation Checklist

    • scripts/apply-repo-settings.sh — replace the generic warning in rs_apply_repo's prefs-fetch failure branch with an actionable message naming the repo scope requirement and repo accessibility (behavior unchanged: still returns 1).

    Tests to Write

    • tests/test_apply_repo_settings.bats — add a test asserting that when the GET check-suites/preferences call fails, the emitted diagnostic mentions repo scope and repo accessibility (and the function still returns 1).

    Test Command

    bats tests/test_apply_repo_settings.bats (full suite via scripts/run-bats.sh), plus bash .dev-lead/scripts/dev-lead-lint.sh

  2. don-petry commented on Jun 19, 2026

    @don-petry
    CollaboratorAuthor

    Dev-Lead: Implementation Complete

    Plan Execution

    • Replaced the generic prefs-fetch failure warning in rs_apply_repo with an actionable diagnostic
    • Added a bats test asserting the diagnostic names repo scope and repo accessibility (and still returns 1)

    Context / Scope note

    The finding's root cause is operational: the weekly compliance audit (in petry-projects/.github) could not read this repo's check-suite preferences because its token lacked repo scope / repo access. The documented remediation — GH_TOKEN=<admin-pat> bash scripts/apply-repo-settings.sh .github-private — requires an admin PAT and modifies shared repo settings, so it is out of scope for the dev-lead agent to execute (and is not a source change). An admin still needs to run that remediation to clear the underlying warning.

    What is fixable in-repo: rs_apply_repo hits the exact same unreadable-prefs wall when an operator runs the remediation with an under-scoped token, but it emitted a generic failed to get check-suite preferences message that gave no next step. The diagnostic now mirrors the finding's guidance so the failure is self-explanatory.

    Test Results

    $ bats tests/test_apply_repo_settings.bats
    ...
    ok 16 rs_apply_repo live: returns 1 when GET check-suite preferences fails
    ok 17 rs_apply_repo live: unreadable preferences warning names repo scope and accessibility
    ...
    ok 32 live mode makes one PATCH call per required setting
    
    32 tests, 0 failures
    
    $ bash .dev-lead/scripts/dev-lead-lint.sh
      [lint] shellcheck on 67 file(s)...
      [lint] validating 4 agent profile(s)...
      [lint] all checks passed
    

    Files Changed

    • scripts/apply-repo-settings.sh: actionable warning when check-suite preferences are unreadable — names the repo scope (classic PAT) requirement and repo accessibility. Behavior unchanged (still returns 1).
    • tests/test_apply_repo_settings.bats: new test covering the improved diagnostic.

    Notes

    • This is a diagnostic/UX hardening change for the script's failure path; it does not and cannot apply the repo settings or clear the compliance warning on its own. Clearing the warning requires an admin to run the remediation command above. Recommend keeping this issue open (or reassigning to an admin) until that operational step is performed.
    • shellcheck on the modified file reports only a pre-existing SC1091 info (cannot follow the sourced lib/push-protection.sh), which the warning-level repo lint ignores.
  3. added a commit that references this issue on Jun 19, 2026
  4. added 18 commits that reference this issue on Aug 2, 2026
  5. added a commit that references this issue on Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    compliance-auditAutomated compliance audit findingdev-leadFor dev-lead agent pickup

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions