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

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

Edited by Fabien Catteau