Skip to content

OCPCLOUD-3647: Consolidate install-time object processing in toBoxcutterRevision - #633

Open
mdbooth wants to merge 4 commits into
openshift:mainfrom
openshift-cloud-team:runtimetransformers/010-toBoxcutterRevision
Open

OCPCLOUD-3647: Consolidate install-time object processing in toBoxcutterRevision#633
mdbooth wants to merge 4 commits into
openshift:mainfrom
openshift-cloud-team:runtimetransformers/010-toBoxcutterRevision

Conversation

@mdbooth

@mdbooth mdbooth commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

This refactor forms the basis of a simplification to enable several other
features:

  • Integration of CRD CompatibilityRequirement generation into capi-installer
  • Consolidation of install-time transformations (e.g. TLS/Proxy Env vars) in
    one place
  • Simplification of RenderedRevision

Summary by CodeRabbit

  • Improvements
    • Installer revisions now reconcile using API revisions directly, then report any collected-resource resolution issues after reconciliation.
    • Rendered components expose a unified set of resources, while installation phases still split CRDs into dedicated phases when present.
    • Existing-resource adoption annotations are validated and applied to the correct resources; “always” adoption disables collision protection.
  • Refactor
    • Simplified rendered component handling to a single unstructured resource model.
  • Tests
    • Added coverage for phase creation, CRD grouping behavior, idempotent phase/object generation, and object-collection execution; updated existing tests to match the unified object model.

mdbooth added 2 commits July 28, 2026 18:09
We were previously pre-converting all API revisions into installer
revisions. The purpose of this was to assemble all related objects
before reconciliation. However, we weren't actually writing them so this
served no purpose. We take the opportunity to remove the unnecessary
complexity.
This allows us to add code to component generation which can fail.
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 28, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@mdbooth: This pull request explicitly references no jira issue.

Details

In response to this:

This refactor forms the basis of a simplification to enable several other
features:

  • Integration of CRD CompatibilityRequirement generation into capi-installer
  • Consolidation of install-time transformations (e.g. TLS/Proxy Env vars) in
    one place
  • Simplification of RenderedRevision

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.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Walkthrough

Revision rendering now exposes all manifests as pointer-based unstructured objects. Installer conversion builds native Boxcutter phases with CRD separation and adopt-existing options, while reconciliation processes API revisions directly and resolves collected objects afterward.

Changes

Revision rendering and validation

