Skip to content

ci(getsentry): Dispatch getsentry backend tests for merge groups - #131267

Draft
sentry-junior[bot] wants to merge 2 commits into
masterfrom
ci/getsentry-dispatch-merge-group
Draft

sentry-junior[bot] wants to merge 2 commits into
masterfrom
ci/getsentry-dispatch-merge-group

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

A merge queue waits for every required check on the merge group commit. getsentry / backend is required, but it's only dispatched from pull_request_target, so a queued group would wait until the queue times out. This adds a merge-group path that dispatches the getsentry backend tests for the group's head SHA.

  • getsentry-merge-queue-trigger.yml runs on merge_group and does nothing. It has permissions: {} and uses no secrets.
  • getsentry-merge-queue-dispatch.yml runs on workflow_run (requested) of the trigger, and only for merge_group runs. It:
    • takes the base SHA from the queue branch name (gh-readonly-queue/<base>/pr-<n>-<base sha>)
    • lists changed files with git diff (new parse-pr-files.py --git-diff mode)
    • filters paths with master's file-filters.yml
    • dispatches with sentry-sha and sentry-pr-sha set to the group head
  • Merge groups dispatch only the backend workflow, because getsentry / backend is the only required getsentry check. The PR path is unchanged.

merge_group runs take their workflow files and scripts from the merge group commit, so the dispatch that needs the getsentry token doesn't run there. workflow_run always runs from master. The token job runs only master's code and filters, and it reads only GitHub-set fields from the triggering run: event, head branch, and head SHA. If a PR breaks the trigger, nothing is dispatched and the check never reports, so the queue entry fails closed.

The merge_group → workflow_run chain can't run until a queue is enabled, so its first real run will happen then.

Refs DI-2872

via @BYK.

--

View Session [Sentry]

A merge queue waits for every required check on the merge group commit,
including getsentry / backend, which getsentry only reports for pull
requests today.

A no-op merge_group workflow starts a workflow_run dispatcher. The
dispatcher runs from master, so code in the merge group never runs with
the getsentry token. It diffs the group against its base, filters the
changed paths with master's filters, and dispatches only getsentry's
backend workflow, which reports the check on the group head.

Refs DI-2872

Co-Authored-By: Burak Yigit Kaya <[email protected]>
@linear-code

linear-code Bot commented Nov 16, 2026

Copy link
Copy Markdown

DI-2872

@github-actions github-actions Bot added Scope: Frontend Automatically applied to PRs that change frontend components Scope: Backend Automatically applied to PRs that change backend components labels Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚨 Warning: This pull request contains Frontend and Backend changes!

It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently.

Have questions? Please ask in the #discuss-dev-infra channel.

…ch-merge-group

Co-Authored-By: BYK <[email protected]>

# Conflicts:
#	.pre-commit-config.yaml
BYK added a commit to getsentry/junior that referenced this pull request Nov 25, 2026
…4306)

Some Junior drafts stay drafts after their required checks pass: marking
them ready would ask CODEOWNERS (#3380), or the repo's
`AGENTS.md` asks for drafts. Today the Watch only posts a Slack message
about these drafts. It adds no Inbox item, so the PR lands in Code ·
Mine's "Drafts" pile and never shows in "Waiting on you".
getsentry/sentry#131267 is one example.

With this change, a held draft gets the same one ask as any other Junior
PR. It is a GitHub review request to the requester only, and the Inbox
item follows from it. Nobody else is pinged, and the item gives one
step.

- **Watch**: when it keeps a draft, it calls `github_updatePullRequest`
with the new `request_review: true` and posts nothing in the thread.
- **`request_review`**: asks only the requester's linked GitHub login to
review. It does nothing when GitHub already asks them, or when they
already reviewed, so after a change request only the review-again flow
asks again. A dismissed review counts as no review. GitHub requests the
code owners only when the PR is marked ready, so they are not asked.
- **Next action** (`pull-request-action.ts`): a review that GitHub asks
for on a draft is a new `review_draft` action. Its item is `Review
requested · #N` with the text "#N is a draft. Review it, then mark it
ready for review." When the draft becomes ready, the same item changes
to the usual "GitHub asks you to review #N." The `next_action` column is
text, so no migration is needed.
- **Copy**: the github-code skill and SPEC now say the Watch asks the
requester to review, and do not say that it tells them. They also say
that the requester's approval marks a held draft ready.
- **Evals**: the code-owner and AGENTS.md draft cases now expect one
`request_review` call and no reply. The draft HTTP fixture serves review
requests.
- **Approval marks it ready**: on a draft Watch, an approval is no
longer a quiet event. When the requester (`sender_login` is
`opener_username`) approves a draft, the Watch marks it ready, so GitHub
asks the code owners only after the requester has looked. A draft that
the requester asked to keep, or that the repo's `AGENTS.md` leaves for a
person to mark ready, stays a draft. Whether Junior held the draft is in
the Conversation, so the agent decides from the Watch guidance.
- **`design/github.md`**: the Gaps line now covers only the
watched-issue half, and Rules has the new draft rule.

There is no dashboard UI change. The new item text is not the plain
`textRepeatsHead` text, so the row shows it under the head.

## Added sentence for @BYK to check

The draft rule in `design/github.md` uses the text you confirmed, plus
one new last sentence for the approval change:

> When the requester approves a draft that Junior held, Junior marks it
ready, so GitHub asks its code owners only after the requester has
looked.

<!-- junior-request-attribution:start -->
via @BYK.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3A6326d01da80f764780c9040642fdd8c7 -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3A6326d01da80f764780c9040642fdd8c7)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A6326d01da80f764780c9040642fdd8c7/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: BYK <[email protected]>

This branch was successfully deployed

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

Labels

Scope: Backend Automatically applied to PRs that change backend components Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant