Skip to content

Subtasks emitted before their group definition become orphaned #514

Open

Description

@ravi866rj-crypto

Bug

When a task generator yields a subtask and later yields the corresponding group task (name: None) to provide group metadata, the group definition replaces the implicitly created group and drops its task_dep entries. The subtask remains in the task list but is no longer reachable through the group.

Reproducer

from doit.loader import generate_tasks

def generated():
    yield {'name': 'child', 'actions': None}
    yield {'name': None, 'doc': 'group documentation', 'actions': None}

tasks = {task.name: task for task in generate_tasks('task_demo', generated())}
print(tasks['task_demo'].task_dep)

Expected: ['task_demo:child'].
Actual: [].

The order is significant: yielding the name: None group before its subtasks retains the dependencies. This makes generator output order unexpectedly change the task graph.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions