Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When includes are used, the value of the variable is not constant and changes randomly. #1646

Closed
ZCube opened this issue May 10, 2024 · 5 comments

Comments

@ZCube
Copy link

ZCube commented May 10, 2024

  • Task version: 3.37.1
  • Operating system: Linux
  • Experiments enabled:

When includes are used, the value of the variable is not constant and changes randomly.

  • env/a/Taskfile.yaml
version: "3"

vars:
  Target: "a"

includes:
  c:
    taskfile: ../c/Taskfile.yaml
    vars:
      Target: "{{.Target}}"
  • env/b/Taskfile.yaml
version: "3"

vars:
  Target: "b"

includes:
  c:
    taskfile: ../c/Taskfile.yaml
    vars:
      Target: "{{.Target}}"
  • env/c/Taskfile.yaml
version: "3"

tasks:
  c:
    desc: "Task c"
    cmds:
      - echo "Task {{.Target}}"
  • Taskfile.yaml
version: "3"

includes:
  a:
    taskfile: ./env/a/Taskfile.yaml
  b:
    taskfile: ./env/b/Taskfile.yaml
  • test.sh
#!/bin/bash

for i in {1..1000}; do
    task b:c:c
done

Test

# ./test.sh | grep "Task a"

...

task: [b:c:c] echo "Task b"
task: [b:c:c] echo "Task a"
Task a
task: [b:c:c] echo "Task a"
Task a
task: [b:c:c] echo "Task a"
Task a
task: [b:c:c] echo "Task b"
task: [b:c:c] echo "Task a"
Task a
task: [b:c:c] echo "Task b"
task: [b:c:c] echo "Task b"
task: [b:c:c] echo "Task b"
task: [b:c:c] echo "Task b"
task: [b:c:c] echo "Task b"
task: [b:c:c] echo "Task b"
task: [b:c:c] echo "Task b"
task: [b:c:c] echo "Task b"
task: [b:c:c] echo "Task b"
task: [b:c:c] echo "Task b"
task: [b:c:c] echo "Task a"
Task a
task: [b:c:c] echo "Task a"
Task a
task: [b:c:c] echo "Task b"
task: [b:c:c] echo "Task b"
task: [b:c:c] echo "Task a"
Task a
task: [b:c:c] echo "Task a"
Task a
...

test.tar.gz

@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label May 10, 2024
@vmaerten
Copy link
Member

Hello !
It's a duplicate of #1643

@ZCube
Copy link
Author

ZCube commented May 10, 2024

@vmaerten thanks

@ZCube ZCube closed this as completed May 10, 2024
@task-bot task-bot removed the state: needs triage Waiting to be triaged by a maintainer. label May 10, 2024
@luischre
Copy link

I am still observing this issue even with the newest version 3.37.2

Anyone else experiencing the same still?

We now also downgraded to 3.36.0 again.

@pd93
Copy link
Member

pd93 commented May 16, 2024

@luischre Can you please open a new issue and provide an example of a Taskfile that reproduces the issue?

@luischre
Copy link

Yes, sure, will do so. Will try to provide a minimal reproduceable example. But need to prepare that first. Will then open the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants