Skip to content

ci: CODEOWNERS on workflows so the human-authors gate cannot be silently removed - #2816

Open
Hugo0 wants to merge 1 commit into
devfrom
ci/human-authors-only
Open

ci: CODEOWNERS on workflows so the human-authors gate cannot be silently removed#2816
Hugo0 wants to merge 1 commit into
devfrom
ci/human-authors-only

Conversation

@Hugo0

@Hugo0 Hugo0 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #2805 (the CODEOWNERS commit landed on the branch after the merge).

Summary: 3-line CODEOWNERS: any PR editing .github/workflows/ needs a code-owner (Hugo) review. Closes the hole where a PR could delete the human-authors job and still merge green with 0 approvals on dev.

Risk: none at runtime — only binds once code-owner review is required on the dev ruleset (org Staging ruleset flip, pending).

QA: file syntax is the standard CODEOWNERS pattern; enforced by GitHub, no CI change.

@vercel

vercel Bot commented Aug 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
peanut-wallet Ready Ready Preview Aug 25, 2026 12:34pm

Request Review

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 602ca0e6-5819-450e-9c36-cc3144af83a3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

Code-analysis diff

Painscore total: 7425.76 → 7425.76 (0)
Findings: 0 net (+0 new, -0 resolved)

@github-actions

Copy link
Copy Markdown
Contributor

🧪 UI test report — ✅ all green

Suites

  • unit: 3544 ran, 0 failed, 0 skipped, 1.0m

📊 Coverage (unit)

metric %
statements 69.2%
branches 54.4%
functions 60.1%
lines 70.1%
⏱ 10 slowest test cases
time test
4.2s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › never places two stickers in heavy overlap (broad seed sweep)
1.0s src/hooks/query/__tests__/user.test.tsx › does NOT clear a token that rotated mid-request (stale 401 racing a fresh login)
0.6s src/utils/__tests__/sentry.utils.test.ts › defaults to the client budget under a browser global
0.5s src/utils/__tests__/crisp.test.ts › settles, and hands back a usable plugin, against a real-shaped plugin proxy
0.4s src/utils/__tests__/crisp.test.ts › configures once across repeated support opens
0.4s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › every sticker stays within canvas at any count
0.3s src/utils/__tests__/crisp.test.ts › resets the native session on logout once support has been opened
0.3s src/utils/__tests__/auth-token.test.ts › authReady does not park — hydrates the plain token without an unlock
0.3s src/app/(mobile-ui)/withdraw/__tests__/withdraw-states.test.tsx › Bank withdrawal keeps the $1 minimum for sub-$1 amounts
0.3s src/hooks/__tests__/useCrispTokenId.test.ts › retries then stays undefined when the endpoint keeps failing (no fallback token)
📍 Inline annotations are in the **Unit test report** check above. Coverage artifact: `coverage-unit`. Generated by `.github/workflows/tests.yml`.

@chip-peanut-bot chip-peanut-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Chip review — changes requested

Request changes: the workflow ownership rule is valid but does not own CODEOWNERS itself, leaving a two-PR bypass of the intended review gate.

Findings

  • MAJOR · .github/CODEOWNERS:3 · Own the CODEOWNERS policy file
    On dev, PR A can delete only .github/CODEOWNERS; line 3 owns only workflows, so GitHub assigns no code owner and the zero-approval ruleset can still merge it. PR B can then remove the human-authors workflow with no code-owner gate. GitHub evaluates ownership from the base branch and recommends owning CODEOWNERS itself. Add /.github/CODEOWNERS @Hugo0 (or own /.github/).

  • MAJOR · .github/CODEOWNERS:3 · [moonshotai/kimi-k3] CODEOWNERS file itself is unprotected — two-step silent removal still possible
    The only rule is /.github/workflows/ @Hugo0, so once 'require code owner review' is enabled on the dev ruleset, a PR touching .github/CODEOWNERS requires no code-owner review. An attacker (or careless contributor) can land PR #1 editing or deleting .github/CODEOWNERS with zero approvals, then PR #2 deleting or neutering the human-authors job in .github/workflows/ merges green — exactly the silent-removal scenario this PR claims to close. Fix: add a rule owning the CODEOWNERS file (and ideally the whole .github/ directory, since workflow-adjacent files like composite actions under .github/actions/ can also alter what the gate executes), e.g. /.github/ @Hugo0 or at minimum /.github/CODEOWNERS @Hugo0, placed after (or instead of) the workflows rule.

Checked clean

  • Exact detached head and merge-base diff: only .github/CODEOWNERS is added.
  • CODEOWNERS syntax validation is clean, and @Hugo0 has admin access.
  • Exact-head CI completed successfully; no failing gate to repeat.
  • GitHub base-branch CODEOWNERS behavior and the active dev ruleset review settings.

Second opinion by moonshotai/kimi-k3: 1 finding(s), marked with the model name. It reads the diff only, so treat its findings as advice.

Exact head: 0ca09c399faf · Context: repo, github, github-docs

Comment thread .github/CODEOWNERS
@@ -0,0 +1,3 @@
# Workflow files gate the human-authors policy. A PR that edits them needs a
# code-owner review, so the gate cannot be removed by a PR nobody reads.
/.github/workflows/ @Hugo0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

MAJOR: Own the CODEOWNERS policy file

On dev, PR A can delete only .github/CODEOWNERS; line 3 owns only workflows, so GitHub assigns no code owner and the zero-approval ruleset can still merge it. PR B can then remove the human-authors workflow with no code-owner gate. GitHub evaluates ownership from the base branch and recommends owning CODEOWNERS itself. Add /.github/CODEOWNERS @Hugo0 (or own /.github/).

Comment thread .github/CODEOWNERS
@@ -0,0 +1,3 @@
# Workflow files gate the human-authors policy. A PR that edits them needs a
# code-owner review, so the gate cannot be removed by a PR nobody reads.
/.github/workflows/ @Hugo0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

MAJOR: [moonshotai/kimi-k3] CODEOWNERS file itself is unprotected — two-step silent removal still possible

The only rule is /.github/workflows/ @Hugo0, so once 'require code owner review' is enabled on the dev ruleset, a PR touching .github/CODEOWNERS requires no code-owner review. An attacker (or careless contributor) can land PR #1 editing or deleting .github/CODEOWNERS with zero approvals, then PR #2 deleting or neutering the human-authors job in .github/workflows/ merges green — exactly the silent-removal scenario this PR claims to close. Fix: add a rule owning the CODEOWNERS file (and ideally the whole .github/ directory, since workflow-adjacent files like composite actions under .github/actions/ can also alter what the gate executes), e.g. /.github/ @Hugo0 or at minimum /.github/CODEOWNERS @Hugo0, placed after (or instead of) the workflows rule.

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