CI/CD Maintainers
Fix failed PRs in no time
Root Cause Analysis
Immediately get to the heart of the issues causing CI to fail, along with actionable solutions you can implement right away.
CI/CD Maintainers
CI/CD Maintainers Crew is your intelligent AI companion on the Kubiya platform, designed to transform CI/CD management. It tracks pull request failures, analyzes logs to find the root cause, and provides actionable suggestions directly on the pull request. Real-time Slack notifications and automated maintenance keep pipelines efficient and repositories well-maintained.
Use Case for CI/CD Maintainer Crew
Let's take an example: a DevOps engineer at an organization who was managing the CI/CD pipelines but left the team. A new engineer joined and now needs to take over without much context about the CI/CD pipelines, files, or issues. Figuring out what went wrong can be a difficult and time-consuming task for him.
The CI/CD Maintainers Crew helps by tracking failed pull requests, analyzing logs, and posting comments directly on the pull request. These comments explain the issue, its cause, and how to fix it.
It also sends Slack notifications with clear details and next steps, making it easier for the new engineer to take charge and solve problems quickly.
How the CI/CD Maintainers Crew Works
The CI/CD Maintainers Crew finds and fixes CI/CD pipeline failures by working with GitHub Actions and Slack. When a pull request (PR) is created, Kubiya watches for workflow failures using a GitHub webhook. If a failure happens, it pulls the logs, looks for the issue, and posts a fix suggestion on the PR. It also sends a Slack message to let the team know.
This process is fully managed by Terraform, which handles:
Adding a webhook to track GitHub workflow failures.
Setting up the AI teammate to check for problems.
Saving the GitHub token securely in Kubiya.
Posting comments on PRs with what went wrong and how to fix it.
Sending Slack alerts with failure details.
How the Backend Works (Terraform Execution)
Kubiya sets up and runs the CI/CD Maintainers Crew using Terraform, which does the following:
Webhook Monitoring → A GitHub webhook watches for failed workflows and PR check runs.
GitHub Token Management → The GitHub token is saved securely in Kubiya to fetch logs and update PRs.
AI Teammate Setup → Kubiya creates an AI teammate that looks at failed jobs and finds what caused them.
PR Commenting → If a PR fails, Kubiya posts a comment with:
What failed (workflow, job, step).
Why it failed (error logs, missing steps).
How to fix it (suggested changes).
Slack Alerts → Sends Slack messages to let the team know about failures and how to fix them.
CI/CD Maintainers Crew Workflow
Features of CI/CD Maintainers Crew
Automatic Detection of Failed PRs
The AI Teammates are alerted whenever a pull request fails and begin analyzing the issue immediately.
Actionable Suggestions
Add comments on failed pull requests with detailed explanations of the issue and suggestions for how to resolve it.
Root Cause Analysis
Review logs to determine the exact cause of failures, such as missing variables or syntax errors.
Codebase-aware AI Teammates
Solutions Within Seconds
AI Teammates understand your codebase context, making sure that suggestions are relevant and precise.
Real-Time Notifications
Sends notifications to a specified Slack channel with details about the failure and steps to fix it.
Solutions Within Seconds
Your root cause analysis and suggested code fixes will be posted as comments on your PR, so you can continue working from within GitHub.
Private & Secure
As with all Kubiya use cases, your AI Teammates maintain your organization's security and information protection.
Want to get started?
Prerequisites
To set up the CI/CD Maintainers Crew, make sure that the following are in place:
A Kubiya runner (local or hosted)
A GitHub personal access token with access to each of the relevant repositories (see permissions)
A Slack integration (the Kubiya Slack app)
Configuration & Inputs
The CI/CD Maintainers Crew requires specific input variables to function correctly. These inputs define which repositories to monitor, where to send notifications, and how to authenticate with GitHub.
Variable
Description
teammate_name
Name of the CI/CD Maintainers Crew teammate.
repositories
List of GitHub repositories to monitor for failures.
github_token_secret
GitHub Personal Access Token (used for authentication).
pipeline_notification_channel
Slack channel where pipeline failure alerts are sent.
kubiya_runner
Runner that executes the AI teammate’s tasks.
monitor_pr_workflow_runs
Boolean flag to track PR workflow failures.
monitor_push_workflow_runs
Boolean flag to track push workflow failures.
monitor_failed_runs_only
Boolean flag to track only failed workflows.
debug_mode
Enables debug logging for troubleshooting.
organizational_knowledge_multiline
Additional internal documentation for AI teammate reference.
These variables feed directly into Terraform, which then applies the required configurations in GitHub, Kubiya, and Slack.
Understanding Terraform Providers & Workflow
Terraform uses the following providers:
Kubiya → Deploys the AI teammate and webhook handling.
GitHub → Manages webhook registration and repository access.
HTTP → Handles API calls to external services.
Terraform pulls these input values to set up:
Webhooks for event tracking.
Permissions for accessing repositories.
AI teammate configuration for failure analysis.
Set up the CI/CD Maintainers use case
Go to the New Use Cases page
Select CI/CD Maintainers and click Continue
For a full breakdown of setting it up, see our guide on setting up pre-built use cases.
Follow the on-screen instructions.
If you haven't created a runner yet, no problem. In the Select Runner drop-down, choose Create a Runner and follow the on-screen instructions.
Make sure the Slack channel you provide is one in which the Kubiya Slack app has been added.
Click Save and Continue. Behind the scenes, This is running
Terraform Plan
.If the plan is successful, you'll be brought to a screen showing a summary of the resources that will be created. To finish setup, click Delegate. This will run a
Terraform Apply
.
Refresh the screen and check that the use case's status is
Active
. If so, then the Terraform Apply was successful, and you are ready to use your use case.
Permissions & Access
For this use case, Kubiya requires specific permissions in your GitHub.
To do so, create a fine-grained personal access token in GitHub. This token should have access to all of the repositories in which your AI Teammates will operate.
Here are the specific permissions that should be granted:
Actions: Read and Write
Commit statuses: Read-only
Contents: Read-only
Issues: Read and Write
Metadata: Read-only
Pull requests: Read and Write
Webhooks: Read and Write
Workflows: Read and Write
For your GitHub token, make sure that under Resource owner you've selected the correct GitHub organization.
How to use your AI Teammates
Once the CI/CD Maintainers Crew is set up, the AI Teammates automatically handle failed pull requests:
Detect Failures: Identify failed pull requests through GitHub webhooks.
Fetch Logs: Retrieve workflow logs associated with the failure.
Analyze Issues: Review logs to pinpoint the root cause of the failure.
Post Comments: Add comments on the pull request with detailed suggestions for resolving the issue.
Send Notifications: Deliver updates to the specified Slack channel with step-by-step instructions.
Outputs from CI/CD Maintainers Crew
GitHub Pull Request Comments
When a pull request fails, the AI Teammate posts a comment directly on the pull request with details about the failure, root cause, and suggested fixes.
Slack Notifications
The AI Teammate sends real-time updates to Slack with failure details and next steps.
Troubleshooting
Runner Not Healthy
Issue: The runner isn’t processing events.
Fix: Restart the runner from the Kubiya dashboard and verify its health.
Failed Terraform Plan
Issue: Misconfiguration causes Terraform to fail.
Fix: Verify the input values (repositories, GitHub token, Slack channel) and rerun the plan.
Invalid GitHub Token
Issue: The token lacks necessary permissions or is linked to the wrong organization/repository.
Fix: Make sure that the token has the correct permissions and is linked to the appropriate GitHub organization/repository.
Last updated
Was this helpful?