microsoft / microsoft/FluidFramework

[code-simplifier] chore: simplify review tooling scripts

Open
#27,215 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

agentic-workflows automation code-quality refactoring
Dominant language
TypeScript
Stars
4.9k
Forks
586
Avg merge
1d 15h
Merged PRs (30d)
146

Description

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
  • Commit 3e6f512 ("docs(ci-readiness-check): require explicit mode prompt before running (#27198)")
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)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with .github/scripts/pr_review_propose.py, .github/scripts/consolidate_reviews.py, and .claude/skills/ci-readiness-check/ci-readiness-check.sh, then review the existing CLI behavior and run the documented compileall and smoke tests. Done means the scripts are easier to read while preserving their output, redirection behavior, and CI workflows.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, shell
Domain
ci-cd, developer-experience, tooling
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.