pwntester / octo.nvim

Edit and review GitHub issues and pull requests from the comfort of your favorite editor
MIT License
2.33k stars 125 forks source link

"User not found" when adding a organisation team as a PR reviewer #293

Open itmecho opened 2 years ago

itmecho commented 2 years ago

Issue Description

Type: bug report/feature request

Describe what happened (or what feature you want)

This could be treated as either a bug or a feature request, probably more of a feature request!

I'd like to be able to add a team from my org as a PR reviewer. I tried with Octo reviewer add org/team but currently I get "User not found". I ran the graphql command and got the same result.

Maybe we could check if the login matches the form org/team, split it into two variables and then use the following query to grab the team ID:

query {
  organization(login:"<org>") {
    teams(first: 1, query:"<team>") {
      edges {
        node {
          id
        }
      }
    }
  }
}

Describe what you expected to happen

Team added successfully as a reviewer.

How to reproduce it (as minimally and precisely as possible)

  1. Create a PR with Octo pr create in an org project
  2. Try to add a team as a reviewer with `Octo reviewer add org/team

Tell us your environment

Arch Linux

Linux orion 5.17.5-zen1-1-zen #1 ZEN SMP PREEMPT Wed, 27 Apr 2022 20:56:14 +0000 x86_64 GNU/Linux
NVIM v0.8.0-dev+126-g95b7851f6
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

Anything else we need to know?

Don't think so!

pwntester commented 2 years ago

Thanks for the report. Im currently working on some other issues, but will implement this afterwards. PRs are welcome too!