Needs keyword does not work as expected with rules

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

Hi, I am currently working on pipelines that need to be flexible for testing. I have a small pipeline consisting of a linting stage followed by a deploy stage. Some of the tasks also depend on each other. When I try to use the "needs" keyword in combination with my rules it does not seem that they are applied.

Steps to reproduce

  1. Create a pipeline with 2 Stages
  2. Add a job to the first stage
  3. Add a job to the second stage
  4. Add a rule to the second job:
rule:
  - if: $CI_PIPELINE_SOURCE == "web"
    needs: []
  1. The needs keyword should be triggered when I run the pipeline via the Web interface -> The second job should start independently from the first job in this scenario.
  2. Result: The second job waits for the first job to finish as "normally".

What is the current bug behavior?

The needs keyword seems to be ignored inside of the rule section.

What is the expected correct behavior?

The needs keyword should be evaluated and be applied according to the matching rule.

Edited by 🤖 GitLab Bot 🤖