Skip to content

[Bug] _api raises without naming the request path, so the 422 in Contributor Reputation Check cannot be located #56

Closed

Description

@Mayur021

What happens

Contributor Reputation Check / check fails on main with:

Error: contributor_check.py exited 1: urllib.error.HTTPError: HTTP Error 422: Unprocessable Entity

That is the whole diagnostic. The error names a status and nothing else, so there is no way
to tell which of the run's API calls produced it.

Observed on the CI run for #49. The job runs on pull_request_target and checks out base
main, so it is not caused by that PR.

Why it is not visible day to day

The job's if: skips the maintainer account, so it only runs on pull requests from everyone
else. #49 was the first external PR to exercise the vendored path since #46 landed, and it
failed. The next external PR will fail the same way.

What is already ruled out

The full profile check was traced locally against the same username and the same
--target-repo, 29 API calls across /users, /users/*/repos, /search/issues,
/repos/*/pulls, /users/*/orgs, /orgs/*/repos and /repos/*/contributors. Every call
returned 200, including both /search/issues queries. So it does not reproduce with a user
token, which points at the Actions GITHUB_TOKEN identity rather than at the query shape.
Without the path in the error there is no way to narrow it further from the log.

Proposed fix

#49 established the convention that an exhausted path names its cause on stderr before
raising, because _run_check surfaces the last stderr line. None of those lines names the
call. Adding the path would make the existing convention diagnostic rather than descriptive:

  • the three cause lines carry path alongside the status or reason
  • the final raise for any other HTTP status gets a cause line of its own, which it currently does not have

That is the branch a 422 takes today, and it is the only one that prints nothing at all.

Activity

  1. Mayur021 commented on Oct 3, 2026

    @Mayur021
    MemberAuthor

    The check fired on this issue and failed the same way. Run 31, event issues, three seconds
    after the issue was opened:

    contributor_check.py exited 1: urllib.error.HTTPError: HTTP Error 422: Unprocessable Entity
    

    https://github.com/agentrust-io/.github/actions/runs/37102002102

    So the scope is wider than I wrote above. The workflow runs on issues: opened as well as
    pull_request_target, which means every externally filed issue hits this too, not only pull
    requests. The job summary reads "The check could not be run. No contributor risk level was
    established and no label was applied."

  2. imran-siddique commented on Oct 5, 2026

    @imran-siddique
    Member

    @Mayur021 found it: the 422 is the search API refusing the author: query for the PR's author ("The listed users cannot be searched"). It does this under a maintainer token too and returns 200 under the account's own token, which is why your local trace came back clean. #57 reports that refusal as UNKNOWN instead of crashing, and takes your path-in-the-error-line proposal as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions