fix(schema-publisher): include contract changes in GitHub CI check summary#8166
Open
AreebEhsan wants to merge 4 commits into
Open
fix(schema-publisher): include contract changes in GitHub CI check summary#8166AreebEhsan wants to merge 4 commits into
AreebEhsan wants to merge 4 commits into
Conversation
… output Add a `contractChanges` parameter to `updateGithubCheckRunForSchemaCheck` and pass `null` from all four call sites. This is groundwork for graphql-hive#6954 and introduces no behavior change yet; it mirrors the existing `failedContractCompositionCount` plumbing so contract data can be surfaced in the GitHub schema-check summary in a follow-up. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…all site Populate the new `contractChanges` parameter from `checkResult.state.contracts` at the successful schema-check call site, keeping only contracts that actually changed. The summary builder does not consume this yet, so behavior is unchanged; this isolates the call-site wiring for graphql-hive#6954. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A successful schema check on a composite/federation project could change only a contract (the core composed schema unchanged). The GitHub CI check summary was built solely from the core schema changes, so such a check was reported as "No changes" even though a contract had changed. Extract the success-branch title/summary logic into a pure, injectable helper (`buildSchemaCheckSuccessGithubOutput`) and feed it the per-contract changes plumbed through in the previous commits. "No changes" is now only reported when there are neither core nor contract changes; otherwise the summary lists the core changes followed by a per-contract section. Add unit tests covering: contract-only changes (no longer "No changes"), the genuine no-changes case, null inputs, empty contract change lists, core-only changes, and combined core + contract changes. Fixes graphql-hive#6954 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the GitHub CI schema-check summary generation to include contract changes. It extracts the success output generation logic into a testable pure function buildSchemaCheckSuccessGithubOutput and adds comprehensive unit tests. This ensures that contract-only changes are correctly reported in the summary instead of showing 'No changes'. I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
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.
Background
Fixes #6954.
When
hive schema:check --githubruns on a composite/federation project, the GitHub CI check could report "No changes" even though a schema contract had changed (with the core composed schema unchanged). The check summary was built only from the core schema changes, so contract-only changes were dropped and the result was misreported as "No changes".Description
The successful-check summary in
SchemaPublisher.updateGithubCheckRunForSchemaCheckonly received the core schema changes (state.schemaChanges.all); the per-contract changes already present on the check result (state.contracts[].schemaChanges) were never passed through.This PR (API / services —
@hive/api):contractChangesparameter toupdateGithubCheckRunForSchemaCheck, mirroring the existingfailedContractCompositionCountplumbing.checkResult.state.contractsat the successful-check call site, keeping only contracts that actually changed.buildSchemaCheckSuccessGithubOutput. "No changes" is now only reported when there are neither core nor contract changes; otherwise the summary lists the core changes followed by a per-contract section.Behavior is unchanged for every project where no contract changed (the helper is byte-for-byte equivalent to the previous code in those cases). A changeset (
'hive': patch) is included.Checklist