License Scanning vendored template changes to start the job within its stage not when pipeline starts

Release notes

https://docs.gitlab.com/ee/ci/yaml/#needs

The default CI template of License Scanning is changing so that the job will no longer start before previous stages finish. This was unexpected and inconsistent default behaviour.

If you have customized your .gitlab-ci.yml and explicitly set the needs attribute of the license_scanning job so that it only starts when its stage starts, you can now remove this customization.

If you use the License Scanning CI template without customization and wish to revert the behavior, customize your .gitlab-ci.yml by overriding the license_scanning job and setting needs: [] in the job definition.

Summary

Because the needs param of the license_scanning job is an empty array it may start before previous stages finish. See CI template.

Also, needs: [] is optimization for certain conditions, but it might slow down the pipeline or waste resources. See discussion on pros & cons.

Review this behavior and look at commenting out or removing from template

This was initially reported in #240945 (comment 452811728)

Steps to reproduce

see #240945 (closed)

Example Project

What is the current bug behavior?

license scanning starts right away

What is the expected correct behavior?

license scanning waits if user made no changes for prior stage to finish

Relevant logs and/or screenshots

Output of checks

Implementation plan

  • Review this behavior, and decide what needs to be done
  • Possibly update https://gitlab.com/gitlab-org/gitlab/-/blob/4050f448d553cff65cf2aab17d1ac1cc8104b5fe/lib/gitlab/ci/templates/Security/License-Scanning.gitlab-ci.yml#L24 and remove needs: [] line
  • Check new template with different pipeline configurations
    • When pipeline has defined order of stage
    • When pipeline doesn't have defined order of stages
    • Check updated template with GitLab project CI configuration

No need to update documentation as this field isn't mention in License Compiance page

Edited Feb 16, 2021 by Fabien Catteau
Assignee Loading
Time tracking Loading