Layer / File(s) Summary
Unified rendered object contract
pkg/revisiongenerator/revision.go, pkg/revisiongenerator/validate.go, pkg/revisiongenerator/*_test.go
Components expose CRDs and other manifests through one Objects() collection of unstructured pointers; collector configuration, the separate CRDs() accessor, and split validation are removed and corresponding tests are updated.

Boxcutter conversion

Layer / File(s) Summary
Boxcutter revision and phase construction
pkg/controllers/installer/boxcutter.go, pkg/controllers/installer/boxcutter_test.go
Installer conversion uses native Boxcutter revisions and phases, separates CRDs into <component>-crds phases, applies adopt-existing options, and tests phase stability and collection callbacks.

API reconciliation

Layer / File(s) Summary
API revision reconciliation flow
pkg/controllers/installer/revision_reconciler.go
Reconciliation and teardown operate directly on API revisions, create internal installer revisions within each operation, centralize waiting messages, and resolve collected objects after reconciliation while appending resolution errors.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant revisionReconciler
  participant reconcileRevision
  participant toBoxcutterRevision
  participant ObjectResolver
  revisionReconciler->>reconcileRevision: reconcile API revision
  reconcileRevision->>toBoxcutterRevision: construct Boxcutter revision and phases
  revisionReconciler->>ObjectResolver: resolve collected objects after reconciliation
  ObjectResolver-->>revisionReconciler: return resolution errors
Loading

Suggested labels: pipeline-auto

Suggested reviewers: nrb, racheljpg

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (14 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed All Ginkgo and t.Run titles in the changed test files are static literals; no interpolated, random, or run-dependent values were found.
Test Structure And Quality ✅ Passed The new Ginkgo tests are focused unit tests, use no cluster resources or waits, and match existing suite/helper patterns; no cleanup or timeout issues found.
Microshift Test Compatibility ✅ Passed The added Ginkgo tests are unit-level and only manipulate unstructured ConfigMaps/CRDs; they don't use unsupported OpenShift APIs or MicroShift-sensitive features.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The added Ginkgo tests are unit tests over in-memory rendered objects; they don’t inspect nodes, topology, scheduling, or HA behavior, so no SNO skip is needed.
Topology-Aware Scheduling Compatibility ✅ Passed PASS: The changed controllers/rendering code refactors object handling only; no nodeSelector, affinity, topology spread, PDB, replica, or taint logic was added.
Ote Binary Stdout Contract ✅ Passed No new process-level stdout writes were added; changed code has no fmt.Print/log-to-stdout calls, and suite logging goes to GinkgoWriter.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Added Ginkgo tests are local/unit-only and show no IPv4-only assumptions or external network connectivity requirements.
No-Weak-Crypto ✅ Passed Touched files use SHA-256 for content IDs only; no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB, custom crypto, or secret comparisons were found.
Container-Privileges ✅ Passed Touched files are Go sources only; no changed manifests or privileged fields (privileged, hostPID/network/IPC, SYS_ADMIN, allowPrivilegeEscalation) were found.
No-Sensitive-Data-In-Logs ✅ Passed No new logs print secrets or PII; logging is limited to revision/phase/object refs and error text, with no passwords/tokens/keys/hostnames exposed.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main refactor: consolidating install-time object processing in toBoxcutterRevision.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@openshift-ci

openshift-ci Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign nrb for approval. For more information see the Code Review Process.

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

@openshift-ci
openshift-ci Bot requested review from nrb and racheljpg July 28, 2026 17:17
@mdbooth

mdbooth commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

/pipeline auto

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification

The pipeline-auto label has been added to this PR. Second-stage tests will be triggered automatically when all first-stage tests pass.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aws-capi-disconnected-techpreview
/test e2e-aws-capi-techpreview
/test e2e-aws-capi-techpreview-post-install
/test e2e-aws-ovn-techpreview
/test e2e-aws-ovn-techpreview-upgrade
/test e2e-azure-capi-techpreview
/test e2e-azure-ovn-techpreview
/test e2e-azure-ovn-techpreview-upgrade
/test e2e-gcp-capi-techpreview
/test e2e-gcp-ovn-techpreview
/test e2e-metal3-capi-techpreview
/test e2e-openstack-capi-techpreview
/test e2e-vsphere-capi-techpreview
/test regression-clusterinfra-aws-ipi-techpreview-capi

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Tests from second stage were triggered manually. Pipeline can be controlled only manually, until HEAD changes. Use command to trigger second stage.

@mdbooth
mdbooth force-pushed the runtimetransformers/010-toBoxcutterRevision branch from 76a6184 to f9e7299 Compare July 28, 2026 20:49

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@pkg/revisiongenerator/revision_test.go`:
- Line 313: Strengthen the object-contract tests: in
pkg/revisiongenerator/revision_test.go at lines 313-313, 571-571, and 706-706,
assert the expected CRD and non-CRD kind/name identities returned by Objects()
and the matched profile, not just counts; in
pkg/revisiongenerator/validate_test.go at lines 108-123, retain or adapt the
CRD-shaped invalid-annotation case to verify CRDs receive the same annotation
validation.
🪄 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: Enterprise

Run ID: c19846cf-ecef-4284-9c61-5400acf6839d

📥 Commits

Reviewing files that changed from the base of the PR and between 76a6184 and f9e7299.

📒 Files selected for processing (7)
  • pkg/controllers/installer/boxcutter.go
  • pkg/controllers/installer/boxcutter_test.go
  • pkg/controllers/installer/revision_reconciler.go
  • pkg/revisiongenerator/revision.go
  • pkg/revisiongenerator/revision_test.go
  • pkg/revisiongenerator/validate.go
  • pkg/revisiongenerator/validate_test.go
🚧 Files skipped from review as they are similar to previous changes (5)
  • pkg/revisiongenerator/validate.go
  • pkg/revisiongenerator/revision.go
  • pkg/controllers/installer/revision_reconciler.go
  • pkg/controllers/installer/boxcutter_test.go
  • pkg/controllers/installer/boxcutter.go

Comment thread pkg/revisiongenerator/revision_test.go
@mdbooth
mdbooth force-pushed the runtimetransformers/010-toBoxcutterRevision branch from f9e7299 to e612ad6 Compare July 28, 2026 21:02
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aws-capi-disconnected-techpreview
/test e2e-aws-capi-techpreview
/test e2e-aws-capi-techpreview-post-install
/test e2e-aws-ovn-techpreview
/test e2e-aws-ovn-techpreview-upgrade
/test e2e-azure-capi-techpreview
/test e2e-azure-ovn-techpreview
/test e2e-azure-ovn-techpreview-upgrade
/test e2e-gcp-capi-techpreview
/test e2e-gcp-ovn-techpreview
/test e2e-metal3-capi-techpreview
/test e2e-openstack-capi-techpreview
/test e2e-vsphere-capi-techpreview
/test regression-clusterinfra-aws-ipi-techpreview-capi

@mdbooth

mdbooth commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

Infra flakes.

/retest-required

@mdbooth mdbooth changed the title NO-JIRA: Consolidate install-time object processing in toBoxcutterRevision OCPCLOUD-3647: Consolidate install-time object processing in toBoxcutterRevision Jul 29, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 29, 2026

Copy link
Copy Markdown

@mdbooth: This pull request references OCPCLOUD-3647 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 story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

This refactor forms the basis of a simplification to enable several other
features:

  • Integration of CRD CompatibilityRequirement generation into capi-installer
  • Consolidation of install-time transformations (e.g. TLS/Proxy Env vars) in
    one place
  • Simplification of RenderedRevision

Summary by CodeRabbit

  • Improvements
  • Installer revisions now reconcile using API revisions directly, then report any collected-resource resolution issues after reconciliation.
  • Rendered components expose a unified set of resources, while installation phases still split CRDs into dedicated phases when present.
  • Existing-resource adoption annotations are validated and applied to the correct resources; “always” adoption disables collision protection.
  • Refactor
  • Simplified rendered component handling to a single unstructured resource model.
  • Tests
  • Added coverage for phase creation, CRD grouping behavior, idempotent phase/object generation, and object-collection execution; updated existing tests to match the unified object model.

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.

@mdbooth

mdbooth commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

Filed OCPBUGS-100155 for the flake.

/test e2e-aws-capi-techpreview

@mdbooth

mdbooth commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

Infra flake

/test regression-clusterinfra-aws-ipi-techpreview-capi

@openshift-ci

openshift-ci Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

@mdbooth: all tests passed!

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-sigs/prow repository. I understand the commands that are listed here.

@mdbooth

mdbooth commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

/verified by CI

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jul 30, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@mdbooth: This PR has been marked as verified by CI.

Details

In response to this:

/verified by CI

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.

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

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. pipeline-auto verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants