Missing dependency should fail job
Currently, our dependencies are "soft", we do not fail the job if the dependency is missing, which is wrong.
Missing dependency should not allow the subsequent stage to be executed and should fail the job.
-
A depending job has
dependencies
keyword, but a depended job can not be found. (This is described at https://gitlab.com/gitlab-org/gitlab-ce/issues/18769) -
A depending job has
dependencies
keyword and a depended job can be found, but the depended job’s artifacts are missing by some reasons(e.g. expired or deleted manually, or job is manual and not executed)
Designs
- Show closed items
Relates to
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Maintainer
I agree, we have an issue for that somewhere already
- Contributor
@grzesiek @ayufan I found issue #18769 (closed) that has a different approach. Were you referring to that?
Personally I agree it should fail, and managed via
allow_failure
if needed. 1 - Author Maintainer
I consider this to be high stake bug that we should fix. @bikebilly should we pick that for %9.6?
- Fabio Busatto changed milestone to %10.0
changed milestone to %10.0
- Contributor
@ayufan sounds good, please consider adding a clear feedback for the user if the error is due to this.
- Fabio Busatto added Deliverable label
added Deliverable label
- Kamil Trzciński assigned to @zj
assigned to @zj
- Author Maintainer
RegisterJobService
, if cannot be picked it should fail. We probably need to introduceci_builds.failure_reason
. And use thatfailure_reason
in Detailed Build Status.I see the following failure_reasons:
- script_error,
- system_error,
- missing_dependency,
- out_of_quota,
- stuck (when not updated over 1hr),
- no_runner.
- Zeger-Jan van de Weg added workflowin dev label
added workflowin dev label
- Kamil Trzciński assigned to @dosuken123
assigned to @dosuken123
- Kamil Trzciński unassigned @zj
unassigned @zj
- Shinya Maeda marked this issue as related to #18769 (closed)
marked this issue as related to #18769 (closed)
- Maintainer
- Shinya Maeda mentioned in merge request !13922 (closed)
mentioned in merge request !13922 (closed)
- Maintainer
failure_reason
first. This issue later with the change. - Maintainer
Something like pipeline source ->
failure_reason
- Shinya Maeda mentioned in issue #37239 (closed)
mentioned in issue #37239 (closed)
- Shinya Maeda marked this issue as related to #37239 (closed)
marked this issue as related to #37239 (closed)
- Maintainer
We'll finish https://gitlab.com/gitlab-org/gitlab-ce/issues/37239 for
ci_builds.failure_reason
at first, then we usemissing_dependency
for this issue. - Shinya Maeda mentioned in merge request !13937 (merged)
mentioned in merge request !13937 (merged)
- Shinya Maeda mentioned in merge request !14009 (merged)
mentioned in merge request !14009 (merged)
- Maintainer
I discussed with @ayufan and decided to postpone this to the next release, because we have not clarified yet about what we should fix particularly.
As far as I know, there are two specific cases we need a patch.
- A depending job has
dependencies
keyword, but a depended job can not be found. (This is described at https://gitlab.com/gitlab-org/gitlab-ce/issues/18769) - A depending job has
dependencies
keyword and a depended job can be found, but the depended job’s artifacts are missing by some reasons(e.g. expired or deleted manually)
@ayufan This is covered by https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/14009. Although it seems you're concerning negative-side-effect by the MR. Could you describe a clear direction what we should fix here?
@bikebilly If we're missing anything, could you point it out?
Thanks!
P.S.
Probably we also should fix the following case.
- A depending job has
dependencies
keyword and a depended job can be found, but the depended job has not been executed (e.g. manual job)
But this could be covered by the 2nd fix I described above.
- A depending job has
- Shinya Maeda changed milestone to %10.1
changed milestone to %10.1
- Maintainer
Also, we should change our doc.
https://docs.gitlab.com/ce/ci/yaml/README.html#dependencies
To use this feature, define dependencies in context of the job and pass a list of all previous jobs from which the artifacts should be downloaded. You can only define jobs from stages that are executed before the current one. An error will be shown if you define jobs from the current stage or next ones. Defining an empty array will skip downloading any artifacts for that job. The status of the previous job is not considered when using dependencies, so if it failed or it is a manual job that was not run, no error occurs.
- Fabio Busatto changed the description
changed the description
- Contributor
Added clarifications in the description.
- Maintainer
@ayufan @bikebilly We don't have enough time to finish this in order to deal with https://gitlab.com/gitlab-org/gitlab-ce/issues/35954. We would be able to fix in %10.2.
1 - Shinya Maeda changed milestone to %10.2
changed milestone to %10.2
- Maintainer
- Shinya Maeda assigned to @ayufan
assigned to @ayufan
- Maintainer
@ayufan @bikebilly Any news? Should we change the milestone again?
- Author Maintainer
@dosuken123 I added this to high-prio todo list. Sorry, for delay :(
- Contributor
@dosuken123 @ayufan since if you don't specify
dependencies
keyword it implies all the previous jobs, is this fix consistent with it, so it fails the job if nodependencies
keyword is defined and any of the previous jobs had problems with artifacts? It may seem not the natural approach, but if you think about what is the implementation it should. - Kamil Trzciński changed milestone to %10.3
changed milestone to %10.3
- Author Maintainer
I commented finally on the dependencies fix: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/14009/diffs#note_47207690
- Kamil Trzciński unassigned @ayufan
unassigned @ayufan
- Kamil Trzciński closed via merge request !14009 (merged)
closed via merge request !14009 (merged)
- Maintainer
@bikebilly https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/14009 was merged. This changes default behavior of
dependencies
keyword. It's better to describe in the 10.3 release blog post. Some users may complain about why their jobs started failing. 1 - Contributor
@dosuken123 do we have the new behavior documented? It may be worth having the list of the standard case, and the edge ones (no artifacts defined, allowed to fail job, etc...).
- Inactive Account removed workflowin dev label
removed workflowin dev label
- Maintainer
@bikebilly It's already documented. You can check https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/14009 the details. @axil did really nice job.
2 - Developer
@bikebilly that's documented in https://docs.gitlab.com/ce/ci/yaml/README.html#when-a-dependent-job-will-fail (waiting for CE>EE merge to appear under
ee/
as well). If you think we should note anything else, open an issue! I'd be happy to take it.Edited by Achilleas Pipinellis - Contributor
@dosuken123 @axil no that's good, I added it to the release post
- Developer
@bikebilly great! Make sure you link to the ee URL even if it's not up yet :)
- Contributor
@axil good point, updated
- Shinya Maeda marked this issue as related to #41111 (closed)
marked this issue as related to #41111 (closed)
- Shinya Maeda marked this issue as related to #41110 (closed)
marked this issue as related to #41110 (closed)
- Shinya Maeda mentioned in issue #41119 (moved)
mentioned in issue #41119 (moved)
- Shinya Maeda mentioned in merge request !15609 (closed)
mentioned in merge request !15609 (closed)