BigW Consortium Gitlab

Commit f0227d76 by Dmitriy Zaporozhets

Merge branch 'master' of github.com:gitlabhq/gitlabhq

parents 2940de43 f93616d6
......@@ -26,6 +26,7 @@ v 7.11.0 (unreleased)
- Prevent sending empty messages to HipChat (Chulki Lee)
- Improve UI for mobile phones on dashboard and project pages
- Add room notification and message color option for HipChat
- Allow to use non-ASCII letters and dashes in project and namespace name. (Jakub Jirutka)
v 7.10.0
- Ignore submodules that are defined in .gitmodules but are checked in as directories.
......
......@@ -208,6 +208,7 @@ group :development do
gem "letter_opener"
gem 'quiet_assets', '~> 1.0.1'
gem 'rack-mini-profiler', require: false
gem 'rerun', '~> 0.10.0'
# Better errors handler
gem 'better_errors'
......
......@@ -167,7 +167,7 @@ GEM
faraday (>= 0.7.4, < 0.9)
fastercsv (1.5.5)
ffaker (1.22.1)
ffi (1.9.3)
ffi (1.9.8)
fog (1.21.0)
fog-brightbox
fog-core (~> 1.21, >= 1.21.1)
......@@ -323,8 +323,8 @@ GEM
addressable (~> 2.3)
letter_opener (1.1.2)
launchy (~> 2.2)
listen (2.3.1)
celluloid (>= 0.15.2)
listen (2.10.0)
celluloid (~> 0.16.0)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
lumberjack (1.0.4)
......@@ -456,8 +456,8 @@ GEM
raindrops (0.13.0)
rake (10.4.2)
raphael-rails (2.1.2)
rb-fsevent (0.9.3)
rb-inotify (0.9.2)
rb-fsevent (0.9.4)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
rdoc (3.12.2)
json (~> 1.4)
......@@ -482,6 +482,8 @@ GEM
redis-store (1.1.4)
redis (>= 2.2)
request_store (1.0.5)
rerun (0.10.0)
listen (~> 2.7, >= 2.7.3)
rest-client (1.6.7)
mime-types (>= 1.16)
rinku (1.7.3)
......@@ -763,6 +765,7 @@ DEPENDENCIES
redcarpet (~> 3.2.3)
redis-rails
request_store
rerun (~> 0.10.0)
rspec-rails (= 2.99)
rubocop (= 0.28.0)
rugments
......
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,
......
......@@ -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
......
......@@ -15,20 +15,20 @@ module Gitlab
def namespace_name_regex
@namespace_name_regex ||= /\A[a-zA-Z0-9_\-\. ]*\z/.freeze
@namespace_name_regex ||= /\A[\p{Alnum}\p{Pd}_\. ]*\z/.freeze
end
def namespace_name_regex_message
"can contain only letters, digits, '_', '-', '.' and space."
"can contain only letters, digits, '_', '.', dash and space."
end
def project_name_regex
@project_name_regex ||= /\A[a-zA-Z0-9_.][a-zA-Z0-9_\-\. ]*\z/.freeze
@project_name_regex ||= /\A[\p{Alnum}_][\p{Alnum}\p{Pd}_\. ]*\z/.freeze
end
def project_name_regex_message
"can contain only letters, digits, '_', '-', '.' and space. " \
"can contain only letters, digits, '_', '.', dash and space. " \
"It must start with letter, digit or '_'."
end
......
......@@ -7,4 +7,9 @@ namespace :dev do
Rake::Task["gitlab:setup"].invoke
Rake::Task["gitlab:shell:setup"].invoke
end
desc 'GITLAB | Start/restart foreman and watch for changes'
task :foreman => :environment do
sh 'rerun --dir app,config,lib -- foreman start'
end
end
# coding: utf-8
require 'spec_helper'
describe Gitlab::Regex do
......@@ -16,6 +17,8 @@ describe Gitlab::Regex do
it { expect('GitLab CE').to match(Gitlab::Regex.project_name_regex) }
it { expect('100 lines').to match(Gitlab::Regex.project_name_regex) }
it { expect('gitlab.git').to match(Gitlab::Regex.project_name_regex) }
it { expect('Český název').to match(Gitlab::Regex.project_name_regex) }
it { expect('Dash – is this').to match(Gitlab::Regex.project_name_regex) }
it { expect('?gitlab').not_to match(Gitlab::Regex.project_name_regex) }
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment