Skip to content

Commit c95b314

Browse files
committed
Better telemetry
1 parent 1987f2d commit c95b314

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

api/integrations/gitlab/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ def _log_for(
1616
self, instance: GitLabConfiguration
1717
) -> structlog.typing.FilteringBoundLogger:
1818
return logger.bind( # type: ignore[no-any-return]
19-
project_id=instance.project.id,
20-
organisation_id=instance.project.organisation_id,
19+
project__id=instance.project.id,
20+
organisation__id=instance.project.organisation_id,
2121
)
2222

2323
def perform_create(self, serializer: GitLabConfigurationSerializer) -> None: # type: ignore[override]

api/tests/unit/integrations/gitlab/test_views.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ def test_create_configuration__valid_data__persists_and_masks_token(
4444
"event": "gitlab-configuration-created",
4545
"level": "info",
4646
"gitlab_instance_url": "https://gitlab.example.com",
47-
"project_id": project.id,
48-
"organisation_id": project.organisation_id,
47+
"project__id": project.id,
48+
"organisation__id": project.organisation_id,
4949
},
5050
]
5151

@@ -98,8 +98,8 @@ def test_update_configuration__valid_data__persists_and_masks_token(
9898
"event": "gitlab-configuration-updated",
9999
"level": "info",
100100
"gitlab_instance_url": "https://gitlab.updated.com",
101-
"project_id": project.id,
102-
"organisation_id": project.organisation_id,
101+
"project__id": project.id,
102+
"organisation__id": project.organisation_id,
103103
},
104104
]
105105

@@ -123,8 +123,8 @@ def test_delete_configuration__existing__soft_deletes(
123123
{
124124
"event": "gitlab-configuration-deleted",
125125
"level": "info",
126-
"project_id": project.id,
127-
"organisation_id": project.organisation_id,
126+
"project__id": project.id,
127+
"organisation__id": project.organisation_id,
128128
},
129129
]
130130

0 commit comments

Comments
 (0)