Skip to content

Conversation

@mathislucka
Copy link
Contributor

This PR adds a new agent pipeline for automatically fixing CI failures. The CI agent works in a similar way to the GitHub agent but is triggered by CI failures rather than GitHub issues.

Changes Made

  1. Created new CI-specific components:

    • CIOutputParser: Parses CI output logs into Haystack documents
    • CIBranchCreator: Creates a new branch for fixing CI issues
    • CIDocumentToChatMessageConverter: Converts CI failures into structured chat messages
  2. Implemented a CI agent pipeline:

    • Added ci_agent.py pipeline similar to the GitHub agent but adapted for CI input
    • Created a system prompt specifically for fixing CI issues
    • Registered the pipeline so it's available for deployment
  3. Added a GitHub workflow:

    • Created ai_ci_processor.yaml workflow that runs on CI failure
    • The workflow downloads CI logs and sends them to the deepset Cloud pipeline
    • CI agent then analyzes failures and creates a PR with fixes

Implementation Details

The CI agent has the same core functionality as the GitHub agent but uses different input sources and parsing mechanisms:

  1. The agent receives CI log output as input (via the query parameter)
  2. It parses logs to identify test failures, linting errors, and other issues
  3. It creates a new branch with timestamp-based naming (e.g., fix-ci-1234567890)
  4. It makes the necessary code changes to fix the issues
  5. It creates a pull request with the fixes

Testing Considerations

To test this implementation:

  • Manually trigger the pipeline with sample CI logs to verify parsing
  • Verify branch creation works with the timestamp-based naming
  • Check that the agent correctly identifies and fixes common CI issues
  • Ensure PRs are created with proper title and description

Next Steps

  • Monitor usage and refine the CI log parsing to better identify different types of failures
  • Consider adding CI-specific tooling like test runners or linting checks the agent could use
  • Enhance the system prompt with more detailed instructions for specific types of CI failures

Closes #17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add agent that runs after CI run

2 participants