-
Notifications
You must be signed in to change notification settings - Fork 309
Fix: Avoid baseUrl validation when it contains expressions #8130
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
base: dev
Are you sure you want to change the base?
Conversation
With expressions, we don't know the values at composition time so we can't tell if it is valid. This can result in us saying it is NOT valid when at run time it would be.
✅ Docs preview has no changesThe preview was not built because there were no changes. Build ID: cb5b74ec321b5d9545dc9f8b |
@andrewmcgivery, please consider creating a changeset entry in |
Message { | ||
code: InvalidUrl, | ||
message: "In `@source(baseURL:)`: Expression is not allowed to evaluate to arrays or objects.", | ||
locations: [ | ||
7:40..7:57, | ||
], | ||
}, |
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.
Why did this go away?
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 believe because the apply_to
happens within the validation function and so with it no longer calling the validation function when there are expressions, it no longer evaluates the expressions, and therefore this error disappears. 😅
I'm unclear on what the solution would be here without totally refactoring to separate the URI validation logic from the expression validation logic... but maybe thats what I should explore?
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.
Yeah I don't think we want to skip all validations for this, we just want to skip the URI parsing bit which we know we can't do
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.
Discussed this on Slack... this actually isn't apply_to
but rather an error generated by write_value
when evaluating the string_template
.... so for now, we can probably ignore this diff.
With expressions, we don't know the values at composition time so we can't tell if it is valid. This can result in us saying it is NOT valid when at run time it would be.
Checklist
Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.
Exceptions
Note any exceptions here
Notes
Footnotes
It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this. ↩
Configuration is an important part of many changes. Where applicable please try to document configuration examples. ↩
A lot of (if not most) features benefit from built-in observability and
debug
-level logs. Please read this guidance on metrics best-practices. ↩Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions. ↩