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

contrib: Fix backport submission for own PRs #17988

Merged

Conversation

joestringer
Copy link
Member

On GitHub, one cannot request oneself to review one's own PR. This
results in the following problem when submitting a backport PR:

$ submit-backport
Using GitHub repository joestringer/cilium (git remote: origin)
Sending PR for branch v1.10:

v1.10 backports 2021-11-23

 * #17788 -- Additional FQDN selector identity tracking fixes (@joestringer)

Once this PR is merged, you can update the PR labels via:
```upstream-prs
$ for pr in 17788; do contrib/backporting/set-labels.py $pr done 1.10; done
```

Sending pull request...
remote:
remote: Create a pull request for 'pr/v1.10-backport-2021-11-23' on GitHub by visiting:
remote:      https://github.com/joestringer/cilium/pull/new/pr/v1.10-backport-2021-11-23
remote:
Error requesting reviewer: Unprocessable Entity (HTTP 422)
Review cannot be requested from pull request author.

Signal ERR caught!

Traceback (line function script):
58 main /home/joe/git/cilium/contrib/backporting/submit-backport

Fix this by excluding ones own username from the reviewers list.

On GitHub, one cannot request oneself to review one's own PR. This
results in the following problem when submitting a backport PR:

    $ submit-backport
    Using GitHub repository joestringer/cilium (git remote: origin)
    Sending PR for branch v1.10:

    v1.10 backports 2021-11-23

     * cilium#17788 -- Additional FQDN selector identity tracking fixes (@joestringer)

    Once this PR is merged, you can update the PR labels via:
    ```upstream-prs
    $ for pr in 17788; do contrib/backporting/set-labels.py $pr done 1.10; done
    ```

    Sending pull request...
    remote:
    remote: Create a pull request for 'pr/v1.10-backport-2021-11-23' on GitHub by visiting:
    remote:      https://github.com/joestringer/cilium/pull/new/pr/v1.10-backport-2021-11-23
    remote:
    Error requesting reviewer: Unprocessable Entity (HTTP 422)
    Review cannot be requested from pull request author.

    Signal ERR caught!

    Traceback (line function script):
    58 main /home/joe/git/cilium/contrib/backporting/submit-backport

Fix this by excluding ones own username from the reviewers list.

Signed-off-by: Joe Stringer <joe@cilium.io>
@joestringer joestringer requested a review from a team as a code owner November 23, 2021 21:48
@joestringer joestringer added the release-note/misc This PR makes changes that have no direct user impact. label Nov 23, 2021
@maintainer-s-little-helper maintainer-s-little-helper bot added dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. and removed dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. labels Nov 23, 2021
Copy link
Member

@aditighag aditighag left a comment

Choose a reason for hiding this comment

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

I didn't run the commands, but the changes look straightforward.

@aditighag aditighag added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Nov 29, 2021
@@ -32,15 +32,20 @@ get_remote () {
echo "$remote"
}

get_user() {
gh_username=$(hub api user --flat | awk '/.login/ {print $2}')
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Could be nice to cache this in a global variable, to avoid curling again on subsequent calls. But it's certainly not blocking the current PR.

@qmonnet qmonnet merged commit 1b42f7a into cilium:master Nov 30, 2021
@christarazi
Copy link
Member

Nominating for backport to all stable releases, as it's useful when using the backporting scripts in older branches.

@maintainer-s-little-helper maintainer-s-little-helper bot added this to Needs backport from master in 1.9.12 Jan 18, 2022
@joestringer joestringer deleted the submit/fix-backport-script-own-pr branch January 18, 2022 22:49
@joestringer joestringer added this to Needs backport from master in 1.9.13 Jan 18, 2022
@joestringer joestringer removed this from Needs backport from master in 1.9.12 Jan 18, 2022
@kkourt kkourt added backport-done/1.11 The backport for Cilium 1.11.x for this PR is done. and removed backport-pending/1.11 labels Jan 25, 2022
@joestringer joestringer moved this from Needs backport from master to Backport done to v1.9 in 1.9.13 Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-done/1.11 The backport for Cilium 1.11.x for this PR is done. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact.
Projects
No open projects
1.9.13
Backport done to v1.9
Development

Successfully merging this pull request may close these issues.

None yet

7 participants