[ROSAENG-1371] chore: migrate e2e build infrastructure to boilerplate#247
Conversation
|
/hold |
WalkthroughThe PR removes the e2e Makefile include and deletes the old e2e make fragment. It also updates the cluster-run instructions to create required secrets, render the shared template with ChangesE2E build and deployment cleanup
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: TheUndeadKing The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #247 +/- ##
=======================================
Coverage 55.67% 55.67%
=======================================
Files 23 23
Lines 1895 1895
=======================================
Hits 1055 1055
Misses 785 785
Partials 55 55 🚀 New features to boost your workflow:
|
|
/unhold |
|
/hold |
|
/unhold |
|
/label tide/merge-method-squash |
There was a problem hiding this comment.
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 `@test/e2e/E2E.md`:
- Around line 234-252: The secret creation steps in the E2E docs currently use
one-time `oc create secret generic`, so refreshing `$(ocm token)` later does not
update the in-cluster secret. Update the secret management instructions around
the OCM credentials flow to use an idempotent `oc apply` or `oc replace` pattern
for the relevant secret, or revise the token-refresh note to explicitly tell
users to recreate the secret before rerunning the job; make sure the guidance is
consistent with the `osde2e-ocm-credentials` and `osde2e-aws-credentials` setup.
🪄 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: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 9d6a9eba-92a4-4b3e-aadd-3ff7a8ce8e8f
📒 Files selected for processing (1)
test/e2e/E2E.md
| 1. **Create required secrets in your target namespace** (e.g., `ocm-agent-e2e`): | ||
|
|
||
| 1. **Set environment variables**: | ||
| ```bash | ||
| export TEST_IMAGE="quay.io/your-org/ocm-agent-e2e" | ||
| export IMAGE_TAG="latest" | ||
| export OCM_E2E_TOKEN=$(ocm token) | ||
| export AWS_ACCESS_KEY_ID="your-access-key" | ||
| export AWS_SECRET_ACCESS_KEY="your-secret-key" | ||
| export REGION="us-east-1" | ||
| export CLUSTER_ID="your-cluster-id" | ||
| export OSD_ENV="stage" | ||
| # Create OCM credentials secret | ||
| oc create secret generic osde2e-ocm-credentials \ | ||
| -n ocm-agent-e2e \ | ||
| --from-literal=config.ocm.token=$(ocm token) \ | ||
| --from-literal=config.cluster.id=${CLUSTER_ID} \ | ||
| --from-literal=config.cluster.skipProvision=true \ | ||
| --as backplane-cluster-admin | ||
|
|
||
| # Create AWS credentials secret | ||
| oc create secret generic osde2e-aws-credentials \ | ||
| -n ocm-agent-e2e \ | ||
| --from-literal=config.aws.accessKeyId=${AWS_ACCESS_KEY_ID} \ | ||
| --from-literal=config.aws.secretAccessKey=${AWS_SECRET_ACCESS_KEY} \ | ||
| --from-literal=config.cloudProvider.region=${AWS_REGION} \ | ||
| --from-literal=config.cluster.id=${CLUSTER_ID} \ | ||
| --as backplane-cluster-admin |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Make the token-refresh path update the secret, not just the local shell.
The note at Line 282 suggests rerunning $(ocm token), but these oc create secret generic steps only create the secret once. After expiry, this flow still leaves the old token in-cluster, so the job keeps failing. Please switch the secret step to an idempotent oc apply/oc replace flow, or update the note to tell users to recreate the secret before reapplying the job.
Suggested fix
- oc create secret generic osde2e-ocm-credentials \
- -n ocm-agent-e2e \
- --from-literal=config.ocm.token=$(ocm token) \
- --from-literal=config.cluster.id=${CLUSTER_ID} \
- --from-literal=config.cluster.skipProvision=true \
- --as backplane-cluster-admin
+ oc create secret generic osde2e-ocm-credentials \
+ -n ocm-agent-e2e \
+ --from-literal=config.ocm.token=$(ocm token) \
+ --from-literal=config.cluster.id=${CLUSTER_ID} \
+ --from-literal=config.cluster.skipProvision=true \
+ --dry-run=client -o yaml \
+ | oc apply --as backplane-cluster-admin -n ocm-agent-e2e -f -Also applies to: 278-283
🤖 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 `@test/e2e/E2E.md` around lines 234 - 252, The secret creation steps in the E2E
docs currently use one-time `oc create secret generic`, so refreshing `$(ocm
token)` later does not update the in-cluster secret. Update the secret
management instructions around the OCM credentials flow to use an idempotent `oc
apply` or `oc replace` pattern for the relevant secret, or revise the
token-refresh note to explicitly tell users to recreate the secret before
rerunning the job; make sure the guidance is consistent with the
`osde2e-ocm-credentials` and `osde2e-aws-credentials` setup.
|
@TheUndeadKing: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. |
|
/lgtm |
What type of PR is this?
cleanup
What this PR does / why we need it?
Background:
After enabling boilerplate conventions in commit f448559, the project now automatically includes
boilerplate/openshift/golang-osd-e2e/project.mkandstandard.mkviaboilerplate/generated-includes.mk.However, the repository still contained local copies of these files that were either duplicating or overriding the boilerplate-provided functionality.
Changes:
test/e2e/project.mk- duplicate of boilerplate's version with custom variable names (E2E_SUITE_IMAGE_*vs standardE2E_IMAGE_*)test/e2e/e2e-image-job.yaml- custom job definition, no longer referenced by CI/CDtest/e2e/e2e-template.yml- stale boilerplate-generated copy (the live version is inboilerplate/openshift/golang-osd-e2e/)include test/e2e/project.mkfrom Makefile - redundant since boilerplate already provides thistest/e2e/E2E.mddocumentation to reference the boilerplate template pathWhat now uses boilerplate:
make e2e-binary-build- buildse2e.testbinarymake e2e-image-build-push- builds and pushes e2e container imageE2E_IMAGE_REGISTRY,E2E_IMAGE_REPOSITORY,E2E_IMAGE_NAME,E2E_IMAGE_TAGboilerplate/openshift/golang-osd-e2e/e2e-template.ymlWhich Jira/Github issue(s) this PR fixes?
Fixes # ROSAENG-1371
Special notes for your reviewer:
Pre-checks (if applicable):
make generatecommand locally to validate code changesSummary by CodeRabbit
Documentation
oc processandoc apply, including creation of required credential secrets and injection of environment variables into the generated manifest.Chores