microsoft / microsoft/lage

Pending tasks not included in `Incomplete` count

Open
#212 2 comments 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

Example scenario for the issue:
Consider a yarn monorepo having with packages and 3 of them are a,b,c where pkg-a build task depends on pkg-b, pkg-c.
And every test task depends on its build. The Lage config for this is

module.exports = {
  pipeline: {
    build: ["^build"],
    test: ["build"],
  },
};

When I run the command yarn lage build test, the tasks listed in topological order would be like
pkg-b build
pkg-c build
pkg-a build
pkg-a test

Different cases of success and failure:
Case 1: yarn build test --to pkg-a
If everything is successful, the summary would be

pkg-b build done
pkg-c build done
pkg-a build done
pkg-a test done
[Tasks Count] success: 4, skipped: 0, incomplete: 0.

Case 2: yarn build test --to pkg-a
If pkg-a build is failing, the summary is

pkg-b build done
pkg-c build done
pkg-a build failed
[Tasks Count] success: 2, skipped: 0, incomplete: 1

Case 3: yarn build test --to pkg-a
If pkg-c build is failing, the summary is

pkg-b build done
pkg-c build failed
[Tasks Count] success: 1, skipped: 0, incomplete: 1

In the above cases, the total no of tasks is 4. In case 2,3, the incomplete field is counting only the failed tasks but not the "incomplete" ones.
In case 2,
pkg-a build failed
pkg-a test incomplete

In case 3,
pkg-c build failed
pkg-a build incomplete
pkg-a test incomplete

Issue: "Incomplete" field has to consider the count of both failures and pending tasks in the graph, to summarize the count of tasks that were yet to run and the tasks that were failed till that point, isn't it.? But it is counting only the failed tasks. All the pending tasks count are unknown to the user until that task node is reached in the tree. Because of this , user can't always rely on the "incomplete" field to know how much of the build graph is yet to run
Can we do something like,

  • Count all pending tasks as "Incomplete"
  • Count all failure tasks as "Failures"

Then in case 2,3 , the summary would be like

case 2:
[Tasks Count] success: 2, skipped: 0, incomplete: 2
case 3:
[Tasks Count] success: 1, skipped: 0, incomplete: 3

@kenotron Would love to hear your thoughts on this and understand better.

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 reproducing the issue with yarn lage build test --to pkg-a using the three-package dependency graph and failure cases described in the report. Trace how the task summary calculates success, skipped, incomplete, and failed work; done should make pending tasks visible in the incomplete count while distinguishing failures from pending tasks.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.