Mic92 / nixpkgs-review

Review pull-requests on https://github.com/NixOS/nixpkgs
MIT License
375 stars 61 forks source link

`nixpkgs-review pr` results in `HTTP Error 400: Bad Request` #328

Closed samuela closed 1 year ago

samuela commented 1 year ago
❯ nixpkgs-review pr 224927
$ git worktree prune
Traceback (most recent call last):
  File "/nix/store/f6qs6s51w6prb5lpz4klk85rywn4p1jb-nixpkgs-review-2.8.0/bin/.nixpkgs-review-wrapped", line 9, in <module>
    sys.exit(main())
  File "/nix/store/f6qs6s51w6prb5lpz4klk85rywn4p1jb-nixpkgs-review-2.8.0/lib/python3.10/site-packages/nixpkgs_review/__init__.py", line 10, in main
    cli.main(command, args)
  File "/nix/store/f6qs6s51w6prb5lpz4klk85rywn4p1jb-nixpkgs-review-2.8.0/lib/python3.10/site-packages/nixpkgs_review/cli/__init__.py", line 301, in main
    return cast(str, args.func(args))
  File "/nix/store/f6qs6s51w6prb5lpz4klk85rywn4p1jb-nixpkgs-review-2.8.0/lib/python3.10/site-packages/nixpkgs_review/cli/pr.py", line 68, in pr_command
    contexts.append((pr, builddir.path, review.build_pr(pr)))
  File "/nix/store/f6qs6s51w6prb5lpz4klk85rywn4p1jb-nixpkgs-review-2.8.0/lib/python3.10/site-packages/nixpkgs_review/review.py", line 202, in build_pr
    packages_per_system = self.github_client.get_borg_eval_gist(pr)
  File "/nix/store/f6qs6s51w6prb5lpz4klk85rywn4p1jb-nixpkgs-review-2.8.0/lib/python3.10/site-packages/nixpkgs_review/github.py", line 86, in get_borg_eval_gist
    for line in urllib.request.urlopen(raw_gist_url):
  File "/nix/store/iw1vmh509hcbby8dbpsaanbri4zsq7dj-python3-3.10.10/lib/python3.10/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "/nix/store/iw1vmh509hcbby8dbpsaanbri4zsq7dj-python3-3.10.10/lib/python3.10/urllib/request.py", line 525, in open
    response = meth(req, response)
  File "/nix/store/iw1vmh509hcbby8dbpsaanbri4zsq7dj-python3-3.10.10/lib/python3.10/urllib/request.py", line 634, in http_response
    response = self.parent.error(
  File "/nix/store/iw1vmh509hcbby8dbpsaanbri4zsq7dj-python3-3.10.10/lib/python3.10/urllib/request.py", line 563, in error
    return self._call_chain(*args)
  File "/nix/store/iw1vmh509hcbby8dbpsaanbri4zsq7dj-python3-3.10.10/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/nix/store/iw1vmh509hcbby8dbpsaanbri4zsq7dj-python3-3.10.10/lib/python3.10/urllib/request.py", line 643, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request

Any idea what could be causing this?

Btw, I tried to get the nixpkgs-review version with nixpkgs-review --version and nixpkgs-review -v to no avail, but it did give me the nix store hash:

❯ nixpkgs-review --version
usage: /nix/store/f6qs6s51w6prb5lpz4klk85rywn4p1jb-nixpkgs-review-2.8.0/bin/nixpkgs-review [-h] {post-result,approve,comments,merge,pr,rev,wip} ...
/nix/store/f6qs6s51w6prb5lpz4klk85rywn4p1jb-nixpkgs-review-2.8.0/bin/nixpkgs-review: error: the following arguments are required: subcommand
figsoda commented 1 year ago

should be fixed in 2.9.0, see https://github.com/Mic92/nixpkgs-review/issues/321. I tried running nixpkgs-review pr 224927 with nixpkgs-review 2.9.1 and it seems to be working fine

samuela commented 1 year ago

I'll try upgrading, thanks @figsoda! how can i figure out which nixpkgs-review version I'm currently on?

figsoda commented 1 year ago

Currently you can only find it from the path to nixpkgs-review

usage: /nix/store/f6qs6s51w6prb5lpz4klk85rywn4p1jb-nixpkgs-review-2.8.0/bin/nixpkgs-review [-h] {post-result,approve,comments,merge,pr,rev,wip} ...

nixpkgs-review-2.8.0

samuela commented 1 year ago

upgraded to

❯ nixpkgs-review
usage: /nix/store/iq6yxrmnwf3b21nwxkijnvs8895pflgp-nixpkgs-review-2.9.1/bin/nixpkgs-review [-h] {post-result,approve,comments,merge,pr,rev,wip} ...
/nix/store/iq6yxrmnwf3b21nwxkijnvs8895pflgp-nixpkgs-review-2.9.1/bin/nixpkgs-review: error: the following arguments are required: subcommand

and that seems to fix it!