feat: add CI monitor for agent PRs - #40
Open
shenxianpeng wants to merge 2 commits into
Open
Conversation
Add three new modules to make RepoKeeper the best AI-powered OSS maintainer agent on GitHub: - commands.py: dedicated /repokeeper comment command parser (go, review, describe, label, fix, status, help) - search.py: codebase grep with git grep + Python fallback, discover_related_files for import/dependency traversal - ci_monitor.py: watches agent PRs for CI failures, diagnoses from real job logs, pushes auto-fixes to the same branch Also: - agent.py: wires in /repokeeper help and /repokeeper status - cli.py: ci-monitor, search, help subcommands - action.yml: supports module=ci-monitor and module=help - Fix _parse_git_grep_output for heading-format git grep output 543 tests pass, 80% coverage, 0 mypy errors, 0 ruff errors
Codecov Report❌ Patch coverage is
❌ Your project status has failed because the head coverage (78.10%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #40 +/- ##
==========================================
+ Coverage 78.04% 78.10% +0.05%
==========================================
Files 16 16
Lines 4173 4192 +19
Branches 766 768 +2
==========================================
+ Hits 3257 3274 +17
- Misses 715 716 +1
- Partials 201 202 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Remove non-essential modules (commands.py, search.py) per review feedback. Keep ci_monitor.py — the only feature that fills a genuine gap (no existing mechanism to auto-fix CI on agent PRs after creation). Also: - Update README.md and docs/module-3-agent.md with CI monitor docs - Revert agent.py command parser wiring - Revert cli.py search/help subcommands (keep ci-monitor) - Revert action.yml module=help (keep ci-monitor) - Rewrite ci_monitor tests with mocks for full control flow coverage - Fix lint in test_ci_monitor.py 495 tests pass, 80% coverage, 0 mypy errors, 0 ruff errors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
After the Implementation Agent creates a PR, there is no mechanism to detect or fix CI failures on that PR. This PR adds CI Monitor — a new module that watches agent PRs for CI failures, diagnoses them from real job log data, and auto-pushes fixes to the same branch.
New Module
src/repokeeper/ci_monitor.pyget_pr_check_status()— queries GitHub Checks API for a PR's check runsfind_agent_prs()— discovers open PRs onrepokeeper/branchesdiagnose_and_fix_ci()— fetches job/step logs, calls LLM for diagnosis, applies fix, pushesrun_ci_monitor()— top-level pipeline: find PRs → check status → auto-fix failuresIntegration
repokeeper ci-monitor --repo owner/reposubcommandmodule: ci-monitorfor GitHub Actions workflowspatrol.ci_auto_fix(default: true)Example workflow
Docs
Verification