cloudbase / garm

GitHub Actions Runner Manager
Apache License 2.0
136 stars 26 forks source link

Reduce getworkflowjobbyid gh requests #253

Closed bavarianbidi closed 5 months ago

bavarianbidi commented 5 months ago

As our garm-instance is running on an enterprise level, we are having a large error rate when it came to GetWorkflowJobByID requests towards github.

This is mostly, because our enterprise-token does not have (and it also does not need) permissions to read on a repo-level. The current (on main) implementation already check, if the garm-instance is responsible for this webhook event (by filtering on pool labels). The proposed implementation only moves the label-check a few lines on top to return a bit earlier and with that reduce the number of api-calls towards github.

image

commit a0a344ba99097fb7a1be959c11c0458558f3b600 is a small restructuring to probably make some conditions obsolete and increase the readability.

bavarianbidi commented 5 months ago

close this PR in favor of https://github.com/cloudbase/garm/pull/254