Skip to content

step-registry/telco5g-ptp-tests: refactor for readability - #82741

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
jzding:ptp-ci-repo-vars
Aug 14, 2026
Merged

step-registry/telco5g-ptp-tests: refactor for readability#82741
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
jzding:ptp-ci-repo-vars

Conversation

@jzding

@jzding jzding commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Refactor telco5g-ptp-tests-commands.sh for developer usability without changing test behavior.

Changes

  • Centralized configuration — all overridable env vars (T5CI_VERSION, TEST_REPO, PTP_REPO, TEST_MODES, etc.) in a single CONFIGURATION section at the top with reference tables
  • Extracted build logic — the 80-line bash script previously nested inside pod YAML is now build_script() and build_pod_definition() functions
  • Explicit test mode arrays — replaced fragile array removal with per-version TEST_MODES arrays
  • Info logs[INFO] markers at each major phase for easier log navigation
  • Early exit on pod failure — builder pod polling loop now breaks immediately on Failed status instead of wasting 12 minutes polling a dead pod

What did NOT change

  • Registry login logic (preserved verbatim from the original)
  • podman push commands
  • Go version selection (still golang-1.22.4 for 4.16+, golang-1.20 for 4.12-4.15)
  • Test execution flow and conformance test invocation

Developer usage

Test from a fork without editing the CI script:

export TEST_REPO=https://github.com/myuser/ptp-operator.git
export TEST_BRANCH=my-fix
export PTP_REPO=https://github.com/myuser/ptp-operator.git
export PTP_UNDER_TEST_BRANCH=my-fix

Verification

  • make update passes
  • bash -n syntax check passes
  • Registry login code is identical to current main
  • Go version selection is identical to current main
  • Builder pod succeeds (image build + push) in rehearsal

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The Telco5G PTP workflow centralizes release and repository settings, separates image-build logic, adds explicit execution stages, supports Go 1.25, and updates the telco runner image with a stable OpenShift client URL.

Changes

Telco5G PTP test workflow

Layer / File(s) Summary
Configuration and image preparation
ci-operator/step-registry/telco5g/ptp/tests/telco5g-ptp-tests-commands.sh, clusters/app.ci/supplemental-ci-images/telco-runner.yaml
The script centralizes release, repository, event, image, and test-mode settings. Image builds use generated scripts and pod definitions. The runner image uses the stable OpenShift client URL and installs Go 1.25.0.
Test pipeline stages
ci-operator/step-registry/telco5g/ptp/tests/telco5g-ptp-tests-commands.sh
The workflow adds explicit configuration, pre-flight, deployment, event-enablement, conformance-test, setup, and test-run stages. Release 5 and later runs use Go 1.25.
Result aggregation and cleanup
ci-operator/step-registry/telco5g/ptp/tests/telco5g-ptp-tests-commands.sh
The workflow aggregates per-mode results, publishes results, collects artifacts, and performs cleanup before undeploying the operator.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

  • openshift/release#81254: Both changes configure the conformance-test repository and test settings in telco5g-ptp-tests-commands.sh.

Suggested labels: rehearsals-ack

Suggested reviewers: stbenjam, neisw


Important

Pre-merge checks failed

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

❌ Failed checks (1 error, 1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Container-Privileges ❌ Error The generated builder Pod sets securityContext.privileged: true and the script grants the privileged SCC before applying the manifest. Remove privileged mode and privileged SCC access; use a rootless or otherwise minimally privileged image-building approach with only required capabilities.
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Stable And Deterministic Test Names ❓ Inconclusive The PR changes CI orchestration, while the referenced Ginkgo test source is external; the repository does not contain the test declarations needed to verify title stability. Provide the changed Ginkgo test source or the exact external test revision so its It/Describe/Context/When titles can be checked.
✅ Passed checks (12 passed)
Check name Status Explanation
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.
Test Structure And Quality ✅ Passed The PR changes only a Bash CI harness and an image YAML; no Ginkgo test source, It blocks, or Ginkgo assertions are present to review.
Microshift Test Compatibility ✅ Passed This PR modifies CI infrastructure files (shell scripts and BuildConfig YAML) but does not add new Ginkgo e2e tests, so the MicroShift Test Compatibility check does not apply.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo e2e tests are added in this PR. Changes are to CI infrastructure scripts and image configuration only.
Topology-Aware Scheduling Compatibility ✅ Passed The PR adds no topology, affinity, replica, PDB, or toleration constraints. The existing worker selector is unchanged from the baseline; the generated builder Pod has no scheduling constraints.
Ote Binary Stdout Contract ✅ Passed The PR changes only a shell script and YAML; it adds no Go files or OTE entrypoints such as main, TestMain, BeforeSuite, or RunSpecs.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Custom check is not applicable. This PR modifies CI infrastructure files (Bash script, YAML image configuration) only. No Ginkgo e2e test code is added or modified.
No-Weak-Crypto ✅ Passed The changed PTP script and telco-runner YAML contain no MD5, SHA-1, DES, RC4, Blowfish, ECB, custom crypto, or secret/token comparisons.
No-Sensitive-Data-In-Logs ✅ Passed The script properly disables debug logging (set +xe) before handling passwords and re-enables it afterward. Pod definitions reference secrets by name only, not content. Main script logs only safe m...
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the PTP test script and summarizes the main refactoring focus, although it does not mention the related CI image update.
✨ 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.

@openshift-ci
openshift-ci Bot requested review from neisw and stbenjam July 31, 2026 15:52
@jzding jzding changed the title step-registry: refactor PTP CI test script for readability and configurability refactor PTP CI test script for readability and configurability Jul 31, 2026
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 31, 2026

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 2

🧹 Nitpick comments (2)
ci-operator/step-registry/telco5g/ptp/tests/telco5g-ptp-tests-commands.sh (2)

14-58: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Tighten the release-matching patterns.

The patterns 4.1[2-5]+ and 4.1[6-7]+ apply + to a bracket expression and leave . unescaped. 4.1[2-5]+ therefore also matches values such as 4.152. Real release strings do not hit this today, so this is cosmetic. Anchored patterns make the intent clear.

♻️ Optional refactor
-if [[ "$T5CI_VERSION" =~ 4.1[2-5]+ ]]; then
+if [[ "$T5CI_VERSION" =~ ^4\.1[2-5]$ ]]; then
   export EVENT_API_VERSION="1.0"
 else
   export EVENT_API_VERSION="2.0"
 fi
 
-if [[ "$T5CI_VERSION" =~ 4.1[6-7]+ ]]; then
+if [[ "$T5CI_VERSION" =~ ^4\.1[6-7]$ ]]; then
🤖 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/step-registry/telco5g/ptp/tests/telco5g-ptp-tests-commands.sh`
around lines 14 - 58, Update the T5CI_VERSION checks controlling
EVENT_API_VERSION and ENABLE_V1_REGRESSION to use anchored regular expressions
with an escaped dot and exact two-digit minor versions, replacing the current
4.1[2-5]+ and 4.1[6-7]+ patterns. Preserve the existing release ranges and flag
assignments.

470-477: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use EVENT_API_VERSION in the events patch.

The configuration block exports EVENT_API_VERSION based on the release, and this block repeats the same release check with a hardcoded "2.0". The two places can drift, and an override of EVENT_API_VERSION has no effect here. Drive the patch from the exported value.

♻️ Recommended refactor
-if [[ "$T5CI_VERSION" =~ 4.1[2-5]+ ]]; then
+if [[ "${EVENT_API_VERSION}" == "1.0" ]]; then
   oc patch ptpoperatorconfigs.ptp.openshift.io default -nopenshift-ptp --patch '{"spec":{"ptpEventConfig":{"enableEventPublisher":true, "storageType":"emptyDir"}, "daemonNodeSelector": {"node-role.kubernetes.io/worker":""}}}' --type=merge
 else
-  oc patch ptpoperatorconfigs.ptp.openshift.io default -nopenshift-ptp --patch '{"spec":{"ptpEventConfig":{"enableEventPublisher":true, "apiVersion":"2.0"}, "daemonNodeSelector": {"node-role.kubernetes.io/worker":""}}}' --type=merge
+  oc patch ptpoperatorconfigs.ptp.openshift.io default -nopenshift-ptp --patch "{\"spec\":{\"ptpEventConfig\":{\"enableEventPublisher\":true, \"apiVersion\":\"${EVENT_API_VERSION}\"}, \"daemonNodeSelector\": {\"node-role.kubernetes.io/worker\":\"\"}}}" --type=merge
 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 `@ci-operator/step-registry/telco5g/ptp/tests/telco5g-ptp-tests-commands.sh`
around lines 470 - 477, Update the PTP events patch in the version-conditional
block to use the exported EVENT_API_VERSION value for apiVersion instead of
hardcoding "2.0" or repeating the release check. Preserve the existing
enableEventPublisher, storageType, and daemonNodeSelector settings.
🤖 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/step-registry/telco5g/ptp/tests/telco5g-ptp-tests-commands.sh`:
- Around line 104-119: Restore errexit after the registry-login block by
changing the final shell option command following the login fallback to
re-enable both tracing and errexit, matching the options disabled by the initial
set +xe. Keep the login logic unchanged so later build_images operations such as
git clone, make docker-build, and podman push terminate the script on failure.
- Around line 68-83: Replace the pattern-based removals in the T5CI_VERSION
branching with explicit TEST_MODES array definitions for each affected release
range. Ensure 4.12 excludes dualnicbc, 4.13–4.15 exclude dualnicbcha, and 4.19
excludes tbc, without leaving empty array elements; preserve the existing modes
for all other versions.

---

Nitpick comments:
In `@ci-operator/step-registry/telco5g/ptp/tests/telco5g-ptp-tests-commands.sh`:
- Around line 14-58: Update the T5CI_VERSION checks controlling
EVENT_API_VERSION and ENABLE_V1_REGRESSION to use anchored regular expressions
with an escaped dot and exact two-digit minor versions, replacing the current
4.1[2-5]+ and 4.1[6-7]+ patterns. Preserve the existing release ranges and flag
assignments.
- Around line 470-477: Update the PTP events patch in the version-conditional
block to use the exported EVENT_API_VERSION value for apiVersion instead of
hardcoding "2.0" or repeating the release check. Preserve the existing
enableEventPublisher, storageType, and daemonNodeSelector settings.
🪄 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: Pro Plus

Run ID: b2d9a3bb-040c-4d89-a0ad-15ce5009aa16

📥 Commits

Reviewing files that changed from the base of the PR and between 8b68748 and 484365d.

📒 Files selected for processing (1)
  • ci-operator/step-registry/telco5g/ptp/tests/telco5g-ptp-tests-commands.sh

Comment thread ci-operator/step-registry/telco5g/ptp/tests/telco5g-ptp-tests-commands.sh Outdated
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@jzding, pj-rehearse: unable to determine affected jobs. This could be due to a branch that needs to be rebased. ERROR:

couldn't prepare candidate: couldn't checkout base SHA 4313230e8bf9e7b4b849fd7e02eefbb295ffae68: error checking out "4313230e8bf9e7b4b849fd7e02eefbb295ffae68": exit status 128 fatal: unable to read tree (4313230e8bf9e7b4b849fd7e02eefbb295ffae68)

Interacting with pj-rehearse

Comment: /pj-rehearse to run up to 5 rehearsals
Comment: /pj-rehearse skip to opt-out of rehearsals
Comment: /pj-rehearse {test-name}, with each test separated by a space, to run one or more specific rehearsals
Comment: /pj-rehearse more to run up to 10 rehearsals
Comment: /pj-rehearse max to run up to 25 rehearsals
Comment: /pj-rehearse auto-ack to run up to 5 rehearsals, and add the rehearsals-ack label on success
Comment: /pj-rehearse list to get an up-to-date list of affected jobs
Comment: /pj-rehearse abort to abort all active rehearsals
Comment: /pj-rehearse network-access-allowed to allow rehearsals of tests that have the restrict_network_access field set to false. This must be executed by an openshift org member who is not the PR author

Once you are satisfied with the results of the rehearsals, comment: /pj-rehearse ack to unblock merge. When the rehearsals-ack label is present on your PR, merge will no longer be blocked by rehearsals.
If you would like the rehearsals-ack label removed, comment: /pj-rehearse reject to re-block merging.

@coderabbitai coderabbitai Bot left a comment

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.

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
`@ci-operator/step-registry/telco5g/ptp-cluster-setup/telco5g-ptp-cluster-setup-commands.sh`:
- Around line 9-10: Update the initialization near SKIP_OCP_INSTALL so it
defaults to true only when the variable is unset, preserving any explicit
caller-provided value such as "false". Keep the existing step contract default
consistent with the intended default behavior.
🪄 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: Pro Plus

Run ID: a01d4a25-66db-45ce-a39b-3327a3ad8387

📥 Commits

Reviewing files that changed from the base of the PR and between 484365d and 410dce3.

📒 Files selected for processing (2)
  • ci-operator/step-registry/telco5g/ptp-cluster-setup/telco5g-ptp-cluster-setup-commands.sh
  • ci-operator/step-registry/telco5g/ptp/tests/telco5g-ptp-tests-commands.sh
🚧 Files skipped from review as they are similar to previous changes (1)
  • ci-operator/step-registry/telco5g/ptp/tests/telco5g-ptp-tests-commands.sh

@jzding

jzding commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

/pj-rehearse periodic-ci-openshift-release-main-nightly-5.0-e2e-telco5g-ptp

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

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

@jzding
jzding force-pushed the ptp-ci-repo-vars branch from 64c11f4 to dfc7d31 Compare July 31, 2026 16:13
@jzding

jzding commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

/pj-rehearse periodic-ci-openshift-release-main-nightly-5.0-e2e-telco5g-ptp

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

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

@jzding
jzding force-pushed the ptp-ci-repo-vars branch from dfc7d31 to 388de10 Compare July 31, 2026 22:54
@openshift-ci openshift-ci Bot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 31, 2026
@jzding jzding changed the title refactor PTP CI test script for readability and configurability step-registry/telco-runner: refactor PTP CI script, add local runner, add Go 1.25.0 Jul 31, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@jzding, pj-rehearse: unable to determine affected jobs. This could be due to a branch that needs to be rebased. ERROR:

could not determine changed registry steps: could not load step registry: file /var/tmp/gitrepo2099262355/ci-operator/step-registry/telco5g/ptp/tests/Dockerfile.telco-runner has incorrect prefix. Prefix should be telco5g-ptp-tests
Interacting with pj-rehearse

Comment: /pj-rehearse to run up to 5 rehearsals
Comment: /pj-rehearse skip to opt-out of rehearsals
Comment: /pj-rehearse {test-name}, with each test separated by a space, to run one or more specific rehearsals
Comment: /pj-rehearse more to run up to 10 rehearsals
Comment: /pj-rehearse max to run up to 25 rehearsals
Comment: /pj-rehearse auto-ack to run up to 5 rehearsals, and add the rehearsals-ack label on success
Comment: /pj-rehearse list to get an up-to-date list of affected jobs
Comment: /pj-rehearse abort to abort all active rehearsals
Comment: /pj-rehearse network-access-allowed to allow rehearsals of tests that have the restrict_network_access field set to false. This must be executed by an openshift org member who is not the PR author

Once you are satisfied with the results of the rehearsals, comment: /pj-rehearse ack to unblock merge. When the rehearsals-ack label is present on your PR, merge will no longer be blocked by rehearsals.
If you would like the rehearsals-ack label removed, comment: /pj-rehearse reject to re-block merging.

@jzding
jzding force-pushed the ptp-ci-repo-vars branch 2 times, most recently from 5c347c8 to 0dd5802 Compare July 31, 2026 23:03
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@jzding, pj-rehearse: unable to determine affected jobs. This could be due to a branch that needs to be rebased. ERROR:

could not determine changed registry steps: could not load step registry: file /var/tmp/gitrepo3021920126/ci-operator/step-registry/telco5g/ptp/tests/Dockerfile.telco-runner has incorrect prefix. Prefix should be telco5g-ptp-tests
Interacting with pj-rehearse

Comment: /pj-rehearse to run up to 5 rehearsals
Comment: /pj-rehearse skip to opt-out of rehearsals
Comment: /pj-rehearse {test-name}, with each test separated by a space, to run one or more specific rehearsals
Comment: /pj-rehearse more to run up to 10 rehearsals
Comment: /pj-rehearse max to run up to 25 rehearsals
Comment: /pj-rehearse auto-ack to run up to 5 rehearsals, and add the rehearsals-ack label on success
Comment: /pj-rehearse list to get an up-to-date list of affected jobs
Comment: /pj-rehearse abort to abort all active rehearsals
Comment: /pj-rehearse network-access-allowed to allow rehearsals of tests that have the restrict_network_access field set to false. This must be executed by an openshift org member who is not the PR author

Once you are satisfied with the results of the rehearsals, comment: /pj-rehearse ack to unblock merge. When the rehearsals-ack label is present on your PR, merge will no longer be blocked by rehearsals.
If you would like the rehearsals-ack label removed, comment: /pj-rehearse reject to re-block merging.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@jzding, pj-rehearse: unable to determine affected jobs. This could be due to a branch that needs to be rebased. ERROR:

could not determine changed registry steps: could not load step registry: file /var/tmp/gitrepo3856425217/ci-operator/step-registry/telco5g/ptp/tests/Dockerfile.telco-runner has incorrect prefix. Prefix should be telco5g-ptp-tests
Interacting with pj-rehearse

Comment: /pj-rehearse to run up to 5 rehearsals
Comment: /pj-rehearse skip to opt-out of rehearsals
Comment: /pj-rehearse {test-name}, with each test separated by a space, to run one or more specific rehearsals
Comment: /pj-rehearse more to run up to 10 rehearsals
Comment: /pj-rehearse max to run up to 25 rehearsals
Comment: /pj-rehearse auto-ack to run up to 5 rehearsals, and add the rehearsals-ack label on success
Comment: /pj-rehearse list to get an up-to-date list of affected jobs
Comment: /pj-rehearse abort to abort all active rehearsals
Comment: /pj-rehearse network-access-allowed to allow rehearsals of tests that have the restrict_network_access field set to false. This must be executed by an openshift org member who is not the PR author

Once you are satisfied with the results of the rehearsals, comment: /pj-rehearse ack to unblock merge. When the rehearsals-ack label is present on your PR, merge will no longer be blocked by rehearsals.
If you would like the rehearsals-ack label removed, comment: /pj-rehearse reject to re-block merging.

@jzding
jzding force-pushed the ptp-ci-repo-vars branch from 0dd5802 to 57d500d Compare July 31, 2026 23:08
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@jzding, pj-rehearse: unable to determine affected jobs. This could be due to a branch that needs to be rebased. ERROR:

could not determine changed registry steps: could not load step registry: file /var/tmp/gitrepo2922732659/ci-operator/step-registry/telco5g/ptp/tests/Dockerfile.telco-runner has incorrect prefix. Prefix should be telco5g-ptp-tests
Interacting with pj-rehearse

Comment: /pj-rehearse to run up to 5 rehearsals
Comment: /pj-rehearse skip to opt-out of rehearsals
Comment: /pj-rehearse {test-name}, with each test separated by a space, to run one or more specific rehearsals
Comment: /pj-rehearse more to run up to 10 rehearsals
Comment: /pj-rehearse max to run up to 25 rehearsals
Comment: /pj-rehearse auto-ack to run up to 5 rehearsals, and add the rehearsals-ack label on success
Comment: /pj-rehearse list to get an up-to-date list of affected jobs
Comment: /pj-rehearse abort to abort all active rehearsals
Comment: /pj-rehearse network-access-allowed to allow rehearsals of tests that have the restrict_network_access field set to false. This must be executed by an openshift org member who is not the PR author

Once you are satisfied with the results of the rehearsals, comment: /pj-rehearse ack to unblock merge. When the rehearsals-ack label is present on your PR, merge will no longer be blocked by rehearsals.
If you would like the rehearsals-ack label removed, comment: /pj-rehearse reject to re-block merging.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
ci-operator/step-registry/telco5g/ptp/tests/Dockerfile.telco-runner (1)

39-46: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Add a non-root USER before WORKDIR.

This image has no USER directive, so containers run as root by default. Trivy confirms this (Image user should not be 'root'). run-in-container.sh (this same PR) launches this image directly with local/remote podman run, without an OpenShift SCC to reassign the UID, so the root default is a real, live effect here, not just theoretical.

The fix_uid.sh script and chmod -R g+rwx calls already prepare the image for OpenShift's arbitrary-UID model. Add an explicit non-root USER anyway: OpenShift's restricted SCC still overrides the UID (while keeping GID 0), so this does not break that model, and it gives a safe default for direct podman/docker run usage.

As per path instructions, **/{Dockerfile,Containerfile}* requires "USER non-root; never run as root."

🔒 Proposed fix
 oc version --client
 
+USER 1001
 WORKDIR /output
🤖 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/step-registry/telco5g/ptp/tests/Dockerfile.telco-runner` around
lines 39 - 46, Add an explicit non-root USER directive in the Dockerfile before
WORKDIR, using the image’s existing arbitrary-UID/OpenShift compatibility setup
rather than root. Preserve the current installation and permission behavior
while ensuring direct podman or docker execution does not default to root.

Sources: Path instructions, Linters/SAST tools

🤖 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/step-registry/telco5g/ptp/tests/Dockerfile.telco-runner`:
- Around line 21-43: Update the Go archive installation loop to download the
official Go checksum file and verify each go${version}.linux-amd64.tar.gz with
sha256sum before tar extraction, failing on mismatches. Update the OpenShift
client installation block to download the stable directory’s sha256sum.txt and
validate openshift-client-linux.tar.gz before unpacking; retain cleanup and
existing installation behavior after successful verification.

In `@ci-operator/step-registry/telco5g/ptp/tests/run-in-container.sh`:
- Around line 92-96: Replace the predictable PID-based REMOTE_BUILD_DIR
assignment in the USE_REMOTE branch with a securely created temporary directory
using mktemp -d on the remote host, and capture the resulting path for
subsequent scp and ssh commands. Apply the same change to the corresponding
remote build block also referenced by the comment, preserving cleanup after the
container build.

In `@ci-operator/step-registry/telco5g/ptp/tests/telco5g-ptp-tests-commands.sh`:
- Around line 474-478: Update the event-patch conditional to branch on the
already computed EVENT_API_VERSION instead of re-matching T5CI_VERSION. Preserve
the existing patch payloads: use storageType emptyDir for the 1.0 event API
configuration and apiVersion 2.0 for the alternate configuration, while keeping
the daemonNodeSelector unchanged.
- Around line 122-176: Avoid embedding repository URLs and branch names directly
in the generated script. Pass PTP_REPO, PTP_UNDER_TEST_BRANCH, DAEMON_REPO, and
CEP_REPO through the privileged build pod environment, then update the git clone
commands in the PTP, linuxptp-daemon, and cloud-event-proxy build flow to use
quoted shell variables while preserving the existing branch selection behavior.

---

Outside diff comments:
In `@ci-operator/step-registry/telco5g/ptp/tests/Dockerfile.telco-runner`:
- Around line 39-46: Add an explicit non-root USER directive in the Dockerfile
before WORKDIR, using the image’s existing arbitrary-UID/OpenShift compatibility
setup rather than root. Preserve the current installation and permission
behavior while ensuring direct podman or docker execution does not default to
root.
🪄 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: Pro Plus

Run ID: 655a6879-82f3-4287-8777-62f9a3da49b5

📥 Commits

Reviewing files that changed from the base of the PR and between 410dce3 and 388de10.

📒 Files selected for processing (4)
  • ci-operator/step-registry/telco5g/ptp/tests/Dockerfile.telco-runner
  • ci-operator/step-registry/telco5g/ptp/tests/run-in-container.sh
  • ci-operator/step-registry/telco5g/ptp/tests/telco5g-ptp-tests-commands.sh
  • clusters/app.ci/supplemental-ci-images/telco-runner.yaml

Comment thread ci-operator/step-registry/telco5g/ptp/tests/Dockerfile.telco-runner Outdated
Comment thread ci-operator/step-registry/telco5g/ptp/tests/run-in-container.sh Outdated
Comment thread ci-operator/step-registry/telco5g/ptp/tests/telco5g-ptp-tests-commands.sh Outdated

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 4

🧹 Nitpick comments (1)
clusters/app.ci/supplemental-ci-images/telco-runner.yaml (1)

40-40: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Consider pinning to a patched Go 1.25.x release instead of 1.25.0.

Go 1.25.0 is valid, but several point releases after it (1.25.1 through at least 1.25.12) ship security fixes to net/http, crypto/tls, crypto/x509, and other packages. Since this image builds and runs test tooling, using an exact 1.25.0 tag forgoes those fixes.

♻️ Proposed change
-      RUN for version in 1.19 1.20 1.21.11 1.22.4 1.25.0; do \
+      RUN for version in 1.19 1.20 1.21.11 1.22.4 1.25.8; do \
🤖 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 `@clusters/app.ci/supplemental-ci-images/telco-runner.yaml` at line 40, Update
the Go version list in the RUN loop to replace 1.25.0 with a patched Go 1.25.x
point release, while preserving the existing versions and loop structure.
🤖 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/step-registry/telco5g/ptp/tests/Dockerfile.telco-runner`:
- Around line 3-9: Add a repository-approved non-root USER to the Dockerfile
after all root-only setup, ensuring the final image does not run as UID 0.
Before switching users, create and grant that user access to /go/.cache and all
required GOPATH paths, including any paths used by /output/fix_uid.sh; retain
root only for setup steps.
- Line 25: Update the chmod command in the Dockerfile’s Go toolchain setup to
remove group write permission, keeping `/usr/local/${version}/go`
read/execute-only. Grant write access only to the required output and cache
directories, preserving the root filesystem as read-only where possible.

In `@ci-operator/step-registry/telco5g/ptp/tests/run-in-container.sh`:
- Around line 244-252: Update both container-run paths in run-in-container.sh,
including the ssh-wrapped podman invocation and the local podman invocation, so
non-zero test exits are captured in status without being terminated by set -e.
Preserve the subsequent artifact copy-back, Results summary, and exit "$status"
flow for both success and failure outcomes.
- Around line 168-196: Replace the runtime sed-based patching in the
entrypoint-generation logic, including the SKIP_BUILD, SKIP_DEPLOY, SKIP_WAIT,
and TEST_MODES override blocks, with a stable interface for controlling the
commands script. Pass skip and test-mode settings through explicit environment
variables or arguments consumed by the target script, or invoke stable
functions/options directly, so behavior does not depend on matching exact
command text such as build_images, sleep 300, deployment anchors, or the
TEST_MODES array.

---

Nitpick comments:
In `@clusters/app.ci/supplemental-ci-images/telco-runner.yaml`:
- Line 40: Update the Go version list in the RUN loop to replace 1.25.0 with a
patched Go 1.25.x point release, while preserving the existing versions and loop
structure.
🪄 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: Pro Plus

Run ID: 4f8337b4-683e-43a6-89b9-d9d2a6eada0e

📥 Commits

Reviewing files that changed from the base of the PR and between 388de10 and 57d500d.

📒 Files selected for processing (3)
  • ci-operator/step-registry/telco5g/ptp/tests/Dockerfile.telco-runner
  • ci-operator/step-registry/telco5g/ptp/tests/run-in-container.sh
  • clusters/app.ci/supplemental-ci-images/telco-runner.yaml

Comment thread ci-operator/step-registry/telco5g/ptp/tests/Dockerfile.telco-runner Outdated
Comment thread ci-operator/step-registry/telco5g/ptp/tests/Dockerfile.telco-runner Outdated
Comment thread ci-operator/step-registry/telco5g/ptp/tests/run-in-container.sh Outdated
Comment thread ci-operator/step-registry/telco5g/ptp/tests/run-in-container.sh Outdated
@jzding
jzding force-pushed the ptp-ci-repo-vars branch from 57d500d to db07978 Compare August 4, 2026 14:11
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@jzding, pj-rehearse: unable to determine affected jobs. This could be due to a branch that needs to be rebased. ERROR:

could not determine changed registry steps: could not load step registry: file /var/tmp/gitrepo4126200944/ci-operator/step-registry/telco5g/ptp/tests/Dockerfile.telco-runner has incorrect prefix. Prefix should be telco5g-ptp-tests
Interacting with pj-rehearse

Comment: /pj-rehearse to run up to 5 rehearsals
Comment: /pj-rehearse skip to opt-out of rehearsals
Comment: /pj-rehearse {test-name}, with each test separated by a space, to run one or more specific rehearsals
Comment: /pj-rehearse more to run up to 10 rehearsals
Comment: /pj-rehearse max to run up to 25 rehearsals
Comment: /pj-rehearse auto-ack to run up to 5 rehearsals, and add the rehearsals-ack label on success
Comment: /pj-rehearse list to get an up-to-date list of affected jobs
Comment: /pj-rehearse abort to abort all active rehearsals
Comment: /pj-rehearse network-access-allowed to allow rehearsals of tests that have the restrict_network_access field set to false. This must be executed by an openshift org member who is not the PR author

Once you are satisfied with the results of the rehearsals, comment: /pj-rehearse ack to unblock merge. When the rehearsals-ack label is present on your PR, merge will no longer be blocked by rehearsals.
If you would like the rehearsals-ack label removed, comment: /pj-rehearse reject to re-block merging.

@jzding
jzding force-pushed the ptp-ci-repo-vars branch from db07978 to 9dd5708 Compare August 4, 2026 14:16
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@jzding, pj-rehearse: unable to determine affected jobs. This could be due to a branch that needs to be rebased. ERROR:

could not determine changed registry steps: could not load step registry: file /var/tmp/gitrepo2753584083/ci-operator/step-registry/telco5g/ptp/tests/Dockerfile.telco-runner has incorrect prefix. Prefix should be telco5g-ptp-tests
Interacting with pj-rehearse

Comment: /pj-rehearse to run up to 5 rehearsals
Comment: /pj-rehearse skip to opt-out of rehearsals
Comment: /pj-rehearse {test-name}, with each test separated by a space, to run one or more specific rehearsals
Comment: /pj-rehearse more to run up to 10 rehearsals
Comment: /pj-rehearse max to run up to 25 rehearsals
Comment: /pj-rehearse auto-ack to run up to 5 rehearsals, and add the rehearsals-ack label on success
Comment: /pj-rehearse list to get an up-to-date list of affected jobs
Comment: /pj-rehearse abort to abort all active rehearsals
Comment: /pj-rehearse network-access-allowed to allow rehearsals of tests that have the restrict_network_access field set to false. This must be executed by an openshift org member who is not the PR author

Once you are satisfied with the results of the rehearsals, comment: /pj-rehearse ack to unblock merge. When the rehearsals-ack label is present on your PR, merge will no longer be blocked by rehearsals.
If you would like the rehearsals-ack label removed, comment: /pj-rehearse reject to re-block merging.

@jzding
jzding force-pushed the ptp-ci-repo-vars branch from 9dd5708 to 6c09daa Compare August 4, 2026 14:27
@jzding

jzding commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

/pj-rehearse periodic-ci-openshift-release-main-nightly-5.0-e2e-telco5g-ptp-upstream

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

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

@jzding jzding changed the title step-registry/telco-runner: refactor PTP CI script, add Go 1.25.0 step-registry/telco5g-ptp-tests: refactor for readability Aug 12, 2026
@jzding
jzding force-pushed the ptp-ci-repo-vars branch 2 times, most recently from 21df9a1 to 9c4a2e9 Compare August 13, 2026 00:38
@jzding

jzding commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

/pj-rehearse periodic-ci-openshift-release-main-nightly-5.0-e2e-telco5g-ptp-upstream

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

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

@jzding

jzding commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

/pj-rehearse periodic-ci-openshift-release-main-nightly-4.22-e2e-telco5g-ptp

@jzding

jzding commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

/pj-rehearse periodic-ci-openshift-release-main-nightly-4.22-e2e-telco5g-ptp

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@jzding: your /pj-rehearse request was not processed because the request waited in queue for longer than 5 minutes. Please retry in a few minutes.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

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

Refactor telco5g-ptp-tests-commands.sh for developer usability:

- Centralize all overridable env vars in a CONFIGURATION section at the
  top (T5CI_VERSION, TEST_REPO, PTP_REPO, TEST_MODES, etc.)
- Extract the 80-line build script from inline pod YAML into a
  build_script() function; separate pod YAML into build_pod_definition()
- Replace fragile array removal (${arr[@]/pattern}) with explicit
  per-version TEST_MODES arrays and reference tables
- Add info logs marking the start of each major step
- Break builder pod polling loop on Failed status (was wasting 12 min
  polling a dead pod, hiding the actual error behind log truncation)

No changes to registry login, podman push, Go version selection, or
test execution logic. Developers can now customize CI runs from a fork
without editing the script by exporting TEST_REPO, PTP_REPO, etc.

Signed-off-by: Jack Ding <jacding@redhat.com>
Signed-off-by: Jack Ding <jackding@gmail.com>
@jzding

jzding commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

/pj-rehearse periodic-ci-openshift-release-main-nightly-4.22-e2e-telco5g-ptp

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@jzding: pj-rehearse could not automatically process this event because the request waited in queue for longer than 5 minutes. Use /pj-rehearse to trigger rehearsals manually.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

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

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

[REHEARSALNOTIFIER]
@jzding: the pj-rehearse plugin accommodates running rehearsal tests for the changes in this PR. Expand 'Interacting with pj-rehearse' for usage details. The following rehearsable tests have been affected by this change:

Test name Repo Type Reason
periodic-ci-openshift-release-main-nightly-4.20-e2e-telco5g-ptp N/A periodic Registry content changed
periodic-ci-openshift-release-main-nightly-5.1-e2e-telco5g-ptp N/A periodic Registry content changed
periodic-ci-openshift-release-main-nightly-5.1-e2e-telco5g-ptp-upstream N/A periodic Registry content changed
periodic-ci-openshift-release-main-nightly-5.0-e2e-telco5g-ptp N/A periodic Registry content changed
periodic-ci-openshift-release-main-nightly-5.0-e2e-telco5g-ptp-upstream N/A periodic Registry content changed
periodic-ci-openshift-release-main-nightly-4.22-e2e-telco5g-ptp N/A periodic Registry content changed
Interacting with pj-rehearse

Comment: /pj-rehearse to run up to 5 rehearsals
Comment: /pj-rehearse skip to opt-out of rehearsals
Comment: /pj-rehearse {test-name}, with each test separated by a space, to run one or more specific rehearsals
Comment: /pj-rehearse more to run up to 10 rehearsals
Comment: /pj-rehearse max to run up to 25 rehearsals
Comment: /pj-rehearse auto-ack to run up to 5 rehearsals, and add the rehearsals-ack label on success
Comment: /pj-rehearse list to get an up-to-date list of affected jobs
Comment: /pj-rehearse abort to abort all active rehearsals
Comment: /pj-rehearse network-access-allowed to allow rehearsals of tests that have the restrict_network_access field set to false. This must be executed by an openshift org member who is not the PR author

Once you are satisfied with the results of the rehearsals, comment: /pj-rehearse ack to unblock merge. When the rehearsals-ack label is present on your PR, merge will no longer be blocked by rehearsals.
If you would like the rehearsals-ack label removed, comment: /pj-rehearse reject to re-block merging.

@jzding

jzding commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

/pj-rehearse ack

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

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

@openshift-merge-bot openshift-merge-bot Bot added the rehearsals-ack Signifies that rehearsal jobs have been acknowledged label Aug 13, 2026
@jzding

jzding commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

/pj-rehearse periodic-ci-openshift-release-main-nightly-5.0-e2e-telco5g-ptp-upstream

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

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

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 14, 2026
@openshift-ci

openshift-ci Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: edcdavid, jzding

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

@openshift-ci

openshift-ci Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

@jzding: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/rehearse/periodic-ci-openshift-release-main-nightly-5.0-e2e-telco5g-ptp dfc7d31 link unknown /pj-rehearse periodic-ci-openshift-release-main-nightly-5.0-e2e-telco5g-ptp
ci/rehearse/periodic-ci-openshift-release-main-nightly-4.22-e2e-telco5g-ptp c41f55a link unknown /pj-rehearse periodic-ci-openshift-release-main-nightly-4.22-e2e-telco5g-ptp
ci/rehearse/periodic-ci-openshift-release-main-nightly-5.0-e2e-telco5g-ptp-upstream c41f55a link unknown /pj-rehearse periodic-ci-openshift-release-main-nightly-5.0-e2e-telco5g-ptp-upstream

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.

@openshift-merge-bot
openshift-merge-bot Bot merged commit 9881ff5 into openshift:main Aug 14, 2026
10 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. rehearsals-ack Signifies that rehearsal jobs have been acknowledged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants