NO-JIRA: Fix docs deploy preview by replacing gh CLI with curl#8488
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@bryan-cox: This pull request explicitly references no jira issue. 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. |
|
Skipping CI for Draft Pull Request. |
📝 WalkthroughWalkthroughThe docs deployment workflow was changed to trigger on pull requests to main limited to docs/**. The “Create PR deployment status” step in the deploy job now uses GITHUB_TOKEN and event data (pull_request.number, head.sha, repository) and replaces Sequence Diagram(s)sequenceDiagram
participant Runner as GitHub Actions runner
participant Repo as Repository / PR
participant API as GitHub REST API
participant Pages as GitHub Pages preview
Runner->>Repo: pull_request event (PR number, head SHA, repo)
Runner->>Runner: construct environment name and environment_url
Runner->>API: POST /repos/{repo}/deployments (ref=head_sha, environment=docs-preview/pr-<N>) with GITHUB_TOKEN
API-->>Runner: 201 Created (response contains deployment.id)
Runner->>Runner: parse deployment.id with jq and validate numeric
Runner->>API: POST /repos/{repo}/deployments/{deployment_id}/statuses (state=success, environment_url, description)
API-->>Runner: 201 Created (status)
API-->>Repo: associate deployment & status with PR
Runner->>Pages: environment_url (preview) advertised in deployment status
Suggested reviewers
🚥 Pre-merge checks | ✅ 12✅ Passed checks (12 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bryan-cox 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 |
The arc-runner-set runners do not have gh installed, causing the deployment status step to fail with "gh: command not found". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
eefcff8 to
5084d23
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 @.github/workflows/docs-deploy.yaml:
- Around line 8-13: Remove the temporary manual test path that allows writing
deployment statuses: delete the workflow_dispatch inputs.block for test_pr
(inputs.test_pr) and remove the corresponding job/steps that perform the manual
status write (look for the test-curl job and any steps invoking curl or writing
deployment statuses), or gate them behind a non-merged/test-only branch so they
are not present in the final merge; ensure no remaining references to test_pr or
test-curl exist in the workflow (also check the remainder of the file around the
20-58 region).
🪄 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: e498cdef-1cd5-4fe4-bc1c-243c7bb1f68f
📒 Files selected for processing (1)
.github/workflows/docs-deploy.yaml
0bd26fb to
31879e0
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/docs-deploy.yaml (1)
38-44: 💤 Low valueConsider using
jqfor safer JSON construction.While the current string interpolation is safe due to prior validation of
PR_NUMBER(andHEAD_SHAbeing a hex SHA), usingjq -nfor JSON construction is more robust and prevents potential issues if validation logic changes in the future.♻️ Optional: Use jq for JSON construction
- DEPLOY_ID=$(curl -fsSL \ - -X POST \ - -H "Authorization: Bearer ${GITHUB_TOKEN}" \ - -H "Accept: application/vnd.github+json" \ - "https://api.github.com/repos/${REPO}/deployments" \ - -d '{"ref":"'"${HEAD_SHA}"'","environment":"'"${DEPLOY_ENV}"'","auto_merge":false,"required_contexts":[]}' \ - | jq -r '.id') + DEPLOY_PAYLOAD=$(jq -n \ + --arg ref "${HEAD_SHA}" \ + --arg env "${DEPLOY_ENV}" \ + '{"ref":$ref,"environment":$env,"auto_merge":false,"required_contexts":[]}') + DEPLOY_ID=$(curl -fsSL \ + -X POST \ + -H "Authorization: Bearer ${GITHUB_TOKEN}" \ + -H "Accept: application/vnd.github+json" \ + "https://api.github.com/repos/${REPO}/deployments" \ + -d "${DEPLOY_PAYLOAD}" \ + | jq -r '.id')Same pattern can be applied to the status creation curl on lines 50-55.
🤖 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/docs-deploy.yaml around lines 38 - 44, The deployment curl that builds the JSON payload into DEPLOY_ID currently uses string interpolation of HEAD_SHA/DEPLOY_ENV/REPO; replace that inline JSON construction with a safer jq-based payload using jq -n --arg HEAD_SHA "$HEAD_SHA" --arg DEPLOY_ENV "$DEPLOY_ENV" --argjson auto_merge false '{ref:$HEAD_SHA,environment:$DEPLOY_ENV,auto_merge:$auto_merge,required_contexts:[]}' (or equivalent) and pipe that to curl's -d `@-` to avoid fragile string concatenation; apply the same jq -n approach to the subsequent status-creation curl (the block around lines creating deployment status) so both payloads are built robustly.
🤖 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.
Nitpick comments:
In @.github/workflows/docs-deploy.yaml:
- Around line 38-44: The deployment curl that builds the JSON payload into
DEPLOY_ID currently uses string interpolation of HEAD_SHA/DEPLOY_ENV/REPO;
replace that inline JSON construction with a safer jq-based payload using jq -n
--arg HEAD_SHA "$HEAD_SHA" --arg DEPLOY_ENV "$DEPLOY_ENV" --argjson auto_merge
false
'{ref:$HEAD_SHA,environment:$DEPLOY_ENV,auto_merge:$auto_merge,required_contexts:[]}'
(or equivalent) and pipe that to curl's -d `@-` to avoid fragile string
concatenation; apply the same jq -n approach to the subsequent status-creation
curl (the block around lines creating deployment status) so both payloads are
built robustly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: c5f00e36-2cb3-4de9-8b1a-fc3bd0d2702f
📒 Files selected for processing (2)
.github/workflows/docs-deploy.yamldocs/content/reference/goals-and-design-invariants.md
✅ Files skipped from review due to trivial changes (1)
- docs/content/reference/goals-and-design-invariants.md
31879e0 to
5084d23
Compare
|
@bryan-cox: The following test 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. |
|
Now I have the complete picture. Let me compile the final report: Test Failure Analysis CompleteJob Information
Test Failure AnalysisErrorSummaryAll actual e2e tests passed successfully (8 of 8 specs across 3 test suites — public, private, and OAuth LB). The job was marked as failed solely because a post-phase CI infrastructure step ( Root CauseThe root cause is a transient CI infrastructure failure on the
Recommendations
Evidence
|
|
Pipeline controller notification No second-stage tests were triggered for this PR. This can happen when:
Use |
|
/verified by pre-submits |
|
@jparrill: This PR has been marked as verified by 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. |
03ea233
into
openshift:main
Summary
arc-runner-setrunners becauseghCLI is not installedgh apicalls with equivalentcurl+jqcalls which are available on all runnersTest plan
🤖 Generated with Claude Code
Summary by CodeRabbit