Git Product home page Git Product logo

github-pr-summary's Introduction

ChatGPT/4 code reviewer for Github PR

flows.network Discord flows.network Twitter Create a flow

Deploy this function on flows.network, and you will get a GitHub ๐Ÿค– to review and summarize Pull Requests. It helps busy open source contributors understand and make decisions on PRs faster! A few examples below!

Still not convinced? See "potential problems 1" in this review, it identified an inefficient Rust implementation of an algorithm. ๐Ÿคฏ

This bot summarizes commits in the PR. Alternatively, you can use this bot to review changed files in the PR.

How it works

This flow function (or ๐Ÿค–) will be triggered when a new PR is raised in the designated GitHub repo. The flow function collects the content in the PR, and asks ChatGPT/4 to review and summarize it. The result is then posted back to the PR as a comment. The flow functions are written in Rust and run in hosted WasmEdge Runtimes on flows.network.

  • The code review comment is updated automatically every time a new commit is pushed to this PR.
  • A new code review could be triggered when someone says a magic trigger phrase in the PR's comments section. The default trigger phrase is "flows summarize".

Deploy your own code review bot in 3 simple steps

  1. Fork this repo to your own GitHub account. It contains the source code for the GitHub bot.
  2. Import the forked repo on flows.network as a flow function.
  3. Connect the flow function to the GitHub repo you want to deploy the bot on (using the flows.network UI).


Click on the picture above to watch a 3-min tutorial video

Prerequisites

You will need to bring your own OpenAI API key. If you do not already have one, sign up here.

You will also need to sign into flows.network from your GitHub account. It is free.

Deploy the PR review ๐Ÿค– onto your GitHub repos

The ๐Ÿค– is designed to run on flows.network, a serverless platform for SaaS and AI automation.

1 Fork this repo

Fork this repo into your own GitHub account.

If your OpenAI API key has GPT4 access, you can change GPT35Turbo to GPT4 in your fork of the source code. GPT4 provides substantially better code reviews, but it is also 10x more expensive.

2 Deploy the bot's source code on flow.network

Go to flows.network to deploy your own flow function (๐Ÿค–) from the forked source code.

  1. Click on the "Create a Flow" button to start.
  2. Authenticate the flows.network to access the github-pr-summary repo you just forked. NOTE: This is NOT the repo you want to install the bot on.

image

  1. Click on the "Advanced" link to see more settings. Fill in the following environment variables.

The 4 variables below are defined in the flow function's Rust source code. You can assign their values in the source code in your fork directly and skip the steps below.

  • login: Your personal GitHub id. The GitHub app will act as you when posting reviews.
  • owner: GitHub org for the repo you want to deploy the ๐Ÿค– on.
  • repo : GitHub repo you want to deploy the ๐Ÿค– on.
  • trigger_phrase: Optional -- The magic phrase to trigger a review from a PR comment.

Let's see an example. You forked the flow function source code to my-name/github-pr-summary and would like to deploy the bot to summarize PRs on my-company/work-project repo. Here login = my-name, owner = my-company and repo = work-project.

image

  1. Click on the Deploy button.

3 Configure integrations

After that, flows.network will direct you to configure the external services required by your flow function ๐Ÿค–.

image

For this flow function, we need to configue two integrations.

  1. Click on the "Connect" or "+ Add new authentication" button to add your OpenAI API key.

image

  1. Click on the "Connect" or "+ Add new authentication" button to give the function access to the GitHub repo to deploy the ๐Ÿค–. That is to give access to the owner/repo in the environment variables. You'll be redirected to a new page where you must grant flows.network permission to the repo.

After that, click on the "Check" button to go to the flow details page. As soon as the flow's status became running, the PR summary GitHub bot is ready to give code reviews! The bot is summoned by every new PR or magic words (i.e., trigger_phrase) in PR comments.

image

Credits

This flow function is originally created by Jay Chen, and jinser made significant contributions to optimize the event triggers from GitHub.

GPT Nitro for Github PR - A ChatGPT-based reviewer for your GitHub pull requests | Product Hunt

github-pr-summary's People

Contributors

juntao avatar alabulei1 avatar jetjinser avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.