Skip to content

WIP: Solve composite status of skipped needs of ci pipelines

What does this MR do?

Related to #213080 (closed)

More explanation is in the summary section of the issue.

The idea behind this MR is very similar to !31624 (closed)

It means that, needs should not care about whether dependent jobs are failed or succeeded. The goal of needs is whether dependent jobs are completed or not. when keyword of the job should decide if dependent jobs need to be success or failure.

However, I did not make the same changes of the previous MR about "app/services/ci/process_build_service.rb".

Of course, legacy tests are failing...

Example 1

build_1:
  stage: build
  script: exit 0

build_2:
  stage: build
  script: exit 1

test:
  stage: test
  script: exit 0

deploy:
  stage: deploy
  script: exit 0
  needs: [build_1, test]

Screen_Shot_2020-03-20_at_13.40.01

According to this MR; in this example, deploy should be skipped and the pipeline should be failed.

Example 2

build_1:
  stage: build
  script: exit 0

build_2:
  stage: build
  script: exit 0

test:
  stage: test
  script: exit 0
  when: on_failure

deploy:
  stage: deploy
  script: exit 0
  needs: [build_1, test]

Screen_Shot_2020-03-24_at_17.54.48

According to this MR; in this example, since "test" is skipped, "deploy" should be skipped. And the pipeline should be succeeded.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Furkan Ayhan

Merge request reports