Skip to content

Fix services API returning nonexistent services

What does this MR do?

The REST GET projects/:id/services/:slug API previously returned unsaved service objects.

For example https://gitlab.com/api/v4/projects/17595187/services/asana currently returns (note the "id": null):

{
"id": null,
"title": "Asana",
"slug": "asana",
"created_at": null,
"updated_at": null,
"active": false,
"commit_events": true,
"push_events": true,
"issues_events": true,
"confidential_issues_events": true,
"merge_requests_events": true,
"tag_push_events": true,
"note_events": true,
"confidential_note_events": true,
"pipeline_events": true,
"wiki_page_events": true,
"job_events": true,
"comment_on_event_enabled": true,
"properties": {}
}

This MR changes that endpoint to return a 404 response when a project does not have the service.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Related to #330818 (closed)

Edited by Luke Duncalfe

Merge request reports