Skip to content

Conversation

@bavarianbidi
Copy link
Contributor

There are only a few cases, where we get a job information from github where the runner name is not set.

For all this cases we do not need to check github API at all because these jobs are never ever get scheduled to a runner:

job.Action is:

  • queued: a queued job is just queued and not scheduled to a runner so we do not get a runner name from the GH API
  • completed: when conclusion=cancelled|failure github never scheduled the job to a runner and with that we do not get a runner name from the GH API

There are only a few cases, where we get a job information from github
where the runner name is not set.

For all this cases we do not need to check github API at all because
these jobs are never ever get scheduled to a runner:

job.Action is:

* queued:
  a queued job is just queued and not scheduled to a runner so we do
  not get a runner name from the GH API
* completed:
  when conclusion=cancelled|failure github never scheduled the job to a
  runner and with that we do not get a runner name from the GH API

Signed-off-by: Mario Constanti <mario.constanti@mercedes-benz.com>
@gabriel-samfira
Copy link
Member

Could you add a check here:

For the runner name. And just log that there was no runner assigned and just return nil.

Saves us some unnecessary db queries and log spam

Signed-off-by: Mario Constanti <mario.constanti@mercedes-benz.com>
bavarianbidi added a commit to mercedes-benz/garm that referenced this pull request Jun 5, 2024
from cloudbase#255

Signed-off-by: Mario Constanti <mario.constanti@mercedes-benz.com>
@gabriel-samfira gabriel-samfira merged commit 7ee235a into cloudbase:main Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants