@@ -276,9 +276,7 @@ def test_handle_system_hook_when_not_enterprise(self):
276276 response = self ._post_event_data (** event_data )
277277 assert response .status_code == status .HTTP_403_FORBIDDEN
278278
279- def test_duplicate_repos_disambiguated_by_job_project_name (self ):
280- """Job Hook payloads include project_name ('namespace/repo') which
281- can disambiguate when two owners share the same service_id."""
279+ def test_duplicate_repos_disambiguated_by_project_name (self ):
282280 owner2 = OwnerFactory (service = "gitlab" )
283281 RepositoryFactory (author = owner2 , service_id = self .repo .service_id , active = True )
284282
@@ -288,15 +286,13 @@ def test_duplicate_repos_disambiguated_by_job_project_name(self):
288286 "object_kind" : "build" ,
289287 "project_id" : self .repo .service_id ,
290288 "build_status" : "pending" ,
291- "project_name" : f"{ self .repo .author .username } / my-repo" ,
289+ "project_name" : f"{ self .repo .author .username } / my-repo" ,
292290 },
293291 )
294292 assert response .status_code == status .HTTP_200_OK
295293 assert response .data == WebhookHandlerErrorMessages .SKIP_PENDING_STATUSES
296294
297- def test_duplicate_repos_disambiguated_by_push_path (self ):
298- """Push events include project.path_with_namespace which can
299- disambiguate duplicate repos."""
295+ def test_duplicate_repos_disambiguated_by_path_with_namespace (self ):
300296 owner2 = OwnerFactory (service = "gitlab" )
301297 RepositoryFactory (author = owner2 , service_id = self .repo .service_id , active = True )
302298
@@ -313,38 +309,6 @@ def test_duplicate_repos_disambiguated_by_push_path(self):
313309 assert response .status_code == status .HTTP_200_OK
314310 assert response .data == "No yaml cached yet."
315311
316- def test_duplicate_repos_disambiguated_by_job_project_name_spaced (self ):
317- """Some GitLab versions use 'namespace / repo' format with spaces."""
318- owner2 = OwnerFactory (service = "gitlab" )
319- RepositoryFactory (author = owner2 , service_id = self .repo .service_id , active = True )
320-
321- response = self ._post_event_data (
322- event = GitLabWebhookEvents .JOB ,
323- data = {
324- "object_kind" : "build" ,
325- "project_id" : self .repo .service_id ,
326- "build_status" : "pending" ,
327- "project_name" : f"{ self .repo .author .username } / my-repo" ,
328- },
329- )
330- assert response .status_code == status .HTTP_200_OK
331- assert response .data == WebhookHandlerErrorMessages .SKIP_PENDING_STATUSES
332-
333- def test_duplicate_repos_without_namespace_falls_through (self ):
334- """Without namespace info, duplicate repos still raise an error."""
335- owner2 = OwnerFactory (service = "gitlab" )
336- RepositoryFactory (author = owner2 , service_id = self .repo .service_id , active = True )
337-
338- response = self ._post_event_data (
339- event = GitLabWebhookEvents .JOB ,
340- data = {
341- "object_kind" : "build" ,
342- "project_id" : self .repo .service_id ,
343- "build_status" : "pending" ,
344- },
345- )
346- assert response .status_code == status .HTTP_500_INTERNAL_SERVER_ERROR
347-
348312 def test_secret_validation (self ):
349313 owner = OwnerFactory (service = "gitlab" )
350314 repo = RepositoryFactory (
0 commit comments