[v1 backports] semver auto labels#2760
Merged
pierreprinetti merged 8 commits intogophercloud:v1from Sep 6, 2023
Merged
Conversation
It'll automatically set the semver label for a given PR. Limitation: files under `/acceptance` or named `doc.go`, `fixtures.go` and `fixture.go` which don't count as semver, will count in this new job. This is because we would need to add a commit that exclude these files, then rebase the PR on top of that and run `go-apidiff`. This is too complex for now and might be addressed later. (cherry picked from commit 00da6f7)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2 to 4. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](actions/setup-go@v2...v4) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> (cherry picked from commit 86e726d)
Bumps [actions-ecosystem/action-add-labels](https://github.com/actions-ecosystem/action-add-labels) from 1.1.0 to 1.1.3. - [Release notes](https://github.com/actions-ecosystem/action-add-labels/releases) - [Commits](actions-ecosystem/action-add-labels@bd52874...18f1af5) --- updated-dependencies: - dependency-name: actions-ecosystem/action-add-labels dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> (cherry picked from commit 8a032b2)
When testing if a PR is API backward compatible or not, we need to test against the base branch, not the head against the PR branched is based on. Otherwise it can lead to the case where a breaking change was merged after that a PR was proposed, go-apidiff will fail because it'll test the repo against base_ref. The PR needs to be rebased on base_ref so the actual compatibility can be verified. If the PR can't be rebase for any reason, we'll return a failure and add the label `semver:unknown`. (cherry picked from commit 3e0071f)
A caracter is missing for the rebase action in git ref. (cherry picked from commit 9e9f560)
Change the tasks order, so we clean semver labels first. This avoids the case when the rebase failed, and we still have the old label, and also the `semver:unknown`, which is confusing. (cherry picked from commit 8534afd)
I haven't found an action that just runs a rebase without pushing it into the repo. Let's just run `git rebase -i` for now. (cherry picked from commit 510ded8)
To avoid the `*** Please tell me who you are` error when a PR is locally rebased to find out which semver label to apply, let's just set fake user.email and user.name, which aren't used anyway since the PR isn't actually rebased, but just for the workflow so we can run `go-apidiff` which itself requires code to be committed. (cherry picked from commit 1335893)
pierreprinetti
approved these changes
Sep 6, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clean cherry-picks of the following commits:
Conflict:
.github/labels.yamldoesn't exist in v1 (which should be fine) so I'vegit rmed it.Fixes #2757