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

Variables Passed to Included Taskfile Is Unavilable During Global Variables Expansion #1503

Closed
liblaf opened this issue Feb 10, 2024 · 4 comments · Fixed by #1533
Closed
Labels
area: variables Changes related to variables. type: bug Something not working as intended.

Comments

@liblaf
Copy link

liblaf commented Feb 10, 2024

  • Task version: v3.34.1 (h1:yAAxUM54zoaHv+OtDnGgkWSVeiRuaOCn1lPUXPQQA0o=)
  • Operating system: Arch Linux
  • Experiments enabled: None

Reproduction

# Taskfile.yaml
version: "3"

includes:
  hello:
    taskfile: taskfiles/hello.yaml
    vars:
      NAME: world

tasks:
  default:
    deps:
      - hello:default
# taskfiles/hello.yaml
version: "3"

vars:
  MESSAGE: "Hello, {{.NAME}}!"

tasks:
  default:
    cmds:
      - echo "{{.MESSAGE}}"
    requires:
      vars:
        - MESSAGE

Actual Output

$ task
task: [hello:default] echo "Hello, !"
Hello, !

Expected Output

$ task
task: [hello:default] echo "Hello, world!"
Hello, world!
@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label Feb 10, 2024
@pd93 pd93 added area: variables Changes related to variables. type: bug Something not working as intended. and removed state: needs triage Waiting to be triaged by a maintainer. labels Mar 4, 2024
@mvhatch
Copy link

mvhatch commented Mar 17, 2024

I'm still seeing the original bug behavior.

➜  ~ task
task: [hello:default] echo "Hello, !"
Hello, !
➜  ~ task --version
Task version: v3.35.1 (h1:zjQ3tLv+LIStDDTzOQx8F97NE/8FSTanjZuwgy/hwro=)
➜  ~ task --experiments
* GENTLE_FORCE:         off
* REMOTE_TASKFILES: off
* ANY_VARIABLES:    off
  • Darwin arm64

@mvhatch
Copy link

mvhatch commented Mar 17, 2024

I checked out version v3.34.1 (h1:yAAxUM54zoaHv+OtDnGgkWSVeiRuaOCn1lPUXPQQA0o=) to double-check, and the bug is still there, too

@liblaf
Copy link
Author

liblaf commented Mar 17, 2024

I got the same bug behavior as @mvhatch. we should reopen this issue @pd93.

@pd93
Copy link
Member

pd93 commented Mar 17, 2024

@mvhatch, @liblaf, The fix has been merged into main (hence the issue being closed). However, it has not been included in a release yet. You'll need to wait until 3.36.0 is released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: variables Changes related to variables. type: bug Something not working as intended.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants