Skip to content

Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.

ci: keep ready label off changes-requested PRs

JerrettDavis595b709a5b23
diff --git a/.github/workflows/pr-health.yml b/.github/workflows/pr-health.yml
index 17c6351a8..688b39046 100644
--- a/.github/workflows/pr-health.yml
+++ b/.github/workflows/pr-health.yml
@@ -196,12 +196,13 @@ jobs:
fi
for pr in $pr_numbers; do
- data="$(gh pr view "$pr" --repo "$REPO" \
- --json isDraft,labels,mergeStateStatus,statusCheckRollup)"
-
- merge_state="$(jq -r '.mergeStateStatus // "UNKNOWN"' <<<"$data")"
- check_state="$(python3 .github/scripts/pr-health-labels.py --state-json "$data")"
- is_draft="$(jq -r '.isDraft' <<<"$data")"
+ data="$(gh pr view "$pr" --repo "$REPO" \
+ --json isDraft,labels,mergeStateStatus,reviewDecision,statusCheckRollup)"
+
+ merge_state="$(jq -r '.mergeStateStatus // "UNKNOWN"' <<<"$data")"
+ check_state="$(python3 .github/scripts/pr-health-labels.py --state-json "$data")"
+ is_draft="$(jq -r '.isDraft' <<<"$data")"
+ review_decision="$(jq -r '.reviewDecision // ""' <<<"$data")"
if [[ "$merge_state" == "BEHIND" ]]; then
gh pr edit "$pr" --repo "$REPO" --add-label "status: needs rebase"
@@ -221,7 +222,7 @@ jobs:
gh pr edit "$pr" --repo "$REPO" --remove-label "status: ci failing" || true
fi
- if [[ "$merge_state" == "BEHIND" || "$merge_state" == "DIRTY" || "$check_state" == "failing" || "$is_draft" == "true" ]]; then
- gh pr edit "$pr" --repo "$REPO" --remove-label "status: ready for review" || true
- fi
+ if [[ "$merge_state" == "BEHIND" || "$merge_state" == "DIRTY" || "$check_state" == "failing" || "$is_draft" == "true" || "$review_decision" == "CHANGES_REQUESTED" ]]; then
+ gh pr edit "$pr" --repo "$REPO" --remove-label "status: ready for review" || true
+ fi
done
diff --git a/scripts/tests/test_pr_health_workflow.py b/scripts/tests/test_pr_health_workflow.py
index 24e13f22a..42c9a2f56 100644
--- a/scripts/tests/test_pr_health_workflow.py
+++ b/scripts/tests/test_pr_health_workflow.py
@@ -14,3 +14,11 @@ def test_incomplete_pr_template_is_reported_without_failing_job() -> None:
assert "PR template validation found missing fields" in workflow
assert "Fail when the PR body is incomplete" not in workflow
assert 'echo "PR template validation failed' not in workflow
+
+
+def test_ready_for_review_label_is_removed_when_changes_are_requested() -> None:
+ workflow = Path(".github/workflows/pr-health.yml").read_text(encoding="utf-8")
+
+ assert "reviewDecision" in workflow
+ assert 'review_decision="$(jq -r \'.reviewDecision // ""\'' in workflow
+ assert '$review_decision" == "CHANGES_REQUESTED"' in workflow