Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pr-body-labels plugin #1554

Merged
merged 4 commits into from
Oct 1, 2020
Merged

Add pr-body-labels plugin #1554

merged 4 commits into from
Oct 1, 2020

Conversation

hipstersmoothie
Copy link
Collaborator

@hipstersmoothie hipstersmoothie commented Sep 30, 2020

What Changed

Add a plugin that detect GitHub labels in a PR body and adds them to the PR.

Why

Outside contributors can't add these labels

Todo:

  • Add tests
  • Add docs

Change Type

Indicate the type of change your pull request is:

  • documentation
  • patch
  • minor
  • major
📦 Published PR as canary version: under canary scope @auto-canary@9.53.2-canary.1554.19032.0

✨ Test out this PR locally via:

npm install @auto-canary/bot-list@9.53.2-canary.1554.19032.0
npm install @auto-canary/auto@9.53.2-canary.1554.19032.0
npm install @auto-canary/core@9.53.2-canary.1554.19032.0
npm install @auto-canary/all-contributors@9.53.2-canary.1554.19032.0
npm install @auto-canary/brew@9.53.2-canary.1554.19032.0
npm install @auto-canary/chrome@9.53.2-canary.1554.19032.0
npm install @auto-canary/cocoapods@9.53.2-canary.1554.19032.0
npm install @auto-canary/conventional-commits@9.53.2-canary.1554.19032.0
npm install @auto-canary/crates@9.53.2-canary.1554.19032.0
npm install @auto-canary/docker@9.53.2-canary.1554.19032.0
npm install @auto-canary/exec@9.53.2-canary.1554.19032.0
npm install @auto-canary/first-time-contributor@9.53.2-canary.1554.19032.0
npm install @auto-canary/gem@9.53.2-canary.1554.19032.0
npm install @auto-canary/gh-pages@9.53.2-canary.1554.19032.0
npm install @auto-canary/git-tag@9.53.2-canary.1554.19032.0
npm install @auto-canary/gradle@9.53.2-canary.1554.19032.0
npm install @auto-canary/jira@9.53.2-canary.1554.19032.0
npm install @auto-canary/maven@9.53.2-canary.1554.19032.0
npm install @auto-canary/npm@9.53.2-canary.1554.19032.0
npm install @auto-canary/omit-commits@9.53.2-canary.1554.19032.0
npm install @auto-canary/omit-release-notes@9.53.2-canary.1554.19032.0
npm install @auto-canary/pr-body-labels@9.53.2-canary.1554.19032.0
npm install @auto-canary/released@9.53.2-canary.1554.19032.0
npm install @auto-canary/s3@9.53.2-canary.1554.19032.0
npm install @auto-canary/slack@9.53.2-canary.1554.19032.0
npm install @auto-canary/twitter@9.53.2-canary.1554.19032.0
npm install @auto-canary/upload-assets@9.53.2-canary.1554.19032.0
# or 
yarn add @auto-canary/bot-list@9.53.2-canary.1554.19032.0
yarn add @auto-canary/auto@9.53.2-canary.1554.19032.0
yarn add @auto-canary/core@9.53.2-canary.1554.19032.0
yarn add @auto-canary/all-contributors@9.53.2-canary.1554.19032.0
yarn add @auto-canary/brew@9.53.2-canary.1554.19032.0
yarn add @auto-canary/chrome@9.53.2-canary.1554.19032.0
yarn add @auto-canary/cocoapods@9.53.2-canary.1554.19032.0
yarn add @auto-canary/conventional-commits@9.53.2-canary.1554.19032.0
yarn add @auto-canary/crates@9.53.2-canary.1554.19032.0
yarn add @auto-canary/docker@9.53.2-canary.1554.19032.0
yarn add @auto-canary/exec@9.53.2-canary.1554.19032.0
yarn add @auto-canary/first-time-contributor@9.53.2-canary.1554.19032.0
yarn add @auto-canary/gem@9.53.2-canary.1554.19032.0
yarn add @auto-canary/gh-pages@9.53.2-canary.1554.19032.0
yarn add @auto-canary/git-tag@9.53.2-canary.1554.19032.0
yarn add @auto-canary/gradle@9.53.2-canary.1554.19032.0
yarn add @auto-canary/jira@9.53.2-canary.1554.19032.0
yarn add @auto-canary/maven@9.53.2-canary.1554.19032.0
yarn add @auto-canary/npm@9.53.2-canary.1554.19032.0
yarn add @auto-canary/omit-commits@9.53.2-canary.1554.19032.0
yarn add @auto-canary/omit-release-notes@9.53.2-canary.1554.19032.0
yarn add @auto-canary/pr-body-labels@9.53.2-canary.1554.19032.0
yarn add @auto-canary/released@9.53.2-canary.1554.19032.0
yarn add @auto-canary/s3@9.53.2-canary.1554.19032.0
yarn add @auto-canary/slack@9.53.2-canary.1554.19032.0
yarn add @auto-canary/twitter@9.53.2-canary.1554.19032.0
yarn add @auto-canary/upload-assets@9.53.2-canary.1554.19032.0

Copy link

@reubenae reubenae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I definitely approve of this change

@codecov
Copy link

codecov bot commented Sep 30, 2020

Codecov Report

Merging #1554 into master will increase coverage by 0.00%.
The diff coverage is 82.35%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1554   +/-   ##
=======================================
  Coverage   81.21%   81.21%           
=======================================
  Files          59       60    +1     
  Lines        4396     4413   +17     
  Branches      932      986   +54     
=======================================
+ Hits         3570     3584   +14     
- Misses        572      573    +1     
- Partials      254      256    +2     
Impacted Files Coverage Δ
packages/core/src/utils/make-hooks.ts 100.00% <ø> (ø)
plugins/pr-body-labels/src/index.ts 81.25% <81.25%> (ø)
packages/core/src/auto.ts 77.24% <100.00%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update beb6ea1...109658c. Read the comment docs.

return;
}

const projectLabels = await auto.git.getProjectLabels();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be limited to tags defined by the .auto config? Or does getProjectLabels() do that already?
There's a potential of this being abused to add any label (i.e. "merge when built") to a PR simply by adding a note in the PR body.

@adierkens adierkens added the minor Increment the minor version when merged label Sep 30, 2020
@hipstersmoothie hipstersmoothie merged commit c9d0b51 into master Oct 1, 2020
@hipstersmoothie hipstersmoothie deleted the pr-label-body branch October 1, 2020 01:10
@adierkens
Copy link
Collaborator

🚀 PR was released in v9.54.0 🚀

@adierkens adierkens added the released This issue/pull request has been released. label Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Increment the minor version when merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants