Giter Site home page Giter Site logo

noqcks / pull-request-size Goto Github PK

View Code? Open in Web Editor NEW
152.0 5.0 38.0 2.68 MB

Applies labels to Pull Requests based on the total lines of code changed.

Home Page: https://github.com/marketplace/pull-request-size

License: MIT License

JavaScript 100.00%
github-app productivity pull-requests probot

pull-request-size's Introduction

Pull Request Size drawing

License: MIT Sentry Build Status codecov Dependabot

Pull Request Size is a GitHub App that applies size/* labels to Pull Requests based on the total lines of code changed (additions and deletions).

screen shot 2018-11-01 at 10 42 27 am

Install

👉 Install via GitHub marketplace 🌟

This app is free to use for personal and public organization repos. There is a paid plan for use with private organization repos.

Sizing

Name Description
size/XS Denotes a PR that changes 0-9 lines.
size/S Denotes a PR that changes 10-29 lines.
size/M Denotes a PR that changes 30-99 lines.
size/L Denotes a PR that changes 100-499 lines.
size/XL Denotes a PR that changes 500-999 lines.
size/XXL Denotes a PR that changes 1000+ lines.

Pull Request Size calculates the size of a PR as

total additions + total deletions - (all generated¹ file additions/deletions)

¹ A generated file is either one of the standard generated files as defined in noqcks/generated or defined with linguist-generated=true in a .gitattributes file.

Billing Issues

image

When an invoiced GitHub account tries to sign up for a subscription to Pull Request Size via the GitHub Marketplace they are met with the following message: "Unfortunately, invoiced customers cannot purchase paid plans on the Github Marketplace."

To get around GitHub billing limitations, we also offer payment via Stripe invoicing. Please follow these steps to complete:

  1. Sign up for the Free plan on the GitHub Marketplace listing
  2. Send an email to [email protected] with a company name, email of a billing contact, and the name of your GitHub Organization. Please indicate whether you would like a yearly or monthly invoice.
  3. Once the Stripe invoice has been paid, you will be added to Pro plan.

Configuration

This app requires no configuration out of the box. However, you can exclude certain files from being counted towards a PR's size, and you can add custom labels in Github.

Excluding Files

If you have files that you would not like to be included in the calculation for a Pull Request's size, you can modify the .gitattributes file with the flag linguist-generated=true on your file or file pattern.

For example to mark all .meta files as generated, add this line to .gitattributes

*.meta linguist-generated=true

A .gitattributes file uses the same rules for matching as .gitignore files. See GitHub documenation on the linguist-generated flag for more info.

Custom Labels

You can set custom label names and colors by checking in the file .github/labels.yml to every repository you'd like to customize

XS:
  name: size/XS
  lines: 0
  color: 3CBF00
S:
  name: size/S
  lines: 10
  color: 5D9801
M:
  name: size/M
  lines: 30
  color: 7F7203
L:
  name: size/L
  lines: 100
  color: A14C05
XL:
  name: size/XL
  lines: 500
  color: C32607
XXL:
  name: size/XXL
  lines: 1000
  color: E50009

Size Comments

Size Comments are comments made on the size of a pull request. By default, Pull Request Size will not add any comments to a pull request. However, you can enable comments by adding a comment to a label in the .github/labels.yml file.

Any comment that is not empty wil be added to the pull request. Leave this key empty to disable comments for a size.

XXL:
  name: size/XXL
  lines: 1000
  color: E50009
  comment: |
    # Whoa! Easy there, Partner!
    This PR is too big. Please break it up into smaller PRs.

Feedback, suggestions and bug reports

Please create an issue here: https://github.com/noqcks/pull-request-size/issues

License

MIT © 2022 Benji Visser [email protected]

pull-request-size's People

Contributors

dependabot[bot] avatar eddiewentw avatar fabianschwarzfritz avatar noqcks avatar snyk-bot avatar tomerfi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pull-request-size's Issues

Intermittent failures

This bot seems to skip applying labels to PRs intermittently.

image

Couldn't find any errors/logs anywhere so not sure where to look further.

Customize labels and size of changes

Would Pull Request Size consider supporting a configuration file that specifies the size of changes and corresponding labels to be used by the app, rather than the default configuration?

This feature would require permissions to read the entire repo content, since multiple file access appears unavailable currently.

Question: How to install for an organization?

Hi, I'm trying to install this app on this repo https://github.com/Axway/axway-open-docs which is owned by an organization. I am an admin of the repo but I am not an admin of the organization.

When I try to install this app, I only get an option to install it on my personal account, and not on the organization account.

image

But for other apps (such as Mergeable) I am able to install on the organization account.

image

Are additional permissions needed for this app or am I doing something wrong?

Uninstall

Hey there, Since we're not able to pay for the bot, we decided to uninstall it - but we're still getting the messages in every PR...
I could block the bot user but prefer not to...what am I doing wrong?

Generated code still being counted

We use a lot of Go code generation, and the code gen headers match your regex in isGoCodgen, but the change still get counted. Any ideas?

exclude certain file types/extensions from line counts

I have a feature request for you: the ability to exclude certain file types/extensions from your line count calculations (if this is possible based on GH app permissions.) I would like to exclude things like Jest snapshots, lock file changes, etc., as they tend to artificially inflate otherwise simple PRs.

And thanks again for this GH extension!

Comments based on size

It would be nice to be able to add comments to the PR as well based on the size of the PR. Especially when it comes to large PRs, we would like to discourage people from making these and give them some strategies how to break up their work.

Question: applying to old issues

First of all, thank you for Pull Request Size! It helps me keep a huge PR backlog organised.

Is there any way I can update old pull requests that were present before I installed the app?

I've found that I can individually edit a pull request's description to force-retrigger an update... but I was wondering if it was possible to do so en masse across all open issues somehow.

Upgraded to Github Enterprise, now I see an error

image

Everything was working just fine. I was using the integration on a private repo, and I was paying for it. Then I upgraded to Github Enterprise today. I started seeing the above error message on all the new PRs.

I tried uninstalling and re-installing the plugin on the Github Marketplace. However, Github knew that I still had an active billing with the integration despite me uninstalling it. I'm not sure what else I should be doing at this point to fix it.

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.