Skip to content

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

Merged
andreynering merged 1 commit into
go-task:mainfrom
hudclark:fix-include-vars
Jul 8, 2023
Merged

andreynering merged 1 commit into
go-task:mainfrom
hudclark:fix-include-vars

Conversation

@hudclark

@hudclark hudclark commented Jul 7, 2023 •

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Member

Nice work @hudclark, thanks a lot!

@andreynering
andreynering merged commit 8a06893 into go-task:main Jul 8, 2023
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

None yet

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