Skip to content

fix(branch-protection): security check runs are never added to required status checks #1231

Closed

Description

@myakove

Summary

Add the built-in security check runs to GitHub branch protection's required status checks when configured as mandatory.

Problem / Motivation

The security-suspicious-paths and security-committer-identity checks appear on PRs but are not marked Required by GitHub. The server-side merge gate already treats them as mandatory, but get_required_status_checks() does not read security-checks when constructing branch-protection contexts.

Requirements

  1. In get_required_status_checks(), read the existing security-checks config and append SECURITY_SUSPICIOUS_PATHS_STR and SECURITY_COMMITTER_IDENTITY_STR when applicable; use the constants, not string literals.
  2. Respect mandatory: false, an empty suspicious-paths list, and committer-identity-check: false when deciding which checks to require.
  3. Ensure exclude-runs can remove the security checks.
  4. Decide and document whether mandatory security checks are included when a branch has explicit include-runs.
  5. Add tests covering mandatory true/false, each individual check being disabled, and exclude-runs removal.
  6. Run uv run ruff check --no-fix, uv run ruff format --check, uv run mypy webhook_server/, and uv run --group tests pytest -n auto.

Deliverables

  • Code changes
  • Tests
  • Document explicit include-runs behavior

Notes

Private repositories skip the set_repository branch-protection path and are outside this change. No config schema change is expected.


Assisted-by: PI (stealth/space-bunny-alpha)

Activity

  1. added a commit that references this issue on Sep 29, 2026
    a903a1c
  2. myakove commented on Sep 29, 2026

    @myakove
    CollaboratorAuthor

    The fix for this issue has landed in PR #1232.

    That PR also carries unrelated work, which is tracked separately:

    On the original Done checklist: everything is satisfied except the include-runs sub-item, which turned out to be a second, independent bug in the same function — exclude-runs was being silently discarded whenever include-runs was set. That was also fixed in PR #1232.

    One deployment note: branch protection is applied at server startup, so this change takes effect on the next restart that runs repository setup, not on merge.

  3. myakove commented on Sep 29, 2026

    @myakove
    CollaboratorAuthor

    Correction to the comment above: PR #1232 is still open, not merged, so "landed in" was premature wording. The commits are pushed to the branch; the wording should be "will land in". Nothing else in that comment changes.


    Assisted-by: PI (stealth/space-bunny-alpha)

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions