Chore: Add auto-milestone workflow for pull-requests (#71177)

This adds a new auto-milestone workflow that will set the milestone for
a PR when it is closed. This way, contributors no longer have to think
about milestone at all.
This commit is contained in:
Horst Gutmann 2023-07-17 09:55:35 +02:00 committed by GitHub
parent 5f63d1a5cb
commit 8ae92db53d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 16 deletions

1
.github/CODEOWNERS vendored
View File

@ -592,6 +592,7 @@ embed.go @grafana/grafana-as-code
/.github/pr-commands.json @marefr
/.github/renovate.json5 @grafana/frontend-ops
/.github/teams.yml @armandgrillet
/.github/workflows/auto-milestone.yml @grafana/grafana-delivery
/.github/workflows/backport.yml @grafana/grafana-delivery
/.github/workflows/bump-version.yml @grafana/grafana-delivery
/.github/workflows/close-milestone.yml @grafana/grafana-delivery

View File

@ -1,11 +1,4 @@
[
{
"type": "check-milestone",
"title": "Milestone Check",
"targetUrl": "https://github.com/grafana/grafana/blob/main/contribute/merge-pull-request.md#assign-a-milestone",
"success": "Milestone set",
"failure": "Milestone not set"
},
{
"type": "check-label",
"title": "Backport Check",
@ -46,4 +39,4 @@
},
"targetUrl": "https://github.com/grafana/grafana/blob/main/contribute/merge-pull-request.md#include-in-changelog-and-release-notes"
}
]
]

22
.github/workflows/auto-milestone.yml vendored Normal file
View File

@ -0,0 +1,22 @@
name: Auto-milestone
on:
pull_request:
types:
- closed
jobs:
main:
runs-on: ubuntu-latest
steps:
- name: "Generate token"
id: generate_token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
with:
app_id: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }}
private_key: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }}
- name: Run auto-milestone
uses: grafana/grafana-github-actions-go/auto-milestone@main
with:
pr: ${{ github.event.pull_request.number }}
token: ${{ steps.generate_token.outputs.token }}

View File

@ -13,7 +13,6 @@ The following checklist/summary should give you a quick overview of what to ask/
- Reviewed and approved?
- All checks passed?
- Proper pull request title?
- Milestone assigned?
- Add to changelog/release notes?
- Needs backporting?
@ -40,14 +39,17 @@ See [formatting guidelines](create-pull-request.md#formatting-guidelines) for mo
### Assign a milestone
A milestone **should** be added to every pull request. Several things in the Grafana release process requires at least pull requests to be in a milestone, for example [generating changelog/release notes](#include-in-changelog-and-release-notes).
Several things in the Grafana release process requires at least pull requests to be in a milestone, for example [generating changelog/release notes](#include-in-changelog-and-release-notes).
This makes it easier to track what changes go into a certain release. Without this information, release managers have to go through git commits which is not an efficient process.
Always assign the milestone for the version that a PR is merged into.
That being said, _you don't have to assign a milestone manually_ to a pull request.
Instead, when it is merged & closed then a bot will look for the most appropriate miletone and assign it to the pull request.
That milestone should always reflect the branch that the pull request is merged into.
For every major and minor release there is a milestone ending with `.x` (e.g. `10.0.x` for the 10.0.x releases).
PRs targetting `main` should use the `.x` milestone of the next minor (or major) version (you can find that version number inside the `package.json` file).
Backport PRs should use the version of the target branch (e.g. `9.4.x` for the `v9.4.x` branch).
Pull requests targetting `main` should use the `.x` milestone of the next minor (or major) version (you can find that version number inside the `package.json` file).
Backport pull requestss should use the version of the target branch (e.g. `9.4.x` for the `v9.4.x` branch).
### Include in changelog and release notes?
@ -83,15 +85,15 @@ The changelog/release notes are divided into sections and here's a description o
**Features and enhancements:**
Milestone assigned and labeled with `add to changelog` and any of the other section rules don't apply.
Labeled with `add to changelog` and any of the other section rules don't apply.
**Bug fixes:**
Milestone assigned and labeled with `add to changelog` and either labeled with `type/bug` or the pull request title contains `fix` or `fixes`.
Labeled with `add to changelog` and either labeled with `type/bug` or the pull request title contains `fix` or `fixes`.
**Plugin development fixes & changes:**
Milestone assigned and labeled with `area/grafana/toolkit`, `area/grafana/ui` or `area/grafana/runtime`.
Labeled with `area/grafana/toolkit`, `area/grafana/ui` or `area/grafana/runtime`.
**Deprecations:**