Repository navigation
feat(ci): Fail when a table copies GitHub state - #4128
Merged
Merged
Conversation
Co-Authored-By: BYK <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
BYK
requested changes
Nov 23, 2026
Contributor
|
513 screenshot changes — 0 changed · 513 added · 0 removed |
Co-Authored-By: BYK <[email protected]>
Co-Authored-By: BYK <[email protected]>
Co-Authored-By: BYK <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 36a8786. Configure here.
BYK
approved these changes
Nov 23, 2026
BYK
added a commit
that referenced
this pull request
Nov 23, 2026
Stacked on #4128, which adds `scripts/github-state-exceptions.mjs`. This PR removes entries from that file. Every pull request webhook parses the issue references in a Junior pull request body and writes them to `junior_github_pull_request_issues`. Nothing reads that table. When Junior needs a pull request's linked issues, the body on GitHub is the source. This drops the table, its write path in the webhook handler, the body parser that only fed it, and its entries in the exceptions file. <!-- junior-request-attribution:start --> via @BYK. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3Aa74cba793e2579695b0fbabff9e41a78 --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3Aa74cba793e2579695b0fbabff9e41a78) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Aa74cba793e2579695b0fbabff9e41a78/?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]>
BYK
added a commit
that referenced
this pull request
Nov 23, 2026
…e footer (#4132) Stacked on #4128, which adds `scripts/github-state-baseline.json`. This PR removes this table's entry from that file. `junior_github_issues` copies the state of Junior's issues from webhooks. Nothing reads `state`, `state_reason`, `opened_at`, or `closed_at`. The only reader is the close annotation, which fans out to the row's `conversation_ids`. Those ids are also in the issue body footer that Junior writes, and every `issues` webhook carries that body. This drops the table. When a Junior-authored issue closes, the webhook reads the Conversations from its footer and marks the issue closed in each one that already holds a card for it. Guard: a person can edit the footer, so the footer only picks the candidates. The write needs the Conversation's own annotation for the issue key in `junior_conversation_annotations`, which Junior adds when it opens the issue. An edited footer cannot add a card to another Conversation. The issue author must still be the bot. #4100 reads this table for its reaction poll, so it needs another source before it can merge. <!-- junior-request-attribution:start --> via @BYK. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3Aa74cba793e2579695b0fbabff9e41a78 --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3Aa74cba793e2579695b0fbabff9e41a78) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Aa74cba793e2579695b0fbabff9e41a78/?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]> Co-authored-by: BYK <[email protected]>
22 tasks done
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

GitHub is the source of truth for GitHub state, but Junior keeps copies of it in its tables. Those copies drift and need reconcile code. This adds the rule to
design/github.mdand a check that stops new copies.provider-state:checkreads the latest Drizzle snapshot of each package and fails on:junior-githubtable that is not inscripts/github-state-baseline.jsonstate,title,draft,merged_at,closed_at,assignees,labels,additions,deletions,changed_files,mergeable,*_count) on a table with aprovider_idcolumn, unless the baseline lists itThe baseline is grouped by table. A table maps to one reason for the whole table, or to a reason for each column. Each reason says why the value may stay: it is a Junior-owned fact, it is too expensive to derive, or it is a mirror that a follow-up cleanup removes. The file matches
scripts/*-baseline.json, sobaseline-growth:checkkeeps it shrink-only. Every entry sits under onetableskey, so a new table counts as growth too. Each cleanup PR removes its entries.The check runs in
pnpm lintthroughscripts/check.mjs. It shares the latest-snapshot read withmoney-units:checkthroughscripts/lib/drizzle-snapshots.mjs.via @BYK.
--
View Session [Sentry]