Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2018-07-19 00:57:08 +0300
committerRobert Speicher <rspeicher@gmail.com>2018-07-19 01:04:45 +0300
commit6cb52964a6c0b64d422b4618c116a4ff9d044b67 (patch)
tree5559f18a9e396ce1021cc80b6a91c83a56a6f3b7 /lib/api
parent1df32177a8dfd0f1f948a48ee9cf87ba74f43417 (diff)
Expose web_url attribute in PipelineBasic and JobBasic
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/entities.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 3f3a95ea8e6..8c40d66c651 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -529,6 +529,10 @@ module API
class PipelineBasic < Grape::Entity
expose :id, :sha, :ref, :status
+
+ expose :web_url do |pipeline, _options|
+ Gitlab::Routing.url_helpers.project_pipeline_url(pipeline.project, pipeline)
+ end
end
class MergeRequestSimple < ProjectEntity
@@ -1069,6 +1073,10 @@ module API
expose :user, with: User
expose :commit, with: Commit
expose :pipeline, with: PipelineBasic
+
+ expose :web_url do |job, _options|
+ Gitlab::Routing.url_helpers.project_job_url(job.project, job)
+ end
end
class Job < JobBasic