Skip to content

[v1 backports] semver auto labels#2760

Merged
pierreprinetti merged 8 commits intogophercloud:v1from
EmilienM:backports_autolabels
Sep 6, 2023
Merged

[v1 backports] semver auto labels#2760
pierreprinetti merged 8 commits intogophercloud:v1from
EmilienM:backports_autolabels

Conversation

@EmilienM
Copy link
Copy Markdown
Contributor

@EmilienM EmilienM commented Sep 6, 2023

Clean cherry-picks of the following commits:

  • Add Github Workflow for checking Go API compatibility on PRs
  • Bump actions/setup-go from 2 to 4
  • Bump actions-ecosystem/action-add-labels from 1.1.0 to 1.1.3
  • workflow/semver-auto: rebase PR
  • CI: Fix a typo in semver-auto
  • semver-auto: remove labels first
  • semver-auto: manual rebase instead of external action
  • semver-auto: tell who we are during rebase

Conflict: .github/labels.yaml doesn't exist in v1 (which should be fine) so I've git rmed it.

Fixes #2757

EmilienM and others added 8 commits September 5, 2023 21:05
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 pierreprinetti merged commit a300a0e into gophercloud:v1 Sep 6, 2023
@EmilienM EmilienM deleted the backports_autolabels branch September 6, 2023 12:57
@pierreprinetti pierreprinetti added the v1 This PR targets v1 label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver:patch No API change v1 This PR targets v1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants