OCPBUGS-85429: hack/update-openapi-spec: accept release image and auth via env vars - #667
OCPBUGS-85429: hack/update-openapi-spec: accept release image and auth via env vars#667jubittajohn wants to merge 1 commit into
Conversation
|
@jubittajohn: This pull request references Jira Issue OCPBUGS-85429, which is valid. 3 validation(s) were run on this bug
The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe update script now uses ChangesRelease image resolution and component extraction
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[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 |
62fe5a0 to
bfecb24
Compare
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 `@hack/update-openapi-spec.sh`:
- Around line 143-150: Make the OPENSHIFT_VERSION probe in the .ci-operator.yaml
block non-fatal under errexit and pipefail by evaluating the grep/sed assignment
within a conditional or otherwise suppressing its failure status. Preserve the
existing empty-version check so it prints the explicit error and exits when no
version is detected.
🪄 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: c509bb1d-9cda-472d-82ea-2253a4e40bad
📒 Files selected for processing (1)
hack/update-openapi-spec.sh
| if [[ -f "${SCRIPT_ROOT}/.ci-operator.yaml" ]]; then | ||
| OPENSHIFT_VERSION=$(grep -o 'openshift-[0-9]*\.[0-9]*' "${SCRIPT_ROOT}/.ci-operator.yaml" | head -1 | sed 's/openshift-//') | ||
| fi | ||
| if [[ -z "${OPENSHIFT_VERSION}" ]]; then | ||
| echo "ERROR: Could not detect OpenShift version from .ci-operator.yaml" | ||
| echo "Please set OPENSHIFT_RELEASE environment variable manually, e.g.:" | ||
| echo " OPENSHIFT_RELEASE=registry.ci.openshift.org/ocp/release:5.0 $0" | ||
| exit 1 |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
sed -n '1,30p' hack/update-openapi-spec.sh
tmp=$(mktemp)
trap 'rm -f "$tmp"' EXIT
printf '%s\n' 'tag: no-openshift-version' >"$tmp"
if bash -c '
set -o errexit
set -o pipefail
value=$(grep -o "openshift-[0-9]*\.[0-9]*" "$1" | head -1 | sed "s/openshift-//")
echo "reached explicit error handling"
' bash "$tmp"; then
echo "Probe completed."
else
echo "Probe exits before the explicit error branch."
fiRepository: openshift/openshift-apiserver
Length of output: 1292
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
sed -n '125,158p' hack/update-openapi-spec.shRepository: openshift/openshift-apiserver
Length of output: 1460
Make the version probe non-fatal.
If .ci-operator.yaml contains no matching version, errexit and pipefail terminate the script during the assignment. The explicit error message is not printed. Evaluate the assignment inside a conditional or make the probe non-fatal.
🤖 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 `@hack/update-openapi-spec.sh` around lines 143 - 150, Make the
OPENSHIFT_VERSION probe in the .ci-operator.yaml block non-fatal under errexit
and pipefail by evaluating the grep/sed assignment within a conditional or
otherwise suppressing its failure status. Preserve the existing empty-version
check so it prints the explicit error and exits when no version is detected.
The script needs a release image to extract kube-apiserver and etcd. Accept OPENSHIFT_RELEASE and REGISTRY_AUTH_FILE as env vars set by the CI job config, falling back to auto-detection from .ci-operator.yaml for local development. Signed-off-by: jubittajohn <jujohn@redhat.com>
bfecb24 to
4540ad5
Compare
|
@jubittajohn: The following tests failed, say
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. |
|
PR needs rebase. 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. |
The script needs a release image to extract kube-apiserver and etcd. Accept OPENSHIFT_RELEASE and REGISTRY_AUTH_FILE as env vars set by the CI job config, falling back to auto-detection from .ci-operator.yaml for local development.
Requires openshift/release#82636 to merge
Summary by CodeRabbit