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

TEP-0154: Enable concise resolver syntax - stage 1 #7845

Merged
merged 1 commit into from
May 15, 2024

Conversation

chitrangpatel
Copy link
Contributor

@chitrangpatel chitrangpatel commented Apr 5, 2024

This PR enables concise resolver syntax as per TEP 0154. It allows users to pass a url like string to Taskref/name field.

This PR does not add the schemes supported by the built-in resolvers. That will come in followup PRs.
Here, we just set up the framework.

Changes

  • Added Feature Flag: enable-concise-resolver-syntax
  • Updated validation logic for name such that it can also be url-like. Both name and params cannot be passed at the same time as discussed in the TEP. If using a url-like name then the feature flag must be enabled.
  • Resolution Request CRD now contains a new field url which is passed in the spec with params.
  • Enable param substitution in name like we allow in resolver params.
  • Updated Remote Resolution Interface to Handle ValidatingUrl.
  • Added ValidatingUrl to all built-in resolvers. Currently it does not validate anything. The details will be added in a followup PR.
  • Updated demo resolver and how-to-write-a-resolver docs.

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
  • pre-commit Passed
  • 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

TEP-0154: Enable concise resolver syntax

/kind feature
/hold wait for TEP to be merged.

@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Apr 5, 2024
@tekton-robot tekton-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Apr 5, 2024
@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 5, 2024
@chitrangpatel chitrangpatel changed the title TEP-0154: Enable concise resolver syntax TEP-0154: Enable concise resolver syntax - stage 1 Apr 5, 2024
@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/feature_flags.go 94.8% 94.9% 0.1
pkg/apis/pipeline/v1/container_validation.go 100.0% 96.4% -3.6
pkg/apis/pipeline/v1/pipelineref_validation.go 100.0% 92.3% -7.7
pkg/apis/pipeline/v1/taskref_validation.go 100.0% 96.2% -3.8
pkg/reconciler/taskrun/taskrun.go 87.2% 86.4% -0.8
pkg/resolution/resolver/bundle/resolver.go 96.3% 92.9% -3.4
pkg/resolution/resolver/cluster/resolver.go 83.3% 82.5% -0.8
pkg/resolution/resolver/framework/fakeresolver.go 91.9% 87.2% -4.7
pkg/resolution/resolver/framework/reconciler.go 73.1% 69.4% -3.7
pkg/resolution/resolver/git/resolver.go 85.2% 84.8% -0.4
pkg/resolution/resolver/http/resolver.go 92.4% 91.5% -0.9
pkg/resolution/resolver/hub/resolver.go 77.2% 76.7% -0.5
pkg/resolution/resource/name.go 76.2% 73.9% -2.3
pkg/resolution/resource/request.go 100.0% 80.0% -20.0

@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/feature_flags.go 94.8% 94.9% 0.1
pkg/apis/pipeline/v1/container_validation.go 100.0% 96.4% -3.6
pkg/apis/pipeline/v1/pipelineref_validation.go 100.0% 92.3% -7.7
pkg/apis/pipeline/v1/taskref_validation.go 100.0% 96.2% -3.8
pkg/reconciler/taskrun/taskrun.go 87.2% 86.4% -0.8
pkg/resolution/resolver/bundle/resolver.go 96.3% 92.9% -3.4
pkg/resolution/resolver/cluster/resolver.go 83.3% 82.5% -0.8
pkg/resolution/resolver/framework/fakeresolver.go 91.9% 87.2% -4.7
pkg/resolution/resolver/framework/reconciler.go 73.1% 69.4% -3.7
pkg/resolution/resolver/git/resolver.go 85.2% 84.8% -0.4
pkg/resolution/resolver/http/resolver.go 92.4% 91.5% -0.9
pkg/resolution/resolver/hub/resolver.go 77.2% 76.7% -0.5
pkg/resolution/resource/name.go 76.2% 73.9% -2.3
pkg/resolution/resource/request.go 100.0% 80.0% -20.0

