From ddd25e673dc59d7a2fda5e1f98df198b1f30bf32 Mon Sep 17 00:00:00 2001 From: Eran Cohen Date: Thu, 23 Jul 2026 16:09:39 +0300 Subject: [PATCH 1/2] OSAC-3065: fix design review triggering on PRD-only PRs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove get_incremental_files which used the GitHub compare API (compare/{before}...{head}) for synchronize events. After a force-push or rebase the two SHAs have different ancestry, causing the compare to return every file in the repo — including design.md files from other enhancement directories — which made detect_skills schedule a spurious design review. Always use get_changed_files (the PR files endpoint) which reliably returns only the PR's actual diff regardless of rebase history. Assisted-by: Claude Code Signed-off-by: Eran Cohen --- .github/scripts/ep_review.py | 17 +---------------- .github/workflows/ep-review.yml | 3 --- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/.github/scripts/ep_review.py b/.github/scripts/ep_review.py index 9ff1f32eb..76e24c47c 100644 --- a/.github/scripts/ep_review.py +++ b/.github/scripts/ep_review.py @@ -41,12 +41,6 @@ def get_changed_files(pr_number): return json.loads(raw) if raw.strip() else [] -def get_incremental_files(before_sha, head_sha): - raw = gh(["api", f"repos/{REPO}/compare/{before_sha}...{head_sha}", - "--jq", "[.files[].filename]"]) - return json.loads(raw) if raw.strip() else [] - - def detect_skills(files): skills = [] has_prd = any(f.lower().endswith("prd.md") for f in files) @@ -119,16 +113,7 @@ def main(): if shadow: print("SHADOW MODE: review will run but no comment will be posted") - event_name = os.environ.get("EVENT_NAME", "") - event_action = os.environ.get("EVENT_ACTION", "") - before_sha = os.environ.get("EVENT_BEFORE_SHA", "") - - # For synchronize events, only review files changed in the latest push - if event_action == "synchronize" and before_sha and head_sha: - files = get_incremental_files(before_sha, head_sha) - print(f"Synchronize: checking incremental diff ({before_sha[:8]}..{head_sha[:8]})") - else: - files = get_changed_files(pr_number) + files = get_changed_files(pr_number) if not files: print("No files changed") diff --git a/.github/workflows/ep-review.yml b/.github/workflows/ep-review.yml index c30c72393..627d38ec6 100644 --- a/.github/workflows/ep-review.yml +++ b/.github/workflows/ep-review.yml @@ -114,9 +114,6 @@ jobs: EP_REVIEW_SHADOW: ${{ vars.EP_REVIEW_SHADOW || 'true' }} PR_NUMBER: ${{ needs.resolve-pr.outputs.pr_number }} PR_HEAD_SHA: ${{ needs.resolve-pr.outputs.head_sha }} - EVENT_NAME: ${{ github.event_name }} - EVENT_ACTION: ${{ github.event.action }} - EVENT_BEFORE_SHA: ${{ github.event.before }} run: python .github/scripts/ep_review.py - name: Upload OTEL metrics From 64677903d2fc8f2109f0f06b27cce15e1d84ea88 Mon Sep 17 00:00:00 2001 From: Eran Cohen Date: Thu, 23 Jul 2026 23:48:40 +0300 Subject: [PATCH 2/2] OSAC-3065: fix paginated file listing in get_changed_files Use .[].filename (one filename per line) instead of [.[].filename] (JSON array per page). With --paginate, each page runs --jq separately, so the array form produces concatenated JSON arrays that json.loads cannot parse on multi-page responses. Assisted-by: Claude Code Signed-off-by: Eran Cohen --- .github/scripts/ep_review.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/ep_review.py b/.github/scripts/ep_review.py index 76e24c47c..0bc525f41 100644 --- a/.github/scripts/ep_review.py +++ b/.github/scripts/ep_review.py @@ -37,8 +37,8 @@ def gh(args): def get_changed_files(pr_number): raw = gh(["api", f"repos/{REPO}/pulls/{pr_number}/files", - "--paginate", "--jq", "[.[].filename]"]) - return json.loads(raw) if raw.strip() else [] + "--paginate", "--jq", ".[].filename"]) + return [f for f in raw.splitlines() if f.strip()] def detect_skills(files):