-
Notifications
You must be signed in to change notification settings - Fork 591
Add TTL fields to Build and BuildConfig APIs #2698
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,6 +42,20 @@ type BuildSpec struct { | |
| // triggeredBy describes which triggers started the most recent update to the | ||
| // build configuration and contains information about those triggers. | ||
| TriggeredBy []BuildTriggerCause `json:"triggeredBy,omitempty" protobuf:"bytes,2,rep,name=triggeredBy"` | ||
|
|
||
| // successfulBuildTTLSeconds defines how long (in seconds) a successful build | ||
| // is retained after completion before being automatically deleted. | ||
| // If not set, the build will not be automatically deleted. | ||
| // This mirrors the semantics of Kubernetes Job's ttlSecondsAfterFinished. | ||
| // +optional | ||
| SuccessfulBuildTTLSeconds *int32 `json:"successfulBuildTTLSeconds,omitempty" protobuf:"varint,3,opt,name=successfulBuildTTLSeconds"` | ||
|
|
||
| // failedBuildTTLSeconds defines how long (in seconds) a failed or errored build | ||
| // is retained after completion before being automatically deleted. | ||
| // If not set, the build will not be automatically deleted. | ||
| // This mirrors the semantics of Kubernetes Job's ttlSecondsAfterFinished. | ||
| // +optional | ||
| FailedBuildTTLSeconds *int32 `json:"failedBuildTTLSeconds,omitempty" protobuf:"varint,4,opt,name=failedBuildTTLSeconds"` | ||
|
Comment on lines
+46
to
+58
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2. Ttl fields lack featuregate • New fields were added to stable build/v1 APIs without a +openshift:enable:FeatureGate=... marker. • Without feature-gating, clusters/profiles cannot control rollout of this stable API change, violating the repository’s stability/compatibility policy for new v1 fields. • No corresponding FeatureGate registration for a Build TTL feature exists in features/features.go using the required builder pattern. Agent Prompt
|
||
| } | ||
|
|
||
| // OptionalNodeSelector is a map that may also be left nil to distinguish between set and unset. | ||
|
|
@@ -994,6 +1008,24 @@ type BuildConfigSpec struct { | |
| // When a BuildConfig is created, the 5 most recent failed builds are retained unless this value is set. | ||
| // If removed after the BuildConfig has been created, all failed builds are retained. | ||
| FailedBuildsHistoryLimit *int32 `json:"failedBuildsHistoryLimit,omitempty" protobuf:"varint,5,opt,name=failedBuildsHistoryLimit"` | ||
|
|
||
| // defaultSuccessfulBuildTTLSeconds sets the default retention time (in seconds) | ||
| // for successful builds created from this BuildConfig. | ||
| // Builds created from this BuildConfig will inherit this value unless overridden | ||
| // in the Build's own successfulBuildTTLSeconds field. | ||
| // If not set, builds will not have an automatic TTL set. | ||
| // This mirrors the semantics of Kubernetes Job's ttlSecondsAfterFinished. | ||
| // +optional | ||
| DefaultSuccessfulBuildTTLSeconds *int32 `json:"defaultSuccessfulBuildTTLSeconds,omitempty" protobuf:"varint,6,opt,name=defaultSuccessfulBuildTTLSeconds"` | ||
|
|
||
| // defaultFailedBuildTTLSeconds sets the default retention time (in seconds) | ||
| // for failed or errored builds created from this BuildConfig. | ||
| // Builds created from this BuildConfig will inherit this value unless overridden | ||
| // in the Build's own failedBuildTTLSeconds field. | ||
| // If not set, builds will not have an automatic TTL set. | ||
| // This mirrors the semantics of Kubernetes Job's ttlSecondsAfterFinished. | ||
| // +optional | ||
| DefaultFailedBuildTTLSeconds *int32 `json:"defaultFailedBuildTTLSeconds,omitempty" protobuf:"varint,7,opt,name=defaultFailedBuildTTLSeconds"` | ||
|
Comment on lines
+1012
to
+1028
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 3. No ttl integration validation tests • The PR changes the build/v1 API schema but does not add integration validation tests under the repository’s /<group>/<version>/tests/<crd-name>/ structure. • Without these tests, schema expectations for the new TTL fields (presence, optionality, gating expectations) are not enforced and regressions are more likely. Agent Prompt
|
||
| } | ||
|
|
||
| // BuildRunPolicy defines the behaviour of how the new builds are executed | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. generated.proto missing ttl fields
📘 Rule violation✓ CorrectnessAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools