cake icon indicating copy to clipboard operation
cake copied to clipboard

Task Dependees don't show up using the `tree` command

Open CDTR-MattConroy opened this issue 7 months ago • 8 comments

Prerequisites

  • [x] I have written a descriptive issue title
  • [x] I have searched issues to ensure it has not already been reported

Cake runner

Cake Frosting

Cake version

5.0.0

Operating system

N/A

Operating system architecture

N/A

CI Server

No response

What are you seeing?

When running the tree command, only Tasks registered as Dependent on others show up. Tasks registered as Dependees are missing.

What is expected?

The tree command shows the entire tree of tasks regardless of how they were registered.

Steps to Reproduce

  1. Create a Frosting project
  2. Create 3 Tasks, A,B,C
  3. Register Task A as dependent on Task B
  4. Register Task B as dependee of Task C
  5. Run --tree

Output log

No response

CDTR-MattConroy avatar May 22 '25 07:05 CDTR-MattConroy

I tested this on Cake Frosting 5.0.0 and the --tree output correctly includes upstream dependencies. I believe this issue is resolved in the current version.

Ashahet1 avatar Jul 03 '25 01:07 Ashahet1

As you can see from the report, I'm using Cake Frosting 5.0.0.

Odd that it works for you though, maybe it's due to the fact some of my tasks are in a NuGet package? Is the tree command looking only at particular assemblies?

CDTR-MattConroy avatar Jul 08 '25 11:07 CDTR-MattConroy

Any update on this?

CDTR-MattConroy avatar Aug 21 '25 09:08 CDTR-MattConroy

Thanks for bringing this to attention! As of now, we are not aware of any active work in progress toward resolving this issue. It is still up-for-grabs for anyone in the community to pick up.

If someone is interested in stepping in, it would be incredibly helpful to have a minimal reproduction case. That would give anyone working on it a much faster path to pinpointing and diagnosing the root cause.

devlead avatar Aug 21 '25 11:08 devlead

Hey guys, I had two questions about the issue and then i will get started working on it

  1. what should be the expected output? like in A,B,C case should it be like A |-B |-C or A |- B B|-c
  2. can a task have multiple dependent tasks? like A has B and C directly depending on it and D depends on B. in case that's possible i think the second option for printing the tasks would make more sense. like we start from the top and first print the directly dependent ones and on the next line we go for the next level

Mohammad1384a avatar Nov 16 '25 18:11 Mohammad1384a

@devlead @CDTR-MattConroy

Mohammad1384a avatar Nov 18 '25 14:11 Mohammad1384a

In the example I gave originally, A is dependent on B, and B is a dependee of C, which is to say C is dependent on B. So if I want to run A or C, I must run B first. So if I understand correctly how --tree currently works I would expect the following:

A
└─B
C
└─B

I don't think the logic for how the --tree command works needs to change, it just seems to be not discovering dependents correctly either when:

  • using DependeeOf
  • tasks are from a different assembly
  • tasks are from a package

Or a combination of the above.

CDTR-MattConroy avatar Nov 18 '25 15:11 CDTR-MattConroy

@CDTR-MattConroy created a pr please take a look https://github.com/cake-build/cake/pull/4663

Mohammad1384a avatar Nov 21 '25 15:11 Mohammad1384a