Skip to content

feat: DAG Library used by KRO adopted for OCM#21

Merged
jakobmoellerdev merged 4 commits into
open-component-model:mainfrom
jakobmoellerdev:dag
Apr 14, 2025
Merged

feat: DAG Library used by KRO adopted for OCM#21
jakobmoellerdev merged 4 commits into
open-component-model:mainfrom
jakobmoellerdev:dag

Conversation

@jakobmoellerdev

Copy link
Copy Markdown
Member

We want to use the KRO Graph Modelling Feature for Dependency Modelling while transferring resources. For this we are copying and adapting KROs take on Resource Graphs with a few adjustments:

  1. We introduce generic capability to make the graphs work with anything in cmp.Ordered
  2. We introduce InDegree/OutDegree to be able to selectively traverse the graph, by processing a graph through the indegree/outdegree.

What this PR does / why we need it

This is in preparation for our transfer library, which will need the directed acyclic graph capabilities for proper dependency management and ordering

Which issue(s) this PR fixes

@github-actions github-actions Bot added kind/feature new feature, enhancement, improvement, extension size/l Large labels Mar 18, 2025
We want to use the KRO Graph Modelling Feature for Dependency Modelling while transferring resources. For this we are copying and adapting KROs take on Resource Graphs with a few adjustments:

1. We introduce generic capability to make the graphs work with anything in cmp.Ordered
2. We introduce InDegree/OutDegree to be able to selectively traverse the graph, by processing a graph through the indegree/outdegree.
@jakobmoellerdev jakobmoellerdev marked this pull request as ready for review March 18, 2025 08:58
@jakobmoellerdev jakobmoellerdev requested a review from a team as a code owner March 18, 2025 09:08
expected := strings.Split(g.Want, ",")
r.ElementsMatch(order, expected, "unexpected result from TopologicalSort for nodes=%q edges=%q, got %q, want %q", g.Nodes, g.Edges, order, expected)

// checkValidTopologicalOrder(t, d, order)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What about this out-commented function?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We do not have natural ordering in our graphs, so I excluded natural order processing. I will remove this leftover :)

Comment thread bindings/go/dag/dag.go Outdated
Comment thread bindings/go/dag/dag.go
Comment thread bindings/go/dag/dag.go
Comment thread bindings/go/dag/dag.go
Comment thread bindings/go/dag/dag.go
Comment thread bindings/go/dag/dag.go
Comment thread bindings/go/dag/dag.go
Skarlso
Skarlso previously approved these changes Mar 18, 2025

@Skarlso Skarlso left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Well done! Nice job! :)

# Conflicts:
#	REUSE.toml
#	Taskfile.yml
@jakobmoellerdev jakobmoellerdev merged commit df9edb9 into open-component-model:main Apr 14, 2025
@jakobmoellerdev jakobmoellerdev deleted the dag branch April 14, 2025 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature new feature, enhancement, improvement, extension size/l Large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants