Skip to main content

MergeMate: Automated PR Review and Command Handling

MIT License coverage version Awesome commits

MergeMate is a sophisticated tool crafted to automate pull request reviews and manage command-based interactions within GitHub issues. It harnesses LLMWare, a comprehensive development framework featuring tools and finely-tuned, to deliver insightful, context-aware responses directly within your git workflow.

Features

  • Advanced Integration with LLMWare: Leverages LLMWare to analyze code and manage interactions, utilizing the latest AI technologies for natural language understanding and decision-making.
  • Automated PR Reviews: Generates thorough reviews for pull requests automatically, including specific code suggestions and adherence to best practices.
  • Command Handling: Interprets and responds to commands in PR comments such as /help, /explain, /status, and /ask, enriching the interaction within PR discussions.
  • Markdown Support: Improves readability and interaction by utilizing Markdown for formatting responses, complete with custom headers and footers.
  • Easy Integration: Seamlessly integrates as a GitHub action, facilitating straightforward incorporation into any project's CI/CD pipeline.
  • Future Expansion Plans: Aimed at extending support to other repository management platforms like GitLab and Bitbucket, broadening the accessibility and utility of MergeMate across different development environments.

Installation

Install MergeMate quickly and easily via pip at mergemate:

pip install mergemate

Deploying MergeMate prepares your environment to leverage advanced AI capabilities, streamlining project interactions and reviews.

GitHub Action Setup

Incorporate MergeMate into your GitHub workflows using this configuration:

Workflow Definition

Create the workflow file at .github/workflows/mergemate.yml.

name: Automated PR Review and Command Handling

on:
  pull_request:
    types: [opened, synchronize]
  issue_comment:
    types: [created]

permissions:
  issues: write
  pull-requests: write

jobs:
  review_pull_request:
    if: ${{ github.event_name == 'pull_request' }}
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: '3.9'
      - name: Install dependencies
        run: pip install mergemate
      - name: Review PR
        run: python -m mergemate.scripts.github.pr_review
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

  handle_comment:
    if: ${{ github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/') }}
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: '3.9'
      - name: Install dependencies
        run: pip install mergemate
      - name: Handle Comment
        run: python -m mergemate.scripts.github.comment_handler
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

NOTE: Do not forget to add OPENAI_API_KEY in Github Secrets.

Documentation

Extensive documentation is included within the package, providing detailed setup instructions, configuration options, and command usage. This ensures that users ranging from beginners to experienced developers can effectively utilize and customize MergeMate.

Contributing

We warmly welcome contributions to MergeMate. If you are interested in enhancing its functionality or adapting it for additional use cases, please fork the repository and submit your pull requests. As an open-source project, MergeMate thrives on community involvement and contributions, which are crucial for its continuous evolution and enhancement.

Licensing

MergeMate is proudly released under the MIT license. This permissive licensing fosters widespread adoption and significant contributions from the community, supporting both personal and commercial use.


MergeMate epitomizes the next step in automating interactions within GitHub's ecosystem, propelled by the ongoing advancement of AI-driven development tools. Your feedback and contributions are invaluable to us as we aim to continually expand and enhance MergeMate's capabilities, catering to a growing range of development environments and communities.

Release files for mergemate 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mergemate 0.1.5
File Size Uploaded
mergemate-0.1.5.tar.gz 9.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mergemate 0.1.5
File Interpreter ABI Platform
mergemate-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 19.1 kB

Release files / mergemate-0.1.5.tar.gz

Download URL mergemate-0.1.5.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
cdc95c5d815c63deae86d9e8384a5dfeef5b9bb9fb6bf9695b4d699a8ac52679
BLAKE2b-256 checksum
How to use checksums
445f607ac25bd1c4b3a9a54d84e8ed859d0f418d8011fb862285d99f7dc6aebb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.7

Release files / mergemate-0.1.5-py3-none-any.whl

Download URL mergemate-0.1.5-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c898bfdb7714f9315487eabcaeb9a08fe61480c69cae3595078d3c202c689404
BLAKE2b-256 checksum
How to use checksums
13c1178c9ae81cd350984bf8eb30f9d4c8e5fe4f1bf000998c9243e93677b9e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.7

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page