Commit a28cad0c authored by Sytse Sijbrandij's avatar Sytse Sijbrandij

Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq into prose-requirement

parents 703087b8 679b450c
...@@ -22,6 +22,24 @@ v 7.7.0 ...@@ -22,6 +22,24 @@ v 7.7.0
- -
- Added API support for sorting projects - Added API support for sorting projects
- Update gitlab_git to version 7.0.0.rc13 - Update gitlab_git to version 7.0.0.rc13
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Change some of application settings on fly in admin area UI
- Redesign signin/signup pages
- Close standard input in Gitlab::Popen.popen
v 7.6.0 v 7.6.0
- Fork repository to groups - Fork repository to groups
......
...@@ -175,7 +175,6 @@ gem 'semantic-ui-sass', '~> 0.16.1.0' ...@@ -175,7 +175,6 @@ gem 'semantic-ui-sass', '~> 0.16.1.0'
gem "sass-rails", '~> 4.0.2' gem "sass-rails", '~> 4.0.2'
gem "coffee-rails" gem "coffee-rails"
gem "uglifier" gem "uglifier"
gem "therubyracer"
gem 'turbolinks' gem 'turbolinks'
gem 'jquery-turbolinks' gem 'jquery-turbolinks'
...@@ -260,6 +259,7 @@ end ...@@ -260,6 +259,7 @@ end
group :production do group :production do
gem "gitlab_meta", '7.0' gem "gitlab_meta", '7.0'
gem "therubyracer"
end end
gem "newrelic_rpm" gem "newrelic_rpm"
...@@ -135,3 +135,16 @@ class @MergeRequest ...@@ -135,3 +135,16 @@ class @MergeRequest
this.$('.automerge_widget').hide() this.$('.automerge_widget').hide()
this.$('.merge-in-progress').hide() this.$('.merge-in-progress').hide()
this.$('.automerge_widget.already_cannot_be_merged').show() this.$('.automerge_widget.already_cannot_be_merged').show()
mergeInProgress: ->
$.ajax
type: 'GET'
url: $('.merge-request').data('url')
success: (data) =>
switch data.state
when 'merged'
location.reload()
else
setTimeout(merge_request.mergeInProgress, 3000)
dataType: 'json'
/* Login Page */ /* Login Page */
.login-page { .login-page {
h1 { .container {
font-size: 3em; max-width: 960px;
font-weight: 200;
} }
.login-box{ .navbar-gitlab .container {
padding: 0 15px; max-width: none;
}
.login-heading h3 { .brand-holder {
font-weight: 300; font-size: 18px;
line-height: 2; line-height: 1.5;
}
.login-footer { p {
margin-top: 10px; color: #888;
} }
.btn { h1:first-child {
padding: 12px !important; font-weight: normal;
@extend .btn-block; margin-bottom: 30px;
} }
}
.brand-image {
img { img {
max-width: 100%; max-width: 100%;
margin-bottom: 20px; margin-bottom: 30px;
} }
&.default-brand-image { a {
margin: 0 80px; font-weight: bold;
} }
} }
.login-logo { .login-box{
margin: 10px 0 30px 0; background: #fafafa;
display: block; border-radius: 10px;
box-shadow: 0 0px 2px #CCC;
padding: 15px;
.login-heading h3 {
font-weight: 300;
line-height: 1.5;
margin: 0;
display: none;
}
.login-footer {
margin-top: 10px;
}
a.forgot {
float: right;
padding-top: 6px
}
.nav .active a {
background: transparent;
}
} }
.form-control { .form-control {
background-color: #F5F5F5; font-size: 14px;
font-size: 16px; padding: 10px 8px;
padding: 14px 10px;
width: 100%; width: 100%;
height: auto; height: auto;
...@@ -68,11 +86,6 @@ ...@@ -68,11 +86,6 @@
} }
} }
.login-box a.forgot {
float: right;
padding-top: 6px
}
.devise-errors { .devise-errors {
h2 { h2 {
font-size: 14px; font-size: 14px;
...@@ -80,7 +93,19 @@ ...@@ -80,7 +93,19 @@
} }
} }
.brand-holder { .remember-me {
border-right: 1px solid #EEE; margin-top: -10px;
label {
font-weight: normal;
}
}
}
@media (max-width: $screen-xs-max) {
.login-page {
.col-sm-5.pull-right {
float: none !important;
}
} }
} }
class Admin::ApplicationSettingsController < Admin::ApplicationController
before_filter :set_application_setting
def show
end
def update
if @application_setting.update_attributes(application_setting_params)
redirect_to admin_application_settings_path,
notice: 'Application settings saved successfully'
else
render :show
end
end
private
def set_application_setting
@application_setting = ApplicationSetting.current
end
def application_setting_params
params.require(:application_setting).permit(
:default_projects_limit,
:signup_enabled,
:signin_enabled,
:gravatar_enabled,
:sign_in_text,
)
end
end
require 'gon' require 'gon'
class ApplicationController < ActionController::Base class ApplicationController < ActionController::Base
include Gitlab::CurrentSettings
before_filter :authenticate_user_from_token! before_filter :authenticate_user_from_token!
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :reject_blocked! before_filter :reject_blocked!
...@@ -13,7 +15,7 @@ class ApplicationController < ActionController::Base ...@@ -13,7 +15,7 @@ class ApplicationController < ActionController::Base
protect_from_forgery with: :exception protect_from_forgery with: :exception
helper_method :abilities, :can? helper_method :abilities, :can?, :current_application_settings
rescue_from Encoding::CompatibilityError do |exception| rescue_from Encoding::CompatibilityError do |exception|
log_exception(exception) log_exception(exception)
......
...@@ -27,6 +27,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -27,6 +27,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
respond_to do |format| respond_to do |format|
format.html format.html
format.json { render json: @merge_request }
format.diff { render text: @merge_request.to_diff(current_user) } format.diff { render text: @merge_request.to_diff(current_user) }
format.patch { render text: @merge_request.to_patch(current_user) } format.patch { render text: @merge_request.to_patch(current_user) }
end end
...@@ -104,15 +105,15 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -104,15 +105,15 @@ class Projects::MergeRequestsController < Projects::ApplicationController
if @merge_request.unchecked? if @merge_request.unchecked?
@merge_request.check_if_can_be_merged @merge_request.check_if_can_be_merged
end end
render json: {merge_status: @merge_request.merge_status_name}
render json: { merge_status: @merge_request.merge_status_name }
end end
def automerge def automerge
return access_denied! unless allowed_to_merge? return access_denied! unless allowed_to_merge?
if @merge_request.open? && @merge_request.can_be_merged? if @merge_request.open? && @merge_request.can_be_merged?
@merge_request.should_remove_source_branch = params[:should_remove_source_branch] AutoMergeWorker.perform_async(@merge_request.id, current_user.id, params)
@merge_request.automerge!(current_user, params[:commit_message])
@status = true @status = true
else else
@status = false @status = false
......
...@@ -26,7 +26,9 @@ class RegistrationsController < Devise::RegistrationsController ...@@ -26,7 +26,9 @@ class RegistrationsController < Devise::RegistrationsController
private private
def signup_enabled? def signup_enabled?
redirect_to new_user_session_path unless Gitlab.config.gitlab.signup_enabled unless current_application_settings.signup_enabled?
redirect_to(new_user_session_path)
end
end end
def sign_up_params def sign_up_params
......
class SessionsController < Devise::SessionsController class SessionsController < Devise::SessionsController
def new def new
redirect_path = if request.referer.present? && (params['redirect_to_referer'] == 'yes') redirect_path =
referer_uri = URI(request.referer) if request.referer.present? && (params['redirect_to_referer'] == 'yes')
if referer_uri.host == Gitlab.config.gitlab.host referer_uri = URI(request.referer)
referer_uri.path if referer_uri.host == Gitlab.config.gitlab.host
else referer_uri.path
request.fullpath else
end request.fullpath
else end
request.fullpath else
end request.fullpath
end
# Prevent a 'you are already signed in' message directly after signing: # Prevent a 'you are already signed in' message directly after signing:
# we should never redirect to '/users/sign_in' after signing in successfully. # we should never redirect to '/users/sign_in' after signing in successfully.
......
...@@ -305,4 +305,9 @@ module ApplicationHelper ...@@ -305,4 +305,9 @@ module ApplicationHelper
profile_key_path(key) profile_key_path(key)
end end
end end
def redirect_from_root?
request.env['rack.session']['user_return_to'] ==
'/'
end
end end
module ApplicationSettingsHelper
def gravatar_enabled?
current_application_settings.gravatar_enabled?
end
def signup_enabled?
current_application_settings.signup_enabled?
end
def signin_enabled?
current_application_settings.signin_enabled?
end
def extra_sign_in_text
current_application_settings.sign_in_text
end
end
...@@ -14,6 +14,6 @@ module ProfileHelper ...@@ -14,6 +14,6 @@ module ProfileHelper
end end
def show_profile_remove_tab? def show_profile_remove_tab?
gitlab_config.signup_enabled signup_enabled?
end end
end end
class ApplicationSetting < ActiveRecord::Base
def self.current
ApplicationSetting.last
end
def self.create_from_defaults
create(
default_projects_limit: Settings.gitlab['default_projects_limit'],
signup_enabled: Settings.gitlab['signup_enabled'],
signin_enabled: Settings.gitlab['signin_enabled'],
gravatar_enabled: Settings.gravatar['enabled'],
sign_in_text: Settings.extra['sign_in_text'],
)
end
end
...@@ -51,14 +51,15 @@ require 'file_size_validator' ...@@ -51,14 +51,15 @@ require 'file_size_validator'
class User < ActiveRecord::Base class User < ActiveRecord::Base
include Gitlab::ConfigHelper include Gitlab::ConfigHelper
extend Gitlab::ConfigHelper
include TokenAuthenticatable include TokenAuthenticatable
extend Gitlab::ConfigHelper
extend Gitlab::CurrentSettings
default_value_for :admin, false default_value_for :admin, false
default_value_for :can_create_group, gitlab_config.default_can_create_group default_value_for :can_create_group, gitlab_config.default_can_create_group
default_value_for :can_create_team, false default_value_for :can_create_team, false
default_value_for :hide_no_ssh_key, false default_value_for :hide_no_ssh_key, false
default_value_for :projects_limit, gitlab_config.default_projects_limit default_value_for :projects_limit, current_application_settings.default_projects_limit
default_value_for :theme_id, gitlab_config.default_theme default_value_for :theme_id, gitlab_config.default_theme
devise :database_authenticatable, :lockable, :async, devise :database_authenticatable, :lockable, :async,
......
class BaseService class BaseService
include Gitlab::CurrentSettings
attr_accessor :project, :current_user, :params attr_accessor :project, :current_user, :params
def initialize(project, user, params = {}) def initialize(project, user, params = {})
...@@ -29,6 +31,10 @@ class BaseService ...@@ -29,6 +31,10 @@ class BaseService
SystemHooksService.new SystemHooksService.new
end end
def current_application_settings
ApplicationSetting.current
end
private private
def error(message) def error(message)
......
class GravatarService class GravatarService
include Gitlab::CurrentSettings
def execute(email, size = nil) def execute(email, size = nil)
if gravatar_config.enabled && email.present? if current_application_settings.gravatar_enabled? && email.present?
size = 40 if size.nil? || size <= 0 size = 40 if size.nil? || size <= 0
sprintf gravatar_url, sprintf gravatar_url,
......
= form_for @application_setting, url: admin_application_settings_path, html: { class: 'form-horizontal fieldset-form' } do |f|
- if @application_setting.errors.any?
#error_explanation
.alert.alert-danger
- @application_setting.errors.full_messages.each do |msg|
%p= msg
%fieldset
%legend Features
.form-group
= f.label :signup_enabled, class: 'control-label'
.col-sm-10
= f.check_box :signup_enabled, class: 'checkbox'
.form-group
= f.label :signin_enabled, class: 'control-label'
.col-sm-10
= f.check_box :signin_enabled, class: 'checkbox'
.form-group
= f.label :gravatar_enabled, class: 'control-label'
.col-sm-10
= f.check_box :gravatar_enabled, class: 'checkbox'
%fieldset
%legend Misc
.form-group
= f.label :default_projects_limit, class: 'control-label'
.col-sm-10
= f.number_field :default_projects_limit, class: 'form-control'
.form-group
= f.label :sign_in_text, class: 'control-label'
.col-sm-10
= f.text_area :sign_in_text, class: 'form-control'
.form-actions
= f.submit 'Save', class: 'btn btn-primary'
%h3.page-title Application settings
%hr
= render 'form'
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
%p %p
Sign up Sign up
%span.light.pull-right %span.light.pull-right
= boolean_to_icon gitlab_config.signup_enabled = boolean_to_icon signup_enabled?
%p %p
LDAP LDAP
%span.light.pull-right %span.light.pull-right
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
%p %p
Gravatar Gravatar
%span.light.pull-right %span.light.pull-right
= boolean_to_icon Gitlab.config.gravatar.enabled = boolean_to_icon gravatar_enabled?
%p %p
OmniAuth OmniAuth
%span.light.pull-right %span.light.pull-right
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
= f.text_field :login, class: "form-control top", placeholder: "Username or Email", autofocus: "autofocus" = f.text_field :login, class: "form-control top", placeholder: "Username or Email", autofocus: "autofocus"
= f.password_field :password, class: "form-control bottom", placeholder: "Password" = f.password_field :password, class: "form-control bottom", placeholder: "Password"
- if devise_mapping.rememberable? - if devise_mapping.rememberable?
.clearfix.append-bottom-10 .remember-me
%label.checkbox.remember_me{for: "user_remember_me"} %label.checkbox.remember_me{for: "user_remember_me"}
= f.check_box :remember_me = f.check_box :remember_me
%span Remember me %span Remember me
......
= form_tag(user_omniauth_callback_path(provider), id: 'new_ldap_user' ) do = form_tag(user_omniauth_callback_path(provider), id: 'new_ldap_user' ) do
= text_field_tag :username, nil, {class: "form-control top", placeholder: "LDAP Login", autofocus: "autofocus"} = text_field_tag :username, nil, {class: "form-control top", placeholder: "LDAP Login", autofocus: "autofocus"}
= password_field_tag :password, nil, {class: "form-control bottom", placeholder: "Password"} = password_field_tag :password, nil, {class: "form-control bottom", placeholder: "Password"}
%br/
= button_tag "LDAP Sign in", class: "btn-save btn" = button_tag "LDAP Sign in", class: "btn-save btn"
.login-box %div
.login-heading = render 'devise/shared/signin_box'
%h3 Sign in
.login-body
- if ldap_enabled?
%ul.nav.nav-tabs
- @ldap_servers.each_with_index do |server, i|
%li{class: (:active if i.zero?)}
= link_to server['label'], "#tab-#{server['provider_name']}", 'data-toggle' => 'tab'
- if gitlab_config.signin_enabled
%li
= link_to 'Standard', '#tab-signin', 'data-toggle' => 'tab'
.tab-content
- @ldap_servers.each_with_index do |server, i|
%div.tab-pane{id: "tab-#{server['provider_name']}", class: (:active if i.zero?)}
= render 'devise/sessions/new_ldap', provider: server['provider_name']
- if gitlab_config.signin_enabled
%div#tab-signin.tab-pane
= render 'devise/sessions/new_base'
- elsif gitlab_config.signin_enabled - if Gitlab.config.omniauth.enabled && devise_mapping.omniauthable?
= render 'devise/sessions/new_base' .prepend-top-20
- else = render 'devise/shared/oauth_box'
%div
No authentication methods configured.
= render 'devise/sessions/oauth_providers' if Gitlab.config.omniauth.enabled && devise_mapping.omniauthable? - if signup_enabled?
.prepend-top-20
= render 'devise/shared/signup_box'
.login-footer .clearfix.prepend-top-20
- if gitlab_config.signup_enabled %p
%p %span.light Did not receive confirmation email?
%span.light = link_to "Send again", new_confirmation_path(resource_name)
Don't have an account?
%strong
= link_to "Sign up", new_registration_path(resource_name)
%p
%span.light Did not receive confirmation email?
= link_to "Send again", new_confirmation_path(resource_name)
- if extra_config.has_key?('sign_in_text')
%hr
= markdown(extra_config.sign_in_text)
- providers = additional_providers - providers = additional_providers
- if providers.present? - if providers.present?
.bs-callout.bs-callout-info{:'data-no-turbolink' => 'data-no-turbolink'} .login-box{:'data-no-turbolink' => 'data-no-turbolink'}
%span Sign in with: &nbsp; %span Sign in with &nbsp;
- providers.each do |provider| - providers.each do |provider|
%span %span
- if default_providers.include?(provider) - if default_providers.include?(provider)
......
.login-box
.login-heading
%h3 Sign in
.login-body
- if ldap_enabled?
%ul.nav.nav-tabs
- @ldap_servers.each_with_index do |server, i|
%li{class: (:active if i.zero?)}
= link_to server['label'], "#tab-#{server['provider_name']}", 'data-toggle' => 'tab'
- if signin_enabled?
%li
= link_to 'Standard', '#tab-signin', 'data-toggle' => 'tab'
.tab-content
- @ldap_servers.each_with_index do |server, i|
%div.tab-pane{id: "tab-#{server['provider_name']}", class: (:active if i.zero?)}
= render 'devise/sessions/new_ldap', provider: server['provider_name']
- if signin_enabled?
%div#tab-signin.tab-pane
= render 'devise/sessions/new_base'
- elsif signin_enabled?
= render 'devise/sessions/new_base'
- else
%div
No authentication methods configured.
.login-box
.login-heading
%h3 Sign up
.login-body
= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
.devise-errors
= devise_error_messages!
%div
= f.text_field :name, class: "form-control top", placeholder: "Name", required: true
%div
= f.text_field :username, class: "form-control middle", placeholder: "Username", required: true
%div
= f.email_field :email, class: "form-control middle", placeholder: "Email", required: true
.form-group#password-strength
= f.password_field :password, class: "form-control bottom", id: "user_password_sign_up", placeholder: "Password", required: true
%div
= f.submit "Sign up", class: "btn-create btn"
...@@ -12,12 +12,13 @@ ...@@ -12,12 +12,13 @@
%span.sr-only Toggle navigation %span.sr-only Toggle navigation
%i.fa.fa-bars %i.fa.fa-bars
.pull-right.hidden-xs - unless current_controller?('sessions')
= link_to "Sign in", new_session_path(:user, redirect_to_referer: 'yes'), class: 'btn btn-sign-in btn-new' .pull-right.hidden-xs
= link_to "Sign in", new_session_path(:user, redirect_to_referer: 'yes'), class: 'btn btn-sign-in btn-new'
.navbar-collapse.collapse .navbar-collapse.collapse
%ul.nav.navbar-nav %ul.nav.navbar-nav
%li.visible-xs %li.visible-xs
= link_to "Sign in", new_session_path(:user, redirect_to_referer: 'yes') = link_to "Sign in", new_session_path(:user, redirect_to_referer: 'yes')
= render 'shared/outdated_browser' = render 'shared/outdated_browser'
!!! 5 !!! 5
%html{ lang: "en"} %html{ lang: "en"}
= render "layouts/head" = render "layouts/head"
%body.ui_basic.login-page %body.ui_mars.login-page.application
.container = render "layouts/broadcast"
.content = render "layouts/public_head_panel", title: ''
.login-title .container.navless-container
%h1= brand_title
= render 'shared/outdated_browser'
%hr
.container
.content .content
= render "layouts/flash" - unless redirect_from_root?
.row = render "layouts/flash"
.col-md-7.brand-holder .row.prepend-top-20
.col-sm-5.pull-right
= yield
.col-sm-7.brand-holder.pull-left
%h1
= brand_title
- if brand_item - if brand_item
.brand-image = brand_image
= brand_image = brand_text
.brand_text
= brand_text
- else - else
.brand-image.default-brand-image.hidden-sm.hidden-xs %h3 Open source software to collaborate on code
= image_tag 'brand_logo.png'
.brand_text.hidden-xs
%h2 Open source software to collaborate on code
%p.lead %p
Manage git repositories with fine grained access controls that keep your code secure. Manage git repositories with fine grained access controls that keep your code secure.
Perform code reviews and enhance collaboration with merge requests. Perform code reviews and enhance collaboration with merge requests.
Each project can also have an issue tracker and a wiki. Each project can also have an issue tracker and a wiki.
- if extra_sign_in_text.present?
= markdown(extra_sign_in_text)
.col-md-5
= yield
%hr %hr
.container .container
.footer-links .footer-links
......
...@@ -40,3 +40,8 @@ ...@@ -40,3 +40,8 @@
%span %span
Background Jobs Background Jobs
= nav_link(controller: :application_settings) do
= link_to admin_application_settings_path do
%i.fa.fa-cogs
%span
Settings
.merge-request .merge-request{'data-url' => project_merge_request_path(@project, @merge_request)}
= render "projects/merge_requests/show/mr_title" = render "projects/merge_requests/show/mr_title"
%hr %hr
= render "projects/merge_requests/show/mr_box" = render "projects/merge_requests/show/mr_box"
......
-if @status -if @status
:plain :plain
location.reload(); merge_request.mergeInProgress();
-else -else
:plain :plain
merge_request.alreadyOrCannotBeMerged() merge_request.alreadyOrCannotBeMerged()
class AutoMergeWorker
include Sidekiq::Worker
sidekiq_options queue: :default
def perform(merge_request_id, current_user_id, params)
params = params.with_indifferent_access
current_user = User.find(current_user_id)
merge_request = MergeRequest.find(merge_request_id)
merge_request.should_remove_source_branch = params[:should_remove_source_branch]
merge_request.automerge!(current_user, params[:commit_message])
end
end
...@@ -109,6 +109,8 @@ Gitlab::Application.routes.draw do ...@@ -109,6 +109,8 @@ Gitlab::Application.routes.draw do
end end
end end
resource :application_settings, only: [:show, :update]
root to: "dashboard#index" root to: "dashboard#index"
end end
......
class CreateApplicationSettings < ActiveRecord::Migration
def change
create_table :application_settings do |t|
t.integer :default_projects_limit
t.boolean :signup_enabled
t.boolean :signin_enabled
t.boolean :gravatar_enabled
t.text :sign_in_text
t.timestamps
end
end
end
...@@ -11,11 +11,21 @@ ...@@ -11,11 +11,21 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20141226080412) do ActiveRecord::Schema.define(version: 20150108073740) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
create_table "application_settings", force: true do |t|
t.integer "default_projects_limit"
t.boolean "signup_enabled"
t.boolean "signin_enabled"
t.boolean "gravatar_enabled"
t.text "sign_in_text"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "broadcast_messages", force: true do |t| create_table "broadcast_messages", force: true do |t|
t.text "message", null: false t.text "message", null: false
t.datetime "starts_at" t.datetime "starts_at"
......
# How to create RC1
The RC1 release comes with the task to update the installation and upgrade docs. Be mindful that there might already be merge requests for this on GitLab or GitHub.
### **1. Update the installation guide**
1. Check if it references the correct branch `x-x-stable` (doesn't exist yet, but that is okay)
1. Check the [GitLab Shell version](/lib/tasks/gitlab/check.rake#L782)
1. Check the [Git version](/lib/tasks/gitlab/check.rake#L794)
1. There might be other changes. Ask around.
### **2. Create update guides**
1. Create: CE update guide from previous version. Like `7.3-to-7.4.md`
1. Create: CE to EE update guide in EE repository for latest version.
1. Update: `6.x-or-7.x-to-7.x.md` to latest version.
1. Create: CI update guide from previous version
It's best to copy paste the previous guide and make changes where necessary.
The typical steps are listed below with any points you should specifically look at.
#### 0. Any major changes?
List any major changes here, so the user is aware of them before starting to upgrade. For instance:
- Database updates
- Web server changes
- File structure changes
#### 1. Stop server
#### 2. Make backup
#### 3. Do users need to update dependencies like `git`?
- Check if the [GitLab Shell version](/lib/tasks/gitlab/check.rake#L782) changed since the last release.
- Check if the [Git version](/lib/tasks/gitlab/check.rake#L794) changed since the last release.
#### 4. Get latest code
#### 5. Does GitLab shell need to be updated?
#### 6. Install libs, migrations, etc.
#### 7. Any config files updated since last release?
Check if any of these changed since last release:
- [lib/support/nginx/gitlab](/lib/support/nginx/gitlab)
- [lib/support/nginx/gitlab-ssl](/lib/support/nginx/gitlab-ssl)
- <https://gitlab.com/gitlab-org/gitlab-shell/commits/master/config.yml.example>
- [config/gitlab.yml.example](/config/gitlab.yml.example)
- [config/unicorn.rb.example](/config/unicorn.rb.example)
- [config/database.yml.mysql](/config/database.yml.mysql)
- [config/database.yml.postgresql](/config/database.yml.postgresql)
- [config/initializers/rack_attack.rb.example](/config/initializers/rack_attack.rb.example)
- [config/resque.yml.example](/config/resque.yml.example)
#### 8. Need to update init script?
Check if the `init.d/gitlab` script changed since last release: [lib/support/init.d/gitlab](/lib/support/init.d/gitlab)
#### 9. Start application
#### 10. Check application status
### **3. Code quality indicators**
Make sure the code quality indicators are green / good.
- [![Build status](http://ci.gitlab.org/projects/1/status.png?ref=master)](http://ci.gitlab.org/projects/1?ref=master) on ci.gitlab.org (master branch)
- [![Build Status](https://semaphoreapp.com/api/v1/projects/2f1a5809-418b-4cc2-a1f4-819607579fe7/243338/badge.png)](https://semaphoreapp.com/gitlabhq/gitlabhq) (master branch)
- [![Code Climate](https://codeclimate.com/github/gitlabhq/gitlabhq.png)](https://codeclimate.com/github/gitlabhq/gitlabhq)
- [![Dependency Status](https://gemnasium.com/gitlabhq/gitlabhq.png)](https://gemnasium.com/gitlabhq/gitlabhq) this button can be yellow (small updates are available) but must not be red (a security fix or an important update is available)
- [![Coverage Status](https://coveralls.io/repos/gitlabhq/gitlabhq/badge.png?branch=master)](https://coveralls.io/r/gitlabhq/gitlabhq)
### 4. Run release tool for CE and EE
**Make sure EE `master` has latest changes from CE `master`**
Get release tools
```
git clone git@dev.gitlab.org:gitlab/release-tools.git
cd release-tools
```
Release candidate creates stable branch from master.
So we need to sync master branch between all CE remotes. Also do same for EE.
```
bundle exec rake sync
```
Create release candidate and stable branch:
```
bundle exec rake release["x.x.0.rc1"]
```
Now developers can use master for merging new features.
So you should use stable branch for future code chages related to release.
### 5. Release GitLab CI RC1
Add to your local `gitlab-ci/.git/config`:
```
[remote "public"]
url = none
pushurl = git@dev.gitlab.org:gitlab/gitlab-ci.git
pushurl = git@gitlab.com:gitlab-org/gitlab-ci.git
pushurl = git@github.com:gitlabhq/gitlab-ci.git
```
* Create a stable branch `x-y-stable`
* Bump VERSION to `x.y.0.rc1`
* `git tag -a v$(cat VERSION) -m "Version $(cat VERSION)"
* `git push public x-y-stable v$(cat VERSION)`
This diff is collapsed.
@admin
Feature: Admin Settings
Background:
Given I sign in as an admin
And I visit admin settings page
Scenario: Change application settings
When I disable gravatars and save form
Then I should be see gravatar disabled
class Spinach::Features::AdminSettings < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
include SharedAdmin
include Gitlab::CurrentSettings
step 'I disable gravatars and save form' do
uncheck 'Gravatar enabled'
click_button 'Save'
end
step 'I should be see gravatar disabled' do
current_application_settings.gravatar_enabled.should be_false
page.should have_content 'Application settings saved successfully'
end
end
...@@ -167,6 +167,10 @@ module SharedPaths ...@@ -167,6 +167,10 @@ module SharedPaths
visit admin_teams_path visit admin_teams_path
end end
step 'I visit admin settings page' do
visit admin_application_settings_path
end
# ---------------------------------------- # ----------------------------------------
# Generic Project # Generic Project
# ---------------------------------------- # ----------------------------------------
......
module Gitlab
module CurrentSettings
def current_application_settings
begin
if ActiveRecord::Base.connection.table_exists?('application_settings')
ApplicationSetting.current ||
ApplicationSetting.create_from_defaults
else
fake_application_settings
end
rescue ActiveRecord::NoDatabaseError
fake_application_settings
end
end
def fake_application_settings
OpenStruct.new(
default_projects_limit: Settings.gitlab['default_projects_limit'],
signup_enabled: Settings.gitlab['signup_enabled'],
signin_enabled: Settings.gitlab['signin_enabled'],
gravatar_enabled: Settings.gravatar['enabled'],
sign_in_text: Settings.extra['sign_in_text'],
)
end
end
end
...@@ -21,6 +21,9 @@ module Gitlab ...@@ -21,6 +21,9 @@ module Gitlab
@cmd_output = "" @cmd_output = ""
@cmd_status = 0 @cmd_status = 0
Open3.popen3(vars, *cmd, options) do |stdin, stdout, stderr, wait_thr| Open3.popen3(vars, *cmd, options) do |stdin, stdout, stderr, wait_thr|
# We are not using stdin so we should close it, in case the command we
# are running waits for input.
stdin.close
@cmd_output << stdout.read @cmd_output << stdout.read
@cmd_output << stderr.read @cmd_output << stderr.read
@cmd_status = wait_thr.value.exitstatus @cmd_status = wait_thr.value.exitstatus
......
...@@ -9,7 +9,7 @@ describe "Profile account page", feature: true do ...@@ -9,7 +9,7 @@ describe "Profile account page", feature: true do
describe "when signup is enabled" do describe "when signup is enabled" do
before do before do
Gitlab.config.gitlab.stub(:signup_enabled).and_return(true) ApplicationSetting.any_instance.stub(signup_enabled?: true)
visit profile_account_path visit profile_account_path
end end
...@@ -23,7 +23,7 @@ describe "Profile account page", feature: true do ...@@ -23,7 +23,7 @@ describe "Profile account page", feature: true do
describe "when signup is disabled" do describe "when signup is disabled" do
before do before do
Gitlab.config.gitlab.stub(:signup_enabled).and_return(false) ApplicationSetting.any_instance.stub(signup_enabled?: false)
visit profile_account_path visit profile_account_path
end end
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
describe 'Users', feature: true do describe 'Users', feature: true do
describe "GET /users/sign_up" do describe "GET /users/sign_up" do
before do before do
Gitlab.config.gitlab.stub(:signup_enabled).and_return(true) ApplicationSetting.any_instance.stub(signup_enabled?: true)
end end
it "should create a new user account" do it "should create a new user account" do
......
...@@ -87,7 +87,7 @@ describe ApplicationHelper do ...@@ -87,7 +87,7 @@ describe ApplicationHelper do
let(:user_email) { 'user@email.com' } let(:user_email) { 'user@email.com' }
it "should return a generic avatar path when Gravatar is disabled" do it "should return a generic avatar path when Gravatar is disabled" do
Gitlab.config.gravatar.stub(:enabled).and_return(false) ApplicationSetting.any_instance.stub(gravatar_enabled?: false)
gravatar_icon(user_email).should match('no_avatar.png') gravatar_icon(user_email).should match('no_avatar.png')
end end
......
require 'spec_helper'
describe ApplicationSetting, models: true do
it { ApplicationSetting.create_from_defaults.should be_valid }
end
...@@ -186,7 +186,7 @@ describe API::API, api: true do ...@@ -186,7 +186,7 @@ describe API::API, api: true do
describe "GET /users/sign_up" do describe "GET /users/sign_up" do
context 'enabled' do context 'enabled' do
before do before do
Gitlab.config.gitlab.stub(:signup_enabled).and_return(true) ApplicationSetting.any_instance.stub(signup_enabled?: true)
end end
it "should return sign up page if signup is enabled" do it "should return sign up page if signup is enabled" do
...@@ -197,7 +197,7 @@ describe API::API, api: true do ...@@ -197,7 +197,7 @@ describe API::API, api: true do
context 'disabled' do context 'disabled' do
before do before do
Gitlab.config.gitlab.stub(:signup_enabled).and_return(false) ApplicationSetting.any_instance.stub(signup_enabled?: false)
end end
it "should redirect to sign in page if signup is disabled" do it "should redirect to sign in page if signup is disabled" do
......
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