Skip to content

feat(github): Keep drafts that would ping code owners or break AGENTS.md - #3380

Open
sentry-junior[bot] wants to merge 3 commits into
mainfrom
feat/draft-codeowners
Open

sentry-junior[bot] wants to merge 3 commits into
mainfrom
feat/draft-codeowners

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Why: since #3250, Junior marks its draft ready once the required checks pass. Two problems: marking a draft ready makes GitHub ask the CODEOWNERS owners to review, so teammates get pinged before the requester has looked. And a repo's AGENTS.md can say PRs stay drafts (sentry-javascript: "Always open PRs as draft"), which the auto-ready ignored. Replaces #3350.

What:

  • For a draft, github_getPullRequest now returns:
    • code_owners: owners of the changed files, read from the base branch's CODEOWNERS file (.github/, the root, then docs/). It's matched deterministically with the ignore package, since CODEOWNERS uses gitignore patterns. The last matching rule wins, and a rule with no owners clears them. If a CODEOWNERS file exists but GitHub doesn't list the changed files, the call fails so the draft stays a draft.
    • agents_md: the root AGENTS.md of the base branch.
    • Both come from one GraphQL query.
  • After checks pass, Junior marks the draft ready only if the requester said to, or if code_owners is empty and AGENTS.md doesn't ask for drafts. Otherwise it stays a draft, and Junior tells the requester in the thread that the checks pass and it's waiting for their review, with the reason.
  • github-code: in a repo with a CODEOWNERS file, open a draft unless the requester asks for a ready PR.

Known gap: GitHub matches docs/* only to files directly in docs/, but gitignore also matches files deeper down. So this can list too many owners, never too few.

via @BYK.

--

View Session [Sentry]

Co-Authored-By: Burak Yigit Kaya <126780+BYK@users.noreply.github.com>
@sentry-junior
sentry-junior Bot requested a review from BYK November 13, 2026 17:44
@vercel

vercel Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 13, 2026 6:03pm UTC

Request Review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 200c382. Configure here.

Co-Authored-By: Burak Yigit Kaya <126780+BYK@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

247 screenshot changes — 0 changed · 247 added · 0 removed

Review screenshots in Frameshift

@sentry-junior sentry-junior Bot changed the title feat(github): Keep drafts with code owners until the requester reviews feat(github): Keep drafts that would ping code owners or break AGENTS.md Nov 13, 2026

This branch was successfully deployed

1 active deployment
Preview – junior-docs — c7ce625c Deployed Nov 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant