Skip to content

Conversation

@vmaerten
Copy link
Member

@vmaerten vmaerten commented Apr 10, 2025

fixes #1909

@vmaerten vmaerten marked this pull request as ready for review April 21, 2025 11:51
@vmaerten vmaerten requested review from andreynering, Copilot and pd93 and removed request for andreynering April 21, 2025 11:51
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes issue #1909 by ensuring that variable interpolation works correctly for deferred tasks. The changes include updating the Taskfile.yml to use interpolation in both deferred and immediate tasks, adding test assertions in task_test.go for the new behavior, and updating task.go to handle variable replacements in the deferred command fields.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
testdata/deferred/Taskfile.yml Added deferred and immediate task definitions with interpolated variables
task_test.go Added test assertions to verify deferred task variable interpolation
task.go Updated deferred command processing to include task and vars interpolation
Comments suppressed due to low confidence (2)

task.go:300

  • Consider adding unit tests that validate the interpolation behavior for both cmd.Task and cmd.Vars to ensure deferred commands are processed as expected.
cmd.Task = templater.ReplaceWithExtra(cmd.Task, cache, extra)

task_test.go:1814

  • Consider adding a test case for the immediate command interpolation outcome (for example, verifying 'task immediate' outputs) to ensure consistency between deferred and immediate tasks.
assert.Contains(t, buff.String(), "child task deferred value-from-parent")
@andreynering andreynering merged commit 7169bf6 into main Apr 21, 2025
14 checks passed
@andreynering andreynering deleted the fix/interpolate-vars-defer branch April 21, 2025 16:43
andreynering added a commit that referenced this pull request Apr 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants