Pull Request Creation
Overview
When connected to GitHub or GitLab, OpsWorker does not just suggest a fix in prose: the Source Code & Repository Agent can actually create a branch and open a pull request (GitHub) or merge request (GitLab) with the proposed change, and return a live URL to it in the chat turn. The Resource Optimizer uses the same mechanism to open a PR/MR with a right-sized manifest.
This is the only write path in OpsWorker. Everything against your Kubernetes cluster stays read-only (see Safe Execution Model).
How It Works
- Correlate timeline: the agent identifies commits and PRs deployed around the time the issue started.
- Analyze changes: it reviews the code or manifest changes for potential causes.
- Prepare a fix: it determines the specific file modification needed.
- Open the PR/MR: after your confirmation, it creates a branch and opens a PR/MR with the change, and returns the URL in the conversation.
A PR/MR exists only when the tool call actually returned a live URL during the session. There are no background or asynchronous PR jobs: if no URL was returned, no PR/MR was created. Resource Optimizer changes open as a draft when confidence is not high.
Requirements
- GitHub or GitLab integration configured for the cluster (the
sourcecontrolcapability) - Repository write access for the integration's credentials so a branch and PR/MR can be created
- See GitHub Integration or GitLab Integration for setup
Use Cases
Configuration Change Caused an Incident
A Kubernetes manifest change (resource limits, environment variables, selectors) introduced an issue. The agent identifies the specific commit and can open a PR/MR reverting or adjusting the change.
Application Code Bug
A recent code deployment introduced a bug. The agent identifies the deploy commit, highlights the relevant changes, and can open a PR/MR with a fix.
Right-Sizing Resources
The Resource Optimizer detects over- or under-provisioned workloads from live metrics and opens a PR/MR adjusting CPU/memory requests, memory limits, or HPA.
What You See
- Related commits: commits deployed around the incident timeframe with links
- Changed files: the specific files and changes involved
- A live PR/MR link: when a PR/MR is opened, its URL is returned directly in the chat turn
Human Review
Every PR/MR is intended for human review. OpsWorker opens the request; your team reviews, approves, and merges it through your normal process. OpsWorker does not merge changes as a background job.
Next Steps
- Source Code & Repository Agent: full agent capabilities
- GitHub Integration: connect GitHub
- GitLab Integration: connect GitLab
- Safe Execution Model: how the write path stays safe