Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ci(BS-001): make CODEOWNERS advisory and cover required-check paths
Name @lazyxeon on the root-anchored paths that change what the required
checks run or report. The policy test matches that set. The ruleset
instruction sets require_code_owner_review to false. Andrew applies it.

Refs #422

Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
  • Loading branch information
cursoragent and lazyxeon committed Nov 10, 2026
commit 2077bb0010438e86cc7121937c25cf62f2840b00
16 changes: 11 additions & 5 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @lazyxeon owns these policy paths. No other ownership rule.
.github/workflows/** @lazyxeon
deny.toml @lazyxeon
AGENTS.md @lazyxeon
.github/CODEOWNERS @lazyxeon
# Advisory. @lazyxeon is named on these paths. Review is not required to merge.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The header says review is not required to merge. Ruleset 7941616 still has require_code_owner_review: true, required_approving_review_count 2, and bypass_actors null. GitHub reads CODEOWNERS from the base branch, so this pull request is uncovered. After this file is on main, a later pull request that touches these paths requests @lazyxeon, and the author cannot approve that request.

Set the flag to false before this file reaches the default branch. The live rule did not stop the last owner merge: #728 head 8bd9fa4d had reviewDecision REVIEW_REQUIRED and no APPROVED review, and @lazyxeon squash-merged it at 2026-11-10T00:36:44Z. The header describes the flag this pull request asks him to set. The live value is still true.

# No other ownership rule. Patterns are root-anchored and do not overlap.
/.github/ @lazyxeon
/.cargo/ @lazyxeon
/scripts/ci/ @lazyxeon
/rust-toolchain.toml @lazyxeon
/CLAUDE.md @lazyxeon
/GROK.md @lazyxeon
/.cursor/rules/ @lazyxeon
/deny.toml @lazyxeon
/AGENTS.md @lazyxeon
22 changes: 21 additions & 1 deletion docs/current/CI_ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ The rollup check-run name is `PR Rust checks`. The app id is 15368 (`github-acti

`gh pr checks` prints the check-run `name`. It does not prefix the workflow name. The compare job's check-run name is `compare`, not `determinism-replay / compare`.
Comment thread
cursor[bot] marked this conversation as resolved.
Resolved

`.github/CODEOWNERS` is advisory. It names @lazyxeon on `/.github/`, `/.cargo/`, `/scripts/ci/`, `/rust-toolchain.toml`, `/CLAUDE.md`, `/GROK.md`, `/.cursor/rules/`, `/deny.toml`, and `/AGENTS.md`. Those paths cover the workflows, composite actions, CI scripts, the audit ignore file, the Linux replay rustflags, the toolchain pin, and the constitution files. The file does not block a merge. On the `pull_request` rule, set `require_code_owner_review` to false and leave the other parameters on that rule as they are. The owner applies that with the status-check swap below. This file does not edit ruleset 7941616.

Require these contexts, each with integration id 15368. On the #700 head every one of them completed success, and none of the three ruleset contexts above was present. The same nine were success on docs-only #597 and #616 and on `.github/dependabot.yml` pull request #645.

```json
Expand All @@ -204,7 +206,25 @@ Require these contexts, each with integration id 15368. On the #700 head every o
}
```

That object replaces `parameters` on the `required_status_checks` rule. The owner applies it. Drop `Code coverage`, `CodeQL`, and `Analyze (rust)`.
`OpenSSF Scorecard Analysis` requests `security-events: write` and uploads SARIF (`github/codeql-action/upload-sarif@v4` in `scorecard.yml`). A pull request from a fork does not receive that permission. The upload step has no `continue-on-error`, so the job fails and this required context fails with it. Same-repository pull requests are the flow this list is for.

That object replaces `parameters` on the `required_status_checks` rule. The owner applies it. Drop the status-check contexts `Code coverage`, `CodeQL`, and `Analyze (rust)`. Keep the separate `code_scanning` rule on the same ruleset. That rule is the alert gate: CodeQL at `errors` / `high_or_higher`, and Scorecard at the same thresholds. It is not in the JSON above.

On the `pull_request` rule, replace `parameters` with the live object and `require_code_owner_review` set to false:

```json
{
"allowed_merge_methods": ["merge", "squash", "rebase"],
"dismiss_stale_reviews_on_push": true,
"require_code_owner_review": false,
"require_extra_approval_for_unattributed_changes": true,
"require_last_push_approval": true,
"required_approving_review_count": 2,
"required_reviewers": []
}
```

The only change from the live `pull_request` parameters is `require_code_owner_review`. Do not change the `code_scanning` rule. This file does not edit ruleset 7941616.

Require:

Expand Down
37 changes: 22 additions & 15 deletions scripts/ci/test_workflow_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,20 @@ def _broken_action_ref_violation(old: str, new: str):

CODEOWNERS_FILE = ROOT / ".github" / "CODEOWNERS"
CODEOWNERS_OWNER = "@lazyxeon"
# File order. These four do not overlap; last-match would not change the owner.
CODEOWNERS_ADVISORY = (
"Advisory. @lazyxeon is named on these paths. Review is not required to merge."
)
# File order. These patterns do not overlap; last-match would not change the owner.
CODEOWNERS_PATHS = (
".github/workflows/**",
"deny.toml",
"AGENTS.md",
".github/CODEOWNERS",
"/.github/",
"/.cargo/",
"/scripts/ci/",
"/rust-toolchain.toml",
"/CLAUDE.md",
"/GROK.md",
"/.cursor/rules/",
"/deny.toml",
"/AGENTS.md",
)


Expand Down Expand Up @@ -1195,23 +1203,22 @@ def test_benchmark_alert_issue_runs_after_failed_regression_check(self) -> None:

def test_codeowners_is_only_the_policy_paths(self) -> None:
text = CODEOWNERS_FILE.read_text(encoding="utf-8")
self.assertIn(CODEOWNERS_ADVISORY, text)
assert_codeowners(text)
missing = text.replace("AGENTS.md @lazyxeon\n", "", 1)
missing = text.replace("/AGENTS.md @lazyxeon\n", "", 1)
self.assertNotEqual(missing, text)
with self.assertRaises(AssertionError):
assert_codeowners(missing)
extra = text + "CLAUDE.md @lazyxeon\n"
extra = text + "/README.md @lazyxeon\n"
with self.assertRaises(AssertionError):
assert_codeowners(extra)
source = inspect.getsource(assert_codeowners)
self.assertIn("if rules != expected:", source)
broken = _exec_assert_codeowners(
source.replace(
"if rules != expected:",
"if False and rules != expected:",
1,
)
)
guard = "\n if rules != expected:\n"
self.assertIn(guard, source)
weakened = source.replace(guard, "\n if False and rules != expected:\n", 1)
self.assertNotEqual(weakened, source)
self.assertNotIn(guard, weakened)
broken = _exec_assert_codeowners(weakened)
broken(missing)
broken(extra)

Expand Down
Loading