question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Checks api functionality broken by recent github api change

See original GitHub issue

Since 26/05 previously working calls to createCheckRun fail with the following error when trying to parse the github response

Cannot deserialize value of type `org.kohsuke.github.GHEvent` from String "discussion": not one of the values accepted for Enum class: [GOLLUM, ALL, INTEGRATION_INSTALLATION_REPOSITORIES, META, DOWNLOAD, FORK_APPLY, CHECK_RUN, MARKETPLACE_PURCHASE, PROJECT_CARD, SCHEDULE, PUSH, PAGE_BUILD, TEAM_ADD, REPOSITORY_VULNERABILITY_ALERT, PACKAGE, UNKNOWN, DELETE, DEPLOYMENT_STATUS, WATCH, FOLLOW, ORG_BLOCK, ORGANIZATION, COMMIT_COMMENT, ISSUE_COMMENT, REPOSITORY_IMPORT, GITHUB_APP_AUTHORIZATION, CODE_SCANNING_ALERT, CHECK_SUITE, FORK, GIST, CONTENT_REFERENCE, REPOSITORY, INSTALLATION_REPOSITORIES, REPOSITORY_DISPATCH, MILESTONE, STAR, LABEL, MEMBERSHIP, SECURITY_ADVISORY, PROJECT_COLUMN, TEAM, PULL_REQUEST_REVIEW, RELEASE, PUBLIC, WORKFLOW_RUN, STATUS, PULL_REQUEST, PROJECT, WORKFLOW_DISPATCH, CREATE, MEMBER, REGISTRY_PACKAGE, INSTALLATION, DEPLOYMENT, PULL_REQUEST_REVIEW_COMMENT, DEPLOY_KEY, PING, ISSUES]

It isn’t instantly obvious to me how the full github response can be logged, but a little debugging suggests that gh events now include ‘DISCUSSION’ and ‘DISCUSSION_COMMENT’.

Unfortunately I think there have been further changes. Patching the enum to include these values moves things further, but calls to

   repo.updateCheckRun(checkRun.getId())
      .add(output)
      .withConclusion(GHCheckRun.Conclusion.SUCCESS)
      .withStatus(GHCheckRun.Status.COMPLETED)
      .create();

Now fail with

org.kohsuke.github.GHFileNotFoundException: https://api.github.com/repos/ORG/REPO/check-runs/2675563029 {"message":"Not Found","documentation_url":"https://docs.github.com/rest"}

The check id is presumably correct as it was returned from the successful createCheckRun call, and this code previously functioned.

I think authentication is also affected. From memory, I was previously able to run adhoc tests of api calls using a personal access token. I now get a message saying that I must authenticate as a github app in order to use the checks api.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
gsmetcommented, May 26, 2021

I’ll have a look at the enum issue this evening.

The authentication issue looks different from #1155. I would create a separate issue for it with as many details as possible.

1reaction
bitwisemancommented, Jun 2, 2021

Done.

Read more comments on GitHub >

github_iconTop Results From Across the Web

New limits affecting the Checks API | GitHub Changelog
The Checks API now has a limit of 1,000 check runs with the same name per check suite. Using checks, you can run...
Read more >
GitHub API: How to retrieve the combined pull request status ...
The first thing that is important to understand is where the list of checks shown at the bottom of most pull requests on...
Read more >
Deprecations by version - GitLab Docs
This is a breaking change. Review the details carefully before upgrading. With the move to the new DAST API analyzer and the DAST-API.gitlab-ci.yml...
Read more >
Semantic Versioning 2.0.0 | Semantic Versioning
Given a version number MAJOR.MINOR.PATCH, increment the: MAJOR version when you make incompatible API changes; MINOR version when you add functionality in a ......
Read more >
All the Things You Can Do With GitHub API and Python
It can't be used for every single feature exposed through the GitHub API, so in the following sections, I will show mixture of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found