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

Use TopologicalSort for viz yaml same as resources.yaml #959

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

gordon-klotho
Copy link
Contributor

Standard checks

  • Unit tests: Any special considerations?
  • Docs: Do we need to update any docs, internal or public?
  • Backwards compatibility: Will this break existing apps? If so, what would be the extra work required to keep them working?

@@ -37,7 +37,7 @@ func (f *File) WriteTo(w io.Writer) (n int64, err error) {
wh.Writef("provider: %s\n", f.Provider)
wh.Write("resources:\n")

resourceIds, err := construct.ReverseTopologicalSort(f.Graph)
resourceIds, err := construct.TopologicalSort(f.Graph)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the change that causes all the tests to change.

@@ -39,6 +39,9 @@ func topologicalSort[K comparable](deps map[K]map[K]graph.Edge[K], less func(K,
enqueue(vertex)
}
}
sort.Slice(queue, func(i, j int) bool {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This has no effect but improves readability by putting the sort next to where all the queuing happens.

@gordon-klotho gordon-klotho merged commit 24f68e6 into main Mar 7, 2024
6 checks passed
@gordon-klotho gordon-klotho deleted the viz_topo_order branch March 7, 2024 15:24
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