INTEROP-9265: Add ACM operator upgrade step for OPP product upgrades - #82641
INTEROP-9265: Add ACM operator upgrade step for OPP product upgrades#82641amp-rh wants to merge 8 commits into
Conversation
|
@amp-rh: This pull request references INTEROP-9265 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds a CI step-registry entry that upgrades the ACM operator through an OLM subscription channel change, approves InstallPlans, waits for completion, validates MCE and hub health, and collects diagnostics and summary artifacts. ChangesACM operator upgrade
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant CI as ACM upgrade step
participant Subscription as OLM subscription
participant InstallPlan
participant CSV as ACM CSV
participant Cluster as ACM cluster
CI->>Subscription: Resolve and patch target channel
Subscription-->>InstallPlan: Create or expose upgrade InstallPlan
CI->>InstallPlan: Approve manual InstallPlan
InstallPlan->>CSV: Install upgraded CSV
CI->>CSV: Wait for Succeeded
CI->>Cluster: Validate MCE and hub health
Cluster-->>CI: Return health status
Suggested reviewers: 🚥 Pre-merge checks | ✅ 14 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (14 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Code Review: ACM Operator Upgrade StepOverall this is a well-structured step with clean function decomposition, proper artifact collection, defensive error handling in diagnostics, and thorough post-upgrade validation (MCE + hub health). The ref YAML documentation with exit codes is excellent. A few issues and suggestions below. Bug:
|
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (1)
ci-operator/step-registry/interop/opp/product-upgrade/acm/interop-opp-product-upgrade-acm-commands.sh (1)
79-97: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winEmpty
spec.sourceNamespacedegrades into a misleading error.If the Subscription omits
sourceNamespace, thepackagemanifestquery runs against the current context namespace and returns nothing, surfacing as "No channels found" rather than the real cause. Default it toopenshift-marketplaceand validatepackage_nametoo.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@ci-operator/step-registry/interop/opp/product-upgrade/acm/interop-opp-product-upgrade-acm-commands.sh` around lines 79 - 97, Update the subscription lookup flow to default an empty catalog_namespace from spec.sourceNamespace to openshift-marketplace before querying packagemanifest. Also validate package_name immediately after retrieving it and return a clear error when it is empty, before executing the channels lookup; preserve the existing no-channels handling for valid package manifests.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@ci-operator/step-registry/interop/opp/product-upgrade/acm/interop-opp-product-upgrade-acm-commands.sh`:
- Around line 303-312: Update the same-channel logic in the target_channel check
to verify that the referenced InstallPlan represents a pending upgrade, rather
than treating any installPlanRef.name as pending. Inspect the referenced
InstallPlan’s spec.clusterServiceVersionNames and status.phase, or compare the
subscription’s currentCSV and installedCSV, and exit 0 only when no upgrade is
actually available; preserve the existing upgrade flow when one is pending.
- Around line 36-40: Update get_current_csv and the corresponding subscription
lookups around the callers near lines 290-297 to explicitly handle oc failures.
Ensure command substitution failures are caught without triggering set -e, then
return an empty result so the existing “No ACM subscription found” handling
executes and exits with status 3.
- Around line 180-193: Update parse_timeout to reject inputs that match none of
its supported formats instead of echoing 0. After the existing parsing branches,
return a nonzero status and emit a clear error for invalid values such as
“1h30m” or “45min”; preserve the current seconds conversion for valid minute,
second, hour, and numeric inputs.
- Around line 143-178: Update wait_for_csv_succeeded to ignore the pre-upgrade
CSV by requiring get_current_csv to differ from the previously installed
current_csv before accepting a Succeeded phase. Preserve the existing timeout,
failure handling, and polling behavior, and only return success after the
replacement CSV reports Succeeded.
- Around line 323-351: Update the InstallPlan lookup in the retry loop to read
`.status.installPlanRef.name`, matching the earlier subscription lookup. Scope
the fallback `oc get installplan` query to InstallPlans whose owner reference
name matches `${ACM_SUBSCRIPTION_NAME}` before selecting the newest result, so
the approval logic only targets the ACM Subscription’s InstallPlan.
---
Nitpick comments:
In
`@ci-operator/step-registry/interop/opp/product-upgrade/acm/interop-opp-product-upgrade-acm-commands.sh`:
- Around line 79-97: Update the subscription lookup flow to default an empty
catalog_namespace from spec.sourceNamespace to openshift-marketplace before
querying packagemanifest. Also validate package_name immediately after
retrieving it and return a clear error when it is empty, before executing the
channels lookup; preserve the existing no-channels handling for valid package
manifests.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: e4f7e528-1fa1-4acd-9866-6113eb749e67
📒 Files selected for processing (5)
ci-operator/step-registry/interop/opp/product-upgrade/OWNERSci-operator/step-registry/interop/opp/product-upgrade/acm/OWNERSci-operator/step-registry/interop/opp/product-upgrade/acm/interop-opp-product-upgrade-acm-commands.shci-operator/step-registry/interop/opp/product-upgrade/acm/interop-opp-product-upgrade-acm-ref.metadata.jsonci-operator/step-registry/interop/opp/product-upgrade/acm/interop-opp-product-upgrade-acm-ref.yaml
Review of fix commit 024e404Reviewed the full PR diff with a focus on the two bug fixes in the latest push. Both fixes are correct and well-implemented. ✅ Fix 1: CSV name gating in
|
024e404 to
ed3f2d4
Compare
Readiness Review for External Product Team ReviewVerified this PR against INTEROP-9265 acceptance criteria and the parent epic INTEROP-8941 (Automated Product Upgrade Testing). Linkage
Acceptance Criteria Coverage
Code Quality
CI Status
Epic AlignmentThis PR correctly implements the ACM upgrade step as the first product in the OPP coordinated upgrade sequence (ACM → ACS → ODF → Quay), consistent with the epic's defined dependency order. The step writes upgrade results to Verdict: Ready for external product team review. The implementation is complete against all verifiable acceptance criteria, review feedback has been addressed, and CI is green. AI-generated. Review for accuracy. |
Ownership Consideration for Long-Term SustainabilityThe implementation is well-structured — clean function decomposition, proper artifact collection, defensive error handling, and thorough post-upgrade validation (MCE + hub health). The exit code documentation in the ref YAML is excellent. Technically solid work. That said, I want to flag a long-term sustainability concern: this step contains ~387 lines of deep ACM domain knowledge (subscription channel resolution, MCE co-upgrade validation, MultiClusterHub phase monitoring, policy propagator health, managed cluster availability). As ACM's architecture evolves — changes to MCE coupling, new hub CRDs, subscription model changes — maintaining this step will require ACM team expertise. Current precedent in the step registry:
DPTP policy (DPTP-1522) explicitly states: "We expect these kinds of installation steps to be owned and maintained by SMEs." Suggestion for structuring toward eventual handoff:
This isn't a merge blocker — the work is correct, valuable, and needed now. It's a heads-up that we should plan for the ACM team to take ownership of the step content while the interop team retains ownership of the multi-product orchestration layer. We'll discuss at the next OPP sync. See also: OSSM-14040 (precedent for interop-to-product ownership transition), ACM-3702 (ACM accepted CI step ownership). |
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: amp-rh 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 |
Add step registry entry at interop/opp/product-upgrade/acm/ that upgrades ACM via OLM subscription channel change and validates the operator reaches Succeeded phase. Includes MCE co-upgrade validation and hub health checks (MCH phase, policy propagator, managed clusters). This step gates downstream product upgrades (ACS, ODF, Quay) in the OPP coordinated product upgrade workflow (INTEROP-8941).
…t default - Add || true to all oc get helpers to prevent inherit_errexit from killing callers before empty-string checks can run - Use consistent .status.installPlanRef.name (not deprecated .installplan) - Add fallback default (30m) for unrecognized timeout formats in parse_timeout - Write acm-upgraded-version and acm-upgraded-channel to SHARED_DIR for downstream step consumption
The step-registry-metadata CI check requires auto-generated metadata with path and owners fields. Replace the manually-written display-name and description with the expected generated format.
wait_for_csv_succeeded now skips iterations where currentCSV still matches the pre-upgrade CSV, preventing false-positive success when OLM has not yet processed the channel change. Same-channel upgrade path now checks InstallPlan phase; a Complete plan means no pending upgrade rather than relying on the presence of installPlanRef.name (which persists after apply).
- set -euxo pipefail (add -x for xtrace) - PascalCase functions with `function` keyword - camelCase local/script variables via typeset - Remove 2>/dev/null (xtrace needs visible output) - Add terminal `true` for clean exit
Add interop-opp-product-upgrade-acm ref to both OPP upgrade configs (4.22 and 5.0) so the ACM operator upgrade runs after OCP platform upgrade and health check, before smoke tests. Override ACM_SUBSCRIPTION_NAMESPACE to 'ocm' to match the namespace used by the install-operators step. Addresses INTEROP-9381 acceptance criteria: - Post-upgrade health validation passes in CI - Health check gates downstream product upgrades
- typeset instead of local throughout
- Trap handler uses {( ... )} subshell form
- Terminal true in CollectDiagnostics, ResolveTargetChannel, ParseTimeout
- Separate oc get from wc to preserve pipefail semantics
- Brace expansion {1..12} instead of $(seq)
- Array-based channel iteration (SC2086)
a9b5e64 to
834e514
Compare
|
/pj-rehearse periodic-ci-stolostron-policy-collection-main-ocp4.22-upgrade-interop-opp-upgrade-aws |
|
/pj-rehearse periodic-ci-stolostron-policy-collection-main-ocp5.0-upgrade-interop-opp-upgrade-aws |
|
@amp-rh: your |
|
@amp-rh: your |
|
/pj-rehearse periodic-ci-stolostron-policy-collection-main-ocp4.22-upgrade-interop-opp-upgrade-aws |
|
/pj-rehearse periodic-ci-stolostron-policy-collection-main-ocp5.0-upgrade-interop-opp-upgrade-aws |
|
@amp-rh: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel. |
1 similar comment
|
@amp-rh: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel. |
|
@amp-rh: The following tests 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-sigs/prow repository. I understand the commands that are listed here. |
|
Both rehearsal failures are pre-existing and unrelated to PR changes. The ocp4.22 job fails in install-operators (rhacs-operator deployment timeout), and the ocp5.0 job fails in interop-opp-preflight (jq install failure). Both production jobs have 100% failure rate with identical errors across all recent runs. The new ACM operator upgrade step introduced by this PR was never reached in either rehearsal. |
|
/pj-rehearse ack |
|
@amp-rh: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel. |
- Capture pre-patch InstallPlan ref before channel change; wait for a different ref to appear (removes stale-ref race condition) - Remove namespace-wide InstallPlan fallback that could select another operator's plan - Fail ValidateHubHealth when policy propagator is not ready after 5m timeout instead of only logging the value
|
[REHEARSALNOTIFIER]
Interacting with pj-rehearseComment: Once you are satisfied with the results of the rehearsals, comment: |
TL;DR
New step registry ref
interop-opp-product-upgrade-acmthat upgrades ACM via OLM subscription channel change and validates the operator reaches Succeeded phase. Wired into both OPP upgrade configs (4.22 and 5.0) after OCP platform upgrade, before downstream product upgrades.What changed
interop/opp/product-upgrade/acm/upgrades ACM by patching the Subscription to the target (or next available) channel, waits for CSV Succeeded, validates MCE co-upgrade, and confirms hub healthinterop-opp-product-upgrade-acmref +ACM_SUBSCRIPTION_NAMESPACE: ocmoverride to both upgrade workflow configsinterop/opp/product-upgrade/OWNERS establishes the namespace for future product upgrade steps (ACS, ODF, Quay)Core files (review these first)
.../acm/interop-opp-product-upgrade-acm-commands.sh.../acm/interop-opp-product-upgrade-acm-ref.yamlACM_TARGET_CHANNEL,ACM_UPGRADE_TIMEOUT,ACM_SUBSCRIPTION_NAME,ACM_SUBSCRIPTION_NAMESPACE), 45m timeout, documentationMechanical/config files
.../product-upgrade/OWNERScspi-qe-ocp-lpteam alias.../product-upgrade/acm/OWNERS.../acm/interop-opp-product-upgrade-acm-ref.metadata.json.../stolostron-policy-collection-main__ocp4.22-upgrade.yaml.../stolostron-policy-collection-main__ocp5.0-upgrade.yamlRisk areas
ResolveTargetChannel): WhenACM_TARGET_CHANNELis empty, the script queries the packagemanifest for the next channel above the installed version. This is the most complex logic path; relies onrelease-X.Ychannel naming convention.ACM_UPGRADE_TIMEOUTdefault. The step-level timeout is 45m to accommodate this.ACM_SUBSCRIPTION_NAMESPACE: ocm(not the defaultopen-cluster-management) to match how install-operators deploys ACM in the OPP pipeline.Testing
ci/prow/ci-operator-registrypasses (step ref validation)ci/prow/step-registry-shellcheckpassesci/prow/ownerspasses (OWNERS file validation)Jira