Skip to content

A task with if-dependencies or/and soft-dependencies pulls all of them if any gets pulled #710

@Eijebong

Description

@Eijebong

Considering the following:

loader: taskgraph.loader.transform:loader

transforms:
  - taskgraph.transforms.task

task-defaults:
  worker-type: succeed

tasks:
  task-a:
    label: task-a
    optimization:
      skip-unless-changed: ["world"]
    description: task-a

  task-b:
    label: task-b
    description: task-b

  final:
    label: final
    dependencies:
      task-a: task-a
      task-b: task-b
    if-dependencies:
      - task-a
      - task-b
    soft-dependencies:
      - task-a
      - task-b
    description: final

task-a gets optimized because of skip-unless-changed but gets pulled back in by final

2025-06-23 17:42:57,207 - DEBUG - no files found matching a pattern in `skip-unless-changed` for "task-a"
2025-06-23 17:42:57,207 - DEBUG - optimize: final kept because of never
2025-06-23 17:42:57,207 - DEBUG - optimize: task-b kept because of never
2025-06-23 17:42:57,207 - DEBUG - optimize: task-a kept because of dependent tasks
2025-06-23 17:42:57,207 - INFO - No tasks removed during optimization

If I optimize task-b away too, then I get an empty graph.

I would expect task-a to not get pulled by final if it's already been optimized.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BREAKING CHANGEBackwards incompatible request that will require major version bump

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions