Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/cc @khrm |
khrm
left a comment
There was a problem hiding this comment.
This looks fine.
I can see scheduledtemplates.triggers.tekton.dev CRD.
|
The following is the coverage report on the affected files.
|
|
The following is the coverage report on the affected files.
|
|
The following is the coverage report on the affected files.
|
6f38229 to
4e8dfc2
Compare
|
The following is the coverage report on the affected files.
|
|
Any updates on this? |
khrm
left a comment
There was a problem hiding this comment.
@savitaashture Let's review and merge this.
|
Any updates on this? |
|
The following is the coverage report on the affected files.
|
|
Any updates on this? |
|
The following is the coverage report on the affected files.
|
|
The following is the coverage report on the affected files.
|
|
/retest |
|
The following is the coverage report on the affected files.
|
|
@sudhishmk: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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"` |
There was a problem hiding this comment.
Question about ScheduledTemplateSpec design:
I noticed that ScheduledTemplateSpec duplicates the Params and ResourceTemplates fields from TriggerTemplateSpec:
TriggerTemplateSpec:triggers/pkg/apis/triggers/v1alpha1/trigger_template_types.go
Lines 30 to 35 in d7ac246
ScheduledTemplateSpec:
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?
There was a problem hiding this comment.
@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
cf796e8 to
f6c13d1
Compare
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:
/kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes