chore(build): replace the webhook events generator with a test that pins the list to @octokit/openapi-webhooks - #403
Merged
Merged
Conversation
Contributor
File size check0 over a hard cap (fails), 31 warning(s).
Split the file, wrap the line, shorten or exempt the comment, or list the path in 5 managed file(s) skipped; repo-platform owns them. |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The new test preserves drift detection while the generator and all related automation references are consistently removed.
Review effort: Balanced
Findings: None
What changed in this PR
Replaces webhook event generation with a CI test that pins the committed list to @octokit/openapi-webhooks.
Changes:
- Adds descriptor-based drift and derivation tests.
- Removes the generator, build script, and generated-file registration.
- Removes webhook-event regeneration from the auto-fix workflow.
| File | Description |
|---|---|
test/sections/webhooks-events.test.ts |
Adds event-list pinning tests. |
test/scripts/generated.test.ts |
Removes events from generated files. |
test/scripts/gen-webhook-events.test.ts |
Removes generator tests. |
src/sections/webhooks/events.ts |
Documents the committed-list workflow. |
package.json |
Removes build:events. |
docs/upgrading/v2-to-v3.md |
Describes the list as pinned. |
.github/workflows/auto-fix.yml |
Removes event regeneration and allowlisting. |
.github/scripts/generated.ts |
Removes the generated-output entry. |
.github/scripts/gen-webhook-events.ts |
Deletes the obsolete generator. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Vivswan
marked this pull request as ready for review
September 22, 2026 04:20
…ins the list to @octokit/openapi-webhooks The repository webhook event list stays committed in src/sections/webhooks/events.ts and stops being a generated artifact. A new test recomputes the list from the package's api.github.com.json descriptor and fails naming the added and dropped events when a bump moves it. The generator, its build:events script, its row in the generated-output table, and its branch in auto-fix.yml go away, so a Dependabot bump of the package now fails loudly until the list is edited. The descriptor is not imported into src/ because bundling it grows lib/index.js from 4774340 to 9374832 bytes.
Vivswan
force-pushed
the
wt/webhook-events
branch
from
September 22, 2026 09:11
44ae40e to
1045a88
Compare
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.
Before / After
Before:
src/sections/webhooks/events.tswas a generated file. A generator script rendered it from the@octokit/openapi-webhooksdescriptor,bun run build:eventsran it,build:checkgated its drift, andauto-fix.ymlcommitted it back on Dependabot bumps.After: the list is a committed source file pinned by a test.
test/sections/webhooks-events.test.tsrecomputes the repository events from the package and fails with the names to add or drop when the list is stale. The generator, its unit test, thebuild:eventsscript, the generated-output row, and the auto-fix branch are gone.A Dependabot bump of
@octokit/openapi-webhooksthat adds or drops a repository event now fails CI on the bump PR until someone edits the list. Nothing rewrites the file.How
lib/index.jsbytessrc/missinglist the test asserts empty), not skipped and not thrown, so the list can never silently shorten.lib/settings.schema.jsonis byte-identical: the list did not change with the current package version.auto-fix.ymlloses every mention of the events file;test/scripts/auto-fix-allowlist.test.tspins its allowlists to the generated-output table and passes with the row removed.Proof
bun run typecheck,bun run knip,bun run lint,bun run build:check: green, no regeneration.bun test test/sections/webhooks-events.test.ts test/sections/webhooks-schema.test.ts test/sections/docs-registry.test.ts test/scripts/generated.test.ts test/scripts/auto-fix-allowlist.test.ts --timeout 120000: 43 pass, 0 fail.bun run test:e2e --sections webhooks: 13/13 passed."gollum"from the list makes the new test fail with a unified diff naming that one line; restoring it passes.Line accounting by kind
.github/scripts/gen-webhook-events.ts,.github/scripts/generated.ts.github/workflows/auto-fix.ymlsrc/sections/webhooks/events.ts(header only, list unchanged)test/sections/webhooks-events.test.ts(new),test/scripts/gen-webhook-events.test.ts(deleted),test/scripts/generated.test.tspackage.jsondocs/upgrading/v2-to-v3.mdReviewer note
The list in
events.tsis unchanged byte for byte; only its header comment moved from "generated, do not edit" to "committed, pinned by the test". The path a reviewer should read is the new test, then the auto-fix workflow diff.Committed-plus-test beat a runtime import because the package ships no small list: importing the 4.8 MB descriptor into src/ takes lib/index.js from 4774340 to 9374832 bytes, and no sibling package (@octokit/webhooks-types, @octokit/webhooks) offers a repository-scoped runtime list.
BEGIN_COMMIT_OVERRIDE
chore(build): replace the webhook events generator with a test that pins the list to @octokit/openapi-webhooks
The repository webhook event list stays committed in src/sections/webhooks/events.ts and stops being a generated artifact.
A new test recomputes the list from the package's api.github.com.json descriptor and fails naming the added and dropped events when a bump moves it.
The generator, its build:events script, its row in the generated-output table, and its branch in auto-fix.yml go away, so a Dependabot bump of the package now fails loudly until the list is edited.
The descriptor is not imported into src/ because bundling it grows lib/index.js from 4774340 to 9374832 bytes.
END_COMMIT_OVERRIDE