Skip to content

Commit e7101d1

Browse files
committed
Emit contains edge from EnvironmentVariable
1 parent a9addd2 commit e7101d1

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

src/openhound_github/models/env_variable.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from datetime import datetime
33

44
from openhound.core.asset import BaseAsset, EdgeDef, NodeDef
5+
from openhound.core.models.entries_dataclass import Edge, EdgePath, EdgeProperties
56

67
from openhound_github.graph import (
78
GHNode,
@@ -15,7 +16,7 @@
1516
@dataclass
1617
class GHEnvVariableProperties(GHNodeProperties):
1718
"""Properties for GHEnvVariableProperties.
18-
19+
1920
Attributes:
2021
environment_name: The name of the environment (GitHub organization).
2122
deployment_environment_name: The name of the deployment environment (GitHub organization).
@@ -31,6 +32,7 @@ class GHEnvVariableProperties(GHNodeProperties):
3132
created_at: datetime | None
3233
updated_at: datetime | None
3334
repository_name: str
35+
deployment_environmentid: str | None = None
3436

3537

3638
@app.asset(
@@ -86,6 +88,7 @@ def as_node(self) -> GHNode:
8688
environment_name=self.org_login,
8789
repository_name=self.repository_name,
8890
environmentid=self.org_node_id,
91+
deployment_environmentid=self.environment_node_id,
8992
updated_at=self.updated_at,
9093
created_at=self.created_at,
9194
value=self.value,
@@ -94,11 +97,9 @@ def as_node(self) -> GHNode:
9497

9598
@property
9699
def edges(self):
97-
# TODO: Check if this should indeed not return CONTAINS edge
98-
return []
99-
# yield Edge(
100-
# kind=ek.CONTAINS,
101-
# start=EdgePath(value=self.environment_node_id, match_by="id"),
102-
# end=EdgePath(value=self.node_id, match_by="id"),
103-
# properties=EdgeProperties(traversable=False),
104-
# )
100+
yield Edge(
101+
kind=ek.CONTAINS,
102+
start=EdgePath(value=self.environment_node_id, match_by="id"),
103+
end=EdgePath(value=self.node_id, match_by="id"),
104+
properties=EdgeProperties(traversable=False),
105+
)

0 commit comments

Comments
 (0)