BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
c1a5f471
Commit
c1a5f471
authored
Apr 27, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8645 from chulkilee/hipchat-api-version
Add api version property on hipchat service
parents
bc9ba523
57c72455
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
services_controller.rb
app/controllers/projects/services_controller.rb
+1
-1
hipchat_service.rb
app/models/project_services/hipchat_service.rb
+4
-2
No files found.
app/controllers/projects/services_controller.rb
View file @
c1a5f471
class
Projects
::
ServicesController
<
Projects
::
ApplicationController
ALLOWED_PARAMS
=
[
:title
,
:token
,
:type
,
:active
,
:api_key
,
:subdomain
,
ALLOWED_PARAMS
=
[
:title
,
:token
,
:type
,
:active
,
:api_key
,
:
api_version
,
:
subdomain
,
:room
,
:recipients
,
:project_url
,
:webhook
,
:user_key
,
:device
,
:priority
,
:sound
,
:bamboo_url
,
:username
,
:password
,
:build_key
,
:server
,
:teamcity_url
,
:build_type
,
...
...
app/models/project_services/hipchat_service.rb
View file @
c1a5f471
...
...
@@ -20,7 +20,7 @@
class
HipchatService
<
Service
MAX_COMMITS
=
3
prop_accessor
:token
,
:room
,
:server
,
:notify
,
:color
prop_accessor
:token
,
:room
,
:server
,
:notify
,
:color
,
:api_version
validates
:token
,
presence:
true
,
if: :activated?
def
title
...
...
@@ -41,6 +41,8 @@ class HipchatService < Service
{
type:
'text'
,
name:
'room'
,
placeholder:
'Room name or ID'
},
{
type:
'checkbox'
,
name:
'notify'
},
{
type:
'select'
,
name:
'color'
,
choices:
[
'yellow'
,
'red'
,
'green'
,
'purple'
,
'gray'
,
'random'
]
},
{
type:
'text'
,
name:
'api_version'
,
placeholder:
'Leave blank for default (v2)'
},
{
type:
'text'
,
name:
'server'
,
placeholder:
'Leave blank for default. https://hipchat.example.com'
}
]
...
...
@@ -60,7 +62,7 @@ class HipchatService < Service
private
def
gate
options
=
{
api_version:
'v2'
}
options
=
{
api_version:
api_version
||
'v2'
}
options
[
:server_url
]
=
server
unless
server
.
blank?
@gate
||=
HipChat
::
Client
.
new
(
token
,
options
)
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment