Skip to content

fix(schema-publisher): include contract changes in GitHub CI check summary#8166

Open
AreebEhsan wants to merge 4 commits into
graphql-hive:mainfrom
AreebEhsan:fix-issue-6954
Open

fix(schema-publisher): include contract changes in GitHub CI check summary#8166
AreebEhsan wants to merge 4 commits into
graphql-hive:mainfrom
AreebEhsan:fix-issue-6954

Conversation

@AreebEhsan

Copy link
Copy Markdown

Background

Fixes #6954.

When hive schema:check --github runs 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.updateGithubCheckRunForSchemaCheck only 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):

  • Adds a contractChanges parameter to updateGithubCheckRunForSchemaCheck, mirroring the existing failedContractCompositionCount plumbing.
  • Derives it from checkResult.state.contracts at the successful-check call site, keeping only contracts that actually changed.
  • Extracts the success-branch title/summary logic into a pure, injectable helper 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.
  • Adds unit tests for the helper (contract-only change, genuine no-changes, null inputs, empty contract change lists, core-only, and combined core + contract).

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

  • Error handling and logging
  • Testing

AreebEhsan and others added 4 commits June 18, 2026 12:10
… 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>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

include contract changes in github ci message

1 participant