-
Notifications
You must be signed in to change notification settings - Fork 45
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
SUP-2141 Add build resolver structure #235
Conversation
e3ba55b
to
e3f7d83
Compare
All this is to achieve a JIT resolution of everything the CLI will need, we can continue extrapolating this out for other resources if/when necessary |
What is the context going to be used for here? I'm assuming it's not to pass data around but rather to use things like |
No, more intended for things like cancelling API requests, etc |
func ResolveFromURL(args []string) build.BuildResolverFn { | ||
return func() (*build.Build, error) { | ||
func ResolveFromURL(args []string) BuildResolverFn { | ||
return func(context.Context) (*build.Build, error) { |
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.
Eg, if this resolver needed to know the pipeline to be able to resolve the build (ie thinking "most recent build on a branch for a pipeline"), we would bind in a PipelineResolverFn here for the function to use. The signature of the build resolver would remain the same and we don't need to expose that dependency to other resolvers that may not need it (like this one)
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.
The API request that is made to determine the "most recent build" would also make use of the context passed in so that it could cancel the request
Test out some structure for build resolution