Overview
Code fixes help your team move from root cause to a reviewable patch without leaving Metoro. When Guardian determines that a production problem or deployment regression is likely caused by application code, it can inspect the mapped source repository, propose a fix, and prepare a pull request for your team to review.Find the Faulty Code
Generate a Patch
Review Before Merge
How Code Fixes Work
Guardian investigates an issue
Guardian finds the matching source code
Guardian analyzes a temporary repository workspace
Guardian saves a generated diff
Your team creates and reviews the pull request
Supported Source Code Integration
GitHub is the currently supported source code repository integration for code fixes. Connect GitHub when you want Guardian to:- Read relevant repository contents during investigations
- Correlate deployment changes with production behavior
- Generate code diffs for likely application bugs
- Create pull requests for generated fixes
Setting Up GitHub for Code Fixes During Onboarding
If you are onboarding AI SRE for the first time, you can connect GitHub directly from the onboarding flow. You can also connect it later from the Settings -> Integrations page in Metoro.Go to the Source Code Mapping step
Connect GitHub
Authorize in GitHub
- Select your organization or personal account
- Choose repository access:
- All repositories - Recommended for full coverage
- Selected repositories - Choose specific repos to grant access
- Review requested permissions
- Click Install & Authorize
Map source code
Verify the Connection
After installation, verify the connection:- Return to Settings -> Integrations -> Third-Party Integrations -> GitHub
- Confirm that GitHub is connected. (The button will turn to Disconnect when GitHub is connected)
Source Code Mapping
Source code mapping tells Guardian which repository belongs to each Kubernetes service. During the onboarding flow, Metoro includes a Source Code Mapping step. This feature checks the services running in your cluster and tries to match them to repositories that Metoro can see from your connected GitHub account. It can also match services to public GitHub repositories when enough repository information is available. You can review and adjust the suggested mappings before using them. For each service, a mapping can include:- Repository URL
- Optional repository path for monorepos
- Optional branch name for environment-specific code
Repository Mapping
Repository mapping links your Metoro services to their corresponding GitHub repositories, enabling Metoro to analyze the right code for each service. Each service in your system can be mapped to its source code repository:- One-to-one: A single service maps to a single repository.
- Monorepo: Multiple services map to the same repository with different paths.
Access Repository Mapping
- Navigate to AI SRE -> Onboarding -> Source Code Mapping
- Review the services detected in your cluster
- Accept, edit, or add mappings for each service
Map Services to Repositories
For each service, configure its repository mapping:- Simple Mapping
- Monorepo Mapping
- Find your service in the list, such as
payment-service - Click Map Repository
- Select the repository, such as
org/payment-service - Leave Repository Path empty to use the repository root
- Click Save Mapping
- Service:
payment-service - Repository:
metoro-org/payment-service - Path:
/
Advanced Configuration
Branch Selection
Configure which branch Metoro should analyze:- Default Branch
- Specific Branch
- Environment-Based
main or master.No configuration is needed for this behavior.Reviewing Generated Code Fixes
After Guardian generates a code fix, you can review and create a pull request from Guardian -> Code Fixes page. Take me thereWhat Metoro Can and Cannot Do
Metoro can:- Analyze mapped source code when a Guardian workflow needs repository context
- Generate a proposed code diff for a likely application issue
- Create a pull request when a user chooses to create one from the generated diff
- Link generated fixes back to the related investigation or issue
- Continuously read every repository
- Store a persistent mirror of your source code
- Automatically merge pull requests
- Modify repositories outside the permissions granted to the GitHub App
FAQ
Can Metoro modify my code?
Can Metoro modify my code?
Do I need to map every service manually?
Do I need to map every service manually?
What if my service is in a monorepo?
What if my service is in a monorepo?
/services/api. Guardian uses that path to focus code analysis on the relevant part of the repository.What if my repository structure changes?
What if my repository structure changes?
How does Metoro handle private repositories?
How does Metoro handle private repositories?
Where can I read more about GitHub permissions?
Where can I read more about GitHub permissions?
