Skip to content

Chore(PE-1558): regenerate the webhooks schema in the weekly schema update - #113

Merged
plain-thinh-tran merged 3 commits into
mainfrom
PE-1558/regenerate-the-webhooks-schema-in-the-weekly
Oct 23, 2026
Merged

plain-thinh-tran merged 3 commits into
mainfrom
PE-1558/regenerate-the-webhooks-schema-in-the-weekly

Conversation

@plain-thinh-tran

@plain-thinh-tran plain-thinh-tran commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Fixes PE-1558, Plain T-37358

The Monday schema update now regenerates @team-plain/webhooks from the latest webhook version and writes its changeset, in the same pull request as GraphQL.

Monday schema Update

The Monday schema update is the “Update schema” GitHub Action in this repo. We added it this month and it has run 3 times so far.

Every Monday, it downloads the production GraphQL schema and regenerates the SDK. If anything changed, it writes a changeset, force pushes to a fixed schema/update branch, and opens or updates one PR. We can make the same change for the webhooks schema.

before:  Monday ─▶ graphql update-schema ─▶ PR
         webhooks: manual codegen, whenever someone remembers

after:   Monday ─▶ graphql update-schema ─┐
                ─▶ webhooks update-schema ─┴▶ one PR (+ changeset per package)

Note

Low Risk
Changes are CI, codegen, changeset automation, and test maintenance; no production webhook verification or parsing logic is altered beyond keeping tests aligned with the bundled schema version.

Overview
The Monday “Update schema” workflow now also runs @team-plain/webhooks update-schema alongside GraphQL, opens or updates the same schema/update PR when either schema changed, and reflects both packages in the PR title.

@team-plain/webhooks gains an update-schema script (wired in package.json) that runs codegen, detects whether webhook-schema.json changed, writes a changeset (minor when webhookTargetVersion moves, patch for same-version regen—without overwriting an existing changeset), and exposes changed / version to GitHub Actions. Webhook codegen now formats generated JSON/TS with Biome.

Docs (CONTRIBUTING.md) describe the combined weekly flow and recommend update-schema instead of bare codegen for manual webhook updates.

Tests tie fixtures to the committed schema via schemaVersion, and verifyPlainWebhook tests compute HMAC signatures at runtime instead of using fixed hex strings.

Reviewed by Cursor Bugbot for commit 0981ef7. Bugbot is set up for automated code reviews on this repo. Configure here.

@plain-thinh-tran
plain-thinh-tran marked this pull request as ready for review October 23, 2026 11:16
@plain-thinh-tran
plain-thinh-tran marked this pull request as draft October 23, 2026 11:16

@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 using default effort 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.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 979c331. Configure here.

Comment thread packages/webhooks/scripts/update-schema.ts Outdated
@plain-thinh-tran plain-thinh-tran self-assigned this Oct 23, 2026
@plain-thinh-tran
plain-thinh-tran marked this pull request as ready for review October 23, 2026 11:25
@plain-thinh-tran
plain-thinh-tran requested review from a team, SayYoungMan, jesushernandez and mpsq and removed request for a team October 23, 2026 11:30
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Comment thread packages/webhooks/scripts/update-schema.ts Fixed
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

@mpsq mpsq left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice one, thanks Thinh

@plain-thinh-tran
plain-thinh-tran merged commit 0d5f2f5 into main Oct 23, 2026
8 checks passed
@plain-thinh-tran
plain-thinh-tran deleted the PE-1558/regenerate-the-webhooks-schema-in-the-weekly branch October 23, 2026 12:59
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.

4 participants