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 auto labeler workflow #205

Merged
merged 1 commit into from
Mar 15, 2022

Conversation

ohltyler
Copy link
Member

Signed-off-by: Tyler Ohlsen ohltyler@amazon.com

Description

This PR adds a labeling github action which is triggered on PRs opening to main. There are 2 added files:

  1. .github/labeler.yml: configures the labels to add to the PR, if the PR's changed files match any of the glob patterns specified. For example, this adds a dependencies label whenever a PR is opened that changes yarn.lock.
  2. .github/workflows/labeler.yml: the actual github action which uses the specified config. Uses permissions from the OpenSearch GitHub app to be able to write to the PR, since that is not possible using the default GITHUB_TOKEN. For more details see here, here

Example PR of this working in my forked repo (using a personal bot in order to get permissions to write to PRs in this repo): ohltyler#7 (auto-label workflow run: link)

Notes:

  • it is defaulting all changes to backport 1.x - this is because this plugin is not tracking the next major version (2.0.0), and so all changes merged to main currently are being backported to 1.x branch already (note this will need to change when moving to 2.0.0 compatibility / having 2.x branch). Also note backport 1.x is the branch name used by the auto-backport bot to open a backport PR to 1.x branch when a PR is merged, so this closes the gap and allows for a fully automated way to open a PR -> merge PR -> backport to release branch.
  • it will add or remove labels based on changes in the PR - for example if yarn.lock was originally changed and then reverted within the PR, the labeler would add and remove the dependencies label as well
  • .github/**/* pattern had to be added separately in backport 1.x label due to the labeler not picking up directories starting with . by default

TODO: understand the github bot permissions and if it can be used for this github action. Until then, this PR is blocked when trying to use the default repo token. Ref: actions/first-interaction#10, use of an app to solve: mentioned here

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
@ohltyler ohltyler requested a review from a team March 10, 2022 17:30
@ohltyler ohltyler mentioned this pull request Mar 10, 2022
1 task
@codecov-commenter
Copy link

Codecov Report

Merging #205 (633ad07) into main (9ae8917) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #205   +/-   ##
=======================================
  Coverage   45.90%   45.90%           
=======================================
  Files         150      150           
  Lines        4956     4956           
  Branches      955      968   +13     
=======================================
  Hits         2275     2275           
  Misses       2463     2463           
  Partials      218      218           

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 9ae8917...633ad07. Read the comment docs.

@ohltyler
Copy link
Member Author

The backport 1.x label can be tuned in the near future to backport 2.x once main is bumped to 2.0 and a 2.x branch is cut.

Copy link
Member

@amitgalitz amitgalitz left a comment

Choose a reason for hiding this comment

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

This is really helpful!

@ohltyler ohltyler merged commit f028924 into opensearch-project:main Mar 15, 2022
@ohltyler ohltyler deleted the add-auto-labeler branch March 15, 2022 23:38
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 22, 2022
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
(cherry picked from commit f028924)
ohltyler added a commit that referenced this pull request Mar 22, 2022
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
(cherry picked from commit f028924)
@amitgalitz amitgalitz added the infra Changes to infrastructure, testing, CI/CD, pipelines, etc. label Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.x infra Changes to infrastructure, testing, CI/CD, pipelines, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants