Ironic Backport Agent

Ironic Backport Agent

Automates backporting upstream Ironic changes across OpenShift release branches using Claude AI for intelligent decision-making and natural language interaction.

Category
Visit Server

README

Ironic Backport Agent (MCP Version)

AI-assisted automation for backporting upstream Ironic changes across OpenShift release branches.

Works with Claude Code - No separate API keys needed!

Project Goal

Automate the repetitive backport workflow for OpenShift BareMetal/Ironic releases using Claude AI for intelligent decision-making. Runs as an MCP server that integrates seamlessly with Claude Code.

JIRA Epic: METAL-1814
Research Spike: METAL-1817

How It Works

Instead of using CLI commands, you talk to Claude naturally:

You: "Backport PR #370 to release-4.20"

Claude: [analyzes PR] "I found 3 commits. Based on the changes,
        only commit 42ac11d31 should be backported. Proceed?"

You: "Yes"

Claude: [executes backport, creates PR] "✅ Done! PR #456 created"

Features

🤖 AI-Powered (via Claude Code)

  • Analyzes PRs to recommend which commits to backport
  • Determines which release branches need the fix
  • Suggests merge conflict resolutions
  • Generates PR titles and descriptions following OpenShift conventions
  • Adapts to errors and retries intelligently

⚙️ Automated Operations

  • Git cherry-pick with conflict detection
  • Branch management and analysis
  • GitHub PR creation with proper formatting
  • Dependency file updates (requirements.cachito, main-package-list.ocp)

💬 Natural Conversation

  • No commands to memorize - just describe what you want
  • Context-aware - Claude remembers the conversation
  • Human oversight - You approve critical steps naturally
  • Audit trail built into Claude conversation history

Quick Start

1. Install

cd /Users/jhajyahy/ironic-backport-agent
./install.sh

2. Configure

# Only need GitHub token - no Claude API key!
export GITHUB_TOKEN="ghp_xxxxxxxxxxxx"

Get token from: https://github.com/settings/tokens (scopes: repo + workflow)

3. Set Up MCP

Add to ~/.claude/config.json:

{
  "mcpServers": {
    "ironic-backport": {
      "command": "python",
      "args": ["/Users/jhajyahy/ironic-backport-agent/src/backport_agent/mcp_server.py"],
      "env": {"GITHUB_TOKEN": "${GITHUB_TOKEN}"}
    }
  }
}

4. Restart Claude Code

The backport tools will now be available in your Claude Code session!

📖 See SETUP-MCP.md for detailed setup guide.

Config File

Create config.yaml:

github:
  base_org: openshift
  repos:
    - openstack-ironic
    - ironic-image
    - ironic-python-agent-image

claude:
  model: claude-sonnet-4-5
  max_tokens: 4096

release_branches:
  - release-4.17
  - release-4.18
  - release-4.19
  - release-4.20
  - release-4.21
  - release-4.22

workflow:
  auto_approve: false
  conflict_strategy: ai_suggest

Usage Examples

Simple Backport

You: "Backport PR #370 from openstack-ironic to release-4.20"

Claude: "I found PR #370 with 3 commits. Analyzing..."
        [uses analyze_pr tool]
        
        "Based on the changes:
        - 42ac11d31: Update heartbeat ✓ BACKPORT
        - abc123de4: Update dev deps ✗ SKIP
        - def456g78: Fix pep8 ✗ SKIP
        
        Proceed with backporting commit 42ac11d31?"

You: "Yes"

Claude: [creates branch, cherry-picks, creates PR]
        "✅ PR created: https://github.com/.../pull/456"

Check Branch Coverage

You: "Does release-4.20 already have commit 42ac11d31?"

Claude: [uses analyze_branch_coverage tool]
        "No, it's not in release-4.20.
        Present in: release-4.21, release-4.22
        Would you like to backport it?"

Batch Backport

You: "Backport PR #370 to all active releases"

Claude: "Analyzing which branches need this fix..."
        [checks each branch]
        
        "Results:
        - release-4.18: Needs it ✓
        - release-4.19: Needs it ✓
        - release-4.20: Needs it ✓
        - release-4.21: Already has it ✗
        - release-4.22: Already has it ✗
        
        Create 3 backport PRs?"

You: "Yes"

Claude: [creates PRs for 4.18, 4.19, 4.20]
        "✅ All done!
        - 4.18: PR #457
        - 4.19: PR #458
        - 4.20: PR #459"

Conflict Handling

You: "Backport commit 42ac11d31 to release-4.20"

Claude: [attempts cherry-pick]
        "⚠️ Conflict in ironic/conductor/manager.py
        
        Analyzing..."
        [reads conflict content]
        
        "The conflict is in import order. Suggested resolution:
        - Use THEIR version for update_heartbeat function
        - Keep OURS version for imports
        
        Apply this?"

You: "Yes"

Claude: [resolves conflict, completes cherry-pick]
        "✅ Resolved and cherry-picked!"

Architecture

See ARCHITECTURE.md for detailed design documentation.

Development

Run Tests

pytest tests/ -v --cov=backport_agent

Code Quality

# Format
black src/

# Lint
ruff check src/

# Type check
mypy src/

METAL-1817 Research Findings

This prototype addresses all research questions from the spike:

✅ Branch Analysis

  • Implemented via git branch --contains and AI-assisted applicability detection
  • See: src/backport_agent/git_ops.py:analyze_branch_coverage()

✅ Cherry-Pick Automation

  • Conflict detection with AI-suggested resolutions
  • See: src/backport_agent/git_ops.py:cherry_pick_with_ai()

✅ GitHub Integration

  • PAT scope requirements documented above
  • PR creation via PyGithub with proper title format
  • See: src/backport_agent/github_client.py

✅ Dependency File Updates

  • AI determines which file to update (requirements.cachito vs main-package-list.ocp)
  • Automated hash updates
  • See: src/backport_agent/dependency_updater.py

✅ GitLab Integration

  • Python-gitlab for ospinfo repos
  • See: src/backport_agent/gitlab_client.py

Roadmap

  • [x] METAL-1817: Git/GitHub/GitLab integration research
  • [ ] METAL-1820: Phase 1 prototype (Scenario A)
  • [ ] METAL-1821: JIRA API integration
  • [ ] METAL-1819: CI monitoring
  • [ ] METAL-1822: Brew/Koji support (Scenario B)
  • [ ] METAL-1823: Optimized semi-autonomous mode
  • [ ] METAL-1824: Production deployment

Contributing

This is a team effort! See the Slack channel for coordination.

License

Internal Red Hat tooling - not for public distribution.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured