tezos-checker / checker

An in-development "robocoin" system for the Tezos blockchain
24 stars 16 forks source link

Add a comment workflow #226

Closed utdemir closed 3 years ago

utdemir commented 3 years ago

This PR changes how our PR-commenter-bot-thing works.

Previously, it was a task running on pull-request events. This was causing multiple problems:

Overall, I did not have a great experience with things happening tied to the events emitted. So I decided to follow a more declarative approach; where we have a task that:

  1. Looks at open PR's
  2. Checks if the tests have passed (both of the PR head and base commit)
  3. Checks if it already posted a comment about that commit.
  4. Otherwise calculates the diff, and sends a comment.

It'd be easy to modify the script to update/delete existing comments.

And here are some disadvantages:

  1. It always runs the code on master.
  2. It is a scheduled task (every 10 minutes), because the account the bot runs at does not have permission to trigger new workflows at the end of pull-request or build tasks (that was my initial plan). This is to avoid triggering recursive workflows, GitHub says. But the script does not enter our nix-shell unless necessary, so the frequent runs should be fast (it has to install Nix tho, so it'd still take a few minutes)

I tried it until line 68 and had to fix a ton of annoying errors in the process. Then I made it a cronjob instead, and that requires me to get the workflow in master in order to try the rest. So it is likely to break a few times in master, and then we should try to fix it there.

github-actions[bot] commented 3 years ago

Gas costs: No change. Entrypoint sizes: No change. Test coverage: No change.

github-actions[bot] commented 3 years ago

Gas costs: No change. Entrypoint sizes: No change. Test coverage: No change.