Add CI Monitor: context-aware CI/Prow monitoring with adaptive polling and failure analysis#60
Add CI Monitor: context-aware CI/Prow monitoring with adaptive polling and failure analysis#60PillaiManish wants to merge 5 commits into
Conversation
- Extract ci-monitor skill from monolithic command - Add release repo context (ci-operator config + step registry) - Add operator repo context and PR change context - Add root cause tracing protocol - Add auto-retest, progress reporting, parallel polling Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: PillaiManish The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/ok-to-test |
|
/cc @shivprakashmuley @rausingh-rh @siddhibhor-56 improved the ci-monitor + added the UI for easy usage. PTAL. |
The ci-monitor entrypoint (main.py) imports ci_monitor.py but it was missing from the COPY directive, causing ModuleNotFoundError at runtime when WORKFLOW_TYPE=ci-monitor. Co-authored-by: Cursor <cursoragent@cursor.com>
- Add jq to Dockerfile for CI use (avoids runtime download) - Add --ignore-context flag to skip self-monitoring in CI - Add --post-comment flag to post report as GitHub PR comment - Set --max-fix-rounds 0 for CI use (report-only, no push) Co-authored-by: Cursor <cursoragent@cursor.com>
swghosh
left a comment
There was a problem hiding this comment.
Made a fair pass over the structure and the overall design bits,
would want to review once more in detail for the actual Claude Skill and Commands to see what prompts are being used.
Overall looks in shape, as long as we can have a dedicated workflow for this. Let's also keep in mind to make sure this is re-usable for other PRs where some tests are failing and wasn't authored by our operator-dev workflow.
| 6. Run `/oape:review OCPBUGS-0 {repo_info['base_branch']}` to review and auto-fix issues | ||
| 7. Commit all changes with a descriptive message | ||
| 8. Push the branch and create a PR against `{repo_info['base_branch']}` | ||
| 9. Run `/oape:ci-monitor <pr1-url> --timeout-min 120 --max-fix-rounds 2` |
There was a problem hiding this comment.
I don't think it's a feasible idea to run directly in the workflow, because it would cause the workflow to wait for a very long period of time blocking the flow.
Could be trigger this as a separate workflow instead, please?
| if not ep_url or not repo or not base_branch: | ||
| print("ERROR: EP_URL, REPO, BASE_BRANCH environment variables are required", file=sys.stderr) | ||
| sys.exit(1) | ||
| if workflow_type == "ci-monitor": |
There was a problem hiding this comment.
yup, I believe the intent was to implement something similar (i.e. run as a separate workflow than the primary one) but if possible we can de-duplicate the parts into 2 separate .py files. The common code can be moved to agent.py or the alike.
There was a problem hiding this comment.
while it's not a bad idea to have an UI, because this actually a monitor monitor - having a dashboard makes total sense.
The only concern is that we need infra maintenance mandatory in that case. Maybe we could move this elsewhere?
(separate change ofc, but we can get rid of the existing UI bits in go-server/static entirely too; motivation: Slack thread)
There was a problem hiding this comment.
Perhaps, 👀 into https://gitlab.cee.redhat.com/service/app-interface#visual-app-interface for a possible UI integration. This could be helpful for hosting a dashboard or UI for long term.
| ), | ||
| cwd=working_dir, | ||
| permission_mode="bypassPermissions", | ||
| allowed_tools=CONFIGS["claude_allowed_tools"], |
There was a problem hiding this comment.
Recently, Claude code CLI has the ability to trigger a cron directly in the Claude session.
We should verify in Claude Agent SDK really has that capability too - if it does we can reuse it where Claude writes the script to watch the CI jobs every few quantum duration, and only invoke when actually failing..
https://code.claude.com/docs/en/scheduled-tasks#let-claude-choose-the-interval
[more deterministic behaviour] If not, we can write a script ourselves keep it here and only let Claude kick-off a session when jobs are actually failing.
Summary
/oape:ci-monitorskill that monitors CI/Prow job status for OpenShift operator PRs with adaptive polling, context-aware failure classification, and optional fix-push-rewatch loop/ci-monitor) and API endpoint (POST /api/v1/ci-monitor) for triggering CI monitoring from the web interfaceWhat changed
Skill + Command refactor (
plugins/oape/):commands/ci-monitor.md: Slimmed to prechecks + delegation (was 496 lines, now 272)skills/ci-monitor/SKILL.md: New skill with polling algorithm, evidence collection, failure classification, root cause tracing, report template, and fix-push-rewatch protocolKey improvements over original ci-monitor:
UI + Server (
go-server/,agent/):go-server/static/ci-monitor.html(accessible at/ci-monitor)go-server/ci_monitor_handler.gogo-server/ci_monitor_k8s.goagent/ci_monitor.py(autonomous execution, no user prompts)main.go, embed directive inhandlers.go, workflow type branching inmain.pyTest plan
/ci-monitorpage loads and form validates PR URLs (1-3 inputs)POST /api/v1/ci-monitorrejects invalid PR URLs and empty input/page andPOST /api/v1/workflowsare unaffected/oape:ci-monitor <pr-url>via Claude Code CLI and verify report includes root cause tracesReference
#51 - this PR is created on top of this changes