summaryrefslogtreecommitdiff
path: root/lib/bitbucket_server/representation/pull_request.rb
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-06-25 22:40:11 -0700
committerStan Hu <stanhu@gmail.com>2018-06-25 22:40:11 -0700
commit046a5e398d202be5865a850cf778fedd9bd39c47 (patch)
treed2d6115e327c3da5ace7b2456480f04386a69f59 /lib/bitbucket_server/representation/pull_request.rb
parentc9deb7cef8d0d85a8773b0e6d26ae12a3ff25a0e (diff)
downloadgitlab-ce-046a5e398d202be5865a850cf778fedd9bd39c47.tar.gz
More work towards supporting Bitbucket Server
Diffstat (limited to 'lib/bitbucket_server/representation/pull_request.rb')
-rw-r--r--lib/bitbucket_server/representation/pull_request.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/bitbucket_server/representation/pull_request.rb b/lib/bitbucket_server/representation/pull_request.rb
index 3553f3adbc7..6e248802a07 100644
--- a/lib/bitbucket_server/representation/pull_request.rb
+++ b/lib/bitbucket_server/representation/pull_request.rb
@@ -2,7 +2,7 @@ module BitbucketServer
module Representation
class PullRequest < Representation::Base
def author
- raw.fetch('author', {}).fetch('username', nil)
+ raw.fetch('author', {}).fetch('user', {}).fetch('name')
end
def description
@@ -24,11 +24,11 @@ module BitbucketServer
end
def created_at
- raw['created_on']
+ raw['createdDate']
end
def updated_at
- raw['updated_on']
+ raw['updatedDate']
end
def title
@@ -36,29 +36,29 @@ module BitbucketServer
end
def source_branch_name
- source_branch.fetch('branch', {}).fetch('name', nil)
+ source_branch['id']
end
def source_branch_sha
- source_branch.fetch('commit', {}).fetch('hash', nil)
+ # XXX Not implemented?
end
def target_branch_name
- target_branch.fetch('branch', {}).fetch('name', nil)
+ target_branch['id']
end
def target_branch_sha
- target_branch.fetch('commit', {}).fetch('hash', nil)
+ # XXX Not implemented?
end
private
def source_branch
- raw['source']
+ raw['fromRef'] || {}
end
def target_branch
- raw['destination']
+ raw['toRef'] || {}
end
end
end