feat: automated PR reviewer agent for drift quality enforcement#560
Conversation
- Add .github/agents/reviewer.agent.md: drift-aware reviewer agent config encoding three review rules (missing tests, module boundary violations, drift signal regressions) with report-only + idempotent comment contract - Add .github/workflows/drift-pr-reviewer.yml: workflow triggering on pull_request events (main branch), running drift analyze + lint-imports + missing-test detection, posting structured upserted review comment - Update .github/CODEOWNERS: add reviewer.agent.md and drift-pr-reviewer.yml to agent-critical paths requiring maintainer review - Add tests/test_drift_pr_reviewer_workflow.py: 26 tests validating workflow contract, agent config content, and CODEOWNERS coverage Agent-Logs-Url: https://github.com/mick-gsk/drift/sessions/c33b1f70-6fc5-49d3-8766-e5a9fdd8028b Co-authored-by: mick-gsk <270290541+mick-gsk@users.noreply.github.com>
|
@copilot Please fix the following issues identified in the review of this PR before it can be merged: Issues to fix🔴 HIGH — Incorrect version comments on pinned ActionsThe workflow uses SHA-pinned actions with version comments that do not match any real release tags: uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
Please verify each SHA against the actual tag it belongs to (e.g. via 🟠 MEDIUM — CHANGELOG entry missingThis is a 🟠 MEDIUM — Feature evidence artifact missingFor python scripts/generate_feature_evidence.py --version <current_version> --slug pr-reviewerand commit the resulting file. 🟡 LOW — Drift JSON parsing fragility
const jsonStart = raw.indexOf('{');
const jsonEnd = raw.lastIndexOf('}');
const report = JSON.parse(raw.slice(jsonStart, jsonEnd + 1));🟡 LOW — Missing-tests scope mismatchThe agent spec ( Please address the two 🟠 MEDIUM and one 🔴 HIGH items before requesting a re-review. The 🟡 LOW items are optional but appreciated. |
… fix, SECURITY.md - CHANGELOG.md: add v2.49.0 entry for PR reviewer agent feature - benchmark_results/v2.49.0_pr-reviewer_feature_evidence.json: generated with scripts/generate_feature_evidence.py (required for feat: push gate) - docs/STUDY.md: add study entry for PR reviewer agent feature - SECURITY.md: add 2.49.x supported version and update current release line - drift-pr-reviewer.yml: narrow missing-test scope from src/ to src/drift/ to match reviewer.agent.md spec; add JSON extraction guard before JSON.parse to handle trailing console output from drift analyze Agent-Logs-Url: https://github.com/mick-gsk/drift/sessions/358d207b-45c8-48a8-9436-88ae66dbb80f Co-authored-by: mick-gsk <270290541+mick-gsk@users.noreply.github.com>
Agent-Logs-Url: https://github.com/mick-gsk/drift/sessions/358d207b-45c8-48a8-9436-88ae66dbb80f Co-authored-by: mick-gsk <270290541+mick-gsk@users.noreply.github.com>
Addressed in commits 🔴 HIGH — Action version comments: Both SHAs are verified correct via the GitHub API. 🟠 MEDIUM — CHANGELOG entry: Added v2.49.0 section to 🟠 MEDIUM — Feature evidence: Generated 🟡 LOW — JSON parsing guard: Added 🟡 LOW — Scope mismatch: Narrowed |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
@copilot resolve the merge conflicts in this pull request |
.github/agents/reviewer.agent.md— drift-aware reviewer agent config with importlinter contracts and recurring pattern rules.github/workflows/drift-pr-reviewer.yml— workflow triggering on PRs, running drift analyze + importlinter + missing-test check, posting structured review comment.github/CODEOWNERS— add new files to agent-critical sectiontests/test_drift_pr_reviewer_workflow.py— 26 tests validating workflow contract and agent configsrc/tosrc/drift/to match agent specjsonStart/jsonEnd) beforeJSON.parsein comment builderCHANGELOG.mdentry for v2.49.0 (feat: gate requirement)benchmark_results/v2.49.0_pr-reviewer_feature_evidence.json(feat: gate requirement)docs/STUDY.mdwith feature study entry (feat: gate requirement)SECURITY.mdsupported versions (add 2.49.x, update release line)