summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-01-15 15:35:33 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2016-01-15 15:35:33 +0100
commit1ce766367eb529fe88068be2f34315f87d74a349 (patch)
treece42ab578a0253324c0b78dd516711af55848405
parentac652d82f17d378e485dcef15a8fabdcf9bad76b (diff)
downloadgitlab-ce-1ce766367eb529fe88068be2f34315f87d74a349.tar.gz
Change dependencies.builds to depends_on_builds
-rw-r--r--doc/ci/api/builds.md36
-rw-r--r--lib/ci/api/entities.rb6
-rw-r--r--spec/requests/ci/api/builds_spec.rb4
3 files changed, 21 insertions, 25 deletions
diff --git a/doc/ci/api/builds.md b/doc/ci/api/builds.md
index 3e2fb804731..018ca22dbbd 100644
--- a/doc/ci/api/builds.md
+++ b/doc/ci/api/builds.md
@@ -53,26 +53,24 @@ Returns:
"public": true
}
],
- "dependencies": {
- "builds": [
- {
- "id": 48584,
- "ref": "0.1.1",
- "tag": true,
- "sha": "d63117656af6ff57d99e50cc270f854691f335ad",
- "status": "success",
- "name": "build",
- "token": "9dd60b4f1a439d1765357446c1084c",
- "stage": "build",
- "project_id": 479,
- "project_name": "test",
- "artifacts_file": {
- "filename": "artifacts.zip",
- "size": 0
- }
+ "depends_on_builds": [
+ {
+ "id": 48584,
+ "ref": "0.1.1",
+ "tag": true,
+ "sha": "d63117656af6ff57d99e50cc270f854691f335ad",
+ "status": "success",
+ "name": "build",
+ "token": "9dd60b4f1a439d1765357446c1084c",
+ "stage": "build",
+ "project_id": 479,
+ "project_name": "test",
+ "artifacts_file": {
+ "filename": "artifacts.zip",
+ "size": 0
}
- ]
- }
+ }
+ ]
}
```
diff --git a/lib/ci/api/entities.rb b/lib/ci/api/entities.rb
index 835f8c97021..b25e0e573a8 100644
--- a/lib/ci/api/entities.rb
+++ b/lib/ci/api/entities.rb
@@ -20,7 +20,7 @@ module Ci
expose :name, :token, :stage
expose :project_id
expose :project_name
- expose :artifacts_file, using: ArtifactFile, if: lambda { |build, opts| build.artifacts_file.exists? }
+ expose :artifacts_file, using: ArtifactFile, if: lambda { |build, opts| build.artifacts? }
end
class BuildDetails < Build
@@ -39,9 +39,7 @@ module Ci
end
expose :variables
- expose :dependencies do
- expose :depends_on_builds, as: :builds, using: Build
- end
+ expose :depends_on_builds, using: Build
end
class Runner < Grape::Entity
diff --git a/spec/requests/ci/api/builds_spec.rb b/spec/requests/ci/api/builds_spec.rb
index 1c3e27abb9f..eec927102aa 100644
--- a/spec/requests/ci/api/builds_spec.rb
+++ b/spec/requests/ci/api/builds_spec.rb
@@ -110,8 +110,8 @@ describe Ci::API::API do
post ci_api("/builds/register"), token: runner.token, info: { platform: :darwin }
expect(response.status).to eq(201)
- expect(json_response["dependencies"]["builds"].count).to eq(2)
- expect(json_response["dependencies"]["builds"][0]["name"]).to eq("rspec")
+ expect(json_response["depends_on_builds"].count).to eq(2)
+ expect(json_response["depends_on_builds"][0]["name"]).to eq("rspec")
end
end