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

Remove tekton resource validation #1699

Merged

Conversation

GijsvanDulmen
Copy link
Contributor

@GijsvanDulmen GijsvanDulmen commented Feb 21, 2024

Changes

Makes it possible to create other resources in the trigger template besides Tekton resources. Solves #1696

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

Removes the limit of only creating Tekton resources from within your TriggerTemplate. This will allow for other K8s resources to be created as well like for example K8s Jobs.

@tekton-robot
Copy link

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@tekton-robot tekton-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesnt merit a release note. labels Feb 21, 2024
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 21, 2024
@GijsvanDulmen
Copy link
Contributor Author

/test all

@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/apis/triggers/v1beta1/trigger_template_validation.go 97.1% 96.6% -0.5

@GijsvanDulmen
Copy link
Contributor Author

/test tekton-triggers-unit-tests

@dibyom
Copy link
Member

dibyom commented Feb 22, 2024

/retest

@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/adapter/adapter.go 23.5% 23.2% -0.3
pkg/apis/triggers/v1beta1/trigger_template_validation.go 97.1% 96.6% -0.5

@dibyom
Copy link
Member

dibyom commented Feb 22, 2024

looks like the builds tests are failing due to goimports:

pkg/apis/triggers/v1alpha1/trigger_template_validation.go:21: File is not `goimports`-ed (goimports)
	"fmt"
pkg/apis/triggers/v1beta1/trigger_template_validation.go:21: File is not `goimports`-ed (goimports)
	"fmt"

@dibyom
Copy link
Member

dibyom commented Feb 22, 2024

/test pull-tekton-triggers-integration-tests

@GijsvanDulmen
Copy link
Contributor Author

/retest

@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/adapter/adapter.go 23.5% 23.2% -0.3
pkg/apis/triggers/v1beta1/trigger_template_validation.go 97.1% 96.6% -0.5

@GijsvanDulmen GijsvanDulmen marked this pull request as ready for review February 22, 2024 21:15
@tekton-robot tekton-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 22, 2024
@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/adapter/adapter.go 23.5% 23.2% -0.3
pkg/apis/triggers/v1beta1/trigger_template_validation.go 97.1% 96.6% -0.5

@GijsvanDulmen
Copy link
Contributor Author

/retest-required

@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/adapter/adapter.go 23.5% 23.2% -0.3
pkg/apis/triggers/v1beta1/trigger_template_validation.go 97.1% 96.6% -0.5

@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/adapter/adapter.go 23.5% 23.2% -0.3
pkg/apis/triggers/v1beta1/trigger_template_validation.go 97.1% 96.6% -0.5

@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/adapter/adapter.go 23.5% 23.2% -0.3
pkg/apis/triggers/v1beta1/trigger_template_validation.go 97.1% 96.6% -0.5

@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/adapter/adapter.go 23.5% 23.2% -0.3
pkg/apis/triggers/v1beta1/trigger_template_validation.go 97.1% 96.6% -0.5

@GijsvanDulmen
Copy link
Contributor Author

/kind feature

@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Feb 23, 2024
@GijsvanDulmen
Copy link
Contributor Author

Removes the limit of only creating Tekton resources from within your TriggerTemplate. This will allow for other K8s resources to be created as well like for example K8s Jobs.

@GijsvanDulmen GijsvanDulmen force-pushed the remove-tekton-resource-validation branch from f2f1f42 to 903702f Compare February 23, 2024 12:20
@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/adapter/adapter.go 23.5% 23.2% -0.3
pkg/apis/triggers/v1beta1/trigger_template_validation.go 97.1% 96.6% -0.5

@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 Feb 23, 2024
@dibyom dibyom linked an issue Feb 23, 2024 that may be closed by this pull request
Copy link
Member

@dibyom dibyom left a comment

Choose a reason for hiding this comment

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

A few small things, but overall looks good! Thanks @GijsvanDulmen

cc @savitaashture @khrm

pkg/sink/sink.go Outdated Show resolved Hide resolved
docs/triggertemplates.md Outdated Show resolved Hide resolved
@GijsvanDulmen
Copy link
Contributor Author

@dibyom Thanks for the review! Will process those asap :-)

@GijsvanDulmen GijsvanDulmen force-pushed the remove-tekton-resource-validation branch from 903702f to 1d3e7b0 Compare February 23, 2024 17:25
@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
cmd/triggerrun/cmd/root.go 45.2% 45.5% 0.4
pkg/adapter/adapter.go 23.5% 23.2% -0.3
pkg/apis/triggers/v1beta1/trigger_template_validation.go 97.1% 96.6% -0.5

@GijsvanDulmen
Copy link
Contributor Author

@dibyom It's ready for another review.

docs/triggertemplates.md Outdated Show resolved Hide resolved
Copy link
Member

@dibyom dibyom left a comment

Choose a reason for hiding this comment

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

one tiny nit, otherwise LGTM! Thanks a lot @GijsvanDulmen

@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dibyom

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 Feb 28, 2024
@dibyom
Copy link
Member

dibyom commented Feb 28, 2024

Also cc @khrm @savitaashture if you'd like to take a look

@GijsvanDulmen GijsvanDulmen force-pushed the remove-tekton-resource-validation branch from 1d3e7b0 to bb030d5 Compare February 28, 2024 20:14
@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
cmd/triggerrun/cmd/root.go 45.2% 45.5% 0.4
pkg/adapter/adapter.go 23.5% 23.2% -0.3
pkg/apis/triggers/v1beta1/trigger_template_validation.go 97.1% 96.6% -0.5

@dibyom
Copy link
Member

dibyom commented Mar 4, 2024

@savitaashture @khrm any objections to merging this?

@khrm
Copy link
Contributor

khrm commented Mar 4, 2024

Would take a look tomorrow.

…ates

Fix name of listener

And another which should becom dynamic instead of set

Remove empty line

Add e2e for custom resources

Go imports

Fix a few references

Use dynamic client instead of set to make it possible to create non tekton resources

Remove dead code after removing type validation

Removal of tekton type resource validation on v1beta1 as well

Remove note about tekton resources but leave the validation

First removal of the allowed type validation

Remove dynamic client set because its not used anymore

Better docs

Change name in test examples

Rename to create-configmap

Little improvement

Remove more not used code
@GijsvanDulmen GijsvanDulmen force-pushed the remove-tekton-resource-validation branch from bb030d5 to 52aff11 Compare March 6, 2024 18:52
@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
cmd/triggerrun/cmd/root.go 45.2% 45.5% 0.4
pkg/adapter/adapter.go 23.5% 23.2% -0.3
pkg/apis/triggers/v1beta1/trigger_template_validation.go 97.1% 96.6% -0.5

Copy link
Contributor

@khrm khrm left a comment

Choose a reason for hiding this comment

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

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 12, 2024
@khrm
Copy link
Contributor

khrm commented Mar 12, 2024

Everything looks fine. Let's merge this.

@tekton-robot tekton-robot merged commit 79c56df into tektoncd:main Mar 12, 2024
6 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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable Triggers to create custom non-Tekton resources
4 participants