Commit 33ea09bd authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into fix/private-references

parents 0c10aee5 12023557
Please view this file on the master branch, on stable branches it's out of date. Please view this file on the master branch, on stable branches it's out of date.
v 8.4.0 (unreleased) v 8.4.0 (unreleased)
- Autocomplete data is now always loaded, instead of when focusing a comment text area (Yorick Peterse)
- Improved performance of finding issues for an entire group (Yorick Peterse)
- Added custom application performance measuring system powered by InfluxDB (Yorick Peterse)
- Bump fog to 1.36.0 (Stan Hu) - Bump fog to 1.36.0 (Stan Hu)
- Add user's last used IP addresses to admin page (Stan Hu)
- Add housekeeping function to project settings page - Add housekeeping function to project settings page
- The default GitLab logo now acts as a loading indicator - The default GitLab logo now acts as a loading indicator
- Fix caching issue where build status was not updating in project dashboard (Stan Hu) - Fix caching issue where build status was not updating in project dashboard (Stan Hu)
...@@ -39,6 +43,10 @@ v 8.4.0 (unreleased) ...@@ -39,6 +43,10 @@ v 8.4.0 (unreleased)
- API: Add support for deleting a tag via the API (Robert Schilling) - API: Add support for deleting a tag via the API (Robert Schilling)
- Allow subsequent validations in CI Linter - Allow subsequent validations in CI Linter
- Show referenced MRs & Issues only when the current viewer can access them - Show referenced MRs & Issues only when the current viewer can access them
- Fix Encoding::CompatibilityError bug when markdown content has some complex URL (Jason Lee)
v 8.3.4
- Use gitlab-workhorse 0.5.4 (fixes API routing bug)
v 8.3.3 v 8.3.3
- Preserve CE behavior with JIRA integration by only calling API if URL is set - Preserve CE behavior with JIRA integration by only calling API if URL is set
...@@ -53,6 +61,7 @@ v 8.3.3 ...@@ -53,6 +61,7 @@ v 8.3.3
- Fix Error 500 when visiting build page of project with nil runners_token (Stan Hu) - Fix Error 500 when visiting build page of project with nil runners_token (Stan Hu)
- Use WOFF versions of SourceSansPro fonts - Use WOFF versions of SourceSansPro fonts
- Fix regression when builds were not generated for tags created through web/api interface - Fix regression when builds were not generated for tags created through web/api interface
- Fix: maintain milestone filter between Open and Closed tabs (Greg Smethells)
v 8.3.2 v 8.3.2
- Disable --follow in `git log` to avoid loading duplicate commit data in infinite scroll (Stan Hu) - Disable --follow in `git log` to avoid loading duplicate commit data in infinite scroll (Stan Hu)
......
...@@ -334,9 +334,9 @@ merge request: ...@@ -334,9 +334,9 @@ merge request:
1. [CoffeeScript](https://github.com/thoughtbot/guides/tree/master/style/coffeescript) 1. [CoffeeScript](https://github.com/thoughtbot/guides/tree/master/style/coffeescript)
1. [Shell commands](doc/development/shell_commands.md) created by GitLab 1. [Shell commands](doc/development/shell_commands.md) created by GitLab
contributors to enhance security contributors to enhance security
1. [Markdown](http://www.cirosantilli.com/markdown-styleguide)
1. [Database Migrations](doc/development/migration_style_guide.md) 1. [Database Migrations](doc/development/migration_style_guide.md)
1. [Documentation styleguide](doc_styleguide.md) 1. [Markdown](http://www.cirosantilli.com/markdown-styleguide)
1. [Documentation styleguide](doc/development/doc_styleguide.md)
1. Interface text should be written subjectively instead of objectively. It 1. Interface text should be written subjectively instead of objectively. It
should be the GitLab core team addressing a person. It should be written in should be the GitLab core team addressing a person. It should be written in
present time and never use past tense (has been/was). For example instead present time and never use past tense (has been/was). For example instead
......
...@@ -247,7 +247,7 @@ group :development, :test do ...@@ -247,7 +247,7 @@ group :development, :test do
gem 'byebug', platform: :mri gem 'byebug', platform: :mri
gem 'pry-rails' gem 'pry-rails'
gem 'awesome_print', '~> 1.2.0' gem 'awesome_print', '~> 1.2.0', require: false
gem 'fuubar', '~> 2.0.0' gem 'fuubar', '~> 2.0.0'
gem 'database_cleaner', '~> 1.4.0' gem 'database_cleaner', '~> 1.4.0'
......
...@@ -16,12 +16,16 @@ class @Issue ...@@ -16,12 +16,16 @@ class @Issue
$(document).on 'tasklist:changed', '.detail-page-description .js-task-list-container', @updateTaskList $(document).on 'tasklist:changed', '.detail-page-description .js-task-list-container', @updateTaskList
initIssueBtnEventListeners: -> initIssueBtnEventListeners: ->
_this = @
issueFailMessage = 'Unable to update this issue at this time.' issueFailMessage = 'Unable to update this issue at this time.'
$('a.btn-close, a.btn-reopen').on 'click', (e) -> $('a.btn-close, a.btn-reopen').on 'click', (e) ->
e.preventDefault() e.preventDefault()
e.stopImmediatePropagation() e.stopImmediatePropagation()
$this = $(this) $this = $(this)
isClose = $this.hasClass('btn-close') isClose = $this.hasClass('btn-close')
shouldSubmit = $this.hasClass('btn-comment')
if shouldSubmit
_this.submitNoteForm($this.closest('form'))
$this.prop('disabled', true) $this.prop('disabled', true)
url = $this.attr('href') url = $this.attr('href')
$.ajax $.ajax
...@@ -32,12 +36,13 @@ class @Issue ...@@ -32,12 +36,13 @@ class @Issue
new Flash(issueFailMessage, 'alert') new Flash(issueFailMessage, 'alert')
success: (data, textStatus, jqXHR) -> success: (data, textStatus, jqXHR) ->
if data.saved if data.saved
$this.addClass('hidden')
if isClose if isClose
$('a.btn-close').addClass('hidden')
$('a.btn-reopen').removeClass('hidden') $('a.btn-reopen').removeClass('hidden')
$('div.status-box-closed').removeClass('hidden') $('div.status-box-closed').removeClass('hidden')
$('div.status-box-open').addClass('hidden') $('div.status-box-open').addClass('hidden')
else else
$('a.btn-reopen').addClass('hidden')
$('a.btn-close').removeClass('hidden') $('a.btn-close').removeClass('hidden')
$('div.status-box-closed').addClass('hidden') $('div.status-box-closed').addClass('hidden')
$('div.status-box-open').removeClass('hidden') $('div.status-box-open').removeClass('hidden')
...@@ -45,6 +50,11 @@ class @Issue ...@@ -45,6 +50,11 @@ class @Issue
new Flash(issueFailMessage, 'alert') new Flash(issueFailMessage, 'alert')
$this.prop('disabled', false) $this.prop('disabled', false)
submitNoteForm: (form) =>
noteText = form.find("textarea.js-note-text").val()
if noteText.trim().length > 0
form.submit()
disableTaskList: -> disableTaskList: ->
$('.detail-page-description .js-task-list-container').taskList('disable') $('.detail-page-description .js-task-list-container').taskList('disable')
$(document).off 'tasklist:changed', '.detail-page-description .js-task-list-container' $(document).off 'tasklist:changed', '.detail-page-description .js-task-list-container'
......
...@@ -19,6 +19,7 @@ class @MergeRequest ...@@ -19,6 +19,7 @@ class @MergeRequest
# Prevent duplicate event bindings # Prevent duplicate event bindings
@disableTaskList() @disableTaskList()
@initMRBtnListeners()
if $("a.btn-close").length if $("a.btn-close").length
@initTaskList() @initTaskList()
...@@ -43,6 +44,27 @@ class @MergeRequest ...@@ -43,6 +44,27 @@ class @MergeRequest
$('.detail-page-description .js-task-list-container').taskList('enable') $('.detail-page-description .js-task-list-container').taskList('enable')
$(document).on 'tasklist:changed', '.detail-page-description .js-task-list-container', @updateTaskList $(document).on 'tasklist:changed', '.detail-page-description .js-task-list-container', @updateTaskList
initMRBtnListeners: ->
_this = @
$('a.btn-close, a.btn-reopen').on 'click', (e) ->
$this = $(this)
if $this.data('submitted')
return
e.preventDefault()
e.stopImmediatePropagation()
shouldSubmit = $this.hasClass('btn-comment')
console.log("shouldSubmit")
if shouldSubmit
_this.submitNoteForm($this.closest('form'),$this)
submitNoteForm: (form, $button) =>
noteText = form.find("textarea.js-note-text").val()
if noteText.trim().length > 0
form.submit()
$button.data('submitted',true)
$button.trigger('click')
disableTaskList: -> disableTaskList: ->
$('.detail-page-description .js-task-list-container').taskList('disable') $('.detail-page-description .js-task-list-container').taskList('disable')
$(document).off 'tasklist:changed', '.detail-page-description .js-task-list-container' $(document).off 'tasklist:changed', '.detail-page-description .js-task-list-container'
......
...@@ -33,8 +33,6 @@ class @Notes ...@@ -33,8 +33,6 @@ class @Notes
$(document).on "click", ".note-edit-cancel", @cancelEdit $(document).on "click", ".note-edit-cancel", @cancelEdit
# Reopen and close actions for Issue/MR combined with note form submit # Reopen and close actions for Issue/MR combined with note form submit
$(document).on "click", ".js-note-target-reopen", @targetReopen
$(document).on "click", ".js-note-target-close", @targetClose
$(document).on "click", ".js-comment-button", @updateCloseButton $(document).on "click", ".js-comment-button", @updateCloseButton
$(document).on "keyup", ".js-note-text", @updateTargetButtons $(document).on "keyup", ".js-note-text", @updateTargetButtons
...@@ -512,17 +510,6 @@ class @Notes ...@@ -512,17 +510,6 @@ class @Notes
visibilityChange: => visibilityChange: =>
@refresh() @refresh()
targetReopen: (e) =>
@submitNoteForm($(e.target).parents('form'))
targetClose: (e) =>
@submitNoteForm($(e.target).parents('form'))
submitNoteForm: (form) =>
noteText = form.find(".js-note-text").val()
if noteText.trim().length > 0
form.submit()
updateCloseButton: (e) => updateCloseButton: (e) =>
textarea = $(e.target) textarea = $(e.target)
form = textarea.parents('form') form = textarea.parents('form')
...@@ -531,7 +518,6 @@ class @Notes ...@@ -531,7 +518,6 @@ class @Notes
updateTargetButtons: (e) => updateTargetButtons: (e) =>
textarea = $(e.target) textarea = $(e.target)
form = textarea.parents('form') form = textarea.parents('form')
if textarea.val().trim().length > 0 if textarea.val().trim().length > 0
form.find('.js-note-target-reopen').text('Comment & reopen') form.find('.js-note-target-reopen').text('Comment & reopen')
form.find('.js-note-target-close').text('Comment & close') form.find('.js-note-target-close').text('Comment & close')
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
/** light list with border-bottom between li **/ /** light list with border-bottom between li **/
ul.bordered-list { ul.bordered-list, ul.unstyled-list {
@include basic-list; @include basic-list;
&.top-list { &.top-list {
...@@ -88,6 +88,10 @@ ul.bordered-list { ...@@ -88,6 +88,10 @@ ul.bordered-list {
} }
} }
ul.unstyled-list > li {
border-bottom: none;
}
ul.task-list { ul.task-list {
li.task-list-item { li.task-list-item {
list-style-type: none; list-style-type: none;
......
...@@ -24,6 +24,7 @@ $gl-gray: #5a5a5a; ...@@ -24,6 +24,7 @@ $gl-gray: #5a5a5a;
$gl-padding: 16px; $gl-padding: 16px;
$gl-padding-top:10px; $gl-padding-top:10px;
$gl-avatar-size: 46px; $gl-avatar-size: 46px;
$secondary-text: #7f8fa4;
/* /*
* Color schema * Color schema
......
...@@ -144,3 +144,8 @@ form.edit-issue { ...@@ -144,3 +144,8 @@ form.edit-issue {
.issue-form .select2-container { .issue-form .select2-container {
width: 250px !important; width: 250px !important;
} }
.issue-closed-by-widget {
color: $secondary-text;
margin-left: 52px;
}
\ No newline at end of file
...@@ -6,11 +6,9 @@ class Admin::AbuseReportsController < Admin::ApplicationController ...@@ -6,11 +6,9 @@ class Admin::AbuseReportsController < Admin::ApplicationController
def destroy def destroy
abuse_report = AbuseReport.find(params[:id]) abuse_report = AbuseReport.find(params[:id])
if params[:remove_user] abuse_report.remove_user if params[:remove_user]
abuse_report.user.destroy
end
abuse_report.destroy abuse_report.destroy
render nothing: true render nothing: true
end end
end end
...@@ -73,6 +73,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController ...@@ -73,6 +73,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
:metrics_pool_size, :metrics_pool_size,
:metrics_timeout, :metrics_timeout,
:metrics_method_call_threshold, :metrics_method_call_threshold,
:metrics_sample_interval,
:recaptcha_enabled, :recaptcha_enabled,
:recaptcha_site_key, :recaptcha_site_key,
:recaptcha_private_key, :recaptcha_private_key,
......
...@@ -205,7 +205,7 @@ module ApplicationHelper ...@@ -205,7 +205,7 @@ module ApplicationHelper
def time_ago_with_tooltip(time, placement: 'top', html_class: 'time_ago', skip_js: false) def time_ago_with_tooltip(time, placement: 'top', html_class: 'time_ago', skip_js: false)
element = content_tag :time, time.to_s, element = content_tag :time, time.to_s,
class: "#{html_class} js-timeago js-timeago-pending", class: "#{html_class} js-timeago js-timeago-pending",
datetime: time.getutc.iso8601, datetime: time.to_time.getutc.iso8601,
title: time.in_time_zone.to_s(:medium), title: time.in_time_zone.to_s(:medium),
data: { toggle: 'tooltip', placement: placement, container: 'body' } data: { toggle: 'tooltip', placement: placement, container: 'body' }
...@@ -266,7 +266,7 @@ module ApplicationHelper ...@@ -266,7 +266,7 @@ module ApplicationHelper
state: params[:state], state: params[:state],
scope: params[:scope], scope: params[:scope],
label_name: params[:label_name], label_name: params[:label_name],
milestone_id: params[:milestone_id], milestone_title: params[:milestone_title],
assignee_id: params[:assignee_id], assignee_id: params[:assignee_id],
author_id: params[:author_id], author_id: params[:author_id],
sort: params[:sort], sort: params[:sort],
......
...@@ -67,7 +67,7 @@ module NotesHelper ...@@ -67,7 +67,7 @@ module NotesHelper
line_type: line_type line_type: line_type
} }
button_tag class: 'btn reply-btn js-discussion-reply-button', button_tag class: 'btn btn-nr reply-btn js-discussion-reply-button',
data: data, title: 'Add a reply' do data: data, title: 'Add a reply' do
link_text = icon('comment') link_text = icon('comment')
link_text << ' Reply' link_text << ' Reply'
......
...@@ -19,6 +19,11 @@ class AbuseReport < ActiveRecord::Base ...@@ -19,6 +19,11 @@ class AbuseReport < ActiveRecord::Base
validates :message, presence: true validates :message, presence: true
validates :user_id, uniqueness: true validates :user_id, uniqueness: true
def remove_user
user.block
user.destroy
end
def notify def notify
return unless self.persisted? return unless self.persisted?
......
...@@ -48,8 +48,8 @@ class WebHook < ActiveRecord::Base ...@@ -48,8 +48,8 @@ class WebHook < ActiveRecord::Base
else else
post_url = url.gsub("#{parsed_url.userinfo}@", "") post_url = url.gsub("#{parsed_url.userinfo}@", "")
auth = { auth = {
username: URI.decode(parsed_url.user), username: CGI.unescape(parsed_url.user),
password: URI.decode(parsed_url.password), password: CGI.unescape(parsed_url.password),
} }
response = WebHook.post(post_url, response = WebHook.post(post_url,
body: data.to_json, body: data.to_json,
......
...@@ -120,13 +120,13 @@ class HipchatService < Service ...@@ -120,13 +120,13 @@ class HipchatService < Service
message << "#{push[:user_name]} " message << "#{push[:user_name]} "
if Gitlab::Git.blank_ref?(before) if Gitlab::Git.blank_ref?(before)
message << "pushed new #{ref_type} <a href=\""\ message << "pushed new #{ref_type} <a href=\""\
"#{project_url}/commits/#{URI.escape(ref)}\">#{ref}</a>"\ "#{project_url}/commits/#{CGI.escape(ref)}\">#{ref}</a>"\
" to #{project_link}\n" " to #{project_link}\n"
elsif Gitlab::Git.blank_ref?(after) elsif Gitlab::Git.blank_ref?(after)
message << "removed #{ref_type} <b>#{ref}</b> from <a href=\"#{project.web_url}\">#{project_name}</a> \n" message << "removed #{ref_type} <b>#{ref}</b> from <a href=\"#{project.web_url}\">#{project_name}</a> \n"
else else
message << "pushed to #{ref_type} <a href=\""\ message << "pushed to #{ref_type} <a href=\""\
"#{project.web_url}/commits/#{URI.escape(ref)}\">#{ref}</a> " "#{project.web_url}/commits/#{CGI.escape(ref)}\">#{ref}</a> "
message << "of <a href=\"#{project.web_url}\">#{project.name_with_namespace.gsub!(/\s/,'')}</a> " message << "of <a href=\"#{project.web_url}\">#{project.name_with_namespace.gsub!(/\s/,'')}</a> "
message << "(<a href=\"#{project.web_url}/compare/#{before}...#{after}\">Compare changes</a>)" message << "(<a href=\"#{project.web_url}/compare/#{before}...#{after}\">Compare changes</a>)"
...@@ -255,8 +255,8 @@ class HipchatService < Service ...@@ -255,8 +255,8 @@ class HipchatService < Service
status = data[:commit][:status] status = data[:commit][:status]
duration = data[:commit][:duration] duration = data[:commit][:duration]
branch_link = "<a href=\"#{project_url}/commits/#{URI.escape(ref)}\">#{ref}</a>" branch_link = "<a href=\"#{project_url}/commits/#{CGI.escape(ref)}\">#{ref}</a>"
commit_link = "<a href=\"#{project_url}/commit/#{URI.escape(sha)}/builds\">#{Commit.truncate_sha(sha)}</a>" commit_link = "<a href=\"#{project_url}/commit/#{CGI.escape(sha)}/builds\">#{Commit.truncate_sha(sha)}</a>"
"#{project_link}: Commit #{commit_link} of #{branch_link} #{ref_type} by #{user_name} #{humanized_status(status)} in #{duration} second(s)" "#{project_link}: Commit #{commit_link} of #{branch_link} #{ref_type} by #{user_name} #{humanized_status(status)} in #{duration} second(s)"
end end
......
...@@ -73,9 +73,10 @@ class IrkerService < Service ...@@ -73,9 +73,10 @@ class IrkerService < Service
'irc[s]://irc.network.net[:port]/#channel. Special cases: if '\ 'irc[s]://irc.network.net[:port]/#channel. Special cases: if '\
'you want the channel to be a nickname instead, append ",isnick" to ' \ 'you want the channel to be a nickname instead, append ",isnick" to ' \
'the channel name; if the channel is protected by a secret password, ' \ 'the channel name; if the channel is protected by a secret password, ' \
' append "?key=secretpassword" to the URI. Note that if you specify a ' \ ' append "?key=secretpassword" to the URI (Note that due to a bug, if you ' \
' default IRC URI to prepend before each recipient, you can just give ' \ ' want to use a password, you have to omit the "#" on the channel). If you ' \
' a channel name.' }, ' specify a default IRC URI to prepend before each recipient, you can just ' \
' give a channel name.' },
{ type: 'checkbox', name: 'colorize_messages' }, { type: 'checkbox', name: 'colorize_messages' },
] ]
end end
......
...@@ -47,7 +47,8 @@ class SystemHooksService ...@@ -47,7 +47,8 @@ class SystemHooksService
data.merge!({ data.merge!({
name: model.name, name: model.name,
email: model.email, email: model.email,
user_id: model.id user_id: model.id,
username: model.username
}) })
when ProjectMember when ProjectMember
data.merge!(project_member_data(model)) data.merge!(project_member_data(model))
...@@ -99,8 +100,10 @@ class SystemHooksService ...@@ -99,8 +100,10 @@ class SystemHooksService
project_path: model.project.path, project_path: model.project.path,
project_path_with_namespace: model.project.path_with_namespace, project_path_with_namespace: model.project.path_with_namespace,
project_id: model.project.id, project_id: model.project.id,
user_username: model.user.username,
user_name: model.user.name, user_name: model.user.name,
user_email: model.user.email, user_email: model.user.email,
user_id: model.user.id,
access_level: model.human_access, access_level: model.human_access,
project_visibility: Project.visibility_levels.key(model.project.visibility_level_field).downcase project_visibility: Project.visibility_levels.key(model.project.visibility_level_field).downcase
} }
...@@ -111,6 +114,7 @@ class SystemHooksService ...@@ -111,6 +114,7 @@ class SystemHooksService
group_name: model.group.name, group_name: model.group.name,
group_path: model.group.path, group_path: model.group.path,
group_id: model.group.id, group_id: model.group.id,
user_username: model.user.username,
user_name: model.user.name, user_name: model.user.name,
user_email: model.user.email, user_email: model.user.email,
user_id: model.user.id, user_id: model.user.id,
......
...@@ -202,6 +202,13 @@ ...@@ -202,6 +202,13 @@
.help-block .help-block
A method call is only tracked when it takes longer to complete than A method call is only tracked when it takes longer to complete than
the given amount of milliseconds. the given amount of milliseconds.
.form-group
= f.label :metrics_sample_interval, 'Sampler Interval (sec)', class: 'control-label col-sm-2'
.col-sm-10
= f.number_field :metrics_sample_interval, class: 'form-control'
.help-block
The sampling interval in seconds. Sampled data includes memory usage,
retained Ruby objects, file descriptors and so on.
%fieldset %fieldset
%legend Spam and Anti-bot Protection %legend Spam and Anti-bot Protection
......
- page_title "Labels" - page_title "Labels"
= link_to new_admin_label_path, class: "pull-right btn btn-new" do = link_to new_admin_label_path, class: "pull-right btn btn-nr btn-new" do
New label New label
%h3.page-title %h3.page-title
Labels Labels
......
- page_title @project.name_with_namespace, "Projects" - page_title @project.name_with_namespace, "Projects"
%h3.page-title %h3.page-title
Project: #{@project.name_with_namespace} Project: #{@project.name_with_namespace}
= link_to edit_project_path(@project), class: "btn pull-right" do = link_to edit_project_path(@project), class: "btn btn-nr pull-right" do
%i.fa.fa-pencil-square-o %i.fa.fa-pencil-square-o
Edit Edit
%hr %hr
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
.pull-right .pull-right
- unless @user == current_user || @user.blocked? - unless @user == current_user || @user.blocked?
= link_to 'Impersonate', impersonate_admin_user_path(@user), method: :post, class: "btn btn-grouped btn-info" = link_to 'Impersonate', impersonate_admin_user_path(@user), method: :post, class: "btn btn-nr btn-grouped btn-info"
= link_to edit_admin_user_path(@user), class: "btn btn-grouped" do = link_to edit_admin_user_path(@user), class: "btn btn-nr btn-grouped" do
%i.fa.fa-pencil-square-o %i.fa.fa-pencil-square-o
Edit Edit
%hr %hr
......
...@@ -70,6 +70,14 @@ ...@@ -70,6 +70,14 @@
%strong.cred %strong.cred
No No
%li
%span.light Current sign-in IP:
%strong
- if @user.current_sign_in_ip
= @user.current_sign_in_ip
- else
never
%li %li
%span.light Current sign-in at: %span.light Current sign-in at:
%strong %strong
...@@ -78,6 +86,14 @@ ...@@ -78,6 +86,14 @@
- else - else
never never
%li
%span.light Last sign-in IP:
%strong
- if @user.last_sign_in_ip
= @user.last_sign_in_ip
- else
never
%li %li
%span.light Last sign-in at: %span.light Last sign-in at:
%strong %strong
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
- if @milestone.complete? && @milestone.active? - if @milestone.complete? && @milestone.active?
.alert.alert-success.prepend-top-default .alert.alert-success.prepend-top-default
%span All issues for this milestone are closed. You may close the milestone now. %span All issues for this milestone are closed. Navigate to the project to close the milestone.
.table-holder .table-holder
%table.table %table.table
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
.col-sm-10 .col-sm-10
= users_select_tag(:user_ids, multiple: true, class: 'input-large', scope: :all, email_user: true) = users_select_tag(:user_ids, multiple: true, class: 'input-large', scope: :all, email_user: true)
.help-block .help-block
Search for existing users or invite new ones using their email address. Search for users by name, username, or email, or invite new ones using their email address.
.form-group .form-group
= f.label :access_level, "Group Access", class: 'control-label' = f.label :access_level, "Group Access", class: 'control-label'
......
.issue-closed-by-widget.gray-content-block.second-block.white .issue-closed-by-widget.second-block
This issue will be closed automatically when merge request #{markdown(merge_requests_sentence(@closed_by_merge_requests), pipeline: :gfm)} is accepted. - pluralized_mr_this = merge_request_count > 1 ? "these" : "this"
- pluralized_mr_is = merge_request_count > 1 ? "are" : "is"
When #{pluralized_mr_this} merge #{"request".pluralize(merge_request_count)} #{pluralized_mr_is} accepted, this issue will be closed automatically.
- content_for :note_actions do - content_for :note_actions do
- if can?(current_user, :update_issue, @issue) - if can?(current_user, :update_issue, @issue)
- if @issue.closed? = link_to 'Reopen Issue', issue_path(@issue, issue: {state_event: :reopen}, status_only: true, format: 'json'), data: {no_turbolink: true}, class: "btn btn-nr btn-grouped btn-reopen btn-comment js-note-target-reopen #{issue_button_visibility(@issue, false)}", title: 'Reopen Issue'
= link_to 'Reopen Issue', issue_path(@issue, issue: {state_event: :reopen}, status_only: true), method: :put, class: 'btn btn-nr btn-grouped btn-reopen js-note-target-reopen', title: 'Reopen Issue' = link_to 'Close Issue', issue_path(@issue, issue: {state_event: :close}, status_only: true, format: 'json'), data: {no_turbolink: true}, class: "btn btn-nr btn-grouped btn-close btn-comment js-note-target-close #{issue_button_visibility(@issue, true)}", title: 'Close Issue'
- else
= link_to 'Close Issue', issue_path(@issue, issue: {state_event: :close}, status_only: true), method: :put, class: 'btn btn-nr btn-grouped btn-close js-note-target-close', title: 'Close Issue'
#notes #notes
= render 'projects/notes/notes_with_form' = render 'projects/notes/notes_with_form'
-if @merge_requests.any? -if @merge_requests.any?
%h2.merge-requests-title %h2.merge-requests-title
= pluralize(@merge_requests.count, 'Related Merge Request') = pluralize(@merge_requests.count, 'Related Merge Request')
%ul.bordered-list %ul.unstyled-list
- has_any_ci = @merge_requests.any?(&:ci_commit) - has_any_ci = @merge_requests.any?(&:ci_commit)
- @merge_requests.each do |merge_request| - @merge_requests.each do |merge_request|
%li %li
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
- elsif has_any_ci - elsif has_any_ci
= icon('blank fw') = icon('blank fw')
%span.merge-request-id %span.merge-request-id
\##{merge_request.iid} \!#{merge_request.iid}
%span.merge-request-info %span.merge-request-info
%strong %strong
= link_to_gfm merge_request.title, merge_request_path(merge_request), class: "row_title" = link_to_gfm merge_request.title, merge_request_path(merge_request), class: "row_title"
...@@ -24,3 +24,5 @@ ...@@ -24,3 +24,5 @@
MERGED MERGED
- elsif merge_request.closed? - elsif merge_request.closed?
CLOSED CLOSED
- if @closed_by_merge_requests.present?
= render partial: 'projects/issues/closed_by_box', locals: {merge_request_count: @merge_requests.count}
...@@ -53,9 +53,6 @@ ...@@ -53,9 +53,6 @@
.gray-content-block.second-block.oneline-block .gray-content-block.second-block.oneline-block
= render 'votes/votes_block', votable: @issue = render 'votes/votes_block', votable: @issue
- if @closed_by_merge_requests.present?
= render 'projects/issues/closed_by_box'
.row .row
%section.col-md-9 %section.col-md-9
.issuable-discussion .issuable-discussion
......
- content_for :note_actions do - content_for :note_actions do
- if can?(current_user, :update_merge_request, @merge_request) - if can?(current_user, :update_merge_request, @merge_request)
- if @merge_request.open? - if @merge_request.open?
= link_to 'Close', merge_request_path(@merge_request, merge_request: {state_event: :close }), method: :put, class: "btn btn-nr btn-grouped btn-close close-mr-link js-note-target-close", title: "Close merge request" = link_to 'Close', merge_request_path(@merge_request, merge_request: {state_event: :close }), method: :put, class: "btn btn-nr btn-comment btn-grouped btn-close close-mr-link js-note-target-close", title: "Close merge request"
- if @merge_request.closed? - if @merge_request.closed?
= link_to 'Reopen', merge_request_path(@merge_request, merge_request: {state_event: :reopen }), method: :put, class: "btn btn-nr btn-grouped btn-reopen reopen-mr-link js-note-target-reopen", title: "Reopen merge request" = link_to 'Reopen', merge_request_path(@merge_request, merge_request: {state_event: :reopen }), method: :put, class: "btn btn-nr btn-comment btn-grouped btn-reopen reopen-mr-link js-note-target-reopen", title: "Reopen merge request"
#notes= render "projects/notes/notes_with_form" #notes= render "projects/notes/notes_with_form"
...@@ -6,5 +6,5 @@ ...@@ -6,5 +6,5 @@
= render 'projects/notes/hints' = render 'projects/notes/hints'
.note-form-actions .note-form-actions
= f.submit 'Save Comment', class: 'btn btn-primary btn-save btn-grouped js-comment-button' = f.submit 'Save Comment', class: 'btn btn-nr btn-save btn-grouped js-comment-button'
= link_to 'Cancel', '#', class: 'btn btn-cancel note-edit-cancel' = link_to 'Cancel', '#', class: 'btn btn-nr btn-cancel note-edit-cancel'
...@@ -15,4 +15,4 @@ ...@@ -15,4 +15,4 @@
.note-form-actions.clearfix .note-form-actions.clearfix
= f.submit 'Add Comment', class: "btn btn-nr btn-create comment-btn btn-grouped js-comment-button" = f.submit 'Add Comment', class: "btn btn-nr btn-create comment-btn btn-grouped js-comment-button"
= yield(:note_actions) = yield(:note_actions)
%a.btn.btn-cancel.js-close-discussion-note-form Cancel %a.btn.btn-nr.btn-cancel.js-close-discussion-note-form Cancel
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
.col-sm-10 .col-sm-10
= users_select_tag(:user_ids, multiple: true, class: 'input-large', scope: :all, email_user: true) = users_select_tag(:user_ids, multiple: true, class: 'input-large', scope: :all, email_user: true)
.help-block .help-block
Search for existing users or invite new ones using their email address. Search for users by name, username, or email, or invite new ones using their email address.
.form-group .form-group
= f.label :access_level, "Project Access", class: 'control-label' = f.label :access_level, "Project Access", class: 'control-label'
......
...@@ -11,7 +11,7 @@ class Settings < Settingslogic ...@@ -11,7 +11,7 @@ class Settings < Settingslogic
# get host without www, thanks to http://stackoverflow.com/a/6674363/1233435 # get host without www, thanks to http://stackoverflow.com/a/6674363/1233435
def get_host_without_www(url) def get_host_without_www(url)
url = URI.encode(url) url = CGI.escape(url)
uri = URI.parse(url) uri = URI.parse(url)
uri = URI.parse("http://#{url}") if uri.scheme.nil? uri = URI.parse("http://#{url}") if uri.scheme.nil?
host = uri.host.downcase host = uri.host.downcase
......
Haml::Template.options[:ugly] = true Haml::Template.options[:ugly] = true
# Remove the `:coffee` and `:coffeescript` filters
#
# See https://git.io/vztMu and http://stackoverflow.com/a/17571242/223897
Haml::Filters.remove_filter('coffee')
Haml::Filters.remove_filter('coffeescript')
class AddMetricsSampleInterval < ActiveRecord::Migration
def change
add_column :application_settings, :metrics_sample_interval, :integer,
default: 15
end
end
This diff is collapsed.
...@@ -70,6 +70,8 @@ ...@@ -70,6 +70,8 @@
## Contributor documentation ## Contributor documentation
- [Documentation styleguide](development/doc_styleguide.md) Use this styleguide if you are
contributing to documentation.
- [Development](development/README.md) Explains the architecture and the guidelines for shell commands. - [Development](development/README.md) Explains the architecture and the guidelines for shell commands.
- [Legal](legal/README.md) Contributor license agreements. - [Legal](legal/README.md) Contributor license agreements.
- [Release](release/README.md) How to make the monthly and security releases. - [Release](release/README.md) How to make the monthly and security releases.
...@@ -76,7 +76,10 @@ Parameters: ...@@ -76,7 +76,10 @@ Parameters:
"updated_at": "2013-09-30T13: 46: 02Z" "updated_at": "2013-09-30T13: 46: 02Z"
}, },
"archived": false, "archived": false,
"avatar_url": "http://example.com/uploads/project/avatar/4/uploads/avatar.png" "avatar_url": "http://example.com/uploads/project/avatar/4/uploads/avatar.png",
"shared_runners_enabled": true,
"forks_count": 0,
"star_count": 0
}, },
{ {
"id": 6, "id": 6,
...@@ -129,7 +132,11 @@ Parameters: ...@@ -129,7 +132,11 @@ Parameters:
} }
}, },
"archived": false, "archived": false,
"avatar_url": null "avatar_url": null,
"shared_runners_enabled": true,
"forks_count": 0,
"star_count": 0,
"runners_token": "b8547b1dc37721d05889db52fa2f02"
} }
] ]
``` ```
...@@ -244,7 +251,11 @@ Parameters: ...@@ -244,7 +251,11 @@ Parameters:
} }
}, },
"archived": false, "archived": false,
"avatar_url": "http://example.com/uploads/project/avatar/3/uploads/avatar.png" "avatar_url": "http://example.com/uploads/project/avatar/3/uploads/avatar.png",
"shared_runners_enabled": true,
"forks_count": 0,
"star_count": 0,
"runners_token": "b8bc4a7a29eb76ea83cf79e4908c2b"
} }
``` ```
......
# Documentation styleguide
This styleguide recommends best practices to improve documentation and to keep
it organized and easy to find.
## Naming
- When creating a new document and it has more than one word in its name,
make sure to use underscores instead of spaces or dashes (`-`). For example,
a proper naming would be `import_projects_from_github.md`. The same rule
applies to images.
## Text
- Split up long lines, this makes it much easier to review and edit. Only
double line breaks are shown as a full line break in [GitLab markdown][gfm].
80-100 characters is a good line length
- Make sure that the documentation is added in the correct directory and that
there's a link to it somewhere useful
- Do not duplicate information
- Be brief and clear
- Unless there's a logical reason not to, add documents in alphabetical order
- Write in US English
- Use [single spaces][] instead of double spaces
## Formatting
- Use dashes (`-`) for unordered lists instead of asterisks (`*`)
- Use the number one (`1`) for ordered lists
- Use underscores (`_`) to mark a word or text in italics
- Use double asterisks (`**`) to mark a word or text in bold
- When using lists, prefer not to end each item with a period. You can use
them if there are multiple sentences, just keep the last sentence without
a period
## Headings
- Add only one H1 title in each document, by adding `#` at the beginning of
it (when using markdown). For subheadings, use `##`, `###` and so on
- Avoid putting numbers in headings. Numbers shift, hence documentation anchor
links shift too, which eventually leads to dead links. If you think it is
compelling to add numbers in headings, make sure to at least discuss it with
someone in the Merge Request
- When introducing a new document, be careful for the headings to be
grammatically and syntactically correct. It is advised to mention one or all
of the following GitLab members for a review: `@axil`, `@rspeicher`,
`@dblessing`, `@ashleys`, `@nearlythere`. This is to ensure that no document
with wrong heading is going live without an audit, thus preventing dead links
and redirection issues when corrected
- Leave exactly one newline after a heading
## Links
- If a link makes the paragraph to span across multiple lines, do not use
the regular Markdown approach: `[Text](https://example.com)`. Instead use
`[Text][identifier]` and at the very bottom of the document add:
`[identifier]: https://example.com`. This is another way to create Markdown
links which keeps the document clear and concise. Bonus points if you also
add an alternative text: `[identifier]: https://example.com "Alternative text"`
that appears when hovering your mouse on a link
## Images
- Place images in a separate directory named `img/` in the same directory where
the `.md` document that you're working on is located. Always prepend their
names with the name of the document that they will be included in. For
example, if there is a document called `twitter.md`, then a valid image name
could be `twitter_login_screen.png`.
- Images should have a specific, non-generic name that will differentiate them.
- Keep all file names in lower case.
- Consider using PNG images instead of JPEG.
Inside the document:
- The Markdown way of using an image inside a document is:
`![Proper description what the image is about](img/document_image_title.png)`
- Always use a proper description for what the image is about. That way, when a
browser fails to show the image, this text will be used as an alternative
description
- If there are consecutive images with little text between them, always add
three dashes (`---`) between the image and the text to create a horizontal
line for better clarity
- If a heading is placed right after an image, always add three dashes (`---`)
between the image and the heading
## Notes
- Notes should be in italics with the word `Note:` being bold. Use this form:
`_**Note:** This is something to note._`. If the note spans across multiple
lines it's OK to split the line.
## New features
- Every piece of documentation that comes with a new feature should declare the
GitLab version that feature got introduced. Right below the heading add a
note: `_**Note:** This feature was introduced in GitLab 8.3_`
- If possible every feature should have a link to the MR that introduced it.
The above note would be then transformed to:
`_**Note:** This feature was [introduced][ce-1242] in GitLab 8.3_`, where
the [link identifier](#links) is named after the repository (CE) and the MR
number
- If the feature is only in GitLab EE, don't forget to mention it, like:
`_**Note:** This feature was introduced in GitLab EE 8.3_`. Otherwise, leave
this mention out
## API
Here is a list of must-have items. Use them in the exact order that appears
on this document. Further explanation is given below.
- Every method must have the REST API request. For example:
```
GET /projects/:id/repository/branches
```
- Every method must have a detailed
[description of the parameters](#method-description).
- Every method must have a cURL example.
- Every method must have a response body (in JSON format).
### Method description
Use the following table headers to describe the methods. Attributes should
always be in code blocks using backticks (`).
```
| Attribute | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
```
Rendered example:
| Attribute | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `user` | string | yes | The GitLab username |
### cURL commands
- Use `https://gitlab.example.com/api/v3/` as an endpoint.
- Wherever needed use this private token: `9koXpg98eAheJpvBs5tK`.
- Always put the request first. `GET` is the default so you don't have to
include it.
- Use double quotes to the URL when it includes additional parameters.
- Prefer to use examples using the private token and don't pass data of
username and password.
| Methods | Description |
| ------- | ----------- |
| `-H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK"` | Use this method as is, whenever authentication needed |
| `-X POST` | Use this method when creating new objects |
| `-X PUT` | Use this method when updating existing objects |
| `-X DELETE` | Use this method when removing existing objects |
### cURL Examples
Below is a set of [cURL][] examples that you can use in the API documentation.
#### Simple cURL command
Get the details of a group:
```bash
curl -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/groups/gitlab-org
```
#### cURL example with parameters passed in the URL
Create a new project under the authenticated user's namespace:
```bash
curl -X POST -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects?name=foo"
```
#### Post data using cURL's --data
Instead of using `-X POST` and appending the parameters to the URI, you can use
cURL's `--data` option. The example below will create a new project `foo` under
the authenticated user's namespace.
```bash
curl --data "name=foo" -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects"
```
#### Post data using JSON content
_**Note:** In this example we create a new group. Watch carefully the single
and double quotes._
```bash
curl -X POST -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" -H "Content-Type: application/json" --data '{"path": "my-group", "name": "My group"}' https://gitlab.example.com/api/v3/groups
```
#### Post data using form-data
Instead of using JSON or urlencode you can use multipart/form-data which
properly handles data encoding:
```bash
curl -X POST -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" -F "title=ssh-key" -F "key=ssh-rsa AAAAB3NzaC1yc2EA..." https://gitlab.example.com/api/v3/users/25/keys
```
The above example is run by and administrator and will add an SSH public key
titled ssh-key to user's account which has an id of 25.
#### Escape special characters
Spaces or slashes (`/`) may sometimes result to errors, thus it is recommended
to escape them when possible. In the example below we create a new issue which
contains spaces in its title. Observe how spaces are escaped using the `%20`
ASCII code.
```bash
curl -X POST -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/42/issues?title=Hello%20Dude"
```
Use `%2F` for slashes (`/`).
#### Pass arrays to API calls
The GitLab API sometimes accepts arrays of strings or integers. For example, to
restrict the sign-up e-mail domains of a GitLab instance to `*.example.com` and
`example.net`, you would do something like this:
```bash
curl -X PUT -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" -d "restricted_signup_domains[]=*.example.com" -d "restricted_signup_domains[]=example.net" https://gitlab.example.com/api/v3/application/settings
```
[cURL]: http://curl.haxx.se/ "cURL website"
[single spaces]: http://www.slate.com/articles/technology/technology/2011/01/space_invaders.html
[gfm]: http://doc.gitlab.com/ce/markdown/markdown.html#newlines "GitLab flavored markdown documentation"
...@@ -231,9 +231,9 @@ sudo usermod -aG redis git ...@@ -231,9 +231,9 @@ sudo usermod -aG redis git
### Clone the Source ### Clone the Source
# Clone GitLab repository # Clone GitLab repository
sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-ce.git -b 8-3-stable gitlab sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-ce.git -b 8-4-stable gitlab
**Note:** You can change `8-3-stable` to `master` if you want the *bleeding edge* version, but never install master on a production server! **Note:** You can change `8-4-stable` to `master` if you want the *bleeding edge* version, but never install master on a production server!
### Configure It ### Configure It
...@@ -348,7 +348,7 @@ GitLab Shell is an SSH access and repository management software developed speci ...@@ -348,7 +348,7 @@ GitLab Shell is an SSH access and repository management software developed speci
cd /home/git cd /home/git
sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-workhorse.git sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-workhorse.git
cd gitlab-workhorse cd gitlab-workhorse
sudo -u git -H git checkout 0.5.3 sudo -u git -H git checkout 0.5.4
sudo -u git -H make sudo -u git -H make
### Initialize Database and Activate Advanced Features ### Initialize Database and Activate Advanced Features
......
# Shibboleth OmniAuth Provider # Shibboleth OmniAuth Provider
This documentation is for enabling shibboleth with gitlab-omnibus package. This documentation is for enabling shibboleth with omnibus-gitlab package.
In order to enable Shibboleth support in gitlab we need to use Apache instead of Nginx (It may be possible to use Nginx, however I did not found way to easily configure Nginx that is bundled in gitlab-omnibus package). Apache uses mod_shib2 module for shibboleth authentication and can pass attributes as headers to omniauth-shibboleth provider. In order to enable Shibboleth support in gitlab we need to use Apache instead of Nginx (It may be possible to use Nginx, however I did not found way to easily configure Nginx that is bundled in omnibus-gitlab package). Apache uses mod_shib2 module for shibboleth authentication and can pass attributes as headers to omniauth-shibboleth provider.
To enable the Shibboleth OmniAuth provider you must: To enable the Shibboleth OmniAuth provider you must:
......
...@@ -24,7 +24,7 @@ Use the following template: ...@@ -24,7 +24,7 @@ Use the following template:
- Picked into respective `stable` branches: - Picked into respective `stable` branches:
- [ ] Merge `x-y-stable` into `x-y-stable-ee` - [ ] Merge `x-y-stable` into `x-y-stable-ee`
- [ ] release-tools: `x.y.z` - [ ] release-tools: `x.y.z`
- gitlab-omnibus - omnibus-gitlab
- [ ] `x.y.z+ee.0` - [ ] `x.y.z+ee.0`
- [ ] `x.y.z+ce.0` - [ ] `x.y.z+ce.0`
- [ ] Deploy - [ ] Deploy
......
...@@ -96,6 +96,7 @@ X-Gitlab-Event: System Hook ...@@ -96,6 +96,7 @@ X-Gitlab-Event: System Hook
"project_path_with_namespace": "jsmith/storecloud", "project_path_with_namespace": "jsmith/storecloud",
"user_email": "johnsmith@gmail.com", "user_email": "johnsmith@gmail.com",
"user_name": "John Smith", "user_name": "John Smith",
"user_username": "johnsmith",
"user_id": 41, "user_id": 41,
"project_visibility": "private", "project_visibility": "private",
} }
...@@ -115,6 +116,7 @@ X-Gitlab-Event: System Hook ...@@ -115,6 +116,7 @@ X-Gitlab-Event: System Hook
"project_path_with_namespace": "jsmith/storecloud", "project_path_with_namespace": "jsmith/storecloud",
"user_email": "johnsmith@gmail.com", "user_email": "johnsmith@gmail.com",
"user_name": "John Smith", "user_name": "John Smith",
"user_username": "johnsmith",
"user_id": 41, "user_id": 41,
"project_visibility": "private", "project_visibility": "private",
} }
...@@ -129,6 +131,7 @@ X-Gitlab-Event: System Hook ...@@ -129,6 +131,7 @@ X-Gitlab-Event: System Hook
"email": "js@gitlabhq.com", "email": "js@gitlabhq.com",
"event_name": "user_create", "event_name": "user_create",
"name": "John Smith", "name": "John Smith",
"username": "js",
"user_id": 41 "user_id": 41
} }
``` ```
...@@ -142,6 +145,7 @@ X-Gitlab-Event: System Hook ...@@ -142,6 +145,7 @@ X-Gitlab-Event: System Hook
"email": "js@gitlabhq.com", "email": "js@gitlabhq.com",
"event_name": "user_destroy", "event_name": "user_destroy",
"name": "John Smith", "name": "John Smith",
"username": "js",
"user_id": 41 "user_id": 41
} }
``` ```
...@@ -215,6 +219,7 @@ X-Gitlab-Event: System Hook ...@@ -215,6 +219,7 @@ X-Gitlab-Event: System Hook
"group_path": "storecloud", "group_path": "storecloud",
"user_email": "johnsmith@gmail.com", "user_email": "johnsmith@gmail.com",
"user_name": "John Smith", "user_name": "John Smith",
"user_username": "johnsmith",
"user_id": 41 "user_id": 41
} }
``` ```
...@@ -231,6 +236,7 @@ X-Gitlab-Event: System Hook ...@@ -231,6 +236,7 @@ X-Gitlab-Event: System Hook
"group_path": "storecloud", "group_path": "storecloud",
"user_email": "johnsmith@gmail.com", "user_email": "johnsmith@gmail.com",
"user_name": "John Smith", "user_name": "John Smith",
"user_username": "johnsmith",
"user_id": 41 "user_id": 41
} }
``` ```
...@@ -78,7 +78,7 @@ which should already be on your system from GitLab 8.1. ...@@ -78,7 +78,7 @@ which should already be on your system from GitLab 8.1.
```bash ```bash
cd /home/git/gitlab-workhorse cd /home/git/gitlab-workhorse
sudo -u git -H git fetch --all sudo -u git -H git fetch --all
sudo -u git -H git checkout 0.5.3 sudo -u git -H git checkout 0.5.4
sudo -u git -H make sudo -u git -H make
``` ```
......
# From 8.3 to 8.4
### 1. Stop server
sudo service gitlab stop
### 2. Backup
```bash
cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
```
### 3. Get latest code
```bash
sudo -u git -H git fetch --all
sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically
```
For GitLab Community Edition:
```bash
sudo -u git -H git checkout 8-4-stable
```
OR
For GitLab Enterprise Edition:
```bash
sudo -u git -H git checkout 8-4-stable-ee
```
### 4. Update gitlab-shell
```bash
cd /home/git/gitlab-shell
sudo -u git -H git fetch --all
sudo -u git -H git checkout v2.6.9
```
### 5. Update gitlab-workhorse
Install and compile gitlab-workhorse. This requires [Go 1.5](https://golang.org/dl)
which should already be on your system from GitLab 8.1.
```bash
cd /home/git/gitlab-workhorse
sudo -u git -H git fetch --all
sudo -u git -H git checkout 0.5.4
sudo -u git -H make
```
### 6. Install libs, migrations, etc.
```bash
cd /home/git/gitlab
# MySQL installations (note: the line below states '--without postgres')
sudo -u git -H bundle install --without postgres development test --deployment
# PostgreSQL installations (note: the line below states '--without mysql')
sudo -u git -H bundle install --without mysql development test --deployment
# Run database migrations
sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production
# Clean up assets and cache
sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production
```
### 7. Update configuration files
#### New configuration options for `gitlab.yml`
There are new configuration options available for [`gitlab.yml`](config/gitlab.yml.example). View them with the command below and apply them manually to your current `gitlab.yml`:
```sh
git diff origin/8-3-stable:config/gitlab.yml.example origin/8-4-stable:config/gitlab.yml.example
```
#### Nginx configuration
GitLab 8.3 introduced major changes in the NGINX configuration. Ensure you're
still up-to-date with the latest changes:
```sh
# For HTTPS configurations
git diff origin/8-3-stable:lib/support/nginx/gitlab-ssl origin/8-4-stable:lib/support/nginx/gitlab-ssl
# For HTTP configurations
git diff origin/8-3-stable:lib/support/nginx/gitlab origin/8-4-stable:lib/support/nginx/gitlab
```
If you are using Apache instead of NGINX please see the updated [Apache templates].
Also note that because Apache does not support upstreams behind Unix sockets you
will need to let gitlab-workhorse listen on a TCP port. You can do this
via [/etc/default/gitlab].
[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache
[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-4-stable/lib/support/init.d/gitlab.default.example#L34
#### Init script
We updated the init script for GitLab in order to pass new
configuration options to gitlab-workhorse. We let gitlab-workhorse
connect to the Rails application via a Unix domain socket and we tell
it where the 'public' directory of GitLab is.
```
cd /home/git/gitlab
sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab
```
### 8. Start application
sudo service gitlab start
sudo service nginx restart
### 9. Check application status
Check if GitLab and its environment are configured correctly:
sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
To make sure you didn't miss anything run a more thorough check:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
If all items are green, then congratulations, the upgrade is complete!
## Things went south? Revert to previous version (8.3)
### 1. Revert the code to the previous version
Follow the [upgrade guide from 8.2 to 8.3](8.2-to-8.3.md), except for the
database migration (the backup is already migrated to the previous version).
### 2. Restore from the backup
```bash
cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production
```
If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above.
...@@ -48,6 +48,7 @@ sudo -u git -H git checkout v`cat /home/git/gitlab/GITLAB_SHELL_VERSION` -b v`ca ...@@ -48,6 +48,7 @@ sudo -u git -H git checkout v`cat /home/git/gitlab/GITLAB_SHELL_VERSION` -b v`ca
cd /home/git/gitlab-workhorse cd /home/git/gitlab-workhorse
sudo -u git -H git fetch sudo -u git -H git fetch
sudo -u git -H git checkout `cat /home/git/gitlab/GITLAB_WORKHORSE_VERSION` -b `cat /home/git/gitlab/GITLAB_WORKHORSE_VERSION` sudo -u git -H git checkout `cat /home/git/gitlab/GITLAB_WORKHORSE_VERSION` -b `cat /home/git/gitlab/GITLAB_WORKHORSE_VERSION`
sudo -u git -H make
``` ```
### 5. Install libs, migrations, etc. ### 5. Install libs, migrations, etc.
......
# Documentation styleguide # Documentation styleguide
This styleguide recommends best practices to improve documentation and to keep it organized and easy to find. Moved to [development/doc_styleguide](doc/development/doc_styleguide.md).
## Text
- Split up long lines, this makes it much easier to review and edit. Only
double line breaks are shown as a full line break in markdown. 80 characters
is a good line length.
- For subtitles, make sure to start with the largest and go down, meaning:
`#` for the title, `##` for subtitles and `###` for subtitles of the subtitles, etc.
- Make sure that the documentation is added in the correct directory and that there's a link to it somewhere useful.
- Add only one H1 or title in each document, by adding '#' at the begining of it (when using markdown).
For subtitles, use '##', '###' and so on.
- Do not duplicate information.
- Be brief and clear.
- Whenever it applies, add documents in alphabetical order.
- Write in US English
- Use [single spaces](http://www.slate.com/articles/technology/technology/2011/01/space_invaders.html) instead of double spaces.
## Images
- Create a directory to store the images with the specific name of the document where the images belong.
It could be in the same directory where the .md document that you're working on is located.
- Images should have a specific, non-generic name that will differentiate them.
- Keep all file names in lower case.
\ No newline at end of file
...@@ -71,6 +71,7 @@ module API ...@@ -71,6 +71,7 @@ module API
expose :avatar_url expose :avatar_url
expose :star_count, :forks_count expose :star_count, :forks_count
expose :open_issues_count, if: lambda { |project, options| project.issues_enabled? && project.default_issues_tracker? } expose :open_issues_count, if: lambda { |project, options| project.issues_enabled? && project.default_issues_tracker? }
expose :runners_token, if: lambda { |_project, options| options[:user_can_admin_project] }
end end
class ProjectMember < UserBasic class ProjectMember < UserBasic
......
...@@ -69,7 +69,8 @@ module API ...@@ -69,7 +69,8 @@ module API
# Example Request: # Example Request:
# GET /projects/:id # GET /projects/:id
get ":id" do get ":id" do
present user_project, with: Entities::ProjectWithAccess, user: current_user present user_project, with: Entities::ProjectWithAccess, user: current_user,
user_can_admin_project: can?(current_user, :admin_project, user_project)
end end
# Get events for a single project # Get events for a single project
...@@ -118,7 +119,8 @@ module API ...@@ -118,7 +119,8 @@ module API
attrs = map_public_to_visibility_level(attrs) attrs = map_public_to_visibility_level(attrs)
@project = ::Projects::CreateService.new(current_user, attrs).execute @project = ::Projects::CreateService.new(current_user, attrs).execute
if @project.saved? if @project.saved?
present @project, with: Entities::Project present @project, with: Entities::Project,
user_can_admin_project: can?(current_user, :admin_project, @project)
else else
if @project.errors[:limit_reached].present? if @project.errors[:limit_reached].present?
error!(@project.errors[:limit_reached], 403) error!(@project.errors[:limit_reached], 403)
...@@ -163,7 +165,8 @@ module API ...@@ -163,7 +165,8 @@ module API
attrs = map_public_to_visibility_level(attrs) attrs = map_public_to_visibility_level(attrs)
@project = ::Projects::CreateService.new(user, attrs).execute @project = ::Projects::CreateService.new(user, attrs).execute
if @project.saved? if @project.saved?
present @project, with: Entities::Project present @project, with: Entities::Project,
user_can_admin_project: can?(current_user, :admin_project, @project)
else else
render_validation_error!(@project) render_validation_error!(@project)
end end
...@@ -182,8 +185,9 @@ module API ...@@ -182,8 +185,9 @@ module API
if @forked_project.errors.any? if @forked_project.errors.any?
conflict!(@forked_project.errors.messages) conflict!(@forked_project.errors.messages)
else else
present @forked_project, with: Entities::Project present @forked_project, with: Entities::Project,
end user_can_admin_project: can?(current_user, :admin_project, @forked_project)
end
end end
# Update an existing project # Update an existing project
...@@ -229,7 +233,8 @@ module API ...@@ -229,7 +233,8 @@ module API
if user_project.errors.any? if user_project.errors.any?
render_validation_error!(user_project) render_validation_error!(user_project)
else else
present user_project, with: Entities::Project present user_project, with: Entities::Project,
user_can_admin_project: can?(current_user, :admin_project, user_project)
end end
end end
......
...@@ -133,7 +133,7 @@ module Banzai ...@@ -133,7 +133,7 @@ module Banzai
next unless link && text next unless link && text
link = URI.decode(link) link = CGI.unescape(link)
# Ignore ending punctionation like periods or commas # Ignore ending punctionation like periods or commas
next unless link == text && text =~ /\A#{pattern}/ next unless link == text && text =~ /\A#{pattern}/
...@@ -170,7 +170,7 @@ module Banzai ...@@ -170,7 +170,7 @@ module Banzai
text = node.text text = node.text
next unless link && text next unless link && text
link = URI.decode(link) link = CGI.unescape(link)
next unless link && link =~ /\A#{pattern}\z/ next unless link && link =~ /\A#{pattern}\z/
html = yield link, text html = yield link, text
......
...@@ -12,7 +12,7 @@ module Gitlab ...@@ -12,7 +12,7 @@ module Gitlab
end end
def execute def execute
project_identifier = URI.encode(project.import_source, '/') project_identifier = CGI.escape(project.import_source, '/')
#Issues && Comments #Issues && Comments
issues = client.issues(project_identifier) issues = client.issues(project_identifier)
......
...@@ -13,7 +13,8 @@ module Gitlab ...@@ -13,7 +13,8 @@ module Gitlab
timeout: current_application_settings[:metrics_timeout], timeout: current_application_settings[:metrics_timeout],
method_call_threshold: current_application_settings[:metrics_method_call_threshold], method_call_threshold: current_application_settings[:metrics_method_call_threshold],
host: current_application_settings[:metrics_host], host: current_application_settings[:metrics_host],
port: current_application_settings[:metrics_port] port: current_application_settings[:metrics_port],
sample_interval: current_application_settings[:metrics_sample_interval] || 15
} }
end end
...@@ -36,20 +37,6 @@ module Gitlab ...@@ -36,20 +37,6 @@ module Gitlab
@pool @pool
end end
# Returns a relative path and line number based on the last application call
# frame.
def self.last_relative_application_frame
frame = caller_locations.find do |l|
l.path.start_with?(RAILS_ROOT) && !l.path.start_with?(METRICS_ROOT)
end
if frame
return frame.path.sub(PATH_REGEX, ''), frame.lineno
else
return nil, nil
end
end
def self.submit_metrics(metrics) def self.submit_metrics(metrics)
prepared = prepare_metrics(metrics) prepared = prepare_metrics(metrics)
......
...@@ -7,9 +7,14 @@ module Gitlab ...@@ -7,9 +7,14 @@ module Gitlab
# statistics, etc. # statistics, etc.
class Sampler class Sampler
# interval - The sampling interval in seconds. # interval - The sampling interval in seconds.
def initialize(interval = 15) def initialize(interval = Metrics.settings[:sample_interval])
@interval = interval interval_half = interval.to_f / 2
@metrics = []
@interval = interval
@interval_steps = (-interval_half..interval_half).step(0.1).to_a
@last_step = nil
@metrics = []
@last_minor_gc = Delta.new(GC.stat[:minor_gc_count]) @last_minor_gc = Delta.new(GC.stat[:minor_gc_count])
@last_major_gc = Delta.new(GC.stat[:major_gc_count]) @last_major_gc = Delta.new(GC.stat[:major_gc_count])
...@@ -26,7 +31,7 @@ module Gitlab ...@@ -26,7 +31,7 @@ module Gitlab
Thread.current.abort_on_exception = true Thread.current.abort_on_exception = true
loop do loop do
sleep(@interval) sleep(sleep_interval)
sample sample
end end
...@@ -102,6 +107,23 @@ module Gitlab ...@@ -102,6 +107,23 @@ module Gitlab
def sidekiq? def sidekiq?
Sidekiq.server? Sidekiq.server?
end end
# Returns the sleep interval with a random adjustment.
#
# The random adjustment is put in place to ensure we:
#
# 1. Don't generate samples at the exact same interval every time (thus
# potentially missing anything that happens in between samples).
# 2. Don't sample data at the same interval two times in a row.
def sleep_interval
while step = @interval_steps.sample
if step != @last_step
@last_step = step
return @interval + @last_step
end
end
end
end end
end end
end end
...@@ -33,16 +33,8 @@ module Gitlab ...@@ -33,16 +33,8 @@ module Gitlab
def tags_for(event) def tags_for(event)
path = relative_path(event.payload[:identifier]) path = relative_path(event.payload[:identifier])
tags = { view: path }
file, line = Metrics.last_relative_application_frame { view: path }
if file and line
tags[:file] = file
tags[:line] = line
end
tags
end end
def current_transaction def current_transaction
......
...@@ -23,20 +23,29 @@ module Gitlab ...@@ -23,20 +23,29 @@ module Gitlab
@values = Hash.new(0) @values = Hash.new(0)
@tags = {} @tags = {}
@action = action @action = action
@memory_before = 0
@memory_after = 0
end end
def duration def duration
@finished_at ? (@finished_at - @started_at) * 1000.0 : 0.0 @finished_at ? (@finished_at - @started_at) * 1000.0 : 0.0
end end
def allocated_memory
@memory_after - @memory_before
end
def run def run
Thread.current[THREAD_KEY] = self Thread.current[THREAD_KEY] = self
@started_at = Time.now @memory_before = System.memory_usage
@started_at = Time.now
yield yield
ensure ensure
@finished_at = Time.now @memory_after = System.memory_usage
@finished_at = Time.now
Thread.current[THREAD_KEY] = nil Thread.current[THREAD_KEY] = nil
end end
...@@ -65,7 +74,7 @@ module Gitlab ...@@ -65,7 +74,7 @@ module Gitlab
end end
def track_self def track_self
values = { duration: duration } values = { duration: duration, allocated_memory: allocated_memory }
@values.each do |name, value| @values.each do |name, value|
values[name] = value values[name] = value
......
...@@ -2,6 +2,8 @@ module Gitlab ...@@ -2,6 +2,8 @@ module Gitlab
class TaskAbortedByUserError < StandardError; end class TaskAbortedByUserError < StandardError; end
end end
String.disable_colorization = true unless STDOUT.isatty
namespace :gitlab do namespace :gitlab do
# Ask if the user wants to continue # Ask if the user wants to continue
......
...@@ -285,6 +285,10 @@ describe ApplicationHelper do ...@@ -285,6 +285,10 @@ describe ApplicationHelper do
it 'allows the script tag to be excluded' do it 'allows the script tag to be excluded' do
expect(element(skip_js: true)).not_to include 'script' expect(element(skip_js: true)).not_to include 'script'
end end
it 'converts to Time' do
expect { helper.time_ago_with_tooltip(Date.today) }.not_to raise_error
end
end end
describe 'render_markup' do describe 'render_markup' do
......
...@@ -44,7 +44,7 @@ describe 'reopen/close issue', -> ...@@ -44,7 +44,7 @@ describe 'reopen/close issue', ->
expect($('div.status-box-closed')).toBeVisible() expect($('div.status-box-closed')).toBeVisible()
expect($('div.status-box-open')).toBeHidden() expect($('div.status-box-open')).toBeHidden()
it 'fails to closes an issue with success:false', -> it 'fails to close an issue with success:false', ->
spyOn(jQuery, 'ajax').and.callFake (req) -> spyOn(jQuery, 'ajax').and.callFake (req) ->
expect(req.type).toBe('PUT') expect(req.type).toBe('PUT')
......
...@@ -9,7 +9,7 @@ describe Gitlab::Metrics::Sampler do ...@@ -9,7 +9,7 @@ describe Gitlab::Metrics::Sampler do
describe '#start' do describe '#start' do
it 'gathers a sample at a given interval' do it 'gathers a sample at a given interval' do
expect(sampler).to receive(:sleep).with(5) expect(sampler).to receive(:sleep).with(a_kind_of(Numeric))
expect(sampler).to receive(:sample) expect(sampler).to receive(:sample)
expect(sampler).to receive(:loop).and_yield expect(sampler).to receive(:loop).and_yield
...@@ -116,4 +116,24 @@ describe Gitlab::Metrics::Sampler do ...@@ -116,4 +116,24 @@ describe Gitlab::Metrics::Sampler do
sampler.add_metric('cats', value: 10) sampler.add_metric('cats', value: 10)
end end
end end
describe '#sleep_interval' do
it 'returns a Numeric' do
expect(sampler.sleep_interval).to be_a_kind_of(Numeric)
end
# Testing random behaviour is very hard, so treat this test as a basic smoke
# test instead of a very accurate behaviour/unit test.
it 'does not return the same interval twice in a row' do
last = nil
100.times do
interval = sampler.sleep_interval
expect(interval).to_not eq(last)
last = interval
end
end
end
end end
...@@ -14,19 +14,12 @@ describe Gitlab::Metrics::Subscribers::ActionView do ...@@ -14,19 +14,12 @@ describe Gitlab::Metrics::Subscribers::ActionView do
before do before do
allow(subscriber).to receive(:current_transaction).and_return(transaction) allow(subscriber).to receive(:current_transaction).and_return(transaction)
allow(Gitlab::Metrics).to receive(:last_relative_application_frame).
and_return(['app/views/x.html.haml', 4])
end end
describe '#render_template' do describe '#render_template' do
it 'tracks rendering of a template' do it 'tracks rendering of a template' do
values = { duration: 2.1 } values = { duration: 2.1 }
tags = { tags = { view: 'app/views/x.html.haml' }
view: 'app/views/x.html.haml',
file: 'app/views/x.html.haml',
line: 4
}
expect(transaction).to receive(:increment). expect(transaction).to receive(:increment).
with(:view_duration, 2.1) with(:view_duration, 2.1)
......
...@@ -11,6 +11,14 @@ describe Gitlab::Metrics::Transaction do ...@@ -11,6 +11,14 @@ describe Gitlab::Metrics::Transaction do
end end
end end
describe '#allocated_memory' do
it 'returns the allocated memory in bytes' do
transaction.run { 'a' * 32 }
expect(transaction.allocated_memory).to be_a_kind_of(Numeric)
end
end
describe '#run' do describe '#run' do
it 'yields the supplied block' do it 'yields the supplied block' do
expect { |b| transaction.run(&b) }.to yield_control expect { |b| transaction.run(&b) }.to yield_control
...@@ -43,8 +51,10 @@ describe Gitlab::Metrics::Transaction do ...@@ -43,8 +51,10 @@ describe Gitlab::Metrics::Transaction do
transaction.increment(:time, 1) transaction.increment(:time, 1)
transaction.increment(:time, 2) transaction.increment(:time, 2)
values = { duration: 0.0, time: 3, allocated_memory: a_kind_of(Numeric) }
expect(transaction).to receive(:add_metric). expect(transaction).to receive(:add_metric).
with('transactions', { duration: 0.0, time: 3 }, {}) with('transactions', values, {})
transaction.track_self transaction.track_self
end end
...@@ -54,8 +64,14 @@ describe Gitlab::Metrics::Transaction do ...@@ -54,8 +64,14 @@ describe Gitlab::Metrics::Transaction do
it 'sets a value' do it 'sets a value' do
transaction.set(:number, 10) transaction.set(:number, 10)
values = {
duration: 0.0,
number: 10,
allocated_memory: a_kind_of(Numeric)
}
expect(transaction).to receive(:add_metric). expect(transaction).to receive(:add_metric).
with('transactions', { duration: 0.0, number: 10 }, {}) with('transactions', values, {})
transaction.track_self transaction.track_self
end end
...@@ -80,8 +96,13 @@ describe Gitlab::Metrics::Transaction do ...@@ -80,8 +96,13 @@ describe Gitlab::Metrics::Transaction do
describe '#track_self' do describe '#track_self' do
it 'adds a metric for the transaction itself' do it 'adds a metric for the transaction itself' do
values = {
duration: transaction.duration,
allocated_memory: a_kind_of(Numeric)
}
expect(transaction).to receive(:add_metric). expect(transaction).to receive(:add_metric).
with('transactions', { duration: transaction.duration }, {}) with('transactions', values, {})
transaction.track_self transaction.track_self
end end
...@@ -104,7 +125,7 @@ describe Gitlab::Metrics::Transaction do ...@@ -104,7 +125,7 @@ describe Gitlab::Metrics::Transaction do
hash = { hash = {
series: 'rails_transactions', series: 'rails_transactions',
tags: { action: 'Foo#bar' }, tags: { action: 'Foo#bar' },
values: { duration: 0.0 }, values: { duration: 0.0, allocated_memory: a_kind_of(Numeric) },
timestamp: an_instance_of(Fixnum) timestamp: an_instance_of(Fixnum)
} }
......
...@@ -13,15 +13,6 @@ describe Gitlab::Metrics do ...@@ -13,15 +13,6 @@ describe Gitlab::Metrics do
end end
end end
describe '.last_relative_application_frame' do
it 'returns an Array containing a file path and line number' do
file, line = described_class.last_relative_application_frame
expect(line).to eq(__LINE__ - 2)
expect(file).to eq('spec/lib/gitlab/metrics_spec.rb')
end
end
describe '#submit_metrics' do describe '#submit_metrics' do
it 'prepares and writes the metrics to InfluxDB' do it 'prepares and writes the metrics to InfluxDB' do
connection = double(:connection) connection = double(:connection)
......
...@@ -29,6 +29,22 @@ RSpec.describe AbuseReport, type: :model do ...@@ -29,6 +29,22 @@ RSpec.describe AbuseReport, type: :model do
it { is_expected.to validate_uniqueness_of(:user_id) } it { is_expected.to validate_uniqueness_of(:user_id) }
end end
describe '#remove_user' do
it 'blocks the user' do
report = build(:abuse_report)
allow(report.user).to receive(:destroy)
expect { report.remove_user }.to change { report.user.blocked? }.to(true)
end
it 'removes the user' do
report = build(:abuse_report)
expect { report.remove_user }.to change { User.count }.by(-1)
end
end
describe '#notify' do describe '#notify' do
it 'delivers' do it 'delivers' do
expect(AbuseReportMailer).to receive(:notify).with(subject.id). expect(AbuseReportMailer).to receive(:notify).with(subject.id).
......
...@@ -9,54 +9,54 @@ describe SystemHooksService, services: true do ...@@ -9,54 +9,54 @@ describe SystemHooksService, services: true do
let(:group_member) { create(:group_member) } let(:group_member) { create(:group_member) }
context 'event data' do context 'event data' do
it { expect(event_data(user, :create)).to include(:event_name, :name, :created_at, :updated_at, :email, :user_id) } it { expect(event_data(user, :create)).to include(:event_name, :name, :created_at, :updated_at, :email, :user_id, :username) }
it { expect(event_data(user, :destroy)).to include(:event_name, :name, :created_at, :updated_at, :email, :user_id) } it { expect(event_data(user, :destroy)).to include(:event_name, :name, :created_at, :updated_at, :email, :user_id, :username) }
it { expect(event_data(project, :create)).to include(:event_name, :name, :created_at, :updated_at, :path, :project_id, :owner_name, :owner_email, :project_visibility) } it { expect(event_data(project, :create)).to include(:event_name, :name, :created_at, :updated_at, :path, :project_id, :owner_name, :owner_email, :project_visibility) }
it { expect(event_data(project, :destroy)).to include(:event_name, :name, :created_at, :updated_at, :path, :project_id, :owner_name, :owner_email, :project_visibility) } it { expect(event_data(project, :destroy)).to include(:event_name, :name, :created_at, :updated_at, :path, :project_id, :owner_name, :owner_email, :project_visibility) }
it { expect(event_data(project_member, :create)).to include(:event_name, :created_at, :updated_at, :project_name, :project_path, :project_path_with_namespace, :project_id, :user_name, :user_email, :access_level, :project_visibility) } it { expect(event_data(project_member, :create)).to include(:event_name, :created_at, :updated_at, :project_name, :project_path, :project_path_with_namespace, :project_id, :user_name, :user_username, :user_email, :user_id, :access_level, :project_visibility) }
it { expect(event_data(project_member, :destroy)).to include(:event_name, :created_at, :updated_at, :project_name, :project_path, :project_path_with_namespace, :project_id, :user_name, :user_email, :access_level, :project_visibility) } it { expect(event_data(project_member, :destroy)).to include(:event_name, :created_at, :updated_at, :project_name, :project_path, :project_path_with_namespace, :project_id, :user_name, :user_username, :user_email, :user_id, :access_level, :project_visibility) }
it { expect(event_data(key, :create)).to include(:username, :key, :id) } it { expect(event_data(key, :create)).to include(:username, :key, :id) }
it { expect(event_data(key, :destroy)).to include(:username, :key, :id) } it { expect(event_data(key, :destroy)).to include(:username, :key, :id) }
it do it do
project.old_path_with_namespace = 'renamed_from_path' project.old_path_with_namespace = 'renamed_from_path'
expect(event_data(project, :rename)).to include( expect(event_data(project, :rename)).to include(
:event_name, :name, :created_at, :updated_at, :path, :project_id, :event_name, :name, :created_at, :updated_at, :path, :project_id,
:owner_name, :owner_email, :project_visibility, :owner_name, :owner_email, :project_visibility,
:old_path_with_namespace :old_path_with_namespace
) )
end end
it do it do
project.old_path_with_namespace = 'transfered_from_path' project.old_path_with_namespace = 'transfered_from_path'
expect(event_data(project, :transfer)).to include( expect(event_data(project, :transfer)).to include(
:event_name, :name, :created_at, :updated_at, :path, :project_id, :event_name, :name, :created_at, :updated_at, :path, :project_id,
:owner_name, :owner_email, :project_visibility, :owner_name, :owner_email, :project_visibility,
:old_path_with_namespace :old_path_with_namespace
) )
end end
it do it do
expect(event_data(group, :create)).to include( expect(event_data(group, :create)).to include(
:event_name, :name, :created_at, :updated_at, :path, :group_id, :event_name, :name, :created_at, :updated_at, :path, :group_id,
:owner_name, :owner_email :owner_name, :owner_email
) )
end end
it do it do
expect(event_data(group, :destroy)).to include( expect(event_data(group, :destroy)).to include(
:event_name, :name, :created_at, :updated_at, :path, :group_id, :event_name, :name, :created_at, :updated_at, :path, :group_id,
:owner_name, :owner_email :owner_name, :owner_email
) )
end end
it do it do
expect(event_data(group_member, :create)).to include( expect(event_data(group_member, :create)).to include(
:event_name, :created_at, :updated_at, :group_name, :group_path, :event_name, :created_at, :updated_at, :group_name, :group_path,
:group_id, :user_id, :user_name, :user_email, :group_access :group_id, :user_id, :user_username, :user_name, :user_email, :group_access
) )
end end
it do it do
expect(event_data(group_member, :destroy)).to include( expect(event_data(group_member, :destroy)).to include(
:event_name, :created_at, :updated_at, :group_name, :group_path, :event_name, :created_at, :updated_at, :group_name, :group_path,
:group_id, :user_id, :user_name, :user_email, :group_access :group_id, :user_id, :user_username, :user_name, :user_email, :group_access
) )
end end
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