Skip to content

improved dir-specific dynamic vars#2757

Open
loganfred wants to merge 1 commit intogo-task:mainfrom
loganfred:lkf/dir-include-dynamic-var-fix
Open

improved dir-specific dynamic vars#2757
loganfred wants to merge 1 commit intogo-task:mainfrom
loganfred:lkf/dir-include-dynamic-var-fix

Conversation

@loganfred
Copy link

This PR is concerned with behavior when multiple task files are include:-ed with explicit dir: and use dynamic sh: vars.

  1. Fixes what I think is a typo where, in merges, t2.env is not being merged into t1
  2. Guards IncludedTaskfileVars so it is no longer unconditionally overwritten on each merge, otherwise in root -> parent -> A/B includes, the outer merge overwrites.
  3. Uses dir:-specific caching of sh: dynamic vars (e.g. now multiplefind . -name '*.md' is possible)
    4.taskRangeFunc should resolve t.Dir at call time, not construction time, so dir: '{{.VAR}}' variables are available

Assuming I ran it properly, the test suite passes, my minimal repro steps are resolved, and my original bug report scenario is fixed.

I am not a go programmer, this PR was overwhelmingly AI-written, I have no idea if these changes are terrible ideas, but I hope they clarify what might be going wrong in #2753

fixes #2753

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.

SIGSEGV in fingerprint; explicit dir include dynamic vars are not isolated and caching prohibits exact shell command re-use

1 participant