🌱 Fix experimental-to-experimental upgrade e2e to deploy baseline from main#2519
🌱 Fix experimental-to-experimental upgrade e2e to deploy baseline from main#2519perdasilva wants to merge 1 commit intooperator-framework:mainfrom
Conversation
…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>
✅ Deploy Preview for olmv1 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
There was a problem hiding this comment.
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.shscript to build and deploy from the main branch - Add
run-main-experimentalMakefile target to invoke the new script - Create
TEST_UPGRADE_EX2EX_E2E_TASKSvariable with the updated task sequence - Update
test-upgrade-ex2ex-e2etarget 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.
There was a problem hiding this comment.
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}'" |
There was a problem hiding this comment.
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).
| echo "Building images from main with tag '${MAIN_TAG}'" | |
| echo "Building images from main with tag '${MAIN_TAG}'" | |
| export IMAGE_TAG="${MAIN_TAG}" |
| # 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 | ||
|
|
There was a problem hiding this comment.
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.
hack/test/deploy-from-main.sh
Outdated
| # 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 |
There was a problem hiding this comment.
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).
| make run-experimental | |
| IMAGE_TAG="${MAIN_TAG}" make docker-build kind-load kind-deploy |
There was a problem hiding this comment.
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 Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I'm thinking checking out and comparing to main is a bit too much of a PITA... perhaps removing is the approach? |
9ffce16 to
c78b25c
Compare
c78b25c to
a2e4a91
Compare
There was a problem hiding this comment.
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 | ||
|
|
There was a problem hiding this comment.
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.
| # 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}" |
| echo "Loading images and deploying experimental manifests from main" | ||
| make kind-load IMAGE_TAG="${MAIN_TAG}" | ||
| make kind-deploy \ | ||
| SOURCE_MANIFEST=manifests/experimental.yaml \ |
There was a problem hiding this comment.
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.
| SOURCE_MANIFEST=manifests/experimental.yaml \ | |
| SOURCE_MANIFEST="${EXPERIMENTAL_MANIFEST:-manifests/experimental.yaml}" \ |
| MAIN_TAG=main | ||
|
|
||
| # Save current HEAD so we can return after building from main | ||
| CURRENT_REF=$(git rev-parse HEAD) |
There was a problem hiding this comment.
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.
| 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. |
| make kind-load IMAGE_TAG="${MAIN_TAG}" | ||
| make kind-deploy \ | ||
| SOURCE_MANIFEST=manifests/experimental.yaml \ | ||
| MANIFEST=operator-controller-experimental.yaml \ |
There was a problem hiding this comment.
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.
| MANIFEST=operator-controller-experimental.yaml \ | |
| MANIFEST="${EXPERIMENTAL_RELEASE_MANIFEST:-operator-controller-experimental.yaml}" \ |
|
I approved #2518 2518 |
|
#2513 would fail with this change either. |
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.
Description
Reviewer Checklist