retries_count webhook value returns unexpected results
Summary
retries_count
returns inaccurate values when the build_status
is failed
.
From the docs:
retries_count is an integer that indicates if the job is a retry. 0 means that the job has not been retried. 1 means that it’s the first retry.
Steps to reproduce
- Register a webhook listener for job events
- Create a
.gitlab-ci.yaml
with the following contents
image: python:latest
test:
script:
- exit 1
retry:
max: 2
when:
- always
- Commit the file running the job
- Observe the values for
retries_count
in webhook events wherebuild_status = 'failed'
Example Project
https://gitlab.com/danlamanna/testci
What is the current bug behavior?
The webhook value for retries_count
where build_status = 'failed'
is 1, 2, 2.
What is the expected correct behavior?
The webhook value for retries_count
where build_status = 'failed'
should be 0, 1, 2.
This bug happens on GitLab.com