Skip to content

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

Description

@renxinhe

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**.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions