Stream: coqbot devs & users

Topic: Close needs:rebased PR after a while


view this post on Zulip Pierre-Marie Pédrot (Jun 25 2021 at 13:30):

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.

view this post on Zulip Pierre-Marie Pédrot (Jun 25 2021 at 13:32):

It seems that coqbot does not handle this message yet, so I started implementing it.

view this post on Zulip Pierre-Marie Pédrot (Jun 25 2021 at 13:33):

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.

view this post on Zulip Pierre-Marie Pédrot (Jun 25 2021 at 13:34):

Am I supposed to send requests to the GitHub API and check they do have a workflow field and extrapolate from here?

view this post on Zulip Pierre-Marie Pédrot (Jun 25 2021 at 13:37):

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?

view this post on Zulip Théo Zimmermann (Jun 25 2021 at 13:57):

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.

view this post on Zulip Théo Zimmermann (Jun 25 2021 at 13:58):

Maybe there even are free online services that can do this in a more lightweight way.

view this post on Zulip Théo Zimmermann (Jun 25 2021 at 14:00):

Example: https://cron-job.org/en/

view this post on Zulip Pierre-Marie Pédrot (Jun 25 2021 at 14:07):

Isn't that a bit fragile to rely on some external service?

view this post on Zulip Pierre-Marie Pédrot (Jun 25 2021 at 14:08):

If we can do everything from within github this reduces the amount of hidden state we're relying on.

view this post on Zulip Pierre-Marie Pédrot (Jun 25 2021 at 14:10):

I'll send directly a request to coqbot via curl instead of going through a workflow.

view this post on Zulip Théo Zimmermann (Jun 25 2021 at 15:04):

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