Skip to content

OSAC-1675: Make e2e workflow reusable across repos - #84

Merged
eliorerz merged 2 commits into
osac-project:mainfrom
eliorerz:OSAC-1675-shared-e2e-workflow
Jun 22, 2026
Merged

eliorerz merged 2 commits into
osac-project:mainfrom
eliorerz:OSAC-1675-shared-e2e-workflow

Conversation

@eliorerz

@eliorerz eliorerz commented Jun 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add image-overrides and installer-ref inputs to the shared e2e.yml workflow, enabling cross-repo callers to swap PR images via Helm --set flags and test installer branch changes
  • Merge CI workflow steps into logical groups (OSAC-1676): cluster prep, boot, and teardown steps consolidated from 13 to 10

Test plan

  • Verify workflow_dispatch still works with default inputs (no image overrides)
  • Test cross-repo call from fulfillment-service with image-overrides input
  • Confirm installer-ref correctly clones the specified branch of osac-installer

Summary by CodeRabbit

  • New Features

    • End-to-end testing workflow now accepts configurable inputs for custom installer branch selection and container image overrides via JSON for enhanced deployment flexibility.
  • Improvements

    • Refactored cluster environment preparation by consolidating setup steps for improved organization and maintainability.
    • Enhanced resource cleanup and teardown procedures ensuring comprehensive removal of artifacts and temporary resources with improved reliability.

@openshift-ci-robot

openshift-ci-robot commented Jun 22, 2026 •

Copy link
Copy Markdown

@eliorerz: This pull request references OSAC-1675 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

  • Add image-overrides and installer-ref inputs to the shared e2e.yml workflow, enabling cross-repo callers to swap PR images via Helm --set flags and test installer branch changes
  • Merge CI workflow steps into logical groups (OSAC-1676): cluster prep, boot, and teardown steps consolidated from 13 to 10

Test plan

  • Verify workflow_dispatch still works with default inputs (no image overrides)
  • Test cross-repo call from fulfillment-service with image-overrides input
  • Confirm installer-ref correctly clones the specified branch of osac-installer

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci

openshift-ci Bot commented Jun 22, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: eliorerz

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

@coderabbitai

coderabbitai Bot commented Jun 22, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@eliorerz, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 58 minutes and 44 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: osac-project/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: e1713f54-59ed-45ee-b200-30025942107e

📥 Commits

Reviewing files that changed from the base of the PR and between fd738a2 and 6be92e7.

📒 Files selected for processing (2)
  • .github/workflows/e2e-test.yml
  • .github/workflows/e2e.yml

Walkthrough

The PR adds installer-ref and image-overrides inputs to the reusable e2e.yml workflow. These are threaded into the OSAC deploy step, where a conditional Helm upgrade applies image overrides. Cluster setup steps are consolidated into one step, teardown is merged into a single always-on step, and e2e-test.yml is fixed to read inputs from the correct context.

Changes

E2E Workflow Enhancements

Layer / File(s) Summary
New workflow_call inputs and caller input context fix
.github/workflows/e2e.yml, .github/workflows/e2e-test.yml
Adds installer-ref (default "main") and image-overrides (default "{}") to e2e.yml's workflow_call inputs. Fixes e2e-test.yml to pass test-suite/test-filter from inputs.* instead of github.event.inputs.*.
Cluster setup step consolidation
.github/workflows/e2e.yml
Merges the standalone "Pull or update cluster flavor" and "Clean up stale clone resources" steps into a single "Prepare cluster environment" step, removing the separate kubeconfig ownership step.
OSAC deploy: installer-ref branch and conditional Helm image override
.github/workflows/e2e.yml
Threads INSTALLER_REF and IMAGE_OVERRIDES into the deploy step env, passes --branch to the osac-installer git clone, and adds a jq/yq/helm block that conditionally runs helm upgrade with --set flags derived from the JSON override map.
Teardown step consolidation
.github/workflows/e2e.yml
Replaces the separate "Destroy cluster clone" and "Clean up" steps with a single always-on Teardown step that inlines cluster destruction and temporary file removal.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • osac-project/osac-test-infra#72: Originally introduced the e2e-test.yml wiring that passed test-suite/test-filter via github.event.inputs.*, which this PR corrects to inputs.*.
  • osac-project/osac-test-infra#76: Modified the same e2e-test.yml→e2e.yml plumbing for test-suite/test-filter and the reusable workflow_call interface.

Suggested labels

lgtm, approved

Suggested reviewers

  • jhernand
  • larsks

Poem

🔧 Two new inputs join the fray,
installer-ref and overrides at play.
Helm upgrades only when you say,
Teardown merged to save the day.
One step cluster, clean and gay! 🎉


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (2 errors, 1 warning)

Check name Status Explanation Resolution
No-Injection-Vectors ❌ Error Code contains argument injection vulnerability: user-provided image-overrides JSON flows through jq into unquoted shell variables (key, value) used in helm command without validation or proper quot... Use bash array instead of string accumulation, validate keys don't start with dash, quote array properly: SET_ARGS=() with while loop, key validation, and "${SET_ARGS[@]}" in helm call.
No-Sensitive-Data-In-Logs ❌ Error Line 251 logs image override values without masking: echo " --set ${key}=${value}". Image refs passed via the image-overrides input could contain embedded credentials, registry URLs, or other s... Apply ::add-mask:: to each override value before logging, or remove the debug echo statements. Example: echo "::add-mask::${value}" and echo " --set ${key}=${value##*:}" to log only partial info if debugging is needed.
Ai-Attribution ⚠️ Warning Commit fd738a2 includes Claude AI configuration files (.claude/ dirs) and AI-generated summaries but lacks Assisted-by/Generated-by trailers required by Red Hat attribution policy. Add proper attribution trailer to commit message: e.g., 'Assisted-by: Claude noreply@anthropic.com' or similar per Red Hat policy.
✅ Passed checks (8 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main objective: making the e2e workflow reusable across repositories, which aligns with the primary changes of adding workflow inputs and consolidating steps.
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.
No-Hardcoded-Secrets ✅ Passed No hardcoded secrets found. PR adds two workflow inputs with safe defaults: image-overrides={} and installer-ref=main. No credentials, tokens, API keys, passwords, base64 strings >32 chars, or URLs...
No-Weak-Crypto ✅ Passed The PR modifies GitHub Actions workflow files. No weak cryptographic algorithms (MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB) or custom crypto implementations are used. The only crypto-related operati...
Container-Privileges ✅ Passed PR only modifies GitHub Actions workflow files, not container/K8s manifests. No privileged container settings, hostPID, hostNetwork, hostIPC, SYS_ADMIN, or allowPrivilegeEscalation found.
✨ 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 and usage tips.

@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/e2e.yml:
- Around line 241-262: The SET_ARGS variable is built by string concatenation,
which causes argument injection risks (malicious keys could inject arbitrary
Helm flags) and word-splitting issues (values with spaces break into separate
arguments). Convert SET_ARGS from a string to a bash array by initializing it as
SET_ARGS=() at the start, then in the loop where you currently append to
SET_ARGS="${SET_ARGS} --set ${key}=${value}", instead append array elements
using SET_ARGS+=("--set" "${key}=${value}"), and finally when passing it to the
helm upgrade command on the line with --set flags, expand it safely as
"${SET_ARGS[@]}" instead of the unquoted ${SET_ARGS}.
🪄 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: osac-project/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: c5e9947e-15a9-4f50-ae5c-644059cb8da0

📥 Commits

Reviewing files that changed from the base of the PR and between cc015dc and fd738a2.

📒 Files selected for processing (2)
  • .github/workflows/e2e-test.yml
  • .github/workflows/e2e.yml

Comment thread .github/workflows/e2e.yml
Comment on lines +241 to +262
# Apply image overrides via helm upgrade --set flags.
# Callers pass a JSON object mapping Helm value paths to image refs,
# e.g. '{"service.images.service":"ghcr.io/repo:pr-42"}'.
# If empty or '{}', this is a no-op.
if [[ -n "${IMAGE_OVERRIDES}" ]] && [[ "${IMAGE_OVERRIDES}" != "{}" ]]; then
echo "Applying image overrides..."
SET_ARGS=""
for key in $(echo "${IMAGE_OVERRIDES}" | jq -r 'keys[]'); do
value=$(echo "${IMAGE_OVERRIDES}" | jq -r --arg k "${key}" '.[$k]')
SET_ARGS="${SET_ARGS} --set ${key}=${value}"
echo " --set ${key}=${value}"
done

yq -i '(.dependencies[].version) = "0.0.0"' charts/osac/Chart.yaml
helm dependency update charts/osac/
helm upgrade osac charts/osac/ \
--namespace "${INSTALLER_NAMESPACE}" \
--values "${VALUES_FILE}" \
${SET_ARGS} \
--timeout 10m \
--wait
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Argument injection and word-splitting risks in Helm override parsing.

The current approach has two issues:

  1. Argument injection via keys: A malicious JSON key like {"--values /etc/passwd": "x"} would produce --set --values /etc/passwd=x, allowing arbitrary Helm flags to be injected.

  2. Word splitting on values: Since ${SET_ARGS} is expanded unquoted (line 259), values containing spaces break into separate arguments, causing incorrect Helm behavior.

Consider using an array to safely accumulate arguments:

🔒 Proposed fix using bash array for safe argument handling
          if [[ -n "${IMAGE_OVERRIDES}" ]] && [[ "${IMAGE_OVERRIDES}" != "{}" ]]; then
            echo "Applying image overrides..."
-           SET_ARGS=""
-           for key in $(echo "${IMAGE_OVERRIDES}" | jq -r 'keys[]'); do
-             value=$(echo "${IMAGE_OVERRIDES}" | jq -r --arg k "${key}" '.[$k]')
-             SET_ARGS="${SET_ARGS} --set ${key}=${value}"
-             echo "  --set ${key}=${value}"
+           SET_ARGS=()
+           while IFS= read -r key; do
+             value=$(echo "${IMAGE_OVERRIDES}" | jq -r --arg k "${key}" '.[$k]')
+             # Validate key doesn't start with - to prevent argument injection
+             if [[ "${key}" == -* ]]; then
+               echo "ERROR: Invalid override key '${key}' - keys cannot start with -" >&2
+               exit 1
+             fi
+             SET_ARGS+=(--set "${key}=${value}")
+             echo "  --set ${key}=${value}"
-           done
+           done < <(echo "${IMAGE_OVERRIDES}" | jq -r 'keys[]')

            yq -i '(.dependencies[].version) = "0.0.0"' charts/osac/Chart.yaml
            helm dependency update charts/osac/
            helm upgrade osac charts/osac/ \
              --namespace "${INSTALLER_NAMESPACE}" \
              --values "${VALUES_FILE}" \
-             ${SET_ARGS} \
+             "${SET_ARGS[@]}" \
              --timeout 10m \
              --wait
          fi
🤖 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 @.github/workflows/e2e.yml around lines 241 - 262, The SET_ARGS variable is
built by string concatenation, which causes argument injection risks (malicious
keys could inject arbitrary Helm flags) and word-splitting issues (values with
spaces break into separate arguments). Convert SET_ARGS from a string to a bash
array by initializing it as SET_ARGS=() at the start, then in the loop where you
currently append to SET_ARGS="${SET_ARGS} --set ${key}=${value}", instead append
array elements using SET_ARGS+=("--set" "${key}=${value}"), and finally when
passing it to the helm upgrade command on the line with --set flags, expand it
safely as "${SET_ARGS[@]}" instead of the unquoted ${SET_ARGS}.

Source: Coding guidelines

@eliorerz
eliorerz force-pushed the OSAC-1675-shared-e2e-workflow branch from fd738a2 to 866788d Compare June 22, 2026 17:16
@eliorerz
eliorerz force-pushed the OSAC-1675-shared-e2e-workflow branch from 866788d to 9ff7366 Compare June 22, 2026 18:20
eliorerz added 2 commits June 22, 2026 14:21
Add image-overrides and installer-ref inputs to the shared e2e.yml
so component repos can call it cross-repo with PR images swapped in
via Helm --set flags. Add nightly schedule trigger to e2e-test.yml.
Consolidate related steps to reduce noise in the GH Actions UI:
- Cluster prep: merge config check, flavor pull, stale cleanup into "Prepare cluster environment"
- Boot: absorb kubeconfig ownership fix into "Boot cluster clone"
- Teardown: merge clone destroy and temp file cleanup into "Teardown"

Reduces step count from 13 to 10 with no behavioral changes.
@eliorerz
eliorerz force-pushed the OSAC-1675-shared-e2e-workflow branch from 9ff7366 to 6be92e7 Compare June 22, 2026 18:21
@eliorerz
eliorerz merged commit ba9ad48 into osac-project:main Jun 22, 2026
4 of 6 checks passed
@eliorerz
eliorerz deleted the OSAC-1675-shared-e2e-workflow branch June 22, 2026 18:54

This branch was previously deployed

1 inactive deployment
e2e-test — 6be92e73 Deployed Jun 22, 2026 by eliorerz via e2e-vmaas / e2e #64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants