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

Add a simple HTTP resolver #7250

Merged
merged 1 commit into from
Oct 26, 2023

Conversation

chmouel
Copy link
Member

@chmouel chmouel commented Oct 20, 2023

This adds a simple HTTP resolver that can fetch a file from a remote HTTP(S) URL.

Only fetch timeout configuration for now is supported.

This is kept simple for now, and does not support any kind of HTTP authentication, custom TLS or any other features. Something we can improve on later.

Fixes #6920

Changes

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings). See some examples of good release notes.
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

A new HTTP resolver is now available, it will let you resolve a http(s) URL to fetch a task or pipeline from.

/kind feature

@tekton-robot tekton-robot added release-note-none Denotes a PR that doesnt merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 20, 2023
@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesnt merit a release note. labels Oct 20, 2023
@chmouel
Copy link
Member Author

chmouel commented Oct 20, 2023

/kind feature
/retest

@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 20, 2023
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/resolver/feature_flags.go 87.0% 84.0% -3.0
pkg/resolution/resolver/http/resolver.go Do not exist 75.0%

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/resolver/feature_flags.go 87.0% 84.0% -3.0
pkg/resolution/resolver/http/resolver.go Do not exist 75.0%

@chmouel
Copy link
Member Author

chmouel commented Oct 20, 2023

/test pull-tekton-pipeline-beta-integration-tests

(seems like a fluke of kind)

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/resolver/feature_flags.go 87.0% 84.0% -3.0
pkg/resolution/resolver/http/resolver.go Do not exist 75.0%

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/resolver/feature_flags.go 87.0% 84.0% -3.0
pkg/resolution/resolver/http/resolver.go Do not exist 92.5%

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/resolver/feature_flags.go 87.0% 84.0% -3.0
pkg/resolution/resolver/http/resolver.go Do not exist 92.5%

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/resolver/feature_flags.go 87.0% 84.0% -3.0
pkg/resolution/resolver/http/resolver.go Do not exist 92.5%

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/resolver/feature_flags.go 87.0% 84.0% -3.0
pkg/resolution/resolver/http/resolver.go Do not exist 92.5%

docs/http-resolver.md Outdated Show resolved Hide resolved
@jerop jerop added this to the Pipelines v0.54 milestone Oct 24, 2023
Copy link
Member

@jerop jerop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add an example which would also serve as an e2e test

example: https://github.com/tektoncd/pipeline/blob/main/examples/v1/pipelineruns/beta/git-resolver.yaml

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/resolver/feature_flags.go 87.0% 84.0% -3.0
pkg/resolution/resolver/http/resolver.go Do not exist 92.5%

@chmouel
Copy link
Member Author

chmouel commented Oct 25, 2023

/retest

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/resolver/feature_flags.go 87.0% 84.0% -3.0
pkg/resolution/resolver/http/resolver.go Do not exist 92.5%

Copy link
Member

@Yongxuanzhang Yongxuanzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Just have some minor questions.
Shall we create an issue to track potential future work as you mentioned in the pr description?

pkg/resolution/resolver/http/resolver.go Outdated Show resolved Hide resolved
pkg/resolution/resolver/http/resolver.go Outdated Show resolved Hide resolved
@chmouel
Copy link
Member Author

chmouel commented Oct 26, 2023

Shall we create an issue to track potential future work as you mentioned in the pr description?

thanks for the review, yes i am planning to fill/tackle those issues when this is merged !

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/resolver/feature_flags.go 87.0% 84.0% -3.0
pkg/resolution/resolver/http/resolver.go Do not exist 92.5%

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/resolver/feature_flags.go 87.0% 84.0% -3.0
pkg/resolution/resolver/http/resolver.go Do not exist 92.5%

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vdemeester

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 26, 2023
@Yongxuanzhang
Copy link
Member

Yongxuanzhang commented Oct 26, 2023

Is it possible that we add an example as @jerop suggested, before we merge this PR? 🙏

@chmouel
Copy link
Member Author

chmouel commented Oct 26, 2023

@Yongxuanzhang I didn't see @jerop comment, thanks!

I just pushed it!

@Yongxuanzhang
Copy link
Member

@Yongxuanzhang I didn't see @jerop comment, thanks!

I just pushed it!

Thanks!
/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 26, 2023
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/resolver/feature_flags.go 87.0% 84.0% -3.0
pkg/resolution/resolver/http/resolver.go Do not exist 92.5%

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/resolver/feature_flags.go 87.0% 84.0% -3.0
pkg/resolution/resolver/http/resolver.go Do not exist 92.5%

This adds a simple HTTP resolver that can fetch a file from a remote
HTTP(S) URL.

Only fetch timeout configuration for now is supported.

This is kept simple for now, and does not support any kind of HTTP
authentication, custom TLS or any other features. Something we can
improve on later.

Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Oct 26, 2023
@chmouel
Copy link
Member Author

chmouel commented Oct 26, 2023

The CI failure was a yaml whitespace errors 🍤


./examples/v1/pipelineruns/beta/http-resolver.yaml
  12:18     error    trailing spaces  (trailing-spaces) 

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/resolver/feature_flags.go 87.0% 84.0% -3.0
pkg/resolution/resolver/http/resolver.go Do not exist 92.5%

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/resolver/feature_flags.go 87.0% 84.0% -3.0
pkg/resolution/resolver/http/resolver.go Do not exist 92.5%

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/resolver/feature_flags.go 87.0% 84.0% -3.0
pkg/resolution/resolver/http/resolver.go Do not exist 92.5%

@Yongxuanzhang
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 26, 2023
@tekton-robot tekton-robot merged commit 9f8fbb4 into tektoncd:main Oct 26, 2023
12 checks passed
@chmouel chmouel deleted the add-a-simple-http-resolver branch October 26, 2023 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add URL Resolver
5 participants