Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions descriptions/nodes/GH_Environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ GH_CanRequestOIDCTokenFor edges from GH_WorkflowJob nodes identify jobs with a s

| Property | Type | Description |
| --- | --- | --- |
| `name` | `string` | The node name used for matching and display. |
| `displayname` | `string` | The human-readable display name. |
| `name` | `string` | The repository-qualified environment name (e.g., `org/repo/production`). |
| `displayname` | `string` | The environment name shown in the UI (e.g., `production`). |
| `environmentid` | `string` | The identifier of the GitHub environment where this node was collected. |
| `last_seen` | `datetime` | The timestamp when this node was last observed during collection. |
| `node_id` | `string` | The stable identifier used as the OpenGraph node ID; this is the native GitHub node ID where available. |
Expand Down
2 changes: 1 addition & 1 deletion src/openhound_github/models/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def as_node(self) -> GHNode:
return GHNode(
kinds=[nk.ENVIRONMENT],
properties=GHEnvironmentProperties(
name=self.name,
name=f"{self.repository_full_name}/{self.name}",
displayname=self.name,
node_id=eid,
short_name=self.name,
Expand Down
4 changes: 3 additions & 1 deletion src/openhound_github/models/workflow_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,9 @@ def _environment_edges(self):
PropertyMatch(
key="repository_id", value=self.repository_node_id
),
PropertyMatch(key="name", value=persisted_environment_name),
PropertyMatch(
key="short_name", value=persisted_environment_name
),
],
),
properties=EdgeProperties(traversable=False),
Expand Down
3 changes: 3 additions & 0 deletions tests/test_environment_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ def test_environment_node_surfaces_protection_rule_properties() -> None:

node = env.as_node

assert node.properties.name == "github/hello-world/staging"
assert node.properties.displayname == "staging"
assert node.properties.short_name == "staging"
assert node.properties.wait_timer == 30
assert node.properties.prevent_self_review is False
assert node.properties.reviewer_count == 2
Expand Down
4 changes: 2 additions & 2 deletions tests/test_workflow_interception_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,13 @@ def test_cross_org_enterprise_runner_interception_path_is_traversable() -> None:
matcher.key: matcher.value
for matcher in can_request_oidc_token.end.property_matchers
} == {
"name": "prod",
"short_name": "prod",
"repository_id": "REPO_B",
}
assert {
matcher.key: matcher.value for matcher in deploys_to.end.property_matchers
} == {
"name": "prod",
"short_name": "prod",
"repository_id": "REPO_B",
}

Expand Down
8 changes: 4 additions & 4 deletions tests/test_workflow_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,15 +527,15 @@ def test_workflow_job_emits_can_request_oidc_token_for_environment_without_oidc_
assert len(environment_edges) == 1
assert _matcher_values(environment_edges[0]) == {
"repository_id": "REPO_1",
"name": "prod",
"short_name": "prod",
}
assert len(edges) == 1
assert edges[0].kind == ek.CAN_REQUEST_OIDC_TOKEN_FOR
assert edges[0].start.value == "JOB_1"
assert edges[0].end.kind == nk.ENVIRONMENT
assert _matcher_values(edges[0]) == {
"repository_id": "REPO_1",
"name": "prod",
"short_name": "prod",
}
assert edges[0].properties.traversable is True
assert edges[0].properties.composed is True
Expand Down Expand Up @@ -627,8 +627,8 @@ def test_workflow_job_can_request_oidc_token_for_edges_are_per_job_and_idempoten
]

assert [(edge.start.value, _matcher_values(edge)) for edge in edges] == [
("JOB_1", {"repository_id": "REPO_1", "name": "prod"}),
("JOB_2", {"repository_id": "REPO_1", "name": "prod"}),
("JOB_1", {"repository_id": "REPO_1", "short_name": "prod"}),
("JOB_2", {"repository_id": "REPO_1", "short_name": "prod"}),
]
assert len(list(jobs[0]._can_request_oidc_token_for_edges)) == 1

Expand Down
Loading