upsidr / merge-gatekeeper

Get better merge control
MIT License
85 stars 14 forks source link

Gatekeeper does not fail if the webhook job fails #36

Closed yuriydzobak closed 1 year ago

yuriydzobak commented 1 year ago

Hi, I faced with an issue The gatekeeper is checking webhook job correct only for status Successful

Total job count:     2
    jobs: ["atlantis/plan" "yaml: lint"]
  Completed job count: 2
    jobs: ["atlantis/plan" "yaml: lint"]
  Failed job count:    0
    jobs: []

The gatekeeper doesn't verify if webhook job is fail and that isn't stopped after timeout.

image image

As you see only one GHA displayed

image
rytswd commented 1 year ago

Hi @yuriydzobak, thanks for raising the issue! πŸ‘

Merge Gatekeeper looks at the GitHub Action status, and is specifically looking for a state called error in the current implementation. How do you have your atlantis/plan job configured / triggered, and do you see some other status with it?

For further investigation, we may need to add an external flag for verbose logging, so that we can pinpoint what's happening with the actual job input. I believe the actual fix for this would be simply to catch other statuses, so that should be straightforward. We will look to see what we can do from our end, but if you can help fill in some details above, it would allow us to get a patch release for your specific use case quickly πŸ™

yuriydzobak commented 1 year ago

Hi @rytswd

Hi @yuriydzobak, thanks for raising the issue! πŸ‘

Merge Gatekeeper looks at the GitHub Action status, and is specifically looking for a state called error in the current implementation. How do you have your atlantis/plan job configured / triggered, and do you see some other status with it?

webhook configuration -> link

For further investigation, we may need to add an external flag for verbose logging, so that we can pinpoint what's happening with the actual job input. I believe the actual fix for this would be simply to catch other statuses, so that should be straightforward. We will look to see what we can do from our end, but if you can help fill in some details above, it would allow us to get a patch release for your specific use case quickly πŸ™

If i understand correct it sends this and you are validating this one

yuriydzobak commented 1 year ago

I've reproduced the issue if the status of commit is failure then gatekeeper doesn't see it If the status of commit is error then all works

doc: https://docs.github.com/en/rest/commits/statuses#create-a-commit-status The state of the status. - Can be one of: error, failure, pending, success gatekeeper doesn't have logic to check failure

rytswd commented 1 year ago

@yuriydzobak Thanks very much for further details! I have created a PR for fixing this. We will look to get this merged in the coming days, and cut a new patch release right after πŸ‘

yuriydzobak commented 1 year ago

I've checked from your branch and all works as expected Thank you very much

rytswd commented 1 year ago

Thanks for testing! v1.1.1 has been released with the above fix ☺️ We will update the relevant major and minor version tags (v1 and v1.1) in the coming days as well.