Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Submission result URL is not a valid Github API endpoint - "message": "Not Found" error #191

Open
renxinhe opened this issue May 31, 2024 · 0 comments

Comments

@renxinhe
Copy link

Issue

The submission result is logged as a clickable URL inside the Github action output log on this line:

      state.log.info(s"Submitted successfully as $snapshotUrl/${snapshot.id}")

In reality, $snapshotUrl/${snapshot.id} is not a valid GET request endpoint from the Github API, and clicking on it from the Github action log would always pop up a new window showing the following 404 error:

{
  "message": "Not Found",
  "documentation_url": "https://docs.github.com/rest"
}

This is a very confusing UX for people who are trying to debug a new Github action that uses this package.

Investigation

When I was testing adding this new Github action to my repo, I kept hitting this red herring 404 status. Only when I tried the submission endpoint locally did I discover the real HTTP response. It showed the real reason why my dependency graph wasn't updating even though the snapshot was submitted successfully:

{
    "id": <redacted>,
    "created_at": "2024-05-31T00:11:22.957Z",
    "result": "ACCEPTED",
    "message": "The snapshot was accepted, but it is not for the default branch. It will not update dependency results for the repository."
}

Mitigation suggestion

I recommend not formatting the success message as a clickable URL. Instead, we should log the httpResp response body in getSnapshot even if the status is 2**.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant