Skip to content

🌱 Fix experimental-to-experimental upgrade e2e to deploy baseline from main#2519

Open
perdasilva wants to merge 1 commit intooperator-framework:mainfrom
perdasilva:fixup-exp2exp-upgrade
Open

🌱 Fix experimental-to-experimental upgrade e2e to deploy baseline from main#2519
perdasilva wants to merge 1 commit intooperator-framework:mainfrom
perdasilva:fixup-exp2exp-upgrade

Conversation

@perdasilva
Copy link
Contributor

@perdasilva perdasilva commented Feb 19, 2026

The ex2ex upgrade test was using the latest release as the baseline, but experimental features may not exist in any published release. Deploy from origin/main instead, so the upgrade path tests main -> PR for experimental manifests.

  • Add hack/test/deploy-from-main.sh to build and deploy from main
  • Add run-main-experimental Makefile target that invokes the new script
  • Add TEST_UPGRADE_EX2EX_E2E_TASKS that uses run-main-experimental
  • Wire test-upgrade-ex2ex-e2e to the new task list

Description

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

…main

The ex2ex upgrade test was using the latest release as the baseline, but
experimental features may not exist in any published release. Deploy from
origin/main instead, so the upgrade path tests main -> PR for experimental
manifests.

- Add hack/test/deploy-from-main.sh to build and deploy from main
- Add run-main-experimental Makefile target that invokes the new script
- Add TEST_UPGRADE_EX2EX_E2E_TASKS that uses run-main-experimental
- Wire test-upgrade-ex2ex-e2e to the new task list

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 19, 2026 14:56
@netlify
Copy link

netlify bot commented Feb 19, 2026

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit a2e4a91
🔍 Latest deploy log https://app.netlify.com/projects/olmv1/deploys/69973b68e453c20008ba2ca9
😎 Deploy Preview https://deploy-preview-2519--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@openshift-ci
Copy link

openshift-ci bot commented Feb 19, 2026

[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 tmshort 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

@perdasilva perdasilva changed the title Fix experimental-to-experimental upgrade e2e to deploy baseline from … 🌱 Fix experimental-to-experimental upgrade e2e to deploy baseline from … Feb 19, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the experimental-to-experimental (ex2ex) upgrade end-to-end test to use the main branch as the baseline instead of the latest release. This is necessary because experimental features being tested may not exist in any published release yet, making the upgrade path main → PR more appropriate than latest-release → PR.

Changes:

  • Add hack/test/deploy-from-main.sh script to build and deploy from the main branch
  • Add run-main-experimental Makefile target to invoke the new script
  • Create TEST_UPGRADE_EX2EX_E2E_TASKS variable with the updated task sequence
  • Update test-upgrade-ex2ex-e2e target to use the new task list instead of the standard upgrade tasks

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
hack/test/deploy-from-main.sh New script that checks out origin/main, builds images with 'main' tag, and deploys experimental manifests as baseline for upgrade testing
Makefile Adds run-main-experimental target, defines TEST_UPGRADE_EX2EX_E2E_TASKS, and updates test-upgrade-ex2ex-e2e to use main branch baseline instead of latest release

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings February 19, 2026 15:14
@perdasilva perdasilva changed the title 🌱 Fix experimental-to-experimental upgrade e2e to deploy baseline from … 🌱 Fix experimental-to-experimental upgrade e2e to deploy baseline from main Feb 19, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

trap cleanup EXIT
# Build images from main with a distinct tag so the upgrade
# (which uses the default 'devel' tag) triggers a real rollout
echo "Building images from main with tag '${MAIN_TAG}'"
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

MAIN_TAG is only echoed but never actually applied to the build/deploy. As written, make run-experimental will use the default IMAGE_TAG=devel and render manifests with :devel, so the baseline and the upgrade will both reference the same tag and may not trigger a rollout. Pass/ export IMAGE_TAG=${MAIN_TAG} and override the Helm values for options.{operatorController,catalogd}.deployment.image (or otherwise ensure the manifest deployed from main uses :main).

Suggested change
echo "Building images from main with tag '${MAIN_TAG}'"
echo "Building images from main with tag '${MAIN_TAG}'"
export IMAGE_TAG="${MAIN_TAG}"

Copilot uses AI. Check for mistakes.
Comment on lines 16 to 27
# Save current HEAD so we can return after building from main
CURRENT_REF=$(git rev-parse HEAD)
cleanup() {
echo "Returning to ${CURRENT_REF}"
git checkout -f "${CURRENT_REF}"
}

# Fetch and checkout main
echo "Fetching and checking out origin/main"
git fetch origin main
git checkout FETCH_HEAD

Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

This script force-checkouts different refs (git checkout FETCH_HEAD / git checkout -f ...), which will discard any local uncommitted changes and can also leave a developer in a detached HEAD when it returns. Consider guarding with a clean-worktree check (and failing fast if dirty) or using git worktree in a temp dir, and restore the original branch via git symbolic-ref when available.

Copilot uses AI. Check for mistakes.
# Build images from main with a distinct tag so the upgrade
# (which uses the default 'devel' tag) triggers a real rollout
echo "Building images from main with tag '${MAIN_TAG}'"
make run-experimental
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

Calling make run-experimental here deletes/recreates the kind cluster and re-runs docker-build/kind-load/kind-deploy/lint/wait via run-internal, which overlaps with the later upgrade task list (kind-cluster, docker-build, kind-load, kind-deploy). This makes the upgrade flow slower and harder to reason about; consider invoking a narrower set of make targets that only deploy the baseline to the existing cluster (and uses the distinct baseline tag).

Suggested change
make run-experimental
IMAGE_TAG="${MAIN_TAG}" make docker-build kind-load kind-deploy

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I was afraid of this. I wasn't sure that would work, but it did seem kinda excessive. The mechanism described above would probably work.

@codecov
Copy link

codecov bot commented Feb 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.49%. Comparing base (af6733e) to head (c78b25c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2519      +/-   ##
==========================================
- Coverage   69.51%   69.49%   -0.03%     
==========================================
  Files         103      103              
  Lines        8516     8516              
==========================================
- Hits         5920     5918       -2     
- Misses       2128     2129       +1     
- Partials      468      469       +1     
Flag Coverage Δ
e2e 45.79% <ø> (-0.03%) ⬇️
experimental-e2e 12.76% <ø> (ø)
unit 57.94% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tmshort
Copy link
Contributor

tmshort commented Feb 19, 2026

I'm thinking checking out and comparing to main is a bit too much of a PITA... perhaps removing is the approach?

@perdasilva perdasilva force-pushed the fixup-exp2exp-upgrade branch from 9ffce16 to c78b25c Compare February 19, 2026 16:11
Copilot AI review requested due to automatic review settings February 19, 2026 16:33
@perdasilva perdasilva force-pushed the fixup-exp2exp-upgrade branch from c78b25c to a2e4a91 Compare February 19, 2026 16:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

# CATD_IMAGE_REPO - catalogd image repository

MAIN_TAG=main

Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

The script uses KIND_CLUSTER_NAME, OPCON_IMAGE_REPO, and CATD_IMAGE_REPO but does not validate that these required environment variables are set. If any are missing, the script will fail with unclear error messages. Following the pattern used in other scripts like hack/tools/update-tls-profiles.sh and hack/test/pre-upgrade-setup.sh, add validation checks after this line to verify all required variables are set before proceeding.

Suggested change
# Validate required environment variables
: "${KIND_CLUSTER_NAME:?Environment variable KIND_CLUSTER_NAME must be set}"
: "${OPCON_IMAGE_REPO:?Environment variable OPCON_IMAGE_REPO must be set}"
: "${CATD_IMAGE_REPO:?Environment variable CATD_IMAGE_REPO must be set}"

Copilot uses AI. Check for mistakes.
echo "Loading images and deploying experimental manifests from main"
make kind-load IMAGE_TAG="${MAIN_TAG}"
make kind-deploy \
SOURCE_MANIFEST=manifests/experimental.yaml \
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

Consider using the Makefile's EXPERIMENTAL_MANIFEST variable instead of hardcoding "manifests/experimental.yaml". While both currently resolve to the same path, using the variable would ensure consistency with other parts of the codebase and make the script more resilient to future changes in manifest organization. The variable would need to be exported from the Makefile or passed as an argument.

Suggested change
SOURCE_MANIFEST=manifests/experimental.yaml \
SOURCE_MANIFEST="${EXPERIMENTAL_MANIFEST:-manifests/experimental.yaml}" \

Copilot uses AI. Check for mistakes.
MAIN_TAG=main

# Save current HEAD so we can return after building from main
CURRENT_REF=$(git rev-parse HEAD)
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

The cleanup function uses 'git checkout -f' which will discard any uncommitted changes in the working directory when returning to the original ref. This could cause unexpected data loss if the script is run in a dirty working directory. Consider checking for uncommitted changes before proceeding, or at minimum document this behavior in the script comments so users are aware of this side effect.

Suggested change
CURRENT_REF=$(git rev-parse HEAD)
CURRENT_REF=$(git rev-parse HEAD)
# NOTE: The cleanup step uses 'git checkout -f' to ensure we always return
# to the original ref. This will discard any uncommitted changes in the
# working directory when the script exits.

Copilot uses AI. Check for mistakes.
make kind-load IMAGE_TAG="${MAIN_TAG}"
make kind-deploy \
SOURCE_MANIFEST=manifests/experimental.yaml \
MANIFEST=operator-controller-experimental.yaml \
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

Consider using the Makefile's EXPERIMENTAL_RELEASE_MANIFEST variable instead of hardcoding "operator-controller-experimental.yaml". While both currently resolve to the same filename, using the variable would ensure consistency with other parts of the codebase and make the script more resilient to future changes in manifest naming conventions. The variable would need to be exported from the Makefile or passed as an argument.

Suggested change
MANIFEST=operator-controller-experimental.yaml \
MANIFEST="${EXPERIMENTAL_RELEASE_MANIFEST:-operator-controller-experimental.yaml}" \

Copilot uses AI. Check for mistakes.
@tmshort
Copy link
Contributor

tmshort commented Feb 19, 2026

I approved #2518 2518

@pedjak
Copy link
Contributor

pedjak commented Feb 19, 2026

#2513 would fail with this change either.

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.

3 participants

Comments