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

backport_pr: Only works for when fork is in user (not in organization) #18486

Open
chrysn opened this issue Aug 21, 2022 · 1 comment
Open

backport_pr: Only works for when fork is in user (not in organization) #18486

chrysn opened this issue Aug 21, 2022 · 1 comment
Assignees
Labels
Community: help wanted The contributors require help from other members of the community Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Comments

@chrysn
Copy link
Member

chrysn commented Aug 21, 2022

Description

Users who forked the RIOT repository into an own organization can't asily use dist/tools/backport-pr/backport_pr.py. This has two reasons:

  • The repository name username / REPO is part of backport_pr.py. This is easy to fix by hardcoding the right repo name -- if we could fix the rest, I'd make that an argument.

  • The personal token issued as described in the README is insufficient to do this:

    Error creating the new pr: "Validation Failed". Is "Public Repo" access enabled for the token?

I've tried giving the token all the rights I could, and the error persisted. Any idea how I could get by a token for an organization I own? If I could find a pointer to get a suitable token, I could take care of documenting and doing everything else.

@chrysn chrysn added the Community: help wanted The contributors require help from other members of the community label Aug 21, 2022
@chrysn
Copy link
Member Author

chrysn commented Aug 21, 2022

Note to self: Here's where the name is changed:

diff --git a/dist/tools/backport_pr/backport_pr.py b/dist/tools/backport_pr/backport_pr.py
index f2f46c13e4..3639ed3578 100755
--- a/dist/tools/backport_pr/backport_pr.py
+++ b/dist/tools/backport_pr/backport_pr.py
@@ -256,7 +256,7 @@ def main():
         for commit in commits:
             bp_repo.git.cherry_pick("-x", commit["sha"])
         # Push to github
-        origin = _find_remote(repo, username, REPO)
+        origin = _find_remote(repo, 'chrysn-pull-requests', REPO)
         print(f"Pushing branch {new_branch} to {origin}")
         if not args.noop:
             push_info = origin.push(f"{new_branch}:{new_branch}")

@maribu maribu added the Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) label May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community: help wanted The contributors require help from other members of the community Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

No branches or pull requests

3 participants