Giter Club home page Giter Club logo

pull-request-assistant's People

Contributors

github-actions[bot] avatar maximbircu avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

pull-request-assistant's Issues

Set up a new project for the PR assistant

Requirements

  • Set up a new Node project for the Assistant GH action
  • Configure CI for master and PR branches
  • Create a PR description template
  • Create issues templates

Add an option to allow Friday commands to be run by all repo contributors

Abstract

It would be nice to have the option to configure Friday so that every repo contributor can run it for cases when all contributors can merge PRs.

Requirements

Do not block running Friday commands if the list of controllers is empty.

Consumer flow

  1. Configure Friday with an empty controllers config list for any repository;
  2. Run any command and make sure Friday runs it.

Implement a Pull Request Assistant and the very first command

Abstract

The PR Assistant should act like a CLI tool embedded into the Github Pull Request UI. The user should be able to run CLI commands by adding them to the PR in for of top-level comments.

The very first command should automate and simplify the PR merging process.

It would be nice to set up the structure of the project in such a way that it will be fairly easy to add new commands to it.

Requirements

Implement the Assistant:

  1. The assistant should be configurable using a JSON file
  2. There should be a way to limit the number of users that could use the assistant - (this is needed as there might be dangerous commands that shouldn't be run by everyone working on a project)
  3. The assistant should have a help command with a neat and clear help message
  4. The project should be scalable and the structure should provide a simple way of adding new commands.
  5. The assistant should execute only the latest active command left on the PR and should ignore all old commands

Implement the merge command

  1. There should be a way to set up a default merge method
  2. The command shouldn't be executed in case the PR is not ready to be merged
  3. There should be a flexible way to configure the merge message generation

Implementation details

Suggested configuration file

{
  "assistant_name": "friday",
  "log_level": "info",
  "assistant_controllers": [],
  "commands": {
    "merge": {
      "default_merge_method": "merge",
      "required_number_of_approvals": 1,
      "commit_message_template_path": "/assets/commands/merge/commit-template.txt",
      "issue_id_provider": "(pullRequest) => pullRequest.sourceBranch.match(/\\d+/)[0]",
      "reviewers_provider": "(reviewers) => reviewers.join(' ')",
      "description_provider": "(pullRequest) => pullRequest.description"
    }
  }
}

How to test

  1. Create a new test branch from the PR base branch
  2. Run yarn build to generate the dist with artifacts
  3. Commit and push the new changes to the test branch
  4. Create a testing repository and integrate add configure the assistant using the test branch as the GH action version
  5. Create new PR in the testing repository
  6. Test all possible friday merge commands on the PR

Add ability to block Pull Request merging using a GitHub label

Abstract

It's a common practice to marc the PRs that are not ready to be merged with a GitHub label. For example, it could be named do-not-merge

It would be nice if we'd be able to make the assistant aware of these labels so that it will take care of and not merge the PR in case it's not ready to be merged.

Requirements

Add the ability to add a label name to the configuration, which will be considered as a blocker for the merge command when they are present on the PR.

Implementation details

You'll have to verify the presence of the label here https://github.com/maximbircu/pull-request-assistant/blob/master/src/domain/commands/merge/MergeabilityProvider.js#L14

Consumer flow

  1. Config a GitHub label that will serve as a blocker for pull request merging;
  2. Open a new pull request and add the label;
  3. Try to merge the PR using the merge command;
  4. Make sure the PR is not merged.

The whole commit message is added to the changelog table of the dry-run of merge command

Abstract

Currently, the whole commit message is added to the changelog table of the dry-run message of the merge command. This looks good in the case of one-line commit messages but doesn't look neat for multi-line ones.

Steps to reproduce

  1. Open a PR from a branch with commits having a multi-line commit message
  2. Run friday merge --dry-run
  3. Notice that the changelog table looks ugly

Expected
Only the first line, which represents the title of the commit message, should be added to the changelog table.

Actual
The whole commit message is added to the changelog table, which makes the changelog table look ugly

Technical notes

We have to use just the commit message title instead of the whole commit message here

result += `\t| ${commit.shortSha} | ${commit.message}\n`

Write documentation for the GH Pull Request Assistant

Abstract

Finally, the PR Assistant is almost ready to be used, and the only missing thing is docs. Yeah, a set of good simple docs that will make it clear how to gather all benefits from the Assistant and will explain how to configure it.

Requirements

Cover the Pull Request Assistant with documentation. For now, the documentation could be written into MD files inside the repo.

How to test

Proofread the docs and make sure they are well structured, clear, and without typos.

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.