Skip to content
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

Merged
merged 7 commits into from
May 6, 2024
Merged

SUP-2141 Add build resolver structure #235

merged 7 commits into from
May 6, 2024

Conversation

jradtilbrook
Copy link
Contributor

Test out some structure for build resolution

@jradtilbrook jradtilbrook force-pushed the SUP-2141 branch 2 times, most recently from e3ba55b to e3f7d83 Compare April 30, 2024 13:41
@jradtilbrook
Copy link
Contributor Author

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

@mcncl
Copy link
Contributor

mcncl commented May 1, 2024

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 cancel?

@jradtilbrook
Copy link
Contributor Author

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 cancel?

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) {
Copy link
Contributor Author

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)

Copy link
Contributor Author

@jradtilbrook jradtilbrook May 2, 2024

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

@jradtilbrook jradtilbrook marked this pull request as ready for review May 2, 2024 07:57
@jradtilbrook jradtilbrook merged commit 7e105f7 into 3.x May 6, 2024
1 check passed
@jradtilbrook jradtilbrook deleted the SUP-2141 branch May 6, 2024 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants