Skip to content

Running task with dependencies in watch mode stopped watching for sources of dependencies #2199

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

Open
SheGe opened this issue Apr 22, 2025 · 2 comments · May be fixed by #2271
Open

Running task with dependencies in watch mode stopped watching for sources of dependencies #2199

SheGe opened this issue Apr 22, 2025 · 2 comments · May be fixed by #2271
Assignees
Labels
area: watcher Changes related to the Taskfile watcher.

Comments

@SheGe
Copy link

SheGe commented Apr 22, 2025

Description

I upgraded Task from version 3.42.1 to 3.43.2, and since then, the feature that watches for changes in sources within tasks provided via dependencies has stopped working. In version 3.42.1, I was able to execute a single task that had dependencies (or referenced other tasks) with sources definitions anywhere in the execution chain of a complex DAG, and the watch mode functioned correctly.

Expected behavior for the given example Taskfile definition:
The helm:package task should be restarted whenever any of its defined sources change, even when triggered through:

  • task up:watch
  • task up --watch

Version

3.43.2

Operating system

Debian 12

Experiments Enabled

No response

Example Taskfile

version: '3'

set: [pipefail]
shopt: [globstar]

interval: 1s

tasks:
  helm:package:
    sources:
      - charts/my-chart/templates/*.yaml
      - charts/my-chart/*.yaml
    cmds:
      - mkdir -p "${DIST_DIR}"
      - helm lint ${CHART_DIR}
      - |
        VERSION=$(yq eval '.version' ${CHART_DIR}/Chart.yaml)
        CHART_NAME=$(yq eval '.name' ${CHART_DIR}/Chart.yaml)
        rm -f ${DIST_DIR}/${CHART_NAME}-${VERSION}.tgz
        helm package ${CHART_DIR} --version ${VERSION} -d "${DIST_DIR}"
    env:
      DIST_DIR: "{{ .ROOT_DIR }}/dist"
      CHART_DIR: "{{ .ROOT_DIR }}/charts/my-chart"

  up:watch:
    watch: true
    silent: true
    deps:
      - task: helm:package
    cmds:
      - echo "🚀 System primed and ready! Keep this bad boy running and let's rock! 🤘"

  up:
    deps:
      - task: helm:package
@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label Apr 22, 2025
@andreynering andreynering added area: watcher Changes related to the Taskfile watcher. and removed state: needs triage Waiting to be triaged by a maintainer. labels Apr 22, 2025
@andreynering andreynering self-assigned this Apr 22, 2025
@andreynering andreynering linked a pull request May 27, 2025 that will close this issue
@andreynering
Copy link
Member

I opened #2271 that intends to fix this. Please give it a try and let me know if it's working for you.

@SheGe
Copy link
Author

SheGe commented May 27, 2025

@andreynering Thank you very much! I tested it with the following DAG, and discovering source changes works as expected - both for tasks triggered via dependencies and for those triggered via commands.

                  up:watch
                     │
                     ▼
                  [up:0]
                     │
        ┌────────────┴────────────┐
        │                         │
   [flux:install]             [app:venv]
        │                         │
        └────────────┬────────────┘
                     │
                  [up:1]
                     │
     ┌───────────────┼───────────────┐
     │               │               │
 [flux:platform] [image:cli]   [image:api]
     │               │               │
     └───────────────┼───────────────┘
                     │
                  [up:2]
                     │
     ┌───────────────┼───────────────┐
     │               │               │
 [app:config]    [app:helm]     [app:secrets]
     │               │               │
     └───────────────┼───────────────┘
                     │
                [flux:app]
                     │
                     ▼
          🚀 System primed and ready!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: watcher Changes related to the Taskfile watcher.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants