1

What happens in general if a GitHub integration is down. Suppose we have a GitHub App app that validates the pull request. What if that app is down, does GitHub display some message about it.

The pull request seems to go through when the app is not up. This is quite dangerous. I mean, is there any fallback mechanism that GitHub provides for GitHub integrations.

EDIT 1 : START

I was just wondering that since webhooks are sent from GitHub side to the webhook url that we configure in the app setting, is there a way for GitHub to notify users if the webhook url is not reachable.

EDIT 1 : END

Asif Kamran Malick
  • 2,409
  • 3
  • 25
  • 47

2 Answers2

2

The pull request seems to go through when the app is not up. This is quite dangerous. I mean, is there any fallback mechanism that GitHub provides for GitHub integrations.

What you can do is use the branch protection settings to enforce a success status from that particular integration. If the integration goes down, then the status will remain pending.

If the integration comes back up, you can re-trigger it, e.g. by pushing another commit. If the integration remains down for a longer time, you can still verify the pull request locally and then override the required status using admin authorization

See also: https://help.github.com/en/github/administering-a-repository/about-required-status-checks

Gregor
  • 2,325
  • 17
  • 27
  • Appreciate that. That indeed sounds great. Checks api !! I have never been able to implement them in my probot app. The example are in ruby and , believe from a beginner's perspective, quite confusing. I am just lost in the docs. Just got confused. Today also I tried after seeing your response, but somehow not able to get through it. I keep getting error. I'll post a different OP to see if I can get any help in this regard. – Asif Kamran Malick May 15 '20 at 00:48
  • just as an fyi for everyone, I posted my question here : https://stackoverflow.com/questions/61810089/unable-to-implement-check-in-my-integration-getting-map-undefined-for-create May be I am missing something, but really having a hard time dealing with it. – Asif Kamran Malick May 15 '20 at 01:21
  • After days of trial and error I got over this. I brought down the integration(my hosted GitHub app) and trying creating a pull request. I can see the status check on PR page now says " Expected — Waiting for status to be reported" . I then tried to bring up the app again. But the status remains unchanged. This behavior is quite natural as GitHub doesn't check the status of an integration. But how can a developer know about the action he needs to perform unless the check completes as the details are provided in the checks title and summary itself, which are not showing up now. – Asif Kamran Malick May 19 '20 at 08:56
1

I mean, is there any fallback mechanism that GitHub provides for GitHub integrations.

That would be GitHub Actions like those ones: since they are executed on GitHub side, following a .github/workflows/ci.yml (for instance actions/create-release ci.yml) part of your source code, if GitHub is down, the PR won't go through because the validation step won't have been completed.

This differs from a WebHook, where GitHub send JSon payload, without caring if those payloads are received or not.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • So, that means there's nothing we can do for GitHub Apps from GitHub side to take care of this scenario, right? Is there any workaround that you would like to suggest which I can try from my side ? I also cannot think of constantly checking (maybe by pinging) app's running status, as this does not sound feasible when thousands of concurrent requests will be raised. – Asif Kamran Malick May 14 '20 at 05:42
  • @AsifKamranMalick Exactly, which is why I suggest something done on GitHub side. – VonC May 14 '20 at 05:44
  • Ok. one final follow up question: There are tons of GitHub apps on market place. How do the app owners handle this scenario. Just curious. – Asif Kamran Malick May 14 '20 at 05:53
  • @AsifKamranMalick I suspect through polling of https://www.githubstatus.com/api/ – VonC May 14 '20 at 05:56
  • But that's for getting GitHub status,right? Whereas we are concerned about the status of GitHub App, which could be running on a personal server – Asif Kamran Malick May 14 '20 at 06:04
  • 1
    @AsifKamranMalick Right: that would then be https://developer.github.com/v3/checks/ and https://developer.github.com/v3/repos/statuses/ (statuses are only available for use with GitHub Apps) – VonC May 14 '20 at 06:07
  • Thank you so much. – Asif Kamran Malick May 14 '20 at 06:40