fix(dev-lead): handle SonarQube Quality Gate failures (issue #279) - #280
Conversation
…ternal gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (9)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Dev-Lead — human-pr (no-changes)No changes were needed for this PR. |
Dev-Lead — fix-bot-comment (no-changes)Engine ran but made no changes. |
There was a problem hiding this comment.
Code Review
This pull request introduces support for handling external quality gate failures, such as SonarCloud, by providing the PR diff to the AI agent when standard GitHub Actions logs are unavailable. The changes include updated prompt instructions, modifications to the dev-lead-fix-ci.sh script to fetch diffs via the GitHub CLI, and new test fixtures. Feedback from the review highlights a significant discrepancy where the ci-relay implementation mentioned in the PR description is missing from the patches. Additionally, the reviewer pointed out that the new unit tests are ineffective as they do not correctly verify the content of the collected diffs, and suggested increasing the line limit for captured diffs to provide better context for the agent.
There was a problem hiding this comment.
Pull request overview
Fixes three compounding bugs that prevented the dev-lead agent from handling SonarQube Quality Gate failures: the ci-relay job silently skipping GitHub App check_runs (empty pull_requests), the fix-bot-comment flow lacking guidance for SonarQube comments that omit file/line refs, and collect_logs producing empty context for non-GitHub-Actions details_url. The patch adds a commits-to-pulls API fallback (with fork protection), enriches the two prompts with SonarQube-specific hotspot guidance, and falls back to gh pr diff for external quality gates.
Changes:
ci-relayfalls back toGET /commits/{sha}/pullswhencheck_run.pull_requestsis empty, skipping forks viahead.repo.full_name.collect_logsemits a labeled# External quality gateheader plus PR diff when no GHA run ID can be extracted;fix-ci.mdandfix-bot-comment.mdadd hotspot-pattern guidance.- Two new bats tests cover the external-gate path; new
check_run_failure_sonarcloud.jsonfixture documents the App check_run shape.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/dev-lead.yml | Adds commits-to-pulls fallback + fork check to ci-relay. |
| scripts/dev-lead-fix-ci.sh | collect_logs now emits a labeled header and gh pr diff when no run ID is found. |
| prompts/dev-lead/fix-ci.md | Documents the new "External quality gate" log header and hotspot patterns. |
| prompts/dev-lead/fix-bot-comment.md | Adds SonarCloud-specific guidance for comments without file/line refs. |
| tests/dev-lead/unit/test_fix_ci.bats | Two new tests for external vs. GHA details_url handling. |
| tests/dev-lead/fixtures/events/check_run_failure_sonarcloud.json | New fixture documenting the GitHub App check_run shape. |
| tests/dev-lead/fixtures/events/check_run_failure_no_pr.json | Updates note to reflect the new commits-to-pulls fallback behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
No description provided. |
- Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
|
|
No description provided. |
Dev-Lead — fix-bot-comment (no-changes)Engine ran but made no changes. |
Dev-Lead — fix-reviews (no-changes)No changes were needed for the open review threads. |
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
) * fix(dev-lead): handle SonarQube failures — relay, hotspot context, external gate logs Three bugs prevented the dev-lead agent from ever fixing a SonarQube Quality Gate failure (observed on PR #276, tracked in issue #279): 1. ci-relay skipped GitHub App check_runs (SonarCloud, CodeQL, etc.) because check_run.pull_requests is empty for App-sourced checks. Fix: fall back to GET /commits/{sha}/pulls when pull_requests is [], including fork protection using head.repo.full_name from that API. 2. fix-bot-comment had no guidance for SonarQube comments that list hotspot counts with no file/line references, leaving the agent with nothing actionable. Fix: add a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets, eval, HTTP downloads). 3. collect_logs() returned a bare "No run logs available" for external quality gates (details_url with no /runs/ segment), giving the agent empty context. Fix: fall back to gh pr diff output so the agent can identify what the gate flagged. fix-ci.md also gains an "External quality gate" guidance section matching the new log header. Tests: two new fix-ci bats tests covering the external quality gate collect_logs path (non-GHA URL → pr diff; GHA URL → run view). New fixture: check_run_failure_sonarcloud.json for ci-relay fallback. Closes #279 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(dev-lead): address review feedback on PR #280 - Extract ci-relay PR-lookup logic into scripts/dev-lead-ci-relay.sh so it can be unit-tested with bats; YAML step now calls the script. Includes the open-PR filter (select(.state=="open")) to prevent relaying against merged PRs that share the same commit SHA (Copilot). - Increase PR diff capture from LOG_MAX_LINES (200) to 1000 lines for the external quality gate fallback — diffs typically exceed 200 lines and hotspots may appear anywhere (Gemini). - Replace ineffective test 17 with a prompt-file inspection: extract the rendered prompt path from dry-run output, then grep for the "External quality gate" header and diff content (Gemini/Copilot). - Replace ineffective test 18 with sentinel files: the gh stub touches .ran_run_view or .ran_pr_diff; test asserts run view was called and pr diff was not (Gemini/Copilot). - Add tests/dev-lead/unit/test_ci_relay.bats: 7 unit tests covering the new ci-relay script — GHA path, App fallback, fork rejection, no-PRs, merged-only PRs, and API failure (Copilot). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Gemini CLI <gemini-cli@example.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>



Summary
Fixes three compounding bugs that prevented the dev-lead agent from ever addressing a SonarQube Quality Gate failure (observed on PR #276, documented in issue #279).
ci-relayfallback for GitHub App check_runs:check_run.pull_requestsis empty for App-sourced checks (SonarCloud, external CodeQL gates, etc.), causing the relay to silently skip. Now falls back toGET /commits/{sha}/pullsAPI, with fork protection viahead.repo.full_name.fix-bot-commentSonarQube guidance: SonarQube comments report hotspot counts without file/line references, leaving the agent with nothing actionable. Added a SonarQube-specific section instructing the agent to diff the PR and scan for known hotspot patterns (curl|bash, hardcoded secrets,eval, HTTP downloads).collect_logsexternal quality gate fallback: For check_runs whosedetails_urlisn't a GitHub Actions URL (no/runs/segment),collect_logsnow falls back togh pr diffoutput.fix-ci.mdgains an "External quality gate" guidance section keyed on the new log header.Test plan
tests/dev-lead/unit/test_fix_ci.bats— two new tests covering Fix 3:details_url) →pr diffin logs, script exits 0details_url→run viewused,pr diffnot calledcheck_run_failure_sonarcloud.jsondocuments the GitHub App check_run case for ci-relaytest_fix_ci.bats) confirmed unchanged from main — not introduced by this PRcurl | bashstep and verify the full fix-ci path fires and removes itCloses #279
🤖 Generated with Claude Code