-
Notifications
You must be signed in to change notification settings - Fork 273
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
JSONSelection in URIs and Header values #6513
Draft
dylan-apollo
wants to merge
21
commits into
benjamn/JSONSelection-compute_output_shape
Choose a base branch
from
dylan/string-template-type-checking
base: benjamn/JSONSelection-compute_output_shape
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
JSONSelection in URIs and Header values #6513
dylan-apollo
wants to merge
21
commits into
benjamn/JSONSelection-compute_output_shape
from
dylan/string-template-type-checking
Conversation
This file contains 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
✅ Docs preview has no changesThe preview was not built because there were no changes. Build ID: 4f9769aff1fc03c607ee1919 |
CI performance tests
|
benjamn
force-pushed
the
benjamn/JSONSelection-compute_output_shape
branch
from
January 7, 2025 18:29
70486c1
to
2658a33
Compare
dylan-apollo
changed the title
String template type checking
JSONSelection in URIs and Header values
Jan 7, 2025
dylan-apollo
force-pushed
the
dylan/string-template-type-checking
branch
from
January 7, 2025 21:56
35ab7e6
to
b132e04
Compare
apollo-federation/src/sources/connect/validation/variable/resolver/mod.rs
Outdated
Show resolved
Hide resolved
benjamn
force-pushed
the
benjamn/JSONSelection-compute_output_shape
branch
from
January 9, 2025 20:24
2658a33
to
9081976
Compare
benjamn
changed the base branch from
benjamn/JSONSelection-compute_output_shape
to
next
January 10, 2025 18:36
pubmodmatt
reviewed
Jan 10, 2025
#[case::slice("$args.string->slice(0, 2)")] | ||
#[case::size("$args.array->size")] | ||
#[case::first("$args.array->first.bool")] | ||
#[case::last("$args.array->last.bool")] |
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.
Nitpick: maybe an additional test for properties nested at a greater depth, like:
#[case::multi_level_input("$args.multiLevel.inner.nested")]
(I did try this and it worked)
benjamn
force-pushed
the
dylan/string-template-type-checking
branch
from
January 10, 2025 19:40
ea917ee
to
e448dcd
Compare
benjamn
changed the base branch from
next
to
benjamn/JSONSelection-compute_output_shape
January 10, 2025 19:40
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.
This PR implements full expressions in URIs and header values (e.g., arrow methods, not just variables) via a few pieces:
apollo-federation/src/sources/connect/string_template.rs
contains shared logic for both URIs and headers, so they can be more consistent behavior (both parsing and interpolation). This comes with support for full JSONSelection rather than just the variable references->jsonStringify
from->jsonStringify
method #6519shape
library is being used. As a result this PR relies on ImplementApplyToInternal::compute_output_shape
andJSONSelection::shape
returningshape::Shape
#6458Pay extra attention to the test cases in
apollo-federation/src/sources/connect/validation/expression.rs
to look for any gaps. In particular, any named types ($args
,$this
,$config
, etc.) can have unexpected effects on the shape processing as things need to be checked/simplified before the types are known.There are some expected gaps in the validations where we need to build more infrastructure for the type checker. For example,
->map
is completely ignored for now.