Skip to content

vcf migration unit tests#78875

Open
jcpowermac wants to merge 1 commit intoopenshift:mainfrom
jcpowermac:vcf-migration-operator
Open

vcf migration unit tests#78875
jcpowermac wants to merge 1 commit intoopenshift:mainfrom
jcpowermac:vcf-migration-operator

Conversation

@jcpowermac
Copy link
Copy Markdown
Contributor

@jcpowermac jcpowermac commented May 5, 2026

Summary by CodeRabbit

  • Chores
    • Switched CI to build from source using a Dockerfile-based workflow, simplifying and standardizing the build process for more consistent, reproducible operator builds.
  • Tests
    • Added a CI test step that runs the project's test suite during the build, improving early regression detection and overall code quality verification.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

Walkthrough

Switches CI from an image-stream Golang tag to a repository-sourced binary build (adds binary_build_commands: make build, build_root.from_repository: true), maps the build output to Dockerfile target vcf-migration-operator, and adds a make test unit test step.

Changes

Build and Test Configuration

Layer / File(s) Summary
Data Shape / Top-level build flags
ci-operator/config/openshift/vcf-migration-operator/openshift-vcf-migration-operator-main.yaml
Adds binary_build_commands: make build and build_root.from_repository: true; removes build_root.image_stream_tag referencing golang-1.25.
Image mapping / Build wiring
ci-operator/config/openshift/vcf-migration-operator/openshift-vcf-migration-operator-main.yaml
Adds images.items entry with dockerfile_path: Dockerfile and to: vcf-migration-operator to map build output.
Tests / Execution wiring
ci-operator/config/openshift/vcf-migration-operator/openshift-vcf-migration-operator-main.yaml
Adds tests: section with an unit job that runs make test in a container from: src.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 11 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'vcf migration unit tests' is vague and doesn't clearly convey the main change, which is configuring CI to build from Dockerfile and run unit tests. Consider a more specific title like 'Add Dockerfile-based build and unit tests to VCF migration operator CI config' to better describe the actual changes made.
✅ Passed checks (11 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.
Stable And Deterministic Test Names ✅ Passed No Ginkgo test code is present in this PR. It modifies only CI configuration YAML files. The check for stable test names is not applicable to CI orchestration configs.
Test Structure And Quality ✅ Passed This PR modifies OpenShift CI configuration files only. No Ginkgo test code is included in this PR for review. The test code referenced in the CI config exists in the source repository.
Microshift Test Compatibility ✅ Passed No Ginkgo e2e tests added. PR contains only CI config and unit test references. Custom check not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo e2e tests are added in this PR. The PR only modifies CI configuration to run make test (unit tests) from the source repository. SNO compatibility check applies only to new e2e tests.
Topology-Aware Scheduling Compatibility ✅ Passed PR only modifies CI build config files, not deployment manifests, operator code, or controllers. No scheduling constraints introduced.
Ote Binary Stdout Contract ✅ Passed PR contains only CI YAML configuration with no test code. OTE stdout checks apply to test implementations, not CI infrastructure. Not applicable to this PR.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR modifies only CI operator YAML configuration. No Ginkgo e2e test code (It, Describe, Context, When patterns) is added. The custom check applies only to new test code, which is absent here.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 5, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jcpowermac

The full list of commands accepted by this bot can be found here.

The pull request process is described 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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 5, 2026
@openshift-ci openshift-ci Bot requested review from AnnaZivkovic and rvanderp3 May 5, 2026 20:29
@openshift-merge-bot openshift-merge-bot Bot added the rehearsals-ack Signifies that rehearsal jobs have been acknowledged label May 5, 2026
@jcpowermac jcpowermac force-pushed the vcf-migration-operator branch from 0eda6fa to 314278f Compare May 5, 2026 20:46
@openshift-merge-bot
Copy link
Copy Markdown
Contributor

@jcpowermac, pj-rehearse: unable to determine affected jobs. This could be due to a branch that needs to be rebased. ERROR:

couldn't prepare candidate: couldn't checkout base SHA 9987e7de06a317afa7c5e8e0796125e2097c51b5: error checking out "9987e7de06a317afa7c5e8e0796125e2097c51b5": exit status 128 fatal: unable to read tree (9987e7de06a317afa7c5e8e0796125e2097c51b5)

Interacting with pj-rehearse

Comment: /pj-rehearse to run up to 5 rehearsals
Comment: /pj-rehearse skip to opt-out of rehearsals
Comment: /pj-rehearse {test-name}, with each test separated by a space, to run one or more specific rehearsals
Comment: /pj-rehearse more to run up to 10 rehearsals
Comment: /pj-rehearse max to run up to 25 rehearsals
Comment: /pj-rehearse auto-ack to run up to 5 rehearsals, and add the rehearsals-ack label on success
Comment: /pj-rehearse list to get an up-to-date list of affected jobs
Comment: /pj-rehearse abort to abort all active rehearsals
Comment: /pj-rehearse network-access-allowed to allow rehearsals of tests that have the restrict_network_access field set to false. This must be executed by an openshift org member who is not the PR author

Once you are satisfied with the results of the rehearsals, comment: /pj-rehearse ack to unblock merge. When the rehearsals-ack label is present on your PR, merge will no longer be blocked by rehearsals.
If you would like the rehearsals-ack label removed, comment: /pj-rehearse reject to re-block merging.

@jcpowermac jcpowermac force-pushed the vcf-migration-operator branch from 314278f to 3233b05 Compare May 5, 2026 20:49
@openshift-merge-bot openshift-merge-bot Bot removed the rehearsals-ack Signifies that rehearsal jobs have been acknowledged label May 5, 2026
@jcpowermac jcpowermac force-pushed the vcf-migration-operator branch from 3233b05 to ed594e5 Compare May 5, 2026 21:06
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

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
`@ci-operator/config/openshift/vcf-migration-operator/openshift-vcf-migration-operator-main.yaml`:
- Around line 1-3: The change sets build_root.from_repository: true which
requires a .ci-operator.yaml in the openshift/vcf-migration-operator repo
defining build_root_image; to fix, either add a .ci-operator.yaml to that
repository with a build_root_image entry before this PR lands, or revert the
pipeline config to use build_root: { image_stream_tag: <appropriate tag> }
instead of from_repository: true so the job doesn't depend on a repo file;
update the binary_build_commands only if the chosen build_root (repository image
vs image_stream_tag) requires different build steps.
🪄 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: 6753fc32-bfa6-4922-8cd2-6ca4aebf8e5a

📥 Commits

Reviewing files that changed from the base of the PR and between 3233b05 and ed594e5.

⛔ Files ignored due to path filters (3)
  • ci-operator/jobs/openshift/vcf-migration-operator/OWNERS is excluded by !ci-operator/jobs/**
  • ci-operator/jobs/openshift/vcf-migration-operator/openshift-vcf-migration-operator-main-postsubmits.yaml is excluded by !ci-operator/jobs/**
  • ci-operator/jobs/openshift/vcf-migration-operator/openshift-vcf-migration-operator-main-presubmits.yaml is excluded by !ci-operator/jobs/**
📒 Files selected for processing (1)
  • ci-operator/config/openshift/vcf-migration-operator/openshift-vcf-migration-operator-main.yaml

Comment on lines +1 to +3
binary_build_commands: make build
build_root:
image_stream_tag:
name: release
namespace: openshift
tag: golang-1.25
from_repository: true
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "1) Check whether source repo has required .ci-operator.yaml"
curl -sSI https://raw.githubusercontent.com/openshift/vcf-migration-operator/main/.ci-operator.yaml | head -n 1

echo
echo "2) If present, verify it defines build_root_image"
curl -fsSL https://raw.githubusercontent.com/openshift/vcf-migration-operator/main/.ci-operator.yaml \
  | grep -nE 'build_root_image|namespace|name|tag' || true

echo
echo "3) Reference docs for from_repository semantics"
echo "https://docs.ci.openshift.org/architecture/ci-operator/#build-root-image"

Repository: openshift/release

Length of output: 374


🏁 Script executed:

# Search the release repo for similar build_root.from_repository patterns
rg "from_repository:\s*true" ci-operator/config --type yaml | head -20

Repository: openshift/release

Length of output: 2455


🏁 Script executed:

# Look for any .ci-operator.yaml files in the release repo to understand the pattern
fd ".ci-operator.yaml" ci-operator/config | head -10

Repository: openshift/release

Length of output: 43


🏁 Script executed:

# Check if this specific operator config file references any dependencies or parallel work
rg "vcf-migration-operator" . --type yaml | grep -v "^Binary" | head -20

Repository: openshift/release

Length of output: 2765


🌐 Web query:

ci-operator build_root from_repository true requirements documentation

💡 Result:

In OpenShift CI Operator configuration, the build_root field defines the ImageStreamTag providing clone-time and build-time dependencies (e.g., for compiling executables or running unit tests), but not for published images. It must include git in $PATH and write permissions in /go [1][2][3]. Setting build_root: from_repository: true configures the build_root from the repository under test instead of the ci-operator config. This allows atomic changes to both code and build_root image. Requirements: - Add build_root: from_repository: true to the ci-operator config (e.g., in-repo-config.yaml). - Create a .ci-operator.yaml file in the repository root containing the ImageStreamTag definition for the build_root, e.g.: build_root_image: image_stream_tag: name: release namespace: openshift tag: golang-1.13 [1][3]. This approach is useful for repositories needing custom or version-specific build environments tied to the code [1][4].

Citations:


build_root.from_repository: true requires .ci-operator.yaml in the source repository.

Switching build_root to from_repository: true mandates that openshift/vcf-migration-operator provide a .ci-operator.yaml file in its root directory defining build_root_image. The file is currently missing (404 on raw URL), which will cause build-root resolution to fail at job execution. This config change requires either the .ci-operator.yaml to land in the source repository first, or this setting to revert to image_stream_tag.

🤖 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/config/openshift/vcf-migration-operator/openshift-vcf-migration-operator-main.yaml`
around lines 1 - 3, The change sets build_root.from_repository: true which
requires a .ci-operator.yaml in the openshift/vcf-migration-operator repo
defining build_root_image; to fix, either add a .ci-operator.yaml to that
repository with a build_root_image entry before this PR lands, or revert the
pipeline config to use build_root: { image_stream_tag: <appropriate tag> }
instead of from_repository: true so the job doesn't depend on a repo file;
update the binary_build_commands only if the chosen build_root (repository image
vs image_stream_tag) requires different build steps.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 5, 2026

@jcpowermac: 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.

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant