chore(test): take the OpenAPI and GraphQL schemas from the Octokit packages instead of fetching them - #406
Conversation
File size check0 over a hard cap (fails), 30 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
🟡 Changes recommended
The nightly probe cannot read the GraphQL package manifest through its restricted exports.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
What changed in this PR
Replaces fetched OpenAPI and GraphQL test artifacts with pinned Octokit packages and package-backed schema validation.
Changes:
- Loads and trims the packaged OpenAPI descriptor in memory.
- Extends the packaged GraphQL schema with tracked upstream gaps.
- Removes artifact fetching, caching, and associated infrastructure.
| File | Description |
|---|---|
test/sections/graphql-queries.test.ts |
Validates queries against the packaged schema and gaps. |
test/scripts/generated.test.ts |
Removes the fetched-spec symlink. |
test/scripts/fetched-artifact.test.ts |
Deletes obsolete artifact tests. |
test/scripts/fetch-retry.test.ts |
Deletes obsolete fetch retry tests. |
test/scripts/endpoint-docs.test.ts |
Uses the packaged GraphQL schema. |
test/scripts/check-compat-markers.test.ts |
Removes the fetched-spec fixture. |
test/scripts/changed-sections.test.ts |
Updates the composite-action fixture. |
test/scripts/auto-fix-allowlist.test.ts |
Simplifies generator command parsing. |
test/e2e/openapi/validate.ts |
Loads and trims the packaged OpenAPI descriptor. |
test/e2e/openapi/validate.test.ts |
Tests descriptor loading and trimming. |
test/e2e/openapi/paths.ts |
Updates descriptor lifecycle documentation. |
test/e2e/mock/support.ts |
Updates OpenAPI terminology. |
test/e2e/mock/request-body.ts |
Updates OpenAPI terminology. |
test/e2e/mock/request-body.test.ts |
Updates OpenAPI terminology. |
test/docs/workflow-loader.ts |
Removes composite-action loading support. |
test/docs/checks-workflow.test.ts |
Removes artifact cache tests. |
src/upstream-gaps/issue-creation-policy.ts |
Adds the missing GraphQL schema extension. |
src/upstream-gaps/index.ts |
Exports aggregated GraphQL gap SDL. |
src/upstream-gaps/gap.ts |
Adds the GraphQL schema gap kind. |
src/sections/shared/roles.ts |
Updates OpenAPI terminology. |
package.json |
Adds Octokit schema dependencies and removes fetch prerequisites. |
CONTRIBUTING.md |
Documents package-backed schemas. |
bun.lock |
Locks the new dependencies. |
.gitignore |
Removes obsolete artifact exclusions. |
.github/workflows/update-release.yml |
Removes artifact setup. |
.github/workflows/nightly.yml |
Probes latest Octokit schemas. |
.github/workflows/nightly-fuzz.yml |
Removes OpenAPI fetching. |
.github/workflows/checks.yml |
Removes artifact setup and caching. |
.github/workflows/auto-fix.yml |
Removes artifact setup. |
.github/scripts/trim-openapi.ts |
Deletes the OpenAPI fetcher. |
.github/scripts/lib/fetched-artifact.ts |
Deletes artifact staleness helpers. |
.github/scripts/lib/fetch-retry.ts |
Deletes fetch retry helpers. |
.github/scripts/gen-gaps-index.ts |
Generates GraphQL gap exports. |
.github/scripts/fetch-graphql-schema.ts |
Deletes the GraphQL schema fetcher. |
.github/scripts/endpoint-docs.yml |
Updates descriptor terminology. |
.github/scripts/endpoint-docs.ts |
Reads the packaged descriptor slice. |
.github/scripts/check-compat-markers.ts |
Removes the fetched-spec exception. |
.github/actions/fetch-test-artifacts/action.yml |
Deletes artifact caching and fetching. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
45dc824 to
ab84def
Compare
ab84def to
05fe963
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Removing the legacy ignores breaks local linting in existing worktrees that retain the former large descriptor.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: None
Resolved since last review (1)
05fe963 to
25f1809
Compare
25f1809 to
cf38681
Compare
cf38681 to
a1d11d4
Compare
…ckages instead of fetching them The e2e validator and the docs generator read GitHub's dereferenced OpenAPI descriptor from @octokit/openapi, cut in memory to USED_PATHS. The GraphQL lockstep tests read GitHub's schema from @octokit/graphql-schema. trim-openapi.ts, fetch-graphql-schema.ts, their fetch and staleness helpers, the fetch-test-artifacts composite, and every cache step are deleted. No script fetches from the network any more, and Dependabot moves both pins. A used path the descriptor lacks, an upstream gap it now documents, or a $ref left in the slice fails the load by name. The pinned @octokit/graphql-schema predates Repository.issueCreationPolicy, so a graphql-schema gap kind carries the SDL the package lags and the lockstep test extends the schema with it. The nightly probe installs both packages at latest and runs the lockstep tests instead of re-cutting the spec from upstream HEAD.
a1d11d4 to
eb5ed44
Compare

Before
After
Two gitignored, fetched, cache-restored test artifacts become two devDependencies. Nothing in the repository fetches from the network any more, and Dependabot moves both pins.
How
$refleft in the slice fails the load by name.Repository.issueCreationPolicy, so a third gap kind,graphql-schema, carries the SDL the package lags. The lockstep test extends the published schema with each gap's SDL; graphql-js refuses the extension once the package ships the type or field, and the failure names the gap file to delete.--no-save, checks the installed version is the latest, and runs the two lockstep tests, replacing the re-cut of the spec from upstream HEAD.trim-openapi.ts,fetch-graphql-schema.ts,lib/fetch-retry.ts,lib/fetched-artifact.ts, thefetch-test-artifactscomposite, every cache step andtest:artifactsprerequisite, and the cache-key lockstep test that guarded them.Proof
--sections labels,webhooks; 368/368 for the full corpus.Line accounting by kind
Reviewer note
trimDescriptor()(about 30 lines). It is a keyed pick overpathsplus three named failure checks; an OpenAPI bundler or$refresolver would add a dependency to do less, since the package already ships the dereferenced document.graphql-schemagap extension uses graphql-js's ownextendSchema; only the retire-the-gap error wording is ours.@octokit/graphql-schemaships cannot carry the@docsCategorydirective the docs-site SDL had; the anchor name is still checked against the schema.BEGIN_COMMIT_OVERRIDE
chore(test): take the OpenAPI and GraphQL schemas from the Octokit packages instead of fetching them
The e2e validator and the docs generator read GitHub's dereferenced OpenAPI descriptor from @octokit/openapi, cut in memory to USED_PATHS.
The GraphQL lockstep tests read GitHub's schema from @octokit/graphql-schema.
trim-openapi.ts, fetch-graphql-schema.ts, their fetch and staleness helpers, the fetch-test-artifacts composite, and every cache step are deleted.
No script fetches from the network any more, and Dependabot moves both pins.
A used path the descriptor lacks, an upstream gap it now documents, or a $ref left in the slice fails the load by name.
The pinned @octokit/graphql-schema predates Repository.issueCreationPolicy, so a graphql-schema gap kind carries the SDL the package lags and the lockstep test extends the schema with it.
The nightly probe installs both packages at latest and runs the lockstep tests instead of re-cutting the spec from upstream HEAD.
END_COMMIT_OVERRIDE