feat(manualapprovalgate): integrate MAG as TektonConfig child component - #3762
feat(manualapprovalgate): integrate MAG as TektonConfig child component#3762pratap0007 wants to merge 1 commit into
Conversation
|
[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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3762 +/- ##
==========================================
+ Coverage 25.46% 25.67% +0.21%
==========================================
Files 449 452 +3
Lines 23494 23625 +131
==========================================
+ Hits 5982 6066 +84
- Misses 16823 16863 +40
- Partials 689 696 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Integrates the ManualApprovalGate (MAG) component into the TektonConfig reconciliation flow so TektonConfig can create/adopt/delete the MAG CR and propagate platform-data-hash changes, aligning MAG with how other Tekton components are managed.
Changes:
- Add
spec.manualApprovaltoTektonConfigSpecwith defaulting + validation wiring. - Introduce shared
manualapprovalgatehelper package to ensure/create/update/delete the MAG CR (including ownerRef andplatform-data-hashpropagation). - Add unit tests covering MAG create/delete, ownerRef migration, and platform-data-hash propagation.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/reconciler/shared/tektonconfig/tektonconfig.go | Wire MAG lifecycle into TektonConfig reconcile/finalize and propagate platform-data-hash. |
| pkg/reconciler/shared/tektonconfig/manualapprovalgate/manualapprovalgate.go | New shared helper functions to ensure/update/delete MAG CR. |
| pkg/reconciler/shared/tektonconfig/manualapprovalgate/manualapprovalgate_test.go | Unit tests for MAG helper behaviors (create/delete/migration/platform hash). |
| pkg/apis/operator/v1alpha1/zz_generated.deepcopy.go | Generated deepcopy updates for new ManualApproval.Disabled pointer + TektonConfigSpec field. |
| pkg/apis/operator/v1alpha1/tektonconfig_validation.go | Add validation for spec.manualApproval.options. |
| pkg/apis/operator/v1alpha1/tektonconfig_types.go | Add ManualApproval field to TektonConfig spec. |
| pkg/apis/operator/v1alpha1/tektonconfig_defaults.go | Default ManualApproval to disabled on fresh installs. |
| pkg/apis/operator/v1alpha1/manualapprovalgate_types.go | Add ManualApproval.Disabled + helpers (setDefaults, IsDisabled). |
Files not reviewed (1)
- pkg/apis/operator/v1alpha1/zz_generated.deepcopy.go: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0b2d99e to
3f8d01b
Compare
| tektonConfigreconciler "github.com/tektoncd/operator/pkg/client/injection/reconciler/operator/v1alpha1/tektonconfig" | ||
| "github.com/tektoncd/operator/pkg/reconciler/common" | ||
| "github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/chain" | ||
| "github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/manualapprovalgate" |
There was a problem hiding this comment.
ManualApprovalGate is not registered in webhook.go's types map. This means SetDefaults and Validate are never called when users create or edit MAG CRs directly. Every component that has a standalone reconciler and is in AGENTS.md's "pattern references" table is registered there (TektonPipeline, TektonChain, TektonResult, TektonPruner, etc.). Please add MAG to the types map.
|
@pratap0007 please update docs https://github.com/tektoncd/operator/blob/main/docs/TektonConfig.md to indicate that with this PR MAG configs can now be managed with tektonconfig. Thank you. |
Add ManualApproval field to TektonConfig spec so that TektonConfig manages the ManualApprovalGate CR lifecycle including ownerRef and platform-data-hash propagation for TLS profile changes. - Disabled by default on fresh installs - On upgrade, standalone MAG CRs (no ownerRef) are adopted under TektonConfig instead of being deleted - Add validation for spec.manualApproval.options - Add unit tests for create, delete, ownerRef migration, and platform-data-hash annotation sync Fixes tektoncd#3656 Signed-off-by: Shiv Verma <shverma@redhat.com> Assisted-by: Claude Opus 4.6 (via Claude Code)
3f8d01b to
a41cb3f
Compare
|
@anithapriyanatarajan Thank you for the review, I've updated the PR and could you please take another look |
Add ManualApproval field to TektonConfig spec so that TektonConfig manages the ManualApprovalGate CR lifecycle including ownerRef and platform-data-hash propagation for TLS profile changes.
Fixes #3656
Assisted-by: Claude Opus 4.6 (via Claude Code)
Changes
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
make test lintbefore submitting a PRSee the contribution guide for more details.
Release Notes