runatlantis / atlantis

Terraform Pull Request Automation
https://www.runatlantis.io
Other
7.68k stars 1.05k forks source link

Option to use GitHub App's "Checks API" instead of PR comments #936

Open MPV opened 4 years ago

MPV commented 4 years ago

Hi, I'd like to propose using the "GitHub Checks API" for delivering even nicer feedback into GitHub pull requests.

Here's two examples of how it looks when the Google Cloud Build GitHub app does this:

Success example:

ghgooglecloudbuild

Failure example:

2IPZt

Some possible benefits:

  1. It shows all runs in a collected list under the Checks tab. Compared to today, where Atlantis plan/applies are intermingled with discussions/changes to the PR. I imagine both could be valuable, and this condensed list could help in some cases.
  2. We could decide (or configure?) whether it should show the output from the Terraform commands directly in the PR, or just link to somewhere "safe" where the right people could access the output (and maybe help with issues like https://github.com/runatlantis/atlantis/issues/163).

Since the GitHub Checks API seems to require tying it to a GitHub app, I imagine it might mean each installation/usage of Atlantis might require the owners to set up their own private app, but that might be fine.

pratikmallya commented 4 years ago

Since this depends on atlantis being configured as a Github app, it seems to require https://github.com/runatlantis/atlantis/issues/418

evanstachowiak commented 3 years ago

Now that #971 is completed (thanks @unRob !), any status on getting this implemented?

nitrocode commented 1 year ago

This would put atlantis more on-par with competitors like Spacelift

https://docs.spacelift.io/integrations/source-control/github

jamengual commented 1 year ago

PRs will be welcome :)

nitrocode commented 1 year ago

It appears the lyft fork has this setup and they previously attempted to upstream the changes here https://github.com/runatlantis/atlantis/pull/2217 but it fell into git conflicts and became stale.

If anyone is interested in taking the changes, fixing conflicts, testing, and opening up a new PR, then we can get it merged 😄 .

Notable in the lyft fork.

https://github.com/lyft/atlantis/blob/4c6dfb9739a84b7db10a8978023a6c8a13dff691/server/events/vcs/github_client.go#L515-L518

https://github.com/lyft/atlantis/blob/4c6dfb9739a84b7db10a8978023a6c8a13dff691/server/events/vcs/github_client.go#L545-L546

Edit: Using the checks api results in github app in a "job summary" (and "job summaries") style output (for issue searchers). It's also possible that a job summary output can be used with or without checks api meaning the github app is not 100% necessary for summaries.

Almenon commented 3 weeks ago

Would be nice to have this for Bitbucket cloud too