I am trying to implement the coqbot feature discussed during the weekly call, namely the ability to close PRs that have a needs:rebased tag for too long. AFAIU the coqbot infrastructure is completely asynchronous, so I need to have GitHub send a message to the bot on a regular basis. If I am not mistaken, the only way to do that is to have a workflow in the coq repository that has an on.schedule
configuration, and then listen to workflow_run
events on the coqbot side.
It seems that coqbot does not handle this message yet, so I started implementing it.
Unfortunately I don't understand how to extract the relevant workflow data from the JSON. The documentation mentions a workflow
field but the example is completely devoid of any such field. Since it's the one that contains the name
of the workflow I don't really know how to recognize that we received a signal for the workflow we're looking for.
Am I supposed to send requests to the GitHub API and check they do have a workflow
field and extrapolate from here?
Or is the whole endeavour an XY problem and is there another more principled approach than checking every day that all PRs have been rebased recently?
Any cron schedule triggering a call to a specific API endpoint should work. You can indeed do this from a GitHub Action (with curl) or from any server.
Maybe there even are free online services that can do this in a more lightweight way.
Example: https://cron-job.org/en/
Isn't that a bit fragile to rely on some external service?
If we can do everything from within github this reduces the amount of hidden state we're relying on.
I'll send directly a request to coqbot via curl instead of going through a workflow.
Pierre-Marie Pédrot said:
Isn't that a bit fragile to rely on some external service?
That kind of service is easy to replace though.
Pierre-Marie Pédrot said:
I'll send directly a request to coqbot via curl instead of going through a workflow.
Sounds good.
Last updated: May 28 2023 at 18:29 UTC