Skip to content
代码片段 群组 项目
未验证 提交 44911410 编辑于 作者: Stan Hu's avatar Stan Hu
浏览文件

Fix handling of DAGs within a stage in AtomicProcessingService

Suppose you had a `.gitlab-ci.yml` with a manual job listed after a
`needs`:

```
test1:
  needs: [manual1]
  script: exit 0

manual1:
  stage: test
  when: manual
  script: exit 0
```

Previously the `test1` job would be stuck in the `created` state
instead of `skipped` because `AtomicProcessingService` did not
consider a DAG within a stage. `test1` only gets updated to `skipped`
if `Ci::ProcessBuildService` is called on `manual1` first, but since
`test1` is listed first `AtomicProcessingService` will usually call
`Ci::ProcessBuildService` on it first. The update order previously
depended on the order returned by the database in
`StatusCollection#all_jobs`.

This commit introduces a `ci_atomic_processing_ordered_update_stage`
feature flag that performs a topological sort on all jobs in the stage
and updates the jobs in that order. This is similar to the approach
taken in `ResetSkippedJobsService`.

Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/450395

Changelog: fixed
上级 897f7dea
No related branches found
No related tags found
加载中
加载中
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册