grafana / wait-for-github

GNU Affero General Public License v3.0
14 stars 5 forks source link

fix: `grafana/wait-for-github` status checks stay `pending` #153

Closed ricky-undeadcoders closed 2 months ago

ricky-undeadcoders commented 4 months ago

There is an issue with how we perform status checks in grafana/wait-for-github in Argo Workflows. For CD jobs such as this one for Pyroscope we perform a status check against the GitHub API for the branch that triggered the build, which stays in a pending state, regardless of any actions that might be running for that branch.

In the case of the Pyroscope job listed above we should have found this Action, and waited for it to complete before moving on.

The fix for this is to add an extra step somewhere in the the GetCIStatus check that will look at GitHub actions that are running for the branch and determine a status based off of the state of those workflows.

See this discussion for more insight into the issue: https://github.com/orgs/community/discussions/58407

guicaulada commented 2 months ago

Testing with gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/grafana/deployment_tools/commits/045b18a023af83f5689492494432004c770285fc/status it seems the API always returns "statuses": [] and "status": "pending", even though all workflows finished running.

iainlane commented 2 months ago

I accidentally worked on this before noticing Gui had claimed it, so stealing the assignment (after chatting in private). Soz!