Gitlab workflow:rules precedence over spec:inputs

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

Summary

During pipeline testing I noticed that despite workflow rule being set to "never", pipeline is still being created but with an missing input error, provided no default value for input is set. Since gitlab has global workflow key I guess it is expected for it to be evaluated first. If not please correct me. While it is not a critical error it would be nice to get it fixed or get documented statement that it is expected behaviour.

Steps to reproduce

Use following .gitlab-ci.yml

spec:
  inputs:
    input:
      type: string
---
workflow:
  rules:
    - when: never

stages:
  - create

install chart:
  stage: create
  script:
  - echo 1

Example Project

https://gitlab.com/daniilborisov2001/test-bug/-/pipelines

What is the current bug behavior?

When using gitlab inputs without default values AND workflow:rule with never clause pipeline is still being created but with error.

What is the expected correct behavior?

Pipeline must not be created with when:never rule.

Relevant logs and/or screenshots

image

Output of checks

<-- This bug happens on GitLab.com -->

Results of GitLab environment info

Repoducible in selfhosted 18.3 and gitlab.com

Possible fixes

Sorry, no idea. Guess pipeline parsing lib?

Patch release information for backports

If the bug fix needs to be backported in a patch release to a version under the maintenance policy, please follow the steps on the patch release runbook for GitLab engineers.

Refer to the internal "Release Information" dashboard for information about the next patch release, including the targeted versions, expected release date, and current status.

High-severity bug remediation

To remediate high-severity issues requiring an internal release for single-tenant SaaS instances, refer to the internal release process for engineers.

Edited by 🤖 GitLab Bot 🤖