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
显示
- app/services/ci/pipeline_processing/atomic_processing_service.rb 44 个添加, 6 个删除...vices/ci/pipeline_processing/atomic_processing_service.rb
- config/feature_flags/gitlab_com_derisk/ci_atomic_processing_ordered_update_stage.yml 9 个添加, 0 个删除..._com_derisk/ci_atomic_processing_ordered_update_stage.yml
- spec/services/ci/pipeline_processing/atomic_processing_service_spec.rb 83 个添加, 0 个删除.../ci/pipeline_processing/atomic_processing_service_spec.rb
加载中
想要评论请 注册 或 登录