-
Notifications
You must be signed in to change notification settings - Fork 12
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
DefaultCheck
with context.Context
#253
Conversation
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'm not sure I follow the motivation. Why do we want authors to apply secrets themselves rather than relying on the framework to apply them?
cd96ba2
to
4a5e543
Compare
371ea13
to
a187b9b
Compare
I added this to the commit message:
|
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.
It is a breaking change (to DefaultCheck
), right? Is that a concern?
The technique of using the context to pass information back up, I've not seen elsewhere. Maybe could use more commentary, like why the default check's encoder is so precious.
It is. I think its a positive one though. This library is still in
|
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.
Approving because it seems fine.
Following up on #252, this allows `DefaultCheck` to safely and accurately handle secrets application. The new signature for `DefaultCheck` is easier to extend without additional breaking changes. The downside to this design is that this makes `DefaultCheck` special. I think it's worth living with that until #212 is resolved. I'd like to merge shortly after #252 (and before #252 is released) so that user's don't rely on #252 injecting secrets when `CustomCheck` is implemented and `DefaultCheck` is not called. Rational for the change: Ideally, most users will not need to implement check. By design, not implementing `CustomCheck` has the same behavior as implementing check with `return infer.DefaultCheck(...)`. If users do implement `CustomCheck`, then we don't want to make any assumptions about what behavior they want. This includes not applying defaults and not injecting secrets.
a187b9b
to
1807678
Compare
This PR has been shipped in release v0.21.0. |
Following up on #252, this allows
DefaultCheck
to safely and accurately handle secrets application. The new signature forDefaultCheck
is easier to extend without additional breaking changes. The downside to this design is that this makesDefaultCheck
special. I think it's worth living with that until #212 is resolved.I'd like to merge shortly after #252 (and before #252 is released) so that user's don't rely on #252 injecting secrets when
CustomCheck
is implemented andDefaultCheck
is not called.