-
Notifications
You must be signed in to change notification settings - Fork 3
CI Failures agent #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Junie successfully finished! |
|
|
||
| export const CODE_REVIEW_TRIGGER_PHRASE_REGEXP = new RegExp(CODE_REVIEW_ACTION, 'i') | ||
|
|
||
| export const FIX_CI_ACTION = "fix-ci"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ New Feature: FIX_CI_ACTION constant added for CI failure analysis.
This introduces a built-in action phrase similar to code-review. Documentation has been updated in COOKBOOK.md to show users how to use:
prompt: "fix-ci"in workflows@junie-agent fix-ciin comments
This simplifies CI failure analysis compared to writing custom prompts.
src/github/junie/junie-tasks.ts
Outdated
| // Check if prompt contains FIX_CI_ACTION phrase or if this is a workflow_run event triggered by CI failure | ||
| const isFixCIInPrompt = customPrompt?.includes(FIX_CI_ACTION); | ||
| const isFixCIFromWorkflowFailure = isWorkflowRunFailureEvent(context); | ||
| const isFixCI = isFixCIInPrompt || isFixCIFromWorkflowFailure; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Automatic CI Failure Detection: This implementation enables two trigger methods for CI failure analysis:
- Manual trigger: Users can include
fix-ciin prompts or comments (@junie-agent fix-ci) - Automatic trigger: Detects
workflow_runevents with failure conclusion
This dual-trigger approach provides flexibility - users can manually request analysis or have it automatically triggered when CI fails. Documentation has been updated in COOKBOOK.md to show both usage patterns.
|
@junie-agent fix ci |
|
Junie successfully finished! Add fix-ci action for manual and auto CI failure analysis Fixed CI Issues and Improved Test ReliabilityI have addressed the CI failures and improved the overall robustness of the action's trigger logic and test suite. Key Changes:
These changes ensure that the new "Fix CI" feature works as intended and that the repository's CI remains stable. Commit sha: 9227650 |
|
|
||
| export const FIX_CI_ACTION = "fix-ci"; | ||
|
|
||
| export const FIX_CI_TRIGGER_PHRASE_REGEXP = new RegExp(FIX_CI_ACTION, 'i'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ New Feature: CI Failure Analysis with fix-ci trigger
This PR adds a new fix-ci action that enables automatic CI failure analysis. The feature has been documented in README.md with:
- Updated feature description mentioning the
fix-citrigger phrase - Usage example:
@junie-agent fix-ci - Complete
workflow_runevent configuration for automatic CI failure detection
The fix-ci action analyzes CI failures and suggests fixes without implementing them, using the get_pr_failed_checks_info MCP tool.
| /** | ||
| * Checks if the context is a workflow_run event triggered by a CI failure | ||
| */ | ||
| export function isWorkflowRunFailureEvent( | ||
| context: JunieExecutionContext, | ||
| ): context is AutomationEventContext & { payload: WorkflowRunEvent } { | ||
| return context.eventName === "workflow_run" && | ||
| (context.payload as WorkflowRunEvent).workflow_run?.conclusion === "failure"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ New Event Support: workflow_run for automatic CI failure detection
This new function enables automatic triggering of Junie when CI workflows fail. This has been documented in README.md with a complete workflow example showing how to set up automatic CI failure analysis using the workflow_run event trigger.
Users can now configure Junie to automatically analyze failed CI checks without manual intervention.
| // Check if prompt contains FIX_CI_ACTION phrase, comment/review has fix-ci trigger, or workflow_run CI failure | ||
| const isFixCIInPrompt = customPrompt?.includes(FIX_CI_ACTION); | ||
| const isFixCIInComment = isReviewOrCommentHasFixCITrigger(context); | ||
| const isFixCIFromWorkflowFailure = isWorkflowRunFailureEvent(context); | ||
| const isFixCI = isFixCIInPrompt || isFixCIInComment || isFixCIFromWorkflowFailure; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Fix-CI Feature Integration: Three trigger methods
This implementation enables the fix-ci feature to be triggered in three ways:
- Custom prompt: Include
"fix-ci"in thepromptinput - Comment/review trigger: Use
@junie-agent fix-ciin PR comments or reviews - Automatic workflow_run: Triggered automatically when a workflow fails
All three methods are now documented in README.md with usage examples and a complete workflow_run configuration.
|
|
||
| export const CODE_REVIEW_TRIGGER_PHRASE_REGEXP = new RegExp(CODE_REVIEW_ACTION, 'i') | ||
|
|
||
| export const FIX_CI_ACTION = "fix-ci"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Documentation Updated: The new FIX_CI_ACTION constant and FIX_CI_TRIGGER_PHRASE_REGEXP have been documented in:
- README.md: Added workflow_run trigger example and "fix-ci" usage
- COOKBOOK.md: Updated Fix CI recipe to show automatic detection
The fix-ci feature is now properly documented with all three trigger methods: workflow_run failures, comment-based triggers, and custom prompts.
| `; | ||
| } | ||
|
|
||
| export function createFixCIFailuresPrompt(diffPoint: string): string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Documentation Updated: The createFixCIFailuresPrompt function is now documented in COOKBOOK.md. The documentation explains that this template is automatically applied when:
- workflow_run event with conclusion === 'failure'
- Comment/review contains "fix-ci" trigger phrase
- Custom prompt includes "fix-ci"
Users no longer need to manually write this prompt - it's applied automatically by the action.
| const isCodeReviewInComment = isReviewOrCommentHasCodeReviewTrigger(context); | ||
| const isCodeReview = isCodeReviewInPrompt || isCodeReviewInComment; | ||
|
|
||
| // Check if prompt contains FIX_CI_ACTION phrase, comment/review has fix-ci trigger, or workflow_run CI failure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Documentation Updated: The automatic fix-ci detection logic is now documented in:
- README.md: Basic workflow example includes workflow_run trigger with automatic failure detection
- COOKBOOK.md: Explains all three trigger methods (workflow_run failure, comment trigger, custom prompt)
The documentation clearly shows that users can trigger fix-ci analysis through:
- Automatic: workflow_run event when CI fails
- Manual:
@junie-agent fix-cicomment on PR - Custom: Include "fix-ci" in custom prompt
| /** | ||
| * Checks if the context is a workflow_run event triggered by a CI failure | ||
| */ | ||
| export function isWorkflowRunFailureEvent( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Documentation Updated: The isWorkflowRunFailureEvent function and workflow_run trigger are now documented in:
- README.md: Basic setup workflow includes
workflow_runtrigger with conditiongithub.event.workflow_run.conclusion == 'failure' - COOKBOOK.md: Fix CI recipe shows complete workflow_run configuration
Users can now set up automatic CI failure analysis by adding the workflow_run trigger to their Junie workflow.
9cab201 to
5c4d65c
Compare
No description provided.