diff options
author | Rémy Coutable <remy@rymai.me> | 2016-09-29 08:46:48 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-09-29 08:46:48 +0000 |
commit | dbfcccaf7754d4501dc253b4409fc9f026248e67 (patch) | |
tree | ca2396139e1cb8329dec3ca23fa810cffcf30d9c /lib | |
parent | 7a7799812e9b21c9957e25ec4b48e0648bda20fb (diff) | |
parent | e80e4cb8b97a3865b7e3c551a856a53d98cccf75 (diff) | |
download | gitlab-ce-dbfcccaf7754d4501dc253b4409fc9f026248e67.tar.gz |
Merge branch '22367-add-pipeline-id-build' into 'master'
Expose pipeline data in builds API
Exposes pipeline data in builds API, as suggested by #22367.
The fields exposed were 'id', 'status', 'ref', and 'sha'.
Closes #22367
See merge request !6502
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/entities.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 0adc118ba27..409a4c7cc07 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -545,6 +545,10 @@ module API expose :filename, :size end + class PipelineBasic < Grape::Entity + expose :id, :sha, :ref, :status + end + class Build < Grape::Entity expose :id, :status, :stage, :name, :ref, :tag, :coverage expose :created_at, :started_at, :finished_at @@ -552,6 +556,7 @@ module API expose :artifacts_file, using: BuildArtifactFile, if: -> (build, opts) { build.artifacts? } expose :commit, with: RepoCommit expose :runner, with: Runner + expose :pipeline, with: PipelineBasic end class Trigger < Grape::Entity @@ -562,8 +567,8 @@ module API expose :key, :value end - class Pipeline < Grape::Entity - expose :id, :status, :ref, :sha, :before_sha, :tag, :yaml_errors + class Pipeline < PipelineBasic + expose :before_sha, :tag, :yaml_errors expose :user, with: Entities::UserBasic expose :created_at, :updated_at, :started_at, :finished_at, :committed_at |