Skip to content

Do an exact match on the job name

David Dieulivol requested to merge ddieulivol-fix_regexp_for_failed_jobs into master

Context

In gitlab-org/gitlab!110184 (merged), we introduced a new job called review-deploy-failure-notification.

This job made the bin/failed_jobs_report fail to report jobs (see slack discussion - internal)

What's in this MR?

We fix the Regexp wen looking for failed jobs to do an exact match for the job name.

Before

https://rubular.com/r/U0v4gV38Y48t6r

$ bundle exec bin/failed_jobs_report -t <redacted> --hours 6 --job 'review-deploy'
No failed job in the past 6 hours

After

https://rubular.com/r/0EWMIVbB3pM0pM

$ bundle exec bin/failed_jobs_report -t <redacted> --hours 6 --job 'review-deploy'
|      id      |       name      |           created_at           |    status    |                            web_url                           |
|--------------|-----------------|--------------------------------|--------------|--------------------------------------------------------------|
|   3979433113 | review-deploy   | 2023-03-22T09:18:17.362Z       | failed       | https://gitlab.com/gitlab-org/gitlab/-/jobs/3979433113       |
Edited by David Dieulivol

Merge request reports

Loading