Open lilyball opened 4 years ago
Do you have by chance an out-of-date token in cat $HOME/.config/hub
?
Yes I do. I'm rather surprised that nixpkgs-review would be reading .config/hub.
Actually, only one of my computers has an outdated token there. The other computer has a perfectly valid token for a GitHub Enterprise installation and no token for github.com. So it looks like nixpkgs-review isn't validating the domain before it grabs the token.
Yes. I should add that.
Does it need the token at all?
EDIT: I see, it's used for the interaction with GitHub.
AFAIK it should only be necessary if you instruct nixpkgs-review
to leave a comment on the PR. It shouldn't be necessary for the default functionality.
Yes it's optional
Coming from https://github.com/NixOS/nixpkgs/pull/92612#discussion_r451188524 setting the token on first time usage through prompt would be a good solution.
It would be great to display which scopes the tool needs, otherwise, one (like me) has to guess the correct combination from dozen of checkboxes. I guess it will be especially painful if that is the first time they issue a new token.
@omasanori also discussed here: https://github.com/Mic92/nixpkgs-review/issues/104 You can add it to the readme if you want.
Thank you for the suggestion, @Mic92! Sure, I will take a look at it.
ping.
This still seems to be the behavior out of the box. Tried running literally the first command in README (I'm new here)
nix run 'nixpkgs#nixpkgs-review' pr ...
and got
urllib.error.HTTPError: HTTP Error 401: Unauthorized
at the end of a backtrace.
I happened to have a github token for other purposes and so running GITHUB_TOKEN=... nix run...
worked.
Maybe, I should just removing hub/gh token parsing.
When I try to run
nix-review
now I get an HTTP 401 Unauthorized error. I'm not giving nix-review a token, and it should only be accessing public data by default, so I don't know why it's failing. The error is rather obtuse as it's just a very long stack trace but it's definitely coming from the call to the GitHub API.