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

fix(NA): auto approve backport action by not looking for non-existent labels #160826

Merged

Conversation

mistic
Copy link
Member

@mistic mistic commented Jun 28, 2023

I believe I found out what was wrong with the previous implementation of the action.
We were trying to check for the existence of the backport label when the PR is created which is never there (as it gets added afterwards).

This PR is replacing the checking of the label by the assert that the branch name on a backport starts with backport and the creator of the PR is kibanamachine.

@mistic mistic added chore Team:Operations Team label for Operations Team backport:all-open Backport to all branches that could still receive a release v8.10.0 labels Jun 28, 2023
@mistic mistic requested a review from a team as a code owner June 28, 2023 22:49
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@mistic mistic added the release_note:skip Skip the PR/issue when compiling release notes label Jun 28, 2023
@mistic mistic enabled auto-merge (squash) June 28, 2023 23:00
@mistic mistic requested a review from Ikuni17 June 28, 2023 23:01
Copy link
Contributor

@Ikuni17 Ikuni17 left a comment

Choose a reason for hiding this comment

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

Think this should work as well. Double checked the debug step output in
https://github.com/elastic/kibana/actions/runs/5406432600/jobs/9823305986

The title says removing the debug step, do you want to do that now as well?

@mistic mistic merged commit 5ac9390 into elastic:main Jun 28, 2023
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 28, 2023
…#160826)

I believe I found out what was wrong with the previous implementation of
the action.
We were trying to check for the existence of the backport label when the
PR is created which is never there (as it gets added afterwards).

This PR is replacing the checking of the label by the assert that the
branch name on a backport starts with `backport` and the creator of the
PR is kibanamachine.

(cherry picked from commit 5ac9390)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 28, 2023
…#160826)

I believe I found out what was wrong with the previous implementation of
the action.
We were trying to check for the existence of the backport label when the
PR is created which is never there (as it gets added afterwards).

This PR is replacing the checking of the label by the assert that the
branch name on a backport starts with `backport` and the creator of the
PR is kibanamachine.

(cherry picked from commit 5ac9390)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
7.17
8.9

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jun 28, 2023
…160826) (#160829)

# Backport

This will backport the following commits from `main` to `8.9`:
- [chore(NA): remove debug step on auto approve backport action
(#160826)](#160826)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Tiago
Costa","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-06-28T23:09:20Z","message":"chore(NA):
remove debug step on auto approve backport action (#160826)\n\nI believe
I found out what was wrong with the previous implementation of\r\nthe
action.\r\nWe were trying to check for the existence of the backport
label when the\r\nPR is created which is never there (as it gets added
afterwards).\r\n\r\nThis PR is replacing the checking of the label by
the assert that the\r\nbranch name on a backport starts with `backport`
and the creator of the\r\nPR is
kibanamachine.","sha":"5ac939091605a115420fa6e47307e70c2a157d9d","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["chore","Team:Operations","release_note:skip","backport:all-open","v8.10.0"],"number":160826,"url":"https://github.com/elastic/kibana/pull/160826","mergeCommit":{"message":"chore(NA):
remove debug step on auto approve backport action (#160826)\n\nI believe
I found out what was wrong with the previous implementation of\r\nthe
action.\r\nWe were trying to check for the existence of the backport
label when the\r\nPR is created which is never there (as it gets added
afterwards).\r\n\r\nThis PR is replacing the checking of the label by
the assert that the\r\nbranch name on a backport starts with `backport`
and the creator of the\r\nPR is
kibanamachine.","sha":"5ac939091605a115420fa6e47307e70c2a157d9d"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/160826","number":160826,"mergeCommit":{"message":"chore(NA):
remove debug step on auto approve backport action (#160826)\n\nI believe
I found out what was wrong with the previous implementation of\r\nthe
action.\r\nWe were trying to check for the existence of the backport
label when the\r\nPR is created which is never there (as it gets added
afterwards).\r\n\r\nThis PR is replacing the checking of the label by
the assert that the\r\nbranch name on a backport starts with `backport`
and the creator of the\r\nPR is
kibanamachine.","sha":"5ac939091605a115420fa6e47307e70c2a157d9d"}}]}]
BACKPORT-->

Co-authored-by: Tiago Costa <[email protected]>
mistic added a commit that referenced this pull request Jun 29, 2023
…160826) (#160828)

# Backport

This will backport the following commits from `main` to `7.17`:
- [chore(NA): remove debug step on auto approve backport action
(#160826)](#160826)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Tiago
Costa","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-06-28T23:09:20Z","message":"chore(NA):
remove debug step on auto approve backport action (#160826)\n\nI believe
I found out what was wrong with the previous implementation of\r\nthe
action.\r\nWe were trying to check for the existence of the backport
label when the\r\nPR is created which is never there (as it gets added
afterwards).\r\n\r\nThis PR is replacing the checking of the label by
the assert that the\r\nbranch name on a backport starts with `backport`
and the creator of the\r\nPR is
kibanamachine.","sha":"5ac939091605a115420fa6e47307e70c2a157d9d","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["chore","Team:Operations","release_note:skip","backport:all-open","v8.10.0"],"number":160826,"url":"https://github.com/elastic/kibana/pull/160826","mergeCommit":{"message":"chore(NA):
remove debug step on auto approve backport action (#160826)\n\nI believe
I found out what was wrong with the previous implementation of\r\nthe
action.\r\nWe were trying to check for the existence of the backport
label when the\r\nPR is created which is never there (as it gets added
afterwards).\r\n\r\nThis PR is replacing the checking of the label by
the assert that the\r\nbranch name on a backport starts with `backport`
and the creator of the\r\nPR is
kibanamachine.","sha":"5ac939091605a115420fa6e47307e70c2a157d9d"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/160826","number":160826,"mergeCommit":{"message":"chore(NA):
remove debug step on auto approve backport action (#160826)\n\nI believe
I found out what was wrong with the previous implementation of\r\nthe
action.\r\nWe were trying to check for the existence of the backport
label when the\r\nPR is created which is never there (as it gets added
afterwards).\r\n\r\nThis PR is replacing the checking of the label by
the assert that the\r\nbranch name on a backport starts with `backport`
and the creator of the\r\nPR is
kibanamachine.","sha":"5ac939091605a115420fa6e47307e70c2a157d9d"}}]}]
BACKPORT-->

Co-authored-by: Tiago Costa <[email protected]>
@mistic mistic changed the title chore(NA): remove debug step on auto approve backport action fix(NA): auto approve backport action by not looking for non-existent labels Jun 29, 2023
@mistic
Copy link
Member Author

mistic commented Jun 29, 2023

@Ikuni17 just updated the pr title. Will remove the debug step in a following PR just to make sure everything works as expected now. Thanks for pointing that out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:all-open Backport to all branches that could still receive a release chore release_note:skip Skip the PR/issue when compiling release notes Team:Operations Team label for Operations Team v7.17.11 v8.9.0 v8.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants