Skip to content

wuyuwenj/CodeBeaver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Merge Resolver

A GitHub App that detects merge conflicts, generates multiple resolution options, tests each in sandboxes, and posts results to the PR.

Features

  • Automatic Conflict Detection: Listens to PR events and detects merge conflicts
  • Multiple Resolution Options:
    • Option A: Keep base branch version (yours)
    • Option B: Keep incoming branch version (theirs)
    • Option C: AI-merged resolution using Claude
  • Sandbox Testing: Tests each resolution in isolated Daytona sandboxes
  • Clear Results: Posts formatted results with test pass/fail status

Setup

1. Install Dependencies

npm install

2. Register GitHub App

Run the dev server and follow the Probot setup wizard:

npm run dev

This will open http://localhost:3000 where you can register your GitHub App.

3. Configure Environment Variables

Copy .env.example to .env and fill in the values:

cp .env.example .env

Required variables:

  • APP_ID - From GitHub App registration
  • PRIVATE_KEY - From GitHub App registration
  • WEBHOOK_SECRET - From GitHub App registration

Optional (for full functionality):

  • DAYTONA_API_KEY - For sandbox testing
  • DAYTONA_SERVER_URL - Daytona server URL
  • ANTHROPIC_API_KEY - For AI merge generation

4. Install on a Repository

After registering, install the app on a test repository.

Development

# Run in development mode with hot reload
npm run dev

# Build TypeScript
npm run build

# Run production build
npm start

Usage

Once installed on a repository:

  1. Open a PR with merge conflicts
  2. The app will automatically detect conflicts and post a comment
  3. View the analysis with test results for each resolution option
  4. Comment /resolve A, /resolve B, or /resolve C to apply a resolution

Project Structure

src/
├── index.ts              # Main Probot entry point
├── handlers/
│   └── pullRequest.ts    # PR event handlers
├── services/
│   ├── conflict.ts       # Conflict detection & parsing
│   ├── github.ts         # GitHub API helpers
│   ├── merge.ts          # Merge option generation
│   ├── claude.ts         # AI merge (requires API key)
│   └── daytona.ts        # Sandbox testing (requires API key)
├── utils/
│   ├── markdown.ts       # Result formatting
│   └── testRunner.ts     # Test framework detection
└── types/
    └── index.ts          # TypeScript types

Current Status

  • Project scaffolding
  • TypeScript configuration
  • PR event handling
  • Conflict detection logic
  • Conflict marker parsing
  • Merge option generation
  • Results formatting
  • Daytona integration (needs API key)
  • Claude integration (needs API key)
  • Resolution application
  • Production deployment

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published