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 documentation for auto-labeling workflow #131

Merged
merged 3 commits into from
Mar 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion BACKPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Integrating the backport workflow is easy and can be done with the following ste

To use the auto backport workflow:

1. Label the original PR according to the release-branch. For example, to backport to 1.x , please add a label `backport 1.x`. You can add multiple backport labels to different release branches. Labels can be added in any order: meaning before or after the PR is merged.
1. Label the original PR according to the release-branch. For example, to backport to 1.x, please add a label `backport 1.x`. You can add multiple backport labels to different release branches. Labels can be added in any order: meaning before or after the PR is merged. Note that there is an [auto-labeling](./LABELS.md) action that can be configured to help automate this process.
2. Once the label is added and the original PR is in a merged state, the auto backport workflow will create backport PR if there are no merge conflicts using `opensearch-trigger-bot`. If there are merge conflicts, it will comment on the original PR on the steps to take.
3. Once the backport PR is merged, the branch created for backport will be auto-deleted.

Expand Down
12 changes: 12 additions & 0 deletions LABELS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- [Labeling PRs](#labeling-prs)
- [Integration](#integration)

# Labeling PRs

Many of the automated workflows to generate [release notes](./RELEASE_NOTES.md) or [backport PRs](./BACKPORT.md) require labels on the PRs to correctly categorize them and perform the right actions. To eliminate having to do this manually, there is an [auto-labeling GitHub action](https://github.com/actions/labeler), which allows for automatically labeling opened PRs based on the files that the PR changes.

## Integration

1. Integrate the `opensearch-trigger-bot` in your repository, if not done already. This requires adding some GitHub secrets. See the [backport documentation](./BACKPORT.md) for details.
2. Add a labeling config `.github/labeler.yml` ([example](https://github.com/actions/labeler#common-examples)) to your repository. This is where labels can be defined, along with their associated glob patterns, such that if any matching files are changed in a PR, that label will be applied.
3. Add a GitHub workflow `.github/workflows/labeler.yml` ([example](https://github.com/opensearch-project/anomaly-detection-dashboards-plugin/blob/main/.github/workflows/labeler.yml)) to your repository, to utilize the configuration. Note this uses permissions provided from the `opensearch-trigger-bot` instead of the default `github-actions`, due to security limitations regarding forked repository pull requests (details on the limitations [here](https://github.com/actions/first-interaction/issues/10)).
13 changes: 7 additions & 6 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

Release notes help OpenSearch users learn about new features, and make educated decisions with regards to upgrading.

- [Release Notes Folder](#release-notes-folder)
- [Naming Convention](#naming-convention)
- [Categories](#categories)
- [Plugin Release Notes](#plugin-release-notes)
- [Release Notes Folder](#release-notes-folder)
- [Naming Convention](#naming-convention)
- [Categories](#categories)
- [Breaking Changes](#breaking-changes)
- [Features](#features)
- [Enhancements](#enhancements)
Expand All @@ -13,8 +14,8 @@ Release notes help OpenSearch users learn about new features, and make educated
- [Documentation](#documentation)
- [Maintenance](#maintenance)
- [Refactoring](#refactoring)
- [Change Lines](#change-lines)
- [Automation](#automation)
- [Change Lines](#change-lines)
- [Automation](#automation)

## Release Notes Folder

Expand Down Expand Up @@ -109,4 +110,4 @@ _Correct:_ `* Fix the out of memory issue ([#456](http:/#456))`

Create a GitHub Actions workflow to help draft release notes. See [.github/workflows/draft-release-notes.yml](.github/workflows/draft-release-notes.yml) for an example. This workflow is configured using [.github/draft-release-notes-config.yml](.github/draft-release-notes-config.yml).

See [release-drafter](https://github.com/release-drafter/release-drafter) for more information.
See [release-drafter](https://github.com/release-drafter/release-drafter) for more information. Note that this GitHub action utilizes labels on PRs. For more information on automating labels, see the [auto-labeling workflow](./LABELS.md).