Skip to content

Jf envar test#78870

Open
jfrazierRedHat wants to merge 2 commits intoopenshift:mainfrom
jfrazierRedHat:jf_envar_test
Open

Jf envar test#78870
jfrazierRedHat wants to merge 2 commits intoopenshift:mainfrom
jfrazierRedHat:jf_envar_test

Conversation

@jfrazierRedHat
Copy link
Copy Markdown
Contributor

@jfrazierRedHat jfrazierRedHat commented May 5, 2026

Summary by CodeRabbit

  • Tests
    • Added ROSA E2E CI job configuration to enhance test coverage for OpenShift nightly builds.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

Walkthrough

A new OpenShift ROSA E2E CI job configuration file is added that runs a test validating JOB_LINK environment variable construction and environment variable forwarding through nested podman containers.

Changes

ROSA E2E Job Link Test Configuration

Layer / File(s) Summary
Build & Base Image Setup
ci-operator/config/openshift-online/rosa-e2e/openshift-online-rosa-e2e-main__job-link-test.yaml (lines 1–24)
Configures the nested-podman base image, OCP 4.22 nightly releases, and pod resource constraints (4 GiB memory limit, 100m CPU / 200 MiB memory requests).
Test Logic
ci-operator/config/openshift-online/rosa-e2e/openshift-online-rosa-e2e-main__job-link-test.yaml (lines 24–72)
Implements job-link-envar-test: echoes Prow variables (JOB_NAME, BUILD_ID, PULL_NUMBER), conditionally constructs JOB_LINK from pull-specific or generic paths, writes environment variables to /tmp/podman.env via heredoc substitution, and runs a nested podman container with the env file to verify variable propagation.
Execution Configuration
ci-operator/config/openshift-online/rosa-e2e/openshift-online-rosa-e2e-main__job-link-test.yaml (lines 72–82)
Specifies nested-podman container source, backed volume size, interval schedule (24 hours), and generated job metadata.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Jf envar test' is vague and uses non-descriptive abbreviations that don't clearly convey the changeset's purpose, which is adding a new ROSA E2E CI job configuration. Consider using a more descriptive title like 'Add ROSA E2E job-link-test CI configuration' to clearly indicate the main change being introduced.
✅ Passed checks (4 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.

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

✨ 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.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 5, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jfrazierRedHat
Once this PR has been reviewed and has the lgtm label, please assign bmeng 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

@openshift-ci openshift-ci Bot requested review from bmeng and ravitri May 5, 2026 19:35
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

🧹 Nitpick comments (1)
ci-operator/config/openshift-online/rosa-e2e/openshift-online-rosa-e2e-main__job-link-test.yaml (1)

49-54: ⚡ Quick win

env -i bash injects unintended variables (SHLVL, PWD) into the env file

Even with env -i and --norc --noprofile, bash automatically exports SHLVL=1 and sets PWD=<cwd>. Both will appear in the env output and end up in /tmp/podman.env, forwarding them as unexpected variables into the nested container. This makes the "All environment variables" dump in Step 5 noisier than intended and the mechanism less obvious to readers.

A direct printf approach produces only the intended variables:

♻️ Simpler alternative for Step 3
-    env -i bash --norc --noprofile << EOF > /tmp/podman.env
-    export TEST_VAR="hello from env file"
-    export JOB_LINK="${JOB_LINK}"
-    env | grep -v '^_='
-    EOF
+    printf 'JOB_LINK=%s\nTEST_VAR=%s\n' \
+      "${JOB_LINK}" \
+      "hello from env file" \
+      > /tmp/podman.env
🤖 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-online/rosa-e2e/openshift-online-rosa-e2e-main__job-link-test.yaml`
around lines 49 - 54, The heredoc using "env -i bash --norc --noprofile << EOF >
/tmp/podman.env" injects unintended exports like SHLVL and PWD; replace that
block with a direct writer that emits only the intended variables (e.g., write
/tmp/podman.env via printf or cat with explicit "export TEST_VAR=...; export
JOB_LINK=\"${JOB_LINK}\"") so JOB_LINK is substituted but no shell-startup
variables are captured, and remove the "env | grep -v '^_='" line used inside
the heredoc.
🤖 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-online/rosa-e2e/openshift-online-rosa-e2e-main__job-link-test.yaml`:
- Around line 40-45: The JOB_LINK construction contains unreachable PULL_NUMBER
logic and an incorrect hardcoded repo name; either remove the dead if-block
around PULL_NUMBER in the JOB_LINK assignment inside the JOB_LINK="..." section,
or (preferably) add a presubmit job so PULL_NUMBER can be set and exercise the
pr-logs path, and while doing so fix the pr-logs path to use the correct
org_repo token "openshift-online_rosa-e2e" instead of "openshift_release" in the
branch that builds pr-logs; locate the JOB_LINK block and the conditional that
references PULL_NUMBER and update the repo token or add a presubmit trigger
alongside the existing periodic trigger to make that branch reachable.

---

Nitpick comments:
In
`@ci-operator/config/openshift-online/rosa-e2e/openshift-online-rosa-e2e-main__job-link-test.yaml`:
- Around line 49-54: The heredoc using "env -i bash --norc --noprofile << EOF >
/tmp/podman.env" injects unintended exports like SHLVL and PWD; replace that
block with a direct writer that emits only the intended variables (e.g., write
/tmp/podman.env via printf or cat with explicit "export TEST_VAR=...; export
JOB_LINK=\"${JOB_LINK}\"") so JOB_LINK is substituted but no shell-startup
variables are captured, and remove the "env | grep -v '^_='" line used inside
the heredoc.
🪄 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: ed1f7bfd-17b9-4132-aa51-d567961fd748

📥 Commits

Reviewing files that changed from the base of the PR and between 9c01821 and cc4d6d7.

⛔ Files ignored due to path filters (1)
  • ci-operator/jobs/openshift-online/rosa-e2e/openshift-online-rosa-e2e-main-periodics.yaml is excluded by !ci-operator/jobs/**
📒 Files selected for processing (1)
  • ci-operator/config/openshift-online/rosa-e2e/openshift-online-rosa-e2e-main__job-link-test.yaml

Comment on lines +40 to +45
JOB_LINK="https://prow.ci.openshift.org/view/gs/test-platform-results/"
if [ -n "${PULL_NUMBER:-}" ]; then
JOB_LINK="${JOB_LINK}pr-logs/pull/openshift_release/${PULL_NUMBER}/${JOB_NAME}/${BUILD_ID}"
else
JOB_LINK="${JOB_LINK}logs/${JOB_NAME}/${BUILD_ID}"
fi
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 | 🟡 Minor | ⚡ Quick win

PULL_NUMBER branch is unreachable, and the hardcoded repo name is wrong

Two issues in this block:

  1. Dead code: This job has interval: 24h making it periodic-only. Periodic Prow jobs never have PULL_NUMBER set, so the if [ -n "${PULL_NUMBER:-}" ] branch can never execute. The pr-logs construction logic is untested.

  2. Wrong repo name in the pr-logs path: The GCS pr-logs path format is pr-logs/pull/<org>_<repo>/.... Since this config lives in openshift-online/rosa-e2e, the path should use openshift-online_rosa-e2e, not the hardcoded openshift_release.

If testing both link-construction paths is the goal, a presubmit trigger is needed in addition to the periodic one.

🐛 Proposed fixes
-    if [ -n "${PULL_NUMBER:-}" ]; then
-      JOB_LINK="${JOB_LINK}pr-logs/pull/openshift_release/${PULL_NUMBER}/${JOB_NAME}/${BUILD_ID}"
-    else
-      JOB_LINK="${JOB_LINK}logs/${JOB_NAME}/${BUILD_ID}"
-    fi
+    if [ -n "${PULL_NUMBER:-}" ]; then
+      JOB_LINK="${JOB_LINK}pr-logs/pull/openshift-online_rosa-e2e/${PULL_NUMBER}/${JOB_NAME}/${BUILD_ID}"
+    else
+      JOB_LINK="${JOB_LINK}logs/${JOB_NAME}/${BUILD_ID}"
+    fi

To also exercise the pr-logs path, add a presubmit entry alongside the periodic trigger in the test configuration.

🤖 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-online/rosa-e2e/openshift-online-rosa-e2e-main__job-link-test.yaml`
around lines 40 - 45, The JOB_LINK construction contains unreachable PULL_NUMBER
logic and an incorrect hardcoded repo name; either remove the dead if-block
around PULL_NUMBER in the JOB_LINK assignment inside the JOB_LINK="..." section,
or (preferably) add a presubmit job so PULL_NUMBER can be set and exercise the
pr-logs path, and while doing so fix the pr-logs path to use the correct
org_repo token "openshift-online_rosa-e2e" instead of "openshift_release" in the
branch that builds pr-logs; locate the JOB_LINK block and the conditional that
references PULL_NUMBER and update the repo token or add a presubmit trigger
alongside the existing periodic trigger to make that branch reachable.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 5, 2026

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

@jfrazierRedHat
Copy link
Copy Markdown
Contributor Author

/pj-rehearse periodic-ci-openshift-online-rosa-e2e-main-job-link-test-job-link-envar-test

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

@jfrazierRedHat: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

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.

1 participant