Project repo-family relations from local declarations
This commit is contained in:
parent
1d8f59f1de
commit
9af9ee3e72
13 changed files with 671 additions and 28 deletions
|
|
@ -159,6 +159,59 @@ def test_graph_explorer_collapses_discovered_repository_nodes() -> None:
|
|||
assert declares_package["data"]["displayOnly"] is False
|
||||
|
||||
|
||||
def test_graph_explorer_surfaces_repository_source_references() -> None:
|
||||
graph = {
|
||||
"apiVersion": "railiance.fabric/v1alpha1",
|
||||
"kind": "FabricGraphExport",
|
||||
"generated_at": "2026-07-26T00:00:00Z",
|
||||
"source": {"repo": "fixture-repo", "commit": "abc123"},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "repo:fixture-repo",
|
||||
"kind": "Repository",
|
||||
"name": "Fixture Repo",
|
||||
"repo": "fixture-repo",
|
||||
"domain": "testing",
|
||||
"lifecycle": "active",
|
||||
"attributes": {
|
||||
"source_path": "/tmp/fixture-repo/declarations/rapp.yaml",
|
||||
"source_links": [
|
||||
{
|
||||
"label": "Rapp declaration",
|
||||
"path": "/tmp/fixture-repo/declarations/rapp.yaml",
|
||||
}
|
||||
],
|
||||
},
|
||||
}
|
||||
],
|
||||
"edges": [],
|
||||
}
|
||||
|
||||
payload = fabric_graph_explorer_payload(
|
||||
graph,
|
||||
[{"slug": "fixture-repo", "name": "Fixture Repo", "repo_family": "rapp"}],
|
||||
{"fixture-repo"},
|
||||
)
|
||||
|
||||
repository_node = next(
|
||||
element
|
||||
for element in payload["elements"]
|
||||
if element["data"].get("id") == "repo:fixture-repo"
|
||||
and "source" not in element["data"]
|
||||
)
|
||||
|
||||
assert repository_node["data"]["sourceReferences"] == [
|
||||
{
|
||||
"label": "Declaration",
|
||||
"path": "/tmp/fixture-repo/declarations/rapp.yaml",
|
||||
},
|
||||
{
|
||||
"label": "Rapp declaration",
|
||||
"path": "/tmp/fixture-repo/declarations/rapp.yaml",
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
def test_graph_explorer_presents_legacy_server_nodes_as_runtime_entities() -> None:
|
||||
graph = {
|
||||
"apiVersion": "railiance.fabric/v1alpha1",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue