Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progressive override #123

Merged
merged 2 commits into from
Mar 30, 2025
Merged

Progressive override #123

merged 2 commits into from
Mar 30, 2025

Conversation

kamilkisiela
Copy link
Contributor

@kamilkisiela kamilkisiela commented Mar 29, 2025

Full support for @override(label:)

Copy link
Contributor

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@theguild/federation-composition 0.18.0-alpha-20250329200406-9a9168c940fcf3bd60f1102350058ced594395a4 npm ↗︎ unpkg ↗︎

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for progressive overrides via the @OverRide(label:) directive in federation composition. Key changes include:

  • Updating constant imports to include MERGEDGRAPH_ID for merged graphs.
  • Modifying various modules (e.g., MoveValidator, Graph, and edge) to propagate and handle override label values.
  • Extending schemas and tests to validate and support the new progressive override behavior.

Reviewed Changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/supergraph/validation/rules/satisfiablity/supergraph.ts Updates mergedGraph instantiation and chaining of override field methods.
src/supergraph/validation/rules/satisfiablity/operation-path.ts Adjusts step building logic to clearly separate field step creation.
src/supergraph/validation/rules/satisfiablity/node.ts Updates method signature for graph combo visitation to include override label values.
src/supergraph/validation/rules/satisfiablity/moves.ts Adds getter/setter for override configuration on FieldMove.
src/supergraph/validation/rules/satisfiablity/move-validator.ts Propagates the new labelValues parameter in edge resolvability checks.
src/supergraph/validation/rules/satisfiablity/helpers.ts Introduces an OverrideLabels class to manage override label states.
src/supergraph/validation/rules/satisfiablity/graph.ts Implements logic to add overridden fields and update join edge properties.
src/supergraph/validation/rules/satisfiablity/finder.ts Updates path finding calls to include override label values.
src/supergraph/validation/rules/satisfiablity/edge.ts Incorporates override labels into edge resolvability state and management.
src/supergraph/composition/* Updates schema composition functions and AST directive generation for @OverRide(label:).
tests/override-with-label.spec.ts Adds tests to verify proper validation and composition for override labels.
.changeset/aa-ss-dd.md Adds a changeset documenting the new support for progressive overrides.

@kamilkisiela kamilkisiela marked this pull request as ready for review March 30, 2025 12:26
@kamilkisiela kamilkisiela merged commit 541d4cc into main Mar 30, 2025
4 checks passed
@kamilkisiela kamilkisiela deleted the kamil-2.7 branch March 30, 2025 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant