Repository navigation
Post automatic follow-up comments when enabled repo CI fails #1927
Copy link
Copy link
Closed
Description
Context
ProPR already receives check_run and legacy status webhooks for auto-merge and Ultrafix readiness. The new behavior should inspect failing CI, post a concise follow-up comment containing the failure evidence, and let the normal PR comment worker process that comment. This must only happen for repositories with autoFollowupOnFailedCi enabled.
Requirements
- React only to completed failing check runs and failing/error status events.
- Check the repo-level
autoFollowupOnFailedCiflag before posting anything. - Include the failing check name, conclusion/state, commit SHA, URL, and the most useful failure excerpt available.
- Prefer check-run annotations over long summaries because annotations usually identify the exact failing file/line/test.
- Deduplicate by repo, PR, SHA, and CI source to avoid repeated comments for webhook redelivery.
- Add a hidden marker so bot-authored CI follow-up comments can bypass normal author filtering safely.
- Strip the hidden marker before sending instructions to the agent.
- Add tests for disabled repos, enabled repos, dedupe, and bot marker processing.
Implementation Specification
- Add
packages/core/src/webhook/ciFailureFollowup.tswith failure extraction, comment body construction, and posting logic. - Call the helper from
packages/core/src/webhook/checkRunHandler.tsfor both check-run and status events. - Update
packages/core/src/webhook/commentEventHandler.tsso ProPR-authored comments with the CI marker are accepted and treated as triggered follow-ups. - Export helper functions from
packages/core/src/index.tsfor tests. - Add unit tests in
test/checkRunHandler.test.tsandtest/commentEventHandler.switch-use.test.tsor a new focused test file.
Acceptance Criteria
- A failing check on a repo with the option disabled does not post a comment.
- A failing check on an enabled repo posts exactly one comment with a failure excerpt and marker.
- Webhook redelivery does not create duplicate follow-up comments.
- The created bot comment is accepted by the comment event pipeline despite normal bot filtering.
- The agent instructions do not include the hidden marker.
Created by ProPR AI Planner
Activity
propr-dev commentedon Aug 24, 2026
Suggested Implementation:
Implementation Approach
This implementation posts a normal GitHub PR comment and then lets the existing comment pipeline process it. Directly enqueueing a worker job was considered, but posting a comment first leaves an auditable GitHub artifact and keeps user-visible follow-up behavior consistent with manual comments. The hidden marker is used only to identify ProPR-created CI comments; it avoids opening a general bypass for bot-authored comments.
File:
packages/core/src/webhook/ciFailureFollowup.ts(new file)Why this file: CI failure extraction and comment construction are distinct from auto-merge logic. Keeping them in a separate module makes the behavior testable without expanding
checkRunHandler.tsfurther.File:
packages/core/src/webhook/commentEventHandler.tsWhy this file: The posted CI comment is authored by the ProPR bot, and the normal comment pipeline intentionally filters bots. This file needs a narrow exception for marked ProPR CI comments so the comment can become a real follow-up job.
File:
packages/core/src/webhook/checkRunHandler.tsWhy this file: This is where CI-related webhook events are already handled. Calling the new helper here keeps auto-merge, Ultrafix, and CI follow-up decisions in the same event path.
Note: if
checkRunHandler.tsdoes not already expose a Redis client, add a small shared accessor incheckRunHelpers.tsand reuse the same connection lifecycle that auto-merge/Ultrafix state uses.File:
packages/core/src/index.tsWhy this file: Tests and API/daemon integration import webhook helpers through the core barrel.
propr-dev commentedon Aug 24, 2026
🤖 AI processing has started for this issue using codex agent with gpt-5.6-sol model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
codexgpt-5.6-sol1927/gpt-5.6-sol-post-automatic-follow-up--20260824-0854-lkd1926-epic-automatic-ci-vn4issue-1927-20260824-0854-gpt-5.6-sol-lkd🔍 Track Task Execution
fix(ai): Resolve issue #1927 - Post automatic follow-up comments when…
fix(ai): Resolve issue #1927 - Post automatic follow-up comments when…