Skip to content

[code-simplifier] chore: simplify review tooling scripts #27215

@github-actions

Description

@github-actions

Overview

This PR makes small readability-focused refactors in recently modified PR review/CI helper scripts, preserving behavior.

Files Simplified

  • .github/scripts/pr_review_propose.py
    • Centralized repeated “read from stdin or file” logic into a small helper.
    • Simplified checkbox parsing by using a seen set to avoid repeated list scans.
  • .github/scripts/consolidate_reviews.py
    • Replaced repeated re.match() calls with a compiled regex constant for clarity.
  • .claude/skills/ci-readiness-check/ci-readiness-check.sh
    • Simplified the checks command redirection to avoid redundant 2>&1 usage.

Changes Based On

Testing

  • python3 -m compileall on the modified Python scripts
  • ✅ Smoke-tested pr_review_propose.py and consolidate_reviews.py via a small local harness
  • ⚠️ pnpm install/build/test could not be run in this environment because the repo requires Node >=22.22.2 but the runner provides Node v20.20.2.

Review Focus

Please sanity-check that the scripts’ CLI behavior/output is unchanged and that the refactors improve readability without affecting the workflows that invoke them.

Generated by Code Simplifier ·

To install this agentic workflow, run

gh aw add github/gh-aw/.github/workflows/code-simplifier.md@94662b1dee8ce96c876ba9f33b3ab8be32de82a4

Warning

⚠️ Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • pypi.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "pypi.org"

See Network Configuration for more information.

  • expires on May 2, 2026, 8:07 AM UTC

Note

This was originally intended as a pull request, but GitHub Actions is not permitted to create or approve pull requests in this repository.
The changes have been pushed to branch code-simplifier/2026-05-01-review-scripts-8259350f8d77c1f5.

Click here to create the pull request

To fix the permissions issue, go to SettingsActionsGeneral and enable Allow GitHub Actions to create and approve pull requests.

Show patch preview (159 of 159 lines)
From c341df1d0c4ab1a71efe4514e97fee06e098f1bd Mon Sep 17 00:00:00 2001
From: Copilot CLI <223556219+Copilot@users.noreply.github.com>
Date: Fri, 1 May 2026 08:05:16 +0000
Subject: [PATCH] chore: simplify review tooling

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
 .../ci-readiness-check/ci-readiness-check.sh  |  2 +-
 .github/scripts/consolidate_reviews.py        |  5 +-
 .github/scripts/pr_review_propose.py          | 54 +++++++++----------
 3 files changed, 28 insertions(+), 33 deletions(-)

diff --git a/.claude/skills/ci-readiness-check/ci-readiness-check.sh b/.claude/skills/ci-readiness-check/ci-readiness-check.sh
index dcd03ce..bc82897 100755
--- a/.claude/skills/ci-readiness-check/ci-readiness-check.sh
+++ b/.claude/skills/ci-readiness-check/ci-readiness-check.sh
@@ -186,7 +186,7 @@ fi
 # ---------- Phase 2: Verify checks pass ----------
 section "Verifying checks pass"
 
-if (cd "${REPO_ROOT}" && pnpm exec fluid-build --task checks ${PKG_ARGS} 2>&1) >/dev/null 2>&1; then
+if (cd "${REPO_ROOT}" && pnpm exec fluid-build --task checks ${PKG_ARGS} >/dev/null 2>&1); then
     ok "All checks pass"
 else
     CHECKS_OK=false
diff --git a/.github/scripts/consolidate_reviews.py b/.github/scripts/consolidate_reviews.py
index afd77df..02df031 100644
--- a/.github/scripts/consolidate_reviews.py
+++ b/.github/scripts/consolidate_reviews.py
@@ -70,6 +70,8 @@ SEVERITY_LABEL_SETS: list[SeverityLabelSet] = [
 
 VALID_SEVERITIES = frozenset({"CRITICAL", "HIGH", "MEDIUM"})
 
+_FILE_LINE_RE = re.compile(r".+:\d+")
+
 
 @dataclass
 class Finding:
@@ -145,8 +147,7 @@ def deduplicate(findings: list[Finding]) -> list[Finding]:
 
     for f in findings:
         # Findings without a recognizable file:line are always kept
-        has_location = re.match(r".+:\d+", f.location)
-        if has_location:
+        if _FILE_LINE_RE.match(f.location):
             if f.location in seen:
                 continue
             seen.add(f.location)
diff --git a/.g
... (truncated)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions