Skip to content

fetch-payloads: resolve stale Pending jobs against Prow - #481

Merged
openshift-merge-bot[bot] merged 3 commits into
openshift-eng:mainfrom
stbenjam:fix-stale-pending-jobs
May 18, 2026
Merged

openshift-merge-bot[bot] merged 3 commits into
openshift-eng:mainfrom
stbenjam:fix-stale-pending-jobs

Conversation

@stbenjam

@stbenjam stbenjam commented May 18, 2026

Copy link
Copy Markdown
Member

Summary

  • The release controller can leave blocking jobs stuck as Pending after a payload reaches a terminal state (Accepted/Rejected), even though the actual Prow job has completed
  • This caused the payload analysis skill to skip those jobs entirely — they appeared still running
  • When a payload is terminal, fetch_payloads.py now cross-checks any Pending jobs by fetching their prowjob.json from GCS to get the real state
  • Example: gcp-ovn-rt-upgrade-4.20-minor in 4.20.0-0.nightly-2026-05-18-050422 was reported as Pending by the release controller but had actually failed in Prow

Test plan

  • Verified against the problematic payload — script now correctly resolves gcp-ovn-rt-upgrade-4.20-minor from Pending to Failed
  • Non-terminal payloads are unaffected (cross-check only runs for Accepted/Rejected payloads)
  • If GCS artifact is unavailable, the job state is left unchanged (graceful fallback)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • More accurate job-state reporting by resolving pending jobs against Prow artifacts; improved handling/logging when states differ.
    • More robust artifact fetching with tolerant JSON fetches for transient failures.
  • Refactor

    • Consolidated job phase computation and streamlined payload construction for clearer processing.
  • Chores

    • Plugin and marketplace metadata version bumped to 0.0.41; docs metadata updated.

…payloads

The release controller can leave blocking jobs as Pending after a payload
reaches a terminal state (Accepted/Rejected). This causes the analysis
skill to skip those jobs even though they actually completed in Prow.

When a payload is terminal, cross-check any Pending jobs by fetching
their prowjob.json from GCS to get the real state. For example, a job
reported as Pending by the release controller but showing failure in
Prow will now correctly appear as Failed in the output.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-ci
openshift-ci Bot requested review from dgoodwin and mrunalp May 18, 2026 10:30
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 18, 2026
@coderabbitai

coderabbitai Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 2ded30fb-22c1-4a5f-be3e-eb65a44ed83c

📥 Commits

Reviewing files that changed from the base of the PR and between 986de70 and 39721bd.

📒 Files selected for processing (2)
  • .claude-plugin/marketplace.json
  • docs/data.json
✅ Files skipped from review due to trivial changes (1)
  • docs/data.json

Walkthrough

Adds constants and helpers to fetch and map Prow prowjob.json artifacts, then reconciles blocking job states in payloads by querying Prow for authoritative job statuses when release-controller reports Pending.

Changes

Prow State Reconciliation

Layer / File(s) Summary
Prow state mapping constants
plugins/ci/skills/fetch-payloads/fetch_payloads.py
GCSWEB_BASE and PROW_VIEW_PREFIX enable URL translation from Prow view to GCS artifact paths. PROW_STATE_MAP maps Prow's raw job status.state values to simplified terminal phases.
State resolution helper functions
plugins/ci/skills/fetch-payloads/fetch_payloads.py
try_fetch_json() returns None on fetch or parse failure. resolve_prow_state() converts a Prow view URL to a GCS artifact URL, fetches prowjob.json, extracts the job state, and maps it through PROW_STATE_MAP.
Payload reconciliation in main loop
plugins/ci/skills/fetch-payloads/fetch_payloads.py
For Accepted and Rejected phases, any blocking job marked Pending by the release controller is queried against Prow. If a terminal state is resolved, the job's state field is overwritten, and the mismatch and resolution are logged to stderr before the payload is appended.
Plugin manifest version bump
plugins/ci/.claude-plugin/plugin.json, .claude-plugin/marketplace.json, docs/data.json
Increment plugin version from 0.0.40 to 0.0.41 in manifests and docs metadata.

Sequence Diagram(s)

sequenceDiagram
  participant FetchPayloads
  participant ReleaseController
  participant ProwGCS
  FetchPayloads->>ReleaseController: read tag and job lists (blocking/async)
  alt job state Pending
    FetchPayloads->>ProwGCS: fetch prowjob.json via GCSWEB_URL for job
    ProwGCS-->>FetchPayloads: prowjob.json with status.state
    FetchPayloads->>FetchPayloads: map status.state via PROW_STATE_MAP
    FetchPayloads->>ReleaseController: log mismatch and resolved state (stderr)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • openshift-eng/ai-helpers#337: Introduced the original fetch-payloads skill; this PR extends it with job-state resolution against Prow artifacts.

Suggested labels

lgtm

Suggested reviewers

  • dgoodwin
  • mrunalp
🚥 Pre-merge checks | ✅ 10
✅ Passed checks (10 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding Prow job state resolution for stale Pending jobs in the fetch-payloads script.
Docstring Coverage ✅ Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%.
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 Real People Names In Style References ✅ Passed No real people names in style references, commands, or documentation. Changes are purely technical functionality additions for resolving stale Pending jobs.
No Assumed Git Remote Names ✅ Passed No hardcoded git remote names ("origin" or "upstream") found. PR adds HTTP fetch logic and version bumps—no git command assumptions.
Git Push Safety Rules ✅ Passed No git push, force push, or other unsafe git operations found. PR modifies payload resolution logic and version metadata only. Complies with all push safety rules.
No Untrusted Mcp Servers ✅ Passed PR does not introduce any MCP servers from untrusted sources. Only standard library used. New code fetches internal Prow artifacts from trusted OpenShift infrastructure (GCS/Prow).
Ai-Helpers Overlap Detection ✅ Passed Check not applicable. PR modifies only implementation (.py) and metadata (.json), not the targeted documentation files (commands/.md, skills//SKILL.md, agents/*.md). SKILL.md was not modified.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 18, 2026
@openshift-ci

openshift-ci Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: petr-muller, stbenjam

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-merge-bot
openshift-merge-bot Bot merged commit a834787 into openshift-eng:main May 18, 2026
7 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants