Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
[orchestra] extract graph logic and enhance with cycle detection + co…
Browse files Browse the repository at this point in the history
…loring (#5614)

* extract graph

* move into scope

* remove dead code

* add special nodes

* avoid some clones

* better doc

* maybe better to use ✨

* print all cycles, or an error

Currently kosaraju_scc returns invalid cycles, which is yet to be investigated.

* don't print tiny cycles, if there is nothing to unvisited anymore, there is a cycle

* make print better

* fmt ffs

* correct: cycle -> scc

A strongly connected cluster contains at least one cycl, but could include more.
So this should be distringuished in the implementation to avoid some confusion.

* fix loop exit condition

* add a test for kosaraju behavior

* unify on 'component'

* disable graph by default

https://github.com/paritytech/ci_cd/issues/433

* chore: fmt

* move graph only to graph_helpers
  • Loading branch information
drahnr authored and al3mart committed Jul 14, 2022
1 parent 9f14b2e commit bb81181
Show file tree
Hide file tree
Showing 5 changed files with 443 additions and 65 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions node/orchestra/proc-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ proc-macro2 = "1.0.37"
proc-macro-crate = "1.1.3"
expander = { version = "0.0.6", default-features = false }
petgraph = "0.6.0"
itertools = { version = "0.10.3", optional = true }

[dev-dependencies]
assert_matches = "1.5"
Expand All @@ -28,10 +29,10 @@ thiserror = "1"
tracing = "0.1"

[features]
default = []
default = [] # enable "graph" by default, blocked by <https://github.com/paritytech/ci_cd/issues/433>
# write the expanded version to a `orchestra-expansion.[a-f0-9]{10}.rs`
# in the `OUT_DIR` as defined by `cargo` for the `expander` crate.
expand = []
# Create directional message consuming / outgoing graph.
# Generates: `${OUT_DIR}/${orchestra|lowercase}-subsystem-messaging.dot`
graph = []
graph = ["itertools"]
Loading

0 comments on commit bb81181

Please sign in to comment.