microsoft / microsoft/lage

Lage scheduler adding "phantom" tasks to the graph.

Open
#592 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
816
Forks
88
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
Running a command with Lage acts as if the command exists across all packages rather than checking if a package actually has this script or not. This is a problem for pipelines trying to optimize build processes of subtasks as Lage is running more tasks than required.

For example, if we wanted to have a pipeline that just ran tests, we shouldn't need to run the full repo's build steps.

To Reproduce

  • git clone https://github.com/Philip-Scott/lage-tasks-min-repro.git
  • npm install
  • npm run test

Expected Behavior

On that min-repro repo, running npm run test should run the build task of the parent package, then the build task of the child2 package, and finally the test task of the child2 package. Since child1 does not have a test package, it should not be built.

$ npm run test:expected 
> lage-tasks-min-repro@1.0.0 test:expected
> lage test --to child2 --no-cache
Lage running tasks with 15 workers
Summary
Slowest targets
  parent#build - 0.36s
  child2#test - 0.27s  
  child2#build - 0.27s
success: 3, skipped: 0, pending: 0, aborted: 0, failed: 0
Took a total of 0.93s to complete.

Current Behavior

Running npm run test is running build for child1, even though it does not have a test task. I see on the log skipped: 2 which I think is the number of packages that do not have a test task.

$ npm run test 
> lage-tasks-min-repro@1.0.0 test
> lage test --no-cache
Lage running tasks with 15 workers
Summary
Slowest targets
  parent#build - 0.39s
  child2#test - 0.33s
  child2#build - 0.30s
  child1#build - 0.29s  # <- This should not be running. 
success: 4, skipped: 2, pending: 0, aborted: 0, failed: 0
Took a total of 1.05s to complete.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by cloning the lage-tasks-min-repro repository, running npm install, and comparing npm run test with npm run test:expected. Trace the Lage task-graph and scheduler entry points that build the test pipeline; done means the test command produces only parent#build, child2#build, and child2#test, without child1#build.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.