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.
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
Additional
SourceSpecDefinition
validations #2914Additional
SourceSpecDefinition
validations #2914Changes from 4 commits
b714123
f13cd22
219e2c6
c3d8b3c
e41715f
e81bdad
3282924
264134e
7ced763
b9d3b3c
4079b9a
16a346b
066783f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this error is necessary. I think it's fine to just not validate rather than throw an error. Not sure that this could ever happen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this enforcement, there's a cryptic error later on because
@join__directive
isn't added to the supergraph schema unless federation v2.7+ is in use.Specifically,
joinDirective
ends up undefined here:federation/composition-js/src/merging/merge.ts
Lines 2747 to 2750 in 6ae4294
when it wasn't added to the schema here:
federation/internals-js/src/specs/joinSpec.ts
Lines 137 to 143 in 6ae4294
I agree with @lennyburdette that not using federation v2.7 is an easy mistake to make, and this error should make the problem easier to diagnose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All directives have an issue where if you don't specify the right version composition will say that it doesn't understand the directive. Not sure why this is a special case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because the source directives are imported from their own link instead of from the federation link. it's a little weird, but i'm ok with leaning into it because enforcing a minimum version of 2.7 should minimize the number of unhappy paths:
@link
federation < 2.7@link
federation >= 2.7There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I got it. Can you make an issue to solve this for the general case? Might be a good starter project for our new hire.
Check warning on line 187 in internals-js/src/specs/sourceSpec.ts
internals-js/src/specs/sourceSpec.ts#L187
Check warning on line 516 in internals-js/src/specs/sourceSpec.ts
internals-js/src/specs/sourceSpec.ts#L515-L516