summaryrefslogtreecommitdiff
path: root/lib/api/entities.rb
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-08-26 16:47:10 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-08-26 16:47:10 +0800
commita8452541e11a86d83cf41edf35b4cf34815e5d8c (patch)
tree42d7a1ce05c2f8c5c363401a6e7004d9ead6ccad /lib/api/entities.rb
parent4323d24abf78a33f8d53b62fe976a6b4a486de8d (diff)
parent1bf2fe276ff084d3b2e0860710ec115a317dd9fc (diff)
downloadgitlab-ce-a8452541e11a86d83cf41edf35b4cf34815e5d8c.tar.gz
Merge remote-tracking branch 'upstream/master' into pipeline-hooks
* upstream/master: (107 commits) Fix external issue tracker "Issues" link leading to 404s Fix CHANGELOG entries related to 8.11 release. Fix changelog Reduce contributions calendar data payload Add lock_version to merge_requests table Add hover color to emoji icon Fix wrong Koding link Capitalize mentioned issue timeline notes Fix groups sort dropdown alignment Use icon helper Fix inline emoji text alignment Adds response mime type to transaction metric action when it's not HTML Moved two 8.11 changelog entries to 8.12 Fix markdown link in doc_styleguide.md Display project icon from default branch Reduce number of database queries on builds tab Update CHANGELOG Update Issue board documentation Label list shows all issues (opened or closed) with that label Update CHANGELOG ...
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r--lib/api/entities.rb28
1 files changed, 27 insertions, 1 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 66b85ab1793..cbb324dd06d 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -49,7 +49,7 @@ module API
class ProjectHook < Hook
expose :project_id, :push_events
expose :issues_events, :merge_requests_events, :tag_push_events
- expose :note_events, :build_events, :pipeline_events
+ expose :note_events, :build_events, :pipeline_events, :wiki_page_events
expose :enable_ssl_verification
end
@@ -90,6 +90,7 @@ module API
expose :shared_with_groups do |project, options|
SharedGroup.represent(project.project_group_links.all, options)
end
+ expose :only_allow_merge_if_build_succeeds
end
class Member < UserBasic
@@ -177,6 +178,10 @@ module API
# TODO (rspeicher): Deprecated; remove in 9.0
expose(:expires_at) { |snippet| nil }
+
+ expose :web_url do |snippet, options|
+ Gitlab::UrlBuilder.build(snippet)
+ end
end
class ProjectEntity < Grape::Entity
@@ -206,6 +211,10 @@ module API
expose :user_notes_count
expose :upvotes, :downvotes
expose :due_date
+
+ expose :web_url do |issue, options|
+ Gitlab::UrlBuilder.build(issue)
+ end
end
class ExternalIssue < Grape::Entity
@@ -229,6 +238,10 @@ module API
expose :user_notes_count
expose :should_remove_source_branch?, as: :should_remove_source_branch
expose :force_remove_source_branch?, as: :force_remove_source_branch
+
+ expose :web_url do |merge_request, options|
+ Gitlab::UrlBuilder.build(merge_request)
+ end
end
class MergeRequestChanges < MergeRequest
@@ -237,6 +250,19 @@ module API
end
end
+ class MergeRequestDiff < Grape::Entity
+ expose :id, :head_commit_sha, :base_commit_sha, :start_commit_sha,
+ :created_at, :merge_request_id, :state, :real_size
+ end
+
+ class MergeRequestDiffFull < MergeRequestDiff
+ expose :commits, using: Entities::RepoCommit
+
+ expose :diffs, using: Entities::RepoDiff do |compare, _|
+ compare.raw_diffs(all_diffs: true).to_a
+ end
+ end
+
class SSHKey < Grape::Entity
expose :id, :title, :key, :created_at
end