GitLab steht aufgrund wichtiger Wartungsarbeiten am Montag, den 8. März, zwischen 17:00 und 19:00 Uhr nicht zur Verfügung.

Commit e1cc0fd5 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch '28598-narrow-environment-payload-by-using-basic-project' into 'master'

Simplify project payload exposed on Environment endpoints in V4

Closes #28598

See merge request !9675
parents ef24c9ef fa0c0bb0
title: Narrow environment payload by using basic project details resource
......@@ -68,3 +68,5 @@ changes are in V4:
- Rename Build Triggers to be Pipeline Triggers API [!9713](
- `POST /projects/:id/trigger/builds` to `POST /projects/:id/trigger/pipeline`
- Require description when creating a new trigger `POST /projects/:id/triggers`
- Simplify project payload exposed on Environment endpoints [!9675](
......@@ -671,7 +671,7 @@ class EnvironmentBasic < Grape::Entity
class Environment < EnvironmentBasic
expose :project, using: Entities::Project
expose :project, using: Entities::BasicProjectDetails
class Deployment < Grape::Entity
......@@ -15,6 +15,8 @@
describe 'GET /projects/:id/environments' do
context 'as member of the project' do
it 'returns project environments' do
project_data_keys = %w(id http_url_to_repo web_url name name_with_namespace path path_with_namespace)
get api("/projects/#{}/environments", user)
expect(response).to have_http_status(200)
......@@ -23,8 +25,7 @@
expect(json_response.size).to eq(1)
expect(json_response.first['name']).to eq(
expect(json_response.first['external_url']).to eq(environment.external_url)
expect(json_response.first['project']['id']).to eq(
expect(json_response.first['project']['visibility']).to be_present
expect(json_response.first['project'].keys).to contain_exactly(*project_data_keys)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment