Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 2
Message 1 of 2

Is it possible to delete a Check Run? Or report netural status on a Check Suite w/o a run?

Solved! Go to Solution.

I work at a company that allows you to deploy cloud infrastructure using code. And we have a GitHub application that surfaces the changes to your cloud infrastructure that were previewed/applied as part of a pull request. (You can get more context here.)

 

The problem is that by the nature of how our system works, we don't know ahead of time what will actually happen for a given commit. Rather, we rely on the user to have configured their CI/CD system to invoke our command-line tool. And we then surface those results by reporting new GitHub check runs.

 

This leads to the unfortunate UX where if the commit didn't end up making any cloud infrastructure changes, the Check Suite associated with our GitHub app doesn't report any Check Runs. And the GitHub UI just says "Queued XX minutes ago". (And later "Queued XX days ago".)

 

 

I'd like to improve this if possible, though the API docs indiciate this isn't really possible. So this is generally feedback on a scenario which doesn't fit well into the current design.

 

(1) Is there a way to have the GitHub app immediately report a "neutral" status for the Check Suite, without creating a new Check Run? Rather than being in the "Queued" state, is it possible to report a neutral status immediately?

 

(2) If not, we can just as easily create a "placeholder" Check Run. With a descriptive title like "waiting for updates". However, if we do that, is it possible to delete that Check Run later? It doesn't make sense to show "waiting for updates" along side of the updates that eventually took place.

1 Reply
Solution
Community Manager
Message 2 of 2

Re: Is it possible to delete a Check Run? Or report netural status on a Check Suite w/o a run?

Thanks for reaching out.

 

 

Here's my understanding of the Checks flow from the documentation:

 

  1. Someone pushes code to the repository
  2. GitHub creates a Check Suite object and pushes a `check_suite` webhook event to your GitHub App
    1. At this point, if your app does nothing you get the "Queued XX YY ago" behavior you're describing
  3. Your GitHub App creates a Check Run object with the resulting status
  4. The Check Suite object aggregates all of the Check Run objects' status into a single result

 

What it sounds like you're currently doing is that when you receive a `check_suite` webhook event, and your command-line app doesn't get called, no Check Run object is created and you end up at the failure case of 2i above.

 

No, there isn't a way to delete a Check Run object, so the key to your question is what to do in step 3 above. What I would suggest is to immediately create the Check Run object with the `in_progress` status as described in the Check Run documentation. Then, when you've determined that nothing is supposed to happen, you can update (not delete) that Check Run object with a status of `completed` and whatever output you want.

 

I hope that helps!