fix: Handle group nodes in graph sorting (#3929)

* Fix: Handle group nodes in graph sorting

- Added `get_root_of_group_node` function to identify the root of a group node.
- Updated `sort_up_to_vertex` to use `get_root_of_group_node` for handling group nodes.
- Modified `__filter_vertices` to pass `parent_node_map` to `sort_up_to_vertex`.

* Refactor: Update NodeStatus component to handle group nodes and improve build status handling

* [autofix.ci] apply automated fixes

* Update type hint for parent_node_map in sort_up_to_vertex function

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-09-27 12:26:20 -03:00 • committed by GitHub
commit b34a7c7f02
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 75 additions and 14 deletions

View file

@ -45,7 +45,7 @@ def test_get_successors_a(graph):
result = utils.get_successors(graph, vertex_id)
assert set(result) == {"A", "B", "D", "E", "F", "H", "G"}
assert set(result) == {"B", "D", "E", "F", "H", "G"}
def test_get_successors_z(graph):
@ -53,7 +53,7 @@ def test_get_successors_z(graph):
result = utils.get_successors(graph, vertex_id)
assert set(result) == {"Z"}
assert len(result) == 0
def test_sort_up_to_vertex_n_is_start(graph):