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

fix: propagate include vars in multi-level includes #1256

Merged
merged 1 commit into from Jul 8, 2023

Conversation

hudclark
Copy link
Contributor

@hudclark hudclark commented Jul 7, 2023

Previously, included vars would be set to nil upon being included by another taskfile. They are now propagated up during the include process.

This is especially problematic for users who want to use library-like taskfiles in a monorepo.

├── common
│   └── docker.yml
├── service-a
│   └── Taskfile.yml 
├── service-b
│   └── Taskfile.yml
└── Taskfile.yaml

You can imagine that the contents of service-a/Taskfile.yml resemble

version: '3'
includes:
  docker:
    taskfile: ../common/docker.yml
    vars:
      DOCKER_IMAGE: service-a

Fixes:

Previously, included vars would be set to nil upon being included by
another taskfile. They are now propagated up during the include process.
@andreynering andreynering added the type: bug Something not working as intended. label Jul 8, 2023
@andreynering
Copy link
Member

Nice work @hudclark, thanks a lot!

@andreynering andreynering merged commit 8a06893 into go-task:main Jul 8, 2023
12 checks passed
andreynering added a commit that referenced this pull request Jul 8, 2023
@pd93 pd93 mentioned this pull request Jul 19, 2023
pd93 added a commit that referenced this pull request Sep 8, 2023
pd93 added a commit that referenced this pull request Sep 8, 2023
pd93 added a commit that referenced this pull request Sep 12, 2023
pd93 added a commit that referenced this pull request Sep 15, 2023
pd93 added a commit that referenced this pull request Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something not working as intended.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vars don't get properly propagated with two levels of included nesting
2 participants