Repository navigation
chore(codegen): add reproducible Bitbucket GraphQL code generation - #3452
Merged
Merged
Conversation
The Bitbucket GraphQL types had no producing configuration - they were generated ad hoc, so they could not be regenerated. - Add a Bitbucket generator to codegen.ts (schema = the public Atlassian gateway, documents = the Bitbucket documents). - Restructure the entrypoint around per-output schemas so the credential-free Bitbucket generator runs even when GITHUB_TOKEN is unset; the GitHub output is added only when a token exists. - The public Atlassian schema needs assumeValid (graphql-js v17) and the documents need skipDocumentsValidation (the gateway schema lacks arguments such as 'flat'); defaultScalarType: 'string' preserves the existing string typing for picture/timestamp. Regeneration produces equivalent public types; three formatting differences (Record<string, any>, normalised document strings, trailing newline) are toolchain-version-driven. OpenSpec change: add-bitbucket-graphql-codegen
|
Contributor
|
🎉 This pull request is included in Gitify v7.10.0! 🎉 Downloads for macOS, Windows, and Linux are available on the release page. Thanks for helping make Gitify better! |
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.



Why
src/renderer/utils/forges/bitbucket/graphql/generated/graphql.tsis compiled from the Bitbucket GraphQL documents, but no codegen configuration produced it — it was generated ad hoc when Bitbucket support landed, so it could not be regenerated when the documents or the Atlassian schema change. The GitHub types are reproducible; the Bitbucket ones were not.What changed
codegen.tsdeclares a Bitbucket generator: schema =https://developer.atlassian.com/gateway/api/graphql(public, no credentials), documents =src/renderer/utils/forges/bitbucket/**/*.graphql, output = the existing generated file.GITHUB_TOKENis unset; the GitHub output is included only when a token exists.assumeValid: true— the public Atlassian schema trips graphql-js v17's interface/deprecation consistency check, the same class of issue as GitHub.skipDocumentsValidation: true— the gateway schema diverges from the runtime one (e.g.notificationFeedlacksflat); the same workaroundsetchy/atlassifycarries.defaultScalarType: 'string'— otherwisepicture/timestampbecomeunknown, which breakstransform.tsandadapter.ts.Verification
pnpm codegenwithGITHUB_TOKENunset: the Bitbucket generator runs and produces output.Record<string, any>, normalised document strings, and a missing trailing newline.pnpm checkpasses.OpenSpec change:
add-bitbucket-graphql-codegen