Skip to content

TEP-0128 Creation of new CRD#1774

Open
sudhishmk wants to merge 1 commit intotektoncd:mainfrom
sudhishmk:tep-0128-crd
Open

TEP-0128 Creation of new CRD#1774
sudhishmk wants to merge 1 commit intotektoncd:mainfrom
sudhishmk:tep-0128-crd

Conversation

@sudhishmk
Copy link
Copy Markdown
Contributor

Changes -: Code changes for generating new PR for TEP 0128

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

NONE

@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 Oct 23, 2024
@tekton-robot
Copy link
Copy Markdown

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 the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Oct 23, 2024
@tekton-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign bobcatfish after the PR has been reviewed.
You can assign the PR to them by writing /assign @bobcatfish in a comment when ready.

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

Details 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

@sudhishmk
Copy link
Copy Markdown
Contributor Author

/cc @khrm

@tekton-robot tekton-robot requested a review from khrm October 23, 2024 14:51
Copy link
Copy Markdown
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.

This looks fine.

I can see scheduledtemplates.triggers.tekton.dev CRD.

@khrm khrm marked this pull request as ready for review November 28, 2024 10:23
@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 Nov 28, 2024
Copy link
Copy Markdown
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.

/kind feature

@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Nov 28, 2024
@tekton-robot
Copy link
Copy Markdown

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/v1alpha1/scheduled_template_defaults.go Do not exist N/A
pkg/apis/triggers/v1alpha1/scheduled_template_validation.go Do not exist 83.3%

@tekton-robot
Copy link
Copy Markdown

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/v1alpha1/scheduled_template_defaults.go Do not exist N/A
pkg/apis/triggers/v1alpha1/scheduled_template_validation.go Do not exist 83.3%

@tekton-robot
Copy link
Copy Markdown

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/v1alpha1/scheduled_template_defaults.go Do not exist N/A
pkg/apis/triggers/v1alpha1/scheduled_template_validation.go Do not exist 83.3%

@tekton-robot
Copy link
Copy Markdown

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/v1alpha1/scheduled_template_defaults.go Do not exist N/A
pkg/apis/triggers/v1alpha1/scheduled_template_validation.go Do not exist 83.3%

@sudhishmk
Copy link
Copy Markdown
Contributor Author

Any updates on this?

Copy link
Copy Markdown
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.

@savitaashture Let's review and merge this.

@l-qing
Copy link
Copy Markdown
Member

l-qing commented Feb 26, 2025

Any updates on this?

Comment thread pkg/apis/triggers/v1alpha1/scheduled_template_types.go Outdated
@tekton-robot
Copy link
Copy Markdown

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/v1alpha1/scheduled_template_defaults.go Do not exist N/A
pkg/apis/triggers/v1alpha1/scheduled_template_validation.go Do not exist 83.3%

@sudhishmk
Copy link
Copy Markdown
Contributor Author

Any updates on this?

@sudhishmk sudhishmk requested a review from danielfbm July 15, 2025 14:28
Comment thread pkg/apis/triggers/v1alpha1/scheduled_template_types.go Outdated
Comment thread pkg/apis/triggers/v1alpha1/scheduled_template_types.go
@tekton-robot
Copy link
Copy Markdown

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/v1alpha1/scheduled_template_defaults.go Do not exist N/A
pkg/apis/triggers/v1alpha1/scheduled_template_validation.go Do not exist 83.3%

@tekton-robot
Copy link
Copy Markdown

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/v1alpha1/scheduled_template_defaults.go Do not exist N/A
pkg/apis/triggers/v1alpha1/scheduled_template_validation.go Do not exist 83.3%

@sudhishmk sudhishmk requested a review from danielfbm August 7, 2025 07:46
@sudhishmk
Copy link
Copy Markdown
Contributor Author

/retest

@tekton-robot
Copy link
Copy Markdown

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/v1alpha1/scheduled_template_defaults.go Do not exist N/A
pkg/apis/triggers/v1alpha1/scheduled_template_validation.go Do not exist 83.3%

@tekton-robot
Copy link
Copy Markdown

@sudhishmk: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-tekton-triggers-build-tests 46a6a37 link true /test pull-tekton-triggers-build-tests

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

Params []ParamSpec `json:"params,omitempty"`
// +listType=atomic
// Resource template can have one or more pipelineruns, taskruns or other allowed Kubernetes and Tekton resources
ResourceTemplates []TriggerResourceTemplate `json:"resourcetemplates,omitempty"`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Question about ScheduledTemplateSpec design:

I noticed that ScheduledTemplateSpec duplicates the Params and ResourceTemplates fields from TriggerTemplateSpec:

Both structs have identical field definitions for these two fields. This also leads to duplicated validation code in scheduled_template_validation.go - the functions validateTriggerResourceTemplate and verifyScheduledResourceParamDeclarations are essentially copies of the validation logic in trigger_template_validation.go.

Have you considered embedding TriggerTemplateSpec directly? Something like:

type ScheduledTemplateSpec struct {
    TriggerTemplateSpec `json:",inline"`
    CloudEventSink *apis.URL `json:"cloudEventSink,omitempty"`
    Schedule string `json:"schedule,omitempty"`
}

This would:

  • Eliminate code duplication
  • Allow reusing TriggerTemplateSpec's validation methods directly
  • Make future maintenance easier

Is there a specific reason for keeping them separate that I might have missed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@l-qing Thanks for the detailed review! Apologies for so late reply, I somehow missed this comment. I've refactored ScheduledTemplateSpec to embed TriggerTemplateSpec directly as suggested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature Categorizes issue or PR as related to a new feature. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants