Skip to content

PoC: Add OLM Smoke Test via GitHub Actions - #8113

Open
sebrandon1 wants to merge 1 commit into
openshift-kni:mainfrom
sebrandon1:add-olm-smoke-test
Open

PoC: Add OLM Smoke Test via GitHub Actions#8113
sebrandon1 wants to merge 1 commit into
openshift-kni:mainfrom
sebrandon1:add-olm-smoke-test

Conversation

@sebrandon1

@sebrandon1 sebrandon1 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add GitHub Actions workflow that builds the operator, installs via OLM on a real OpenShift cluster (CRC), and validates the full operator lifecycle
  • Fills the gap left by the current Prow integration test, which provisions an AWS cluster only to run echo "Stub test target"
  • Runs on free-tier ubuntu-24.04 runners (~30-45 min total, CRC startup dominates); runs alongside Prow, does not replace it
  • No changes to existing code or CI configuration

What it validates:

  • Build: operator image, bundle manifests, bundle image
  • OLM install: CSV reaches Succeeded, deployment rolls out, pod healthy (Running, Ready, 0 restarts)
  • CRDs: all 3 registered (ImageBasedUpgrade, SeedGenerator, IPConfig)
  • RBAC: ServiceAccount, 4 ClusterRoles, ClusterRoleBinding, metrics Service
  • Singletons: auto-created resources exist (upgrade, seedimage, ipconfig), IBU reaches Idle
  • CEL validation: wrong-name IBU and SeedGenerator rejected
  • Scorecard: 6 operator-sdk scorecard tests pass

How it works:

  1. Builds operator image, pushes to a local registry on the runner
  2. Generates bundle manifests pointing to the CRC internal registry
  3. Starts OpenShift via palmsoftware/quick-ocp (CRC on GHA)
  4. preloadImages mirrors both images into the cluster's internal registry -- no insecure registry config needed
  5. operator-sdk run bundle installs the operator via OLM
  6. Verification and diagnostics run from self-contained scripts in .github/scripts/

Triggers: PR to main or release-* (skips docs-only), push to main, manual via workflow_dispatch

File Purpose
.github/workflows/olm-smoke-test.yml Workflow definition
.github/scripts/olm-smoke-verify.sh Operator verification (CSV, pods, CRDs, RBAC, singletons, CEL)
.github/scripts/olm-smoke-diagnostics.sh Failure diagnostics collection

Upstream References

Test Plan

  • Workflow runs successfully on a PR branch (CRC starts, OLM installs operator, all verification checks pass)
  • Scorecard tests pass
  • Docs-only PR changes correctly skip the workflow
  • workflow_dispatch manual trigger works
  • Diagnostics step fires on failure and collects useful output

@openshift-ci
openshift-ci Bot requested review from Missxiaoguo and donpenney July 29, 2026 22:09
@openshift-ci

openshift-ci Bot commented Jul 29, 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 browsell 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

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 55323509-4be9-49aa-a9d3-28f274baf703

📝 Walkthrough

Walkthrough

This PR adds a GitHub Actions workflow that builds and installs the operator through OLM on OpenShift, verifies resource health and validation, and collects diagnostics when checks fail.

Changes

OLM smoke test automation

Layer / File(s) Summary
Workflow setup and image build
.github/workflows/olm-smoke-test.yml
Defines workflow triggers, configures the job and local registry, and builds and pushes operator and bundle images.
OLM installation and verification
.github/workflows/olm-smoke-test.yml, .github/scripts/olm-smoke-verify.sh
Starts OpenShift, installs the bundle through OLM, verifies CSV, deployment, pod, CRD, RBAC, metrics, singleton, and CEL validation states, and runs the operator-sdk scorecard.
Failure diagnostics collection
.github/scripts/olm-smoke-diagnostics.sh
Collects operator, OLM, event, log, upgrade-status, and pod diagnostics after workflow failure.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions
  participant LocalRegistry
  participant OpenShiftCluster
  participant olmSmokeVerify
  participant olmSmokeDiagnostics

  GitHubActions->>LocalRegistry: build and push operator and bundle images
  GitHubActions->>OpenShiftCluster: start cluster with preloaded images
  GitHubActions->>OpenShiftCluster: install bundle through OLM
  GitHubActions->>olmSmokeVerify: run verification checks
  olmSmokeVerify->>OpenShiftCluster: query operator resources and custom resources
  OpenShiftCluster-->>olmSmokeVerify: return resource states
  GitHubActions->>OpenShiftCluster: run operator-sdk scorecard
  alt workflow fails
    GitHubActions->>olmSmokeDiagnostics: collect diagnostics
    olmSmokeDiagnostics->>OpenShiftCluster: query logs, events, and OLM resources
    OpenShiftCluster-->>olmSmokeDiagnostics: return diagnostic output
  end
Loading

Suggested reviewers: missxiaoguo, donpenney

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description check ✅ Passed The description clearly states the purpose, validation scope, implementation approach, affected files, references, triggers, and test plan.
Title check ✅ Passed The title clearly identifies the proof-of-concept OLM smoke test and its GitHub Actions implementation.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

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

@sebrandon1
sebrandon1 force-pushed the add-olm-smoke-test branch 2 times, most recently from e275e27 to 5aa6b28 Compare July 31, 2026 14:31

@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: 3

🤖 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 @.github/scripts/olm-smoke-verify.sh:
- Around line 70-77: Scope all operator resource commands to ${NAMESPACE}: add
the namespace option to the singleton oc wait and oc get commands in
.github/scripts/olm-smoke-verify.sh lines 70-77, both oc apply commands in
.github/scripts/olm-smoke-verify.sh lines 82-104, and the IBU oc describe
command in .github/scripts/olm-smoke-diagnostics.sh lines 23-24.

In @.github/workflows/olm-smoke-test.yml:
- Around line 33-48: Update the Checkout step to set persist-credentials to
false while retaining submodules: true, preventing PR-controlled make and shell
steps from accessing the checkout token. If authenticated submodules require
credentials, configure SSH-based submodule authentication instead.
- Around line 82-96: Update the “Start OpenShift cluster” workflow step to
verify or establish that quick-ocp preloads the bundle image at the same
internal registry path used by “Install operator via OLM.” Add a diagnostic or
bridge step that confirms the expected
image-registry.openshift-image-registry.svc:5000/openshift/${BUNDLE_IMG_NAME}:${IMG_TAG}
reference, creating the required ImageStream when necessary before running
operator-sdk.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 88973a3f-0b44-465c-910f-81b425a57510

📥 Commits

Reviewing files that changed from the base of the PR and between a7b93d4 and 5aa6b28.

📒 Files selected for processing (3)
  • .github/scripts/olm-smoke-diagnostics.sh
  • .github/scripts/olm-smoke-verify.sh
  • .github/workflows/olm-smoke-test.yml

Comment thread .github/scripts/olm-smoke-verify.sh
Comment thread .github/workflows/olm-smoke-test.yml
Comment thread .github/workflows/olm-smoke-test.yml

@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 @.github/workflows/olm-smoke-test.yml:
- Around line 92-96: Update the namespace creation command before the
operator-sdk run bundle step to propagate failures from oc create namespace,
while explicitly treating only an already-existing namespace as success. Do not
retain the unconditional || true suppression; ensure API, authentication,
validation, and other creation errors terminate the workflow.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 75f95571-c5b2-44c5-addb-294de47f7ca9

📥 Commits

Reviewing files that changed from the base of the PR and between 5aa6b28 and 9eaa311.

📒 Files selected for processing (3)
  • .github/scripts/olm-smoke-diagnostics.sh
  • .github/scripts/olm-smoke-verify.sh
  • .github/workflows/olm-smoke-test.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/scripts/olm-smoke-verify.sh

Comment thread .github/workflows/olm-smoke-test.yml
@sebrandon1

Copy link
Copy Markdown
Contributor Author

/retest

@sebrandon1
sebrandon1 force-pushed the add-olm-smoke-test branch 2 times, most recently from 8cb80ad to 69e9932 Compare August 17, 2026 19:58
@sebrandon1

Copy link
Copy Markdown
Contributor Author

/retest

@openshift-ci

openshift-ci Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

@sebrandon1: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/ci-job 2b2f81f link true /test ci-job
ci/prow/ipc-e2e-flow-v6v4 2b2f81f link false /test ipc-e2e-flow-v6v4
ci/prow/ipc-e2e-flow-v4v6 2b2f81f link false /test ipc-e2e-flow-v4v6

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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant