Combining dependencies and needs:artifacts results in artifacts not downloaded

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

  • Close this issue

Summary

In CI, when combining dependencies and needs:artifacts, no artifacts are downloaded.

Steps to reproduce

stages:
  - build
  - test

build:
  stage: build
  script:
    - echo "Hello world" >foo
  artifacts:
    paths:
      - foo

test:
  stage: test
  needs:
    - job: build
      artifacts: true
  dependencies: []
  script:
    - cat foo

Example Project

https://gitlab.com/mjerabek/gitlab-bug-artifacts/

What is the current bug behavior?

The pipeline runs, but no artifacts are downloaded in job test. I think this used to work, but I cannot find a proof, so maybe it never did.

What is the expected correct behavior?

I'd be fine with either of:

  1. The artifacts are downloaded (dependencies: [] says not to download by default, needs:artifacts adds an extra requirement)
  2. The pipeline fails with "invalid YAML", stating that dependencies and needs:artifacts together are not supported

Note: The solution for the example here is obvious - just remove dependencies: []. But I use this in a more complicated scenario, where the test job extends another job that actually uses dependencies and I need to clear that. Using only needs/dependencies in both jobs is also suboptimal, as in one job I want the stage-barrier (wait until all preceding jobs complete), whereas in the second one I don't. Creating a common-parent job without either dependencies or needs is a possible workaround, though.

Edited Aug 27, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading