Repository navigation
claude: "process-konflux-prs" skill improvements #2605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8c40151
552c578
c8e939e
6cf47d7
5f2d517
f89b4a0
66ddfab
5171662
d7bb877
09bd206
a6ca028
e80b342
070f7d1
96f01e7
640f543
1f1b1b1
3202741
7bb405c
bec456c
8e8431a
14abce4
57ebb44
88ba4ec
863a611
62853f2
99eb8e2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,7 @@ | |
| # (enterprise-contract checks with NEUTRAL conclusion are excluded) | ||
| # build_checks_failed: array of names of build checks that failed (FAILURE conclusion) | ||
| # pending_checks: integer count of checks still IN_PROGRESS, QUEUED, or PENDING | ||
| # checks: raw array of all checks (name, status, conclusion, details_url); nulls filtered out | ||
| # checks: raw array of all checks (name, status, conclusion); nulls filtered out | ||
|
|
||
| set -euo pipefail | ||
|
|
||
|
|
@@ -60,38 +60,62 @@ fi | |
| # Get PR details | ||
| pr_data=$(gh pr view "$PR_NUMBER" \ | ||
| --repo "$REPO_URL" \ | ||
| --json number,title,state,labels,statusCheckRollup,baseRefName) | ||
| --json number,title,state,labels,statusCheckRollup,baseRefName,headRefOid) | ||
|
|
||
| # All checks, with null entries filtered out | ||
| # Normalize all checks: both CheckRun (name/conclusion) and StatusContext (context/state). | ||
| # StatusContext objects have no "name" field — they use "context" instead, and "state" | ||
| # instead of "conclusion". Mapping: FAILURE/ERROR -> FAILURE, PENDING/EXPECTED -> IN_PROGRESS. | ||
| checks=$(echo "$pr_data" | jq '[(.statusCheckRollup // [])[] | | ||
| select(.name != null) | | ||
| { | ||
| name: .name, | ||
| status: .status, | ||
| conclusion: (.conclusion // ""), | ||
| details_url: .detailsUrl | ||
| }]') | ||
| if .name != null then | ||
| { | ||
| name: .name, | ||
| status: .status, | ||
| conclusion: (.conclusion // "") | ||
| } | ||
| elif .context != null then | ||
| { | ||
| name: .context, | ||
| status: (if (.state == "PENDING" or .state == "EXPECTED") then "IN_PROGRESS" else "COMPLETED" end), | ||
| conclusion: (if .state == "SUCCESS" then "SUCCESS" | ||
| elif (.state == "FAILURE" or .state == "ERROR") then "FAILURE" | ||
| elif (.state == "PENDING" or .state == "EXPECTED") then "" | ||
| else .state end) | ||
| } | ||
| else empty end]') | ||
|
|
||
| # Labels: array of strings | ||
| labels=$(echo "$pr_data" | jq '[(.labels // [])[].name]') | ||
|
|
||
| # Build pipeline checks only: "Red Hat Konflux / {component}-on-pull-request[…]" | ||
| # Enterprise-contract checks (containing "enterprise-contract") are excluded — | ||
| # they return NEUTRAL when not required, which is not a failure. | ||
| # Enterprise-contract checks are excluded ONLY when their conclusion is NEUTRAL | ||
| # (not enforced on this branch). A FAILURE conclusion from an enterprise-contract | ||
| # check is a real failure and must block the PR. | ||
| build_checks=$(echo "$checks" | jq '[.[] | | ||
| select(.name | startswith("Red Hat Konflux / ")) | | ||
| select(.name | test("-on-pull-request")) | | ||
| select(.name | contains("enterprise-contract") | not)]') | ||
| select((.name | contains("enterprise-contract")) and (.conclusion == "NEUTRAL") | not)]') | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Behavioral change: enterprise-contract FAILURE now blocks PRs. Previously, all enterprise-contract checks were unconditionally excluded from The comment here explicitly documents this as intentional. Flagging for visibility: on branches where the enterprise-contract check actively runs and can produce FAILURE (rather than NEUTRAL), any ec failure will now permanently hold up the PR until resolved. Please confirm this is the intended operational behavior before merging.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that was intentional. At this point, it is easier for me to ignore "Neutral" state on devel, rather than trying to find out if there's an error within it, and I'm still monitoring the EC failures in the Konflux console. |
||
|
|
||
| # Non-build checks that failed: anything with FAILURE conclusion that is not a | ||
| # Konflux build pipeline check. These block merging and require developer attention. | ||
| other_checks_failed=$(echo "$checks" | jq '[.[] | | ||
| select( | ||
| (.name | startswith("Red Hat Konflux / ") and test("-on-pull-request") and (contains("enterprise-contract") | not)) | ||
| | not | ||
| ) | | ||
| select(.conclusion == "FAILURE") | | ||
| .name]') | ||
|
|
||
| echo "$pr_data" | jq \ | ||
| --argjson checks "$checks" \ | ||
| --argjson labels "$labels" \ | ||
| --argjson build_checks "$build_checks" \ | ||
| --argjson other_checks_failed "$other_checks_failed" \ | ||
| '{ | ||
| number: .number, | ||
| title: .title, | ||
| state: .state, | ||
| base_branch: .baseRefName, | ||
| head_sha: .headRefOid, | ||
| labels: $labels, | ||
| has_ok_to_test: ($labels | any(. == "ok-to-test")), | ||
| has_lgtm: ($labels | any(. == "lgtm")), | ||
|
|
@@ -102,6 +126,7 @@ echo "$pr_data" | jq \ | |
| (map(.conclusion == "SUCCESS") | all)), | ||
| build_checks_failed: [$build_checks[] | | ||
| select(.conclusion == "FAILURE") | .name], | ||
| other_checks_failed: $other_checks_failed, | ||
| pending_checks: ([$checks[] | | ||
| select(.status == "IN_PROGRESS" or | ||
| .status == "QUEUED" or | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.