Skip to content
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

feat: improve output of ProjectGraphTask and include topological sort. #1326

Merged
merged 3 commits into from
Dec 3, 2024

Conversation

autonomousapps
Copy link
Owner

@autonomousapps autonomousapps commented Nov 27, 2024

In a follow-up, I will add a task at the root level for doing this globally in one pass.

@autonomousapps autonomousapps changed the title feat: improve output of ProjectGraphTask (generateProjectGraph...). feat: improve output of ProjectGraphTask and include topological sort. Nov 27, 2024
@autonomousapps autonomousapps marked this pull request as ready for review November 27, 2024 23:38
@autonomousapps autonomousapps marked this pull request as draft December 1, 2024 02:34
Copy link

github-actions bot commented Dec 1, 2024

❌ Test workflow failed:

* Root buildHealth         : https://gradle.com/s/w7vmiizb6vmhq
* TestKit buildHealth      : https://gradle.com/s/ivz6wlczvr6ni
* Non-functional tests     : https://gradle.com/s/rzzuxlbe76a7o
* TestKit check            : https://gradle.com/s/zgdcx3cmlsuvi
* JVM functional tests     : https://gradle.com/s/cicgcmty7gcxe
* Android functional tests : 

Copy link

github-actions bot commented Dec 2, 2024

❌ Test workflow failed:

* Root buildHealth         : https://gradle.com/s/v7hau4bku2otg
* TestKit buildHealth      : https://gradle.com/s/kpzyn3vtsgddc
* Non-functional tests     : https://gradle.com/s/riokpunvkeqkq
* TestKit check            : https://gradle.com/s/jtjo4wxqmo3es
* JVM functional tests     : https://gradle.com/s/5lgznxotptwxa
* Android functional tests : 

Copy link
Owner Author

Choose a reason for hiding this comment

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

Need to publish a new version of graph-support before I can merge.


final class WorkPlanSpec extends AbstractJvmSpec {

@PendingFeature
Copy link
Owner Author

Choose a reason for hiding this comment

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

Fix test or delete feature and test.

Comment on lines +49 to +69
/**
* Returns the [graph] sorted into topological order, ascending. Each node in the graph is paired with its depth.
*
* TODO(tsr): shortest path is wrong, I need the _longest_ path.
*/
fun topological(graph: Graph<Coordinates>): String {
val root = graph.root()
val top = graph.topological(root)
// val paths = graph.shortestPaths(root)

return buildString {
top.forEach { node ->
appendLine(node.maybeProjectCoordinates(buildPath).gav())
// append(" ")
// appendLine("${paths.distanceTo(node)}")
}
}
}

// TODO replace with Hu's algorithm (for scheduling concurrent work), and push relevant bits into Graphs.kt.
fun workPlan(graph: Graph<Coordinates>): String {
Copy link
Owner Author

Choose a reason for hiding this comment

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

Follow-up.

Copy link

github-actions bot commented Dec 2, 2024

❌ Test workflow failed:

* Root buildHealth         : https://gradle.com/s/x4v733qi2f2xo
* TestKit buildHealth      : https://gradle.com/s/nyat3iw3lv7pc
* Non-functional tests     : https://gradle.com/s/wav7wl3jur35c
* TestKit check            : 
* JVM functional tests     : 
* Android functional tests : 

Copy link

github-actions bot commented Dec 2, 2024

❌ Test workflow failed:

* Root buildHealth         : https://gradle.com/s/ecnqimytfxpn6
* TestKit buildHealth      : https://gradle.com/s/bxhdey22ggnee
* Non-functional tests     : https://gradle.com/s/qdwftmf3k26ti
* TestKit check            : 
* JVM functional tests     : 
* Android functional tests : 

Copy link

github-actions bot commented Dec 2, 2024

❌ Test workflow failed:

* Root buildHealth         : https://gradle.com/s/4bhs6ayaw452y
* TestKit buildHealth      : https://gradle.com/s/fwwjc6oxgpipw
* Non-functional tests     : https://gradle.com/s/mbcpq6ul2vk7i
* TestKit check            : https://gradle.com/s/aadbxsa5aqtkg
* JVM functional tests     : https://gradle.com/s/r4epla6sehqxg
* Android functional tests : 

1. improve output of ProjectGraphTask.
2. generate merged graph of all variants in a project.
3. generate merged graph for entire build.
4. incubating support for generating work plan.
@autonomousapps autonomousapps marked this pull request as ready for review December 3, 2024 00:01
@autonomousapps autonomousapps merged commit 6e8d8d5 into main Dec 3, 2024
1 check passed
@autonomousapps autonomousapps deleted the trobalik.topo branch December 3, 2024 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants