Mic92 / nixpkgs-review

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

Error posting result to GitHub. #280

Closed kevincox closed 1 year ago

kevincox commented 1 year ago
Posting result comment on https://github.com/NixOS/nixpkgs/pull/199664
$ git worktree prune
Traceback (most recent call last):
  File "/nix/store/nci1s3y693yifx3kqg0cd81p8alybnqk-nixpkgs-review-2.7.0/bin/.nixpkgs-review-wrapped", line 9, in <module>
    sys.exit(main())
  File "/nix/store/nci1s3y693yifx3kqg0cd81p8alybnqk-nixpkgs-review-2.7.0/lib/python3.10/site-packages/nixpkgs_review/__init__.py", line 10, in main
    cli.main(command, args)
  File "/nix/store/nci1s3y693yifx3kqg0cd81p8alybnqk-nixpkgs-review-2.7.0/lib/python3.10/site-packages/nixpkgs_review/cli/__init__.py", line 294, in main
    return cast(str, args.func(args))
  File "/nix/store/nci1s3y693yifx3kqg0cd81p8alybnqk-nixpkgs-review-2.7.0/lib/python3.10/site-packages/nixpkgs_review/cli/pr.py", line 72, in pr_command
    review.start_review(attrs, path, pr, args.post_result)
  File "/nix/store/nci1s3y693yifx3kqg0cd81p8alybnqk-nixpkgs-review-2.7.0/lib/python3.10/site-packages/nixpkgs_review/review.py", line 233, in start_review
    self.github_client.comment_issue(pr, report.markdown(pr))
  File "/nix/store/nci1s3y693yifx3kqg0cd81p8alybnqk-nixpkgs-review-2.7.0/lib/python3.10/site-packages/nixpkgs_review/github.py", line 44, in comment_issue
    return self.post(
  File "/nix/store/nci1s3y693yifx3kqg0cd81p8alybnqk-nixpkgs-review-2.7.0/lib/python3.10/site-packages/nixpkgs_review/github.py", line 36, in post
    return self._request(path, "POST", data)
  File "/nix/store/nci1s3y693yifx3kqg0cd81p8alybnqk-nixpkgs-review-2.7.0/lib/python3.10/site-packages/nixpkgs_review/github.py", line 29, in _request
    resp = urllib.request.urlopen(req)
  File "/nix/store/xcaaly5shfy227ffs8nipxrd49b56iqq-python3-3.10.8/lib/python3.10/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "/nix/store/xcaaly5shfy227ffs8nipxrd49b56iqq-python3-3.10.8/lib/python3.10/urllib/request.py", line 525, in open
    response = meth(req, response)
  File "/nix/store/xcaaly5shfy227ffs8nipxrd49b56iqq-python3-3.10.8/lib/python3.10/urllib/request.py", line 634, in http_response
    response = self.parent.error(
  File "/nix/store/xcaaly5shfy227ffs8nipxrd49b56iqq-python3-3.10.8/lib/python3.10/urllib/request.py", line 563, in error
    return self._call_chain(*args)
  File "/nix/store/xcaaly5shfy227ffs8nipxrd49b56iqq-python3-3.10.8/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/nix/store/xcaaly5shfy227ffs8nipxrd49b56iqq-python3-3.10.8/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 422: Unprocessable Entity

I've seen this twice for two different runs for that PR. Maybe the result is too big?

For example I can't post the terminal summary text here because I get "There was an error creating your Issue: body is too long, body is too long (maximum is 65536 characters)." Summary attached instead in case it is relevant. nixpkgs-review.log

SuperSandro2000 commented 1 year ago

You tried building over 15k packages. That is just to much for a single GitHub comment and the false negative rate is also very high. I would recommend to not run nixpkgs-review on mass rebuilds.

kevincox commented 1 year ago

Maybe instead of a comment the log could be uploaded as an attachment.

SuperSandro2000 commented 1 year ago

That wouldn't be as useful. Also in my experience in such runs there are a lot of false positives which makes the results very unreliable.

kevincox commented 1 year ago

Why wouldn't it be useful?

Also in my experience in such runs there are a lot of false positives which makes the results very unreliable.

This is unrelated to the amount of packages built. You can have false-positives with few or many. Maybe the better option here is to add features to combat this such as confirmation before posting.

SuperSandro2000 commented 1 year ago

This is unrelated to the amount of packages built.

The chance that a fail occurs which causes all remaining packages to premature fail is exponential with the amount of packages.

Maybe the better option here is to add features to combat this such as confirmation before posting.

We already have a such a feature. It is the interactive review shell which I recommend to always use to reduce false negatives.

kevincox commented 1 year ago

Ok, and so if I review and want to post?