@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
docs/resolver-template/cmd/demoresolver/main.go 75.0% 65.0% -10.0
pkg/apis/config/feature_flags.go 94.8% 94.9% 0.1
pkg/apis/pipeline/v1/container_validation.go 100.0% 96.4% -3.6
pkg/apis/pipeline/v1/pipelineref_validation.go 100.0% 92.3% -7.7
pkg/apis/pipeline/v1/taskref_validation.go 100.0% 96.2% -3.8
pkg/reconciler/taskrun/taskrun.go 87.2% 86.4% -0.8
pkg/resolution/resolver/bundle/resolver.go 96.3% 92.9% -3.4
pkg/resolution/resolver/cluster/resolver.go 83.3% 82.5% -0.8
pkg/resolution/resolver/framework/fakeresolver.go 91.9% 87.2% -4.7
pkg/resolution/resolver/framework/reconciler.go 73.1% 69.4% -3.7
pkg/resolution/resolver/git/resolver.go 85.2% 84.8% -0.4
pkg/resolution/resolver/http/resolver.go 92.4% 91.5% -0.9
pkg/resolution/resolver/hub/resolver.go 77.2% 76.7% -0.5
pkg/resolution/resource/name.go 76.2% 73.9% -2.3
pkg/resolution/resource/request.go 100.0% 80.0% -20.0

@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
docs/resolver-template/cmd/demoresolver/main.go 75.0% 65.0% -10.0
pkg/apis/config/feature_flags.go 94.8% 94.9% 0.1
pkg/apis/pipeline/v1/pipelineref_validation.go 100.0% 95.5% -4.5
pkg/reconciler/taskrun/taskrun.go 87.2% 86.4% -0.8
pkg/resolution/resolver/bundle/resolver.go 96.3% 92.9% -3.4
pkg/resolution/resolver/cluster/resolver.go 83.3% 82.5% -0.8
pkg/resolution/resolver/framework/fakeresolver.go 91.9% 87.2% -4.7
pkg/resolution/resolver/framework/reconciler.go 73.1% 69.4% -3.7
pkg/resolution/resolver/git/resolver.go 85.2% 84.8% -0.4
pkg/resolution/resolver/http/resolver.go 92.4% 91.5% -0.9
pkg/resolution/resolver/hub/resolver.go 77.2% 76.7% -0.5
pkg/resolution/resource/name.go 76.2% 73.9% -2.3
pkg/resolution/resource/request.go 100.0% 80.0% -20.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
docs/resolver-template/cmd/demoresolver/main.go 75.0% 65.0% -10.0
pkg/apis/config/feature_flags.go 94.8% 94.9% 0.1
pkg/apis/pipeline/v1/pipelineref_validation.go 100.0% 95.5% -4.5
pkg/reconciler/taskrun/taskrun.go 87.2% 86.4% -0.8
pkg/resolution/resolver/bundle/resolver.go 96.3% 92.9% -3.4
pkg/resolution/resolver/cluster/resolver.go 83.3% 82.5% -0.8
pkg/resolution/resolver/framework/fakeresolver.go 91.9% 87.2% -4.7
pkg/resolution/resolver/framework/reconciler.go 73.1% 69.4% -3.7
pkg/resolution/resolver/git/resolver.go 85.2% 84.8% -0.4
pkg/resolution/resolver/http/resolver.go 92.4% 91.5% -0.9
pkg/resolution/resolver/hub/resolver.go 77.2% 76.7% -0.5
pkg/resolution/resource/name.go 76.2% 73.9% -2.3

@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
docs/resolver-template/cmd/demoresolver/main.go 75.0% 65.0% -10.0
pkg/apis/config/feature_flags.go 94.8% 94.9% 0.1
pkg/apis/pipeline/v1/pipelineref_validation.go 100.0% 95.5% -4.5
pkg/reconciler/taskrun/taskrun.go 87.2% 86.4% -0.8
pkg/resolution/resolver/bundle/resolver.go 96.3% 92.9% -3.4
pkg/resolution/resolver/cluster/resolver.go 83.3% 82.5% -0.8
pkg/resolution/resolver/framework/fakeresolver.go 91.9% 87.2% -4.7
pkg/resolution/resolver/framework/reconciler.go 73.1% 69.4% -3.7
pkg/resolution/resolver/git/resolver.go 85.2% 84.8% -0.4
pkg/resolution/resolver/http/resolver.go 92.4% 91.5% -0.9
pkg/resolution/resolver/hub/resolver.go 77.2% 76.7% -0.5
pkg/resolution/resource/name.go 76.2% 73.9% -2.3

@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
docs/resolver-template/cmd/demoresolver/main.go 75.0% 65.0% -10.0
pkg/apis/config/feature_flags.go 94.8% 94.9% 0.1
pkg/apis/pipeline/v1/pipelineref_validation.go 100.0% 95.5% -4.5
pkg/reconciler/taskrun/resources/taskref.go 92.6% 92.6% 0.1
pkg/reconciler/taskrun/taskrun.go 87.2% 86.4% -0.8
pkg/resolution/resolver/bundle/resolver.go 96.3% 92.9% -3.4
pkg/resolution/resolver/cluster/resolver.go 83.3% 82.5% -0.8
pkg/resolution/resolver/framework/fakeresolver.go 91.9% 87.2% -4.7
pkg/resolution/resolver/framework/reconciler.go 73.1% 69.4% -3.7
pkg/resolution/resolver/git/resolver.go 85.2% 84.8% -0.4
pkg/resolution/resolver/http/resolver.go 92.4% 91.5% -0.9
pkg/resolution/resolver/hub/resolver.go 77.2% 76.7% -0.5
pkg/resolution/resource/name.go 76.2% 73.9% -2.3

@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
docs/resolver-template/cmd/demoresolver/main.go 75.0% 65.0% -10.0
pkg/apis/config/feature_flags.go 94.8% 94.9% 0.1
pkg/apis/pipeline/v1/pipelineref_validation.go 100.0% 95.5% -4.5
pkg/reconciler/taskrun/resources/taskref.go 92.6% 92.6% 0.1
pkg/reconciler/taskrun/taskrun.go 87.2% 86.4% -0.8
pkg/resolution/resolver/bundle/resolver.go 96.3% 92.9% -3.4
pkg/resolution/resolver/cluster/resolver.go 83.3% 82.5% -0.8
pkg/resolution/resolver/framework/fakeresolver.go 91.9% 87.2% -4.7
pkg/resolution/resolver/framework/reconciler.go 73.1% 69.4% -3.7
pkg/resolution/resolver/git/resolver.go 85.2% 84.8% -0.4
pkg/resolution/resolver/http/resolver.go 92.4% 91.5% -0.9
pkg/resolution/resolver/hub/resolver.go 77.2% 76.7% -0.5
pkg/resolution/resource/name.go 76.2% 73.9% -2.3

@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
docs/resolver-template/cmd/demoresolver/main.go 75.0% 65.0% -10.0
pkg/apis/config/feature_flags.go 94.8% 94.9% 0.1
pkg/apis/pipeline/v1/pipelineref_validation.go 100.0% 95.5% -4.5
pkg/reconciler/pipelinerun/resources/apply.go 98.5% 97.9% -0.7
pkg/reconciler/pipelinerun/resources/pipelineref.go 93.2% 93.8% 0.6
pkg/reconciler/taskrun/resources/taskref.go 92.6% 92.9% 0.3
pkg/resolution/resolver/bundle/resolver.go 96.3% 92.9% -3.4
pkg/resolution/resolver/cluster/resolver.go 83.3% 82.5% -0.8
pkg/resolution/resolver/framework/fakeresolver.go 91.9% 87.2% -4.7
pkg/resolution/resolver/framework/reconciler.go 73.1% 69.4% -3.7
pkg/resolution/resolver/git/resolver.go 85.2% 84.8% -0.4
pkg/resolution/resolver/http/resolver.go 92.4% 91.5% -0.9
pkg/resolution/resolver/hub/resolver.go 77.2% 76.7% -0.5
pkg/resolution/resource/name.go 76.2% 73.9% -2.3

@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
docs/resolver-template/cmd/demoresolver/main.go 75.0% 65.0% -10.0
pkg/apis/config/feature_flags.go 94.8% 94.9% 0.1
pkg/apis/pipeline/v1/pipelineref_validation.go 100.0% 95.5% -4.5
pkg/reconciler/pipelinerun/resources/apply.go 98.5% 97.9% -0.7
pkg/reconciler/pipelinerun/resources/pipelineref.go 93.2% 93.8% 0.6
pkg/reconciler/taskrun/resources/taskref.go 92.6% 92.9% 0.3
pkg/resolution/resolver/bundle/resolver.go 96.3% 92.9% -3.4
pkg/resolution/resolver/cluster/resolver.go 83.3% 82.5% -0.8
pkg/resolution/resolver/framework/fakeresolver.go 91.9% 87.2% -4.7
pkg/resolution/resolver/framework/reconciler.go 73.1% 69.4% -3.7
pkg/resolution/resolver/git/resolver.go 85.2% 84.8% -0.4
pkg/resolution/resolver/http/resolver.go 92.4% 91.5% -0.9
pkg/resolution/resolver/hub/resolver.go 77.2% 76.7% -0.5
pkg/resolution/resource/name.go 76.2% 73.9% -2.3

@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
docs/resolver-template/cmd/demoresolver/main.go 75.0% 65.0% -10.0
pkg/apis/config/feature_flags.go 94.8% 94.9% 0.1
pkg/apis/pipeline/v1/pipelineref_validation.go 100.0% 95.5% -4.5
pkg/reconciler/pipelinerun/resources/apply.go 98.5% 97.9% -0.7
pkg/reconciler/pipelinerun/resources/pipelineref.go 93.2% 93.8% 0.6
pkg/reconciler/taskrun/resources/taskref.go 92.6% 92.9% 0.3
pkg/resolution/resolver/bundle/resolver.go 96.3% 92.9% -3.4
pkg/resolution/resolver/cluster/resolver.go 83.3% 82.5% -0.8
pkg/resolution/resolver/framework/fakeresolver.go 91.9% 87.2% -4.7
pkg/resolution/resolver/framework/reconciler.go 73.1% 69.4% -3.7
pkg/resolution/resolver/git/resolver.go 85.2% 84.8% -0.4
pkg/resolution/resolver/http/resolver.go 92.4% 91.5% -0.9
pkg/resolution/resolver/hub/resolver.go 77.2% 76.7% -0.5
pkg/resolution/resource/name.go 76.2% 73.9% -2.3

@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
docs/resolver-template/cmd/demoresolver/main.go 75.0% 65.0% -10.0
pkg/apis/config/feature_flags.go 94.8% 94.9% 0.1
pkg/apis/pipeline/v1/pipelineref_validation.go 100.0% 95.5% -4.5
pkg/reconciler/pipelinerun/resources/apply.go 98.5% 97.9% -0.7
pkg/reconciler/pipelinerun/resources/pipelineref.go 93.2% 93.8% 0.6
pkg/reconciler/taskrun/resources/taskref.go 92.6% 92.9% 0.3
pkg/resolution/resolver/bundle/resolver.go 96.3% 92.9% -3.4
pkg/resolution/resolver/cluster/resolver.go 83.3% 82.5% -0.8
pkg/resolution/resolver/framework/fakeresolver.go 91.9% 87.2% -4.7
pkg/resolution/resolver/framework/reconciler.go 73.1% 69.4% -3.7
pkg/resolution/resolver/git/resolver.go 85.2% 84.8% -0.4
pkg/resolution/resolver/http/resolver.go 92.4% 91.5% -0.9
pkg/resolution/resolver/hub/resolver.go 77.2% 76.7% -0.5
pkg/resolution/resource/name.go 76.2% 73.9% -2.3

@chitrangpatel
Copy link
Contributor Author

/hold cancel

@tekton-robot tekton-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Apr 5, 2024
@chitrangpatel
Copy link
Contributor Author

/hold

@tekton-robot tekton-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 26, 2024
@chitrangpatel
Copy link
Contributor Author

chitrangpatel commented May 14, 2024

/hold cancel

Since the required refactoring has been completed.

@tekton-robot tekton-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 14, 2024
@chitrangpatel chitrangpatel requested a review from afrittoli May 14, 2024 20:00
@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
docs/resolver-template/cmd/resolver/main.go 75.0% 88.2% 13.2
pkg/apis/config/feature_flags.go 94.3% 94.4% 0.1
pkg/apis/pipeline/v1beta1/pipelineref_validation.go 100.0% 97.6% -2.4
pkg/reconciler/pipelinerun/resources/apply.go 98.5% 97.9% -0.7
pkg/reconciler/pipelinerun/resources/pipelineref.go 93.6% 94.1% 0.5
pkg/reconciler/taskrun/resources/taskref.go 94.3% 94.4% 0.2
pkg/remoteresolution/resolver/bundle/resolver.go 100.0% 81.8% -18.2
pkg/remoteresolution/resolver/cluster/resolver.go 100.0% 81.8% -18.2
pkg/remoteresolution/resolver/framework/reconciler.go 73.1% 76.1% 3.0
pkg/remoteresolution/resolver/git/resolver.go 92.3% 86.7% -5.6
pkg/remoteresolution/resolver/http/resolver.go 100.0% 88.9% -11.1
pkg/remoteresolution/resource/crd_resource.go 94.7% 95.0% 0.3
pkg/resolution/resource/name.go 55.3% 56.1% 0.8
test/remoteresolution/resolution.go 35.4% 67.9% 32.4
test/remoteresolution/resolution.go Do not exist 14.3%
test/remoteresolution/resolution.go Do not exist 33.9%

@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
docs/resolver-template/cmd/resolver/main.go 75.0% 88.2% 13.2
pkg/apis/config/feature_flags.go 94.3% 94.4% 0.1
pkg/apis/pipeline/v1beta1/pipelineref_validation.go 100.0% 97.6% -2.4
pkg/reconciler/pipelinerun/resources/apply.go 98.5% 97.9% -0.7
pkg/reconciler/pipelinerun/resources/pipelineref.go 93.6% 94.1% 0.5
pkg/reconciler/taskrun/resources/taskref.go 94.3% 94.4% 0.2
pkg/remoteresolution/resolver/bundle/resolver.go 100.0% 81.8% -18.2
pkg/remoteresolution/resolver/cluster/resolver.go 100.0% 81.8% -18.2
pkg/remoteresolution/resolver/framework/reconciler.go 73.1% 76.1% 3.0
pkg/remoteresolution/resolver/git/resolver.go 92.3% 86.7% -5.6
pkg/remoteresolution/resolver/http/resolver.go 100.0% 88.9% -11.1
pkg/remoteresolution/resource/crd_resource.go 94.7% 95.0% 0.3
pkg/resolution/resource/name.go 55.3% 56.1% 0.8
test/remoteresolution/resolution.go 35.4% 14.3% -21.1
test/remoteresolution/resolution.go Do not exist 67.9%
test/remoteresolution/resolution.go Do not exist 67.9%
test/remoteresolution/resolution.go Do not exist 0.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
docs/resolver-template/cmd/resolver/main.go 75.0% 88.2% 13.2
pkg/apis/config/feature_flags.go 94.3% 94.4% 0.1
pkg/apis/pipeline/v1beta1/pipelineref_validation.go 100.0% 97.6% -2.4
pkg/reconciler/pipelinerun/resources/apply.go 98.5% 97.9% -0.7
pkg/reconciler/pipelinerun/resources/pipelineref.go 93.6% 94.1% 0.5
pkg/reconciler/taskrun/resources/taskref.go 94.3% 94.4% 0.2
pkg/remoteresolution/resolver/bundle/resolver.go 100.0% 81.8% -18.2
pkg/remoteresolution/resolver/cluster/resolver.go 100.0% 81.8% -18.2
pkg/remoteresolution/resolver/framework/reconciler.go 73.1% 76.1% 3.0
pkg/remoteresolution/resolver/git/resolver.go 92.3% 86.7% -5.6
pkg/remoteresolution/resolver/http/resolver.go 100.0% 88.9% -11.1
pkg/remoteresolution/resource/crd_resource.go 94.7% 95.0% 0.3
pkg/resolution/resource/name.go 55.3% 56.1% 0.8
test/remoteresolution/resolution.go 35.4% 67.9% 32.4
test/remoteresolution/resolution.go Do not exist 14.3%
test/remoteresolution/resolution.go Do not exist 33.9%

@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
docs/resolver-template/cmd/resolver/main.go 75.0% 88.2% 13.2
pkg/apis/config/feature_flags.go 94.3% 94.4% 0.1
pkg/apis/pipeline/v1beta1/pipelineref_validation.go 100.0% 97.6% -2.4
pkg/reconciler/pipelinerun/resources/apply.go 98.5% 97.9% -0.7
pkg/reconciler/pipelinerun/resources/pipelineref.go 93.6% 94.1% 0.5
pkg/reconciler/taskrun/resources/taskref.go 94.3% 94.4% 0.2
pkg/remoteresolution/resolver/bundle/resolver.go 100.0% 81.8% -18.2
pkg/remoteresolution/resolver/cluster/resolver.go 100.0% 81.8% -18.2
pkg/remoteresolution/resolver/framework/reconciler.go 73.1% 76.1% 3.0
pkg/remoteresolution/resolver/git/resolver.go 92.3% 86.7% -5.6
pkg/remoteresolution/resolver/http/resolver.go 100.0% 88.9% -11.1
pkg/remoteresolution/resource/crd_resource.go 94.7% 95.0% 0.3
pkg/resolution/resource/name.go 55.3% 56.1% 0.8
test/remoteresolution/resolution.go 35.4% 14.3% -21.1
test/remoteresolution/resolution.go Do not exist 67.9%
test/remoteresolution/resolution.go Do not exist 67.9%
test/remoteresolution/resolution.go Do not exist 0.0%

return errs
}

func validateRef(ctx context.Context, refName string, refResolver ResolverName, refParams Params) (errs *apis.FieldError) {
Copy link
Member

Choose a reason for hiding this comment

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

nit: validateRef looks more likely to be in taskref_validation than container_validation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is for validating the StepAction Ref. I think that's in container validation.
There is a separate validateTaskRef which is in taskref validation.

Copy link
Member

@JeromeJu JeromeJu May 15, 2024

Choose a reason for hiding this comment

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

I am not sure I understand - ain't this change here using validateRef as a function that's used commonly at container_validation, taskref_validation and pipeline_validation?

And maybe as you pointed explicitly name it as validateStepActionRef might untangle this? WDYT

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's tied to validating the ref. The field name for StepAction Ref is ref. That's why I went with validateRef since it is validating the ref field.

pkg/resolution/resource/name_test.go Show resolved Hide resolved
This PR enables concise resolver syntax interface.
@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
docs/resolver-template/cmd/resolver/main.go 75.0% 88.2% 13.2
pkg/apis/config/feature_flags.go 94.3% 94.4% 0.1
pkg/apis/pipeline/v1beta1/pipelineref_validation.go 100.0% 97.6% -2.4
pkg/reconciler/pipelinerun/resources/apply.go 98.5% 97.9% -0.7
pkg/reconciler/pipelinerun/resources/pipelineref.go 93.6% 94.1% 0.5
pkg/reconciler/taskrun/resources/taskref.go 94.3% 94.4% 0.2
pkg/remoteresolution/resolver/bundle/resolver.go 100.0% 81.8% -18.2
pkg/remoteresolution/resolver/cluster/resolver.go 100.0% 81.8% -18.2
pkg/remoteresolution/resolver/framework/reconciler.go 73.1% 76.1% 3.0
pkg/remoteresolution/resolver/git/resolver.go 92.3% 86.7% -5.6
pkg/remoteresolution/resolver/http/resolver.go 100.0% 88.9% -11.1
pkg/remoteresolution/resource/crd_resource.go 94.7% 95.0% 0.3
pkg/resolution/resource/name.go 55.3% 56.1% 0.8
test/remoteresolution/resolution.go 35.4% 14.3% -21.1
test/remoteresolution/resolution.go Do not exist 67.9%
test/remoteresolution/resolution.go Do not exist 67.9%
test/remoteresolution/resolution.go Do not exist 0.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
docs/resolver-template/cmd/resolver/main.go 75.0% 88.2% 13.2
pkg/apis/config/feature_flags.go 94.3% 94.4% 0.1
pkg/apis/pipeline/v1beta1/pipelineref_validation.go 100.0% 97.6% -2.4
pkg/reconciler/pipelinerun/resources/apply.go 98.5% 97.9% -0.7
pkg/reconciler/pipelinerun/resources/pipelineref.go 93.6% 94.1% 0.5
pkg/reconciler/taskrun/resources/taskref.go 94.3% 94.4% 0.2
pkg/remoteresolution/resolver/bundle/resolver.go 100.0% 81.8% -18.2
pkg/remoteresolution/resolver/cluster/resolver.go 100.0% 81.8% -18.2
pkg/remoteresolution/resolver/framework/reconciler.go 73.1% 76.1% 3.0
pkg/remoteresolution/resolver/git/resolver.go 92.3% 86.7% -5.6
pkg/remoteresolution/resolver/http/resolver.go 100.0% 88.9% -11.1
pkg/remoteresolution/resource/crd_resource.go 94.7% 95.0% 0.3
pkg/resolution/resource/name.go 55.3% 56.1% 0.8
test/remoteresolution/resolution.go 35.4% 41.1% 5.7
test/remoteresolution/resolution.go Do not exist 33.9%

@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
docs/resolver-template/cmd/resolver/main.go 75.0% 88.2% 13.2
pkg/apis/config/feature_flags.go 94.3% 94.4% 0.1
pkg/apis/pipeline/v1beta1/pipelineref_validation.go 100.0% 97.6% -2.4
pkg/reconciler/pipelinerun/resources/apply.go 98.5% 97.9% -0.7
pkg/reconciler/pipelinerun/resources/pipelineref.go 93.6% 94.1% 0.5
pkg/reconciler/taskrun/resources/taskref.go 94.3% 94.4% 0.2
pkg/remoteresolution/resolver/bundle/resolver.go 100.0% 81.8% -18.2
pkg/remoteresolution/resolver/cluster/resolver.go 100.0% 81.8% -18.2
pkg/remoteresolution/resolver/framework/reconciler.go 73.1% 76.1% 3.0
pkg/remoteresolution/resolver/git/resolver.go 92.3% 86.7% -5.6
pkg/remoteresolution/resolver/http/resolver.go 100.0% 88.9% -11.1
pkg/remoteresolution/resource/crd_resource.go 94.7% 95.0% 0.3
pkg/resolution/resource/name.go 55.3% 56.1% 0.8
test/remoteresolution/resolution.go 35.4% 41.1% 5.7
test/remoteresolution/resolution.go Do not exist 67.9%
test/remoteresolution/resolution.go Do not exist 0.0%

@chitrangpatel chitrangpatel requested a review from JeromeJu May 15, 2024 17:28
@JeromeJu JeromeJu self-assigned this May 15, 2024
return bundle.ValidateParams(ctx, req.Params)
}
// Remove this error once validate url has been implemented.
return errors.New("cannot validate request. the Validate method has not been implemented.")
Copy link
Member

Choose a reason for hiding this comment

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

Could we add test cases for those failure usage?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure.

Copy link
Member

@JeromeJu JeromeJu left a comment

Choose a reason for hiding this comment

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

[Not a blocker to this PR] can we have some examples to how the new syntax look like?

@chitrangpatel
Copy link
Contributor Author

[Not a blocker to this PR] can we have some examples to how the new syntax look like?

That will be different for each resolver since they decide the scheme. In followup PRs when we update the individual resolvers, we will add this.

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JeromeJu, vdemeester, Yongxuanzhang

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:
  • OWNERS [JeromeJu,Yongxuanzhang,vdemeester]

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

Copy link
Member

@JeromeJu JeromeJu left a comment

Choose a reason for hiding this comment

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

/lgtm
offline discussion with @chitrangpatel that we'll have more example test cases coming up in the follow-up PR with the actual scheTypes

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label May 15, 2024
@tekton-robot tekton-robot merged commit 88fc740 into tektoncd:main May 15, 2024
13 checks passed
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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants