Commit 483bc386 authored by Alejandro Rodríguez's avatar Alejandro Rodríguez

Fix conflicts after ce-upstream update

parent 2d4a65b6
......@@ -4,61 +4,6 @@ entry.
## 8.14.0 (2016-11-22)
<<<<<<< HEAD
- Centralize LDAP config/filter logic. !6606
- Show random messages when the To Do list is empty. !6818 (Josep Llaneras)
- Fix record not found error on NewNoteWorker processing. !6863 (Oswaldo Ferreira)
- Fix expanding a collapsed diff when converting a symlink to a regular file. !6953
- Add link to build pipeline within individual build pages. !7082
- Add api endpoint `/groups/owned`. !7103 (Borja Aparicio)
- Fix no "Register" tab if ldap auth is enabled (#24038). !7274 (Luc Didry)
- Added ability to throttle Sidekiq Jobs. !7292
- Require projects before creating milestone. !7301 (gfyoung)
- Fix error when using invalid branch name when creating a new pipeline. !7324
- Fix cache for commit status in commits list to respect branches. !7372
- Removed gray button styling from todo buttons in sidebars. !7387
- Fix project records with invalid visibility_level values. !7391
- Use 'Forking in progress' title when appropriate. !7394 (Philip Karpiak)
- Fix error links in help index page. !7396 (Fu Xu)
- [Fix] Extra divider issue in dropdown. !7398
- Project download buttons always show. !7405 (Philip Karpiak)
- Give search-input correct padding-right value. !7407 (Philip Karpiak)
- Remove additional padding on right-aligned items in MR widget. !7411 (Didem Acet)
- Fix issue causing Labels not to appear in sidebar on MR page. !7416 (Alex Sanford)
- Fix project Visibility Level selector not using default values.
- Use separate email-token for incoming email and revert back the inactive feature. !5914
- Replace jQuery.timeago with timeago.js. !6274 (ClemMakesApps)
- Add CI notifications. Who triggered a pipeline would receive an email after the pipeline is succeeded or failed. Users could also update notification settings accordingly. !6342
- Finer-grained Git gargage collection. !6588
- Introduce better credential and error checking to `rake gitlab:ldap:check`. !6601
- Process commits using a dedicated Sidekiq worker. !6802
- Fix showing pipeline status for a given commit from correct branch. !7034
- Add query param to filter users by external & blocked type. !7109 (Yatish Mehta)
- Issues atom feed url reflect filters on dashboard. !7114 (Lucas Deschamps)
- Add setting to only allow merge requests to be merged when all discussions are resolved. !7125 (Rodolfo Arruda)
- Remove an extra leading space from diff paste data. !7133 (Hiroyuki Sato)
- Fix 404 on network page when entering non-existent git revision. !7172 (Hiroyuki Sato)
- Rewrite git blame spinach feature tests to rspec feature tests. !7197 (Lisanne Fellinger)
- Only skip group when it's actually a group in the "Share with group" select. !7262
- Introduce round-robin project creation to spread load over multiple shards. !7266
- Ensure merge request's "remove branch" accessors return booleans. !7267
- Expose label IDs in API. !7275 (Rares Sfirlogea)
- Fix invalid filename validation on eslint. !7281
- API: Ability to retrieve version information. !7286 (Robert Schilling)
- Set default Sidekiq retries to 3. !7294
- Return 400 when creating a system hook fails. !7350 (Robert Schilling)
- Use the Gitlab Workhorse HTTP header in the admin dashboard. (Chris Wright)
- Add an index for project_id in project_import_data to improve performance.
- Fix broken link to observatory cli on Frontend Dev Guide. (Sam Rose)
- Faster search inside Project.
- Clicking "force remove source branch" label now toggles the checkbox again.
- Allow to test JIRA service settings without having a repository.
- Fix: Guest sees some repository details and gets 404.
- Bump omniauth-gitlab to 1.0.2 to fix incompatibility with omniauth-oauth2.
- Fix: Todos Filter Shows All Users.
- Fix broken commits search.
=======
>>>>>>> ce-dev/master
- Show correct environment log in admin/logs (@duk3luk3 !7191)
- Fix Milestone dropdown not stay selected for `Upcoming` and `No Milestone` option !7117
- Diff collapse won't shift when collapsing.
......
......@@ -31,7 +31,6 @@ module SearchHelper
end
def parse_search_result(result)
<<<<<<< HEAD
if result.is_a?(String)
parse_search_result_from_grep(result)
else
......@@ -83,37 +82,7 @@ module SearchHelper
end
def parse_search_result_from_grep(result)
ref = nil
filename = nil
basename = nil
startline = 0
result.each_line.each_with_index do |line, index|
if line =~ /^.*:.*:\d+:/
ref, filename, startline = line.split(':')
startline = startline.to_i - index
extname = Regexp.escape(File.extname(filename))
basename = filename.sub(/#{extname}$/, '')
break
end
end
data = ""
result.each_line do |line|
data << line.sub(ref, '').sub(filename, '').sub(/^:-\d+-/, '').sub(/^::\d+:/, '')
end
OpenStruct.new(
filename: filename,
basename: basename,
ref: ref,
startline: startline,
data: data
)
=======
Gitlab::ProjectSearchResults.parse_search_result(result)
>>>>>>> ce-dev/master
end
def find_project_for_blob(blob)
......
......@@ -182,16 +182,12 @@ class User < ActiveRecord::Base
scope :external, -> { where(external: true) }
scope :active, -> { with_state(:active) }
scope :not_in_project, ->(project) { project.users.present? ? where("id not in (:ids)", ids: project.users.map(&:id) ) : all }
<<<<<<< HEAD
scope :without_projects, -> { where('id NOT IN (SELECT DISTINCT(user_id) FROM members)') }
scope :without_projects, -> { where('id NOT IN (SELECT DISTINCT(user_id) FROM members WHERE user_id IS NOT NULL AND requested_at IS NULL)') }
scope :subscribed_for_admin_email, -> { where(admin_email_unsubscribed_at: nil) }
scope :ldap, -> { joins(:identities).where('identities.provider LIKE ?', 'ldap%') }
scope :with_provider, ->(provider) do
joins(:identities).where(identities: { provider: provider })
end
=======
scope :without_projects, -> { where('id NOT IN (SELECT DISTINCT(user_id) FROM members WHERE user_id IS NOT NULL AND requested_at IS NULL)') }
>>>>>>> ce-dev/master
scope :todo_authors, ->(user_id, state) { where(id: Todo.where(user_id: user_id, state: state).select(:author_id)) }
def self.with_two_factor
......
<<<<<<< HEAD
- parsed_blob = parse_search_result(blob)
- project = @project || find_project_for_blob(blob)
- blob_link = namespace_project_blob_path(project.namespace, project, tree_join(parsed_blob.ref, parsed_blob.filename))
.blob-result
.file-holder
.file-title
=======
- file_name, blob = blob
- project = @project || find_project_for_blob(blob)
- ref = @search_results.repository_ref
- blob_link = namespace_project_blob_path(project.namespace, project, tree_join(ref, file_name))
.blob-result
.file-holder
.file-title
- ref = @search_results.repository_ref
- blob_link = namespace_project_blob_path(@project.namespace, @project, tree_join(ref, file_name))
>>>>>>> ce-dev/master
= link_to blob_link do
= icon('fa-file')
%strong
<<<<<<< HEAD
- if @project
= parsed_blob.filename
= file_name
- else
#{project.name_with_namespace}:
%i= parsed_blob.filename
.file-content.code.term
= render 'shared/file_highlight', blob: parsed_blob, first_line_number: parsed_blob.startline, blob_link: blob_link
=======
= file_name
%i= file_name
- if blob
.file-content.code.term
= render 'shared/file_highlight', blob: blob, first_line_number: blob.startline, blob_link: blob_link
>>>>>>> ce-dev/master
......@@ -151,7 +151,6 @@
method: :delete, class: 'btn btn-danger btn-grouped'
= link_to 'Cancel', polymorphic_path([@project.namespace.becomes(Namespace), @project, issuable]), class: 'btn btn-grouped btn-cancel'
<<<<<<< HEAD
%li.unsaved-approvers.hide.approver.approver-template{id: "user_{user_id}"}
= link_to "{approver_name}", "#"
.pull-right
......@@ -159,6 +158,4 @@
= icon("sign-out")
Remove
=======
>>>>>>> ce-dev/master
= form.hidden_field :lock_version
......@@ -816,16 +816,12 @@ ActiveRecord::Schema.define(version: 20161109150329) do
t.boolean "membership_lock", default: false
t.boolean "share_with_group_lock", default: false
t.integer "visibility_level", default: 20, null: false
<<<<<<< HEAD
t.boolean "request_access_enabled", default: true, null: false
t.boolean "request_access_enabled", default: false, null: false
t.string "ldap_sync_status", default: "ready", null: false
t.string "ldap_sync_error"
t.datetime "ldap_sync_last_update_at"
t.datetime "ldap_sync_last_successful_update_at"
t.datetime "ldap_sync_last_sync_at"
=======
t.boolean "request_access_enabled", default: false, null: false
>>>>>>> ce-dev/master
t.datetime "deleted_at"
t.text "description_html"
t.boolean "lfs_enabled"
......
......@@ -8,6 +8,8 @@ module API
optional :visibility_level, type: Integer, desc: 'The visibility level of the group'
optional :lfs_enabled, type: Boolean, desc: 'Enable/disable LFS for the projects in this group'
optional :request_access_enabled, type: Boolean, desc: 'Allow users to request member access'
optional :membership_lock, type: Boolean, desc: 'Prevent adding new members to project membership within this group'
optional :share_with_group_lock, type: Boolean, desc: 'Prevent sharing a project with another group within this group'
end
end
......@@ -42,21 +44,6 @@ module API
present paginate(groups), with: Entities::Group, user: current_user
end
<<<<<<< HEAD
# Create group. Available only for users who can create groups.
#
# Parameters:
# name (required) - The name of the group
# path (required) - The path of the group
# description (optional) - The description of the group
# visibility_level (optional) - The visibility level of the group
# membership_lock (optional, boolean) - Prevent adding new members to project membership within this group
# share_with_group_lock (optional, boolean) - Prevent sharing a project with another group within this group
# lfs_enabled (optional) - Enable/disable LFS for the projects in this group
# request_access_enabled (optional) - Allow users to request member access
# Example Request:
# POST /groups
=======
desc 'Create a group. Available only for users who can create groups.' do
success Entities::Group
end
......@@ -65,15 +52,12 @@ module API
requires :path, type: String, desc: 'The path of the group'
use :optional_params
end
>>>>>>> ce-dev/master
post do
authorize! :create_group
<<<<<<< HEAD
attrs = attributes_for_keys [:name, :path, :description, :visibility_level, :membership_lock, :share_with_group_lock, :lfs_enabled, :request_access_enabled]
@group = Group.new(attrs)
group = ::Groups::CreateService.new(current_user, declared_params(include_missing: false)).execute
if @group.save
if group.persisted?
# NOTE: add backwards compatibility for single ldap link
ldap_attrs = attributes_for_keys [:ldap_cn, :ldap_access]
if ldap_attrs.present?
......@@ -83,36 +67,13 @@ module API
})
end
@group.add_owner(current_user)
present @group, with: Entities::Group
=======
group = ::Groups::CreateService.new(current_user, declared_params(include_missing: false)).execute
if group.persisted?
present group, with: Entities::Group
>>>>>>> ce-dev/master
else
render_api_error!("Failed to save group #{group.errors.messages}", 400)
end
end
end
<<<<<<< HEAD
# Update group. Available only for users who can manage this group.
#
# Parameters:
# id (required) - The ID of a group
# name (optional) - The name of the group
# path (optional) - The path of the group
# description (optional) - The details of the group
# visibility_level (optional) - The visibility level of the group
# lfs_enabled (optional) - Enable/disable LFS for the projects in this group
# membership_lock (optional, boolean) - Prevent adding new members to project membership within this group
# share_with_group_lock (optional, boolean) - Prevent sharing a project with another group within this group
# request_access_enabled (optional) - Allow users to request member access
# Example Request:
# PUT /groups/:id
=======
params do
requires :id, type: String, desc: 'The ID of a group'
end
......@@ -127,18 +88,11 @@ module API
at_least_one_of :name, :path, :description, :visibility_level,
:lfs_enabled, :request_access_enabled
end
>>>>>>> ce-dev/master
put ':id' do
group = find_group(params[:id])
authorize! :admin_group, group
<<<<<<< HEAD
attrs = attributes_for_keys [:name, :path, :description, :visibility_level, :membership_lock, :share_with_group_lock, :lfs_enabled, :request_access_enabled]
if ::Groups::UpdateService.new(group, current_user, attrs).execute
=======
if ::Groups::UpdateService.new(group, current_user, declared_params(include_missing: false)).execute
>>>>>>> ce-dev/master
present group, with: Entities::GroupDetail
else
render_validation_error!(group)
......
......@@ -52,6 +52,14 @@ module API
:push_code
]
end
def log_user_activity(actor)
commands = Gitlab::GitAccess::DOWNLOAD_COMMANDS +
Gitlab::GitAccess::PUSH_COMMANDS +
Gitlab::GitAccess::GIT_ANNEX_COMMANDS
::Users::ActivityService.new(actor, 'Git SSH').execute if commands.include?(params[:action])
end
end
end
end
......@@ -16,53 +16,6 @@ module API
# ref - branch name
# forced_push - forced_push
# protocol - Git access protocol being used, e.g. HTTP or SSH
<<<<<<< HEAD
#
helpers do
def project_path
@project_path ||= begin
project_path = params[:project].sub(/\.git\z/, '')
Repository.remove_storage_from_path(project_path)
end
end
def wiki?
@wiki ||= project_path.end_with?('.wiki') &&
!Project.find_with_namespace(project_path)
end
def project
@project ||= begin
# Check for *.wiki repositories.
# Strip out the .wiki from the pathname before finding the
# project. This applies the correct project permissions to
# the wiki repository as well.
project_path.chomp!('.wiki') if wiki?
Project.find_with_namespace(project_path)
end
end
def ssh_authentication_abilities
[
:read_project,
:download_code,
:push_code
]
end
def log_user_activity(actor)
commands = Gitlab::GitAccess::DOWNLOAD_COMMANDS +
Gitlab::GitAccess::PUSH_COMMANDS +
Gitlab::GitAccess::GIT_ANNEX_COMMANDS
::Users::ActivityService.new(actor, 'Git SSH').execute if commands.include?(params[:action])
end
end
=======
>>>>>>> ce-dev/master
post "/allowed" do
status 200
......
......@@ -28,6 +28,7 @@ module API
optional :assignee_id, type: Integer, desc: 'The ID of a user to assign the merge request'
optional :milestone_id, type: Integer, desc: 'The ID of a milestone to assign the merge request'
optional :labels, type: String, desc: 'Comma-separated list of label names'
optional :approvals_before_merge, type: Integer, desc: 'Number of approvals required before this can be merged'
end
end
......@@ -63,30 +64,6 @@ module API
present paginate(merge_requests), with: Entities::MergeRequest, current_user: current_user
end
<<<<<<< HEAD
# Create MR
#
# Parameters:
#
# id (required) - The ID of a project - this will be the source of the merge request
# source_branch (required) - The source branch
# target_branch (required) - The target branch
# target_project_id (optional) - The target project of the merge request defaults to the :id of the project
# assignee_id (optional) - Assignee user ID
# title (required) - Title of MR
# description (optional) - Description of MR
# labels (optional) - Labels for MR as a comma-separated list
# milestone_id (optional) - Milestone ID
# approvals_before_merge (optional) - Number of approvals required before this can be merged
#
# Example:
# POST /projects/:id/merge_requests
#
post ":id/merge_requests" do
authorize! :create_merge_request, user_project
required_attributes! [:source_branch, :target_branch, :title]
attrs = attributes_for_keys [:source_branch, :target_branch, :assignee_id, :title, :target_project_id, :description, :milestone_id, :approvals_before_merge]
=======
desc 'Create a merge request' do
success Entities::MergeRequest
end
......@@ -102,7 +79,6 @@ module API
authorize! :create_merge_request, user_project
mr_params = declared_params
>>>>>>> ce-dev/master
# Validate label names in advance
if (errors = validate_label_params(mr_params)).any?
......@@ -176,7 +152,7 @@ module API
desc: 'Status of the merge request'
use :optional_params
at_least_one_of :title, :target_branch, :description, :assignee_id,
:milestone_id, :labels, :state_event
:milestone_id, :labels, :state_event, :approvals_before_merge
end
put path do
merge_request = user_project.merge_requests.find(params.delete(:merge_request_id))
......
......@@ -16,7 +16,6 @@ FactoryGirl.define do
visibility_level Gitlab::VisibilityLevel::PRIVATE
end
<<<<<<< HEAD
factory :group_with_members do
after(:create) do |group, evaluator|
group.add_developer(create :user)
......@@ -38,10 +37,10 @@ FactoryGirl.define do
provider: evaluator.provider
)
end
=======
end
trait :access_requestable do
request_access_enabled true
>>>>>>> ce-dev/master
end
end
end
......@@ -24,7 +24,6 @@ FactoryGirl.define do
visibility_level Gitlab::VisibilityLevel::PRIVATE
end
<<<<<<< HEAD
trait :import_started do
import_url FFaker::Internet.uri('http')
import_status :started
......@@ -40,10 +39,10 @@ FactoryGirl.define do
mirror true
mirror_user_id { creator_id }
=======
end
trait :access_requestable do
request_access_enabled true
>>>>>>> ce-dev/master
end
trait :empty_repo do
......
......@@ -6,39 +6,6 @@ describe SearchHelper do
str
end
<<<<<<< HEAD
describe 'parsing result' do
let(:project) { create(:project) }
let(:repository) { project.repository }
let(:results) { repository.search_files('feature', 'master') }
let(:search_result) { results.first }
subject { helper.parse_search_result(search_result) }
it "returns a valid OpenStruct object" do
is_expected.to be_an OpenStruct
expect(subject.filename).to eq('CHANGELOG')
expect(subject.basename).to eq('CHANGELOG')
expect(subject.ref).to eq('master')
expect(subject.startline).to eq(188)
expect(subject.data.lines[2]).to eq(" - Feature: Replace teams with group membership\n")
end
context "when filename has extension" do
let(:search_result) { "master:CONTRIBUTE.md:5:- [Contribute to GitLab](#contribute-to-gitlab)\n" }
it { expect(subject.filename).to eq('CONTRIBUTE.md') }
it { expect(subject.basename).to eq('CONTRIBUTE') }
end
context "when file under directory" do
let(:search_result) { "master:a/b/c.md:5:a b c\n" }
it { expect(subject.filename).to eq('a/b/c.md') }
it { expect(subject.basename).to eq('a/b/c') }
end
end
describe '#parse_search_result_from_elastic' do
before do
stub_application_setting(elasticsearch_search: true, elasticsearch_indexing: true)
......@@ -72,8 +39,6 @@ describe SearchHelper do
end
end
=======
>>>>>>> ce-dev/master
describe 'search_autocomplete_source' do
context "with no current user" do
before do
......
......@@ -1699,7 +1699,6 @@ describe Repository, models: true do
end.to raise_error(Repository::CommitError)
end
end
<<<<<<< HEAD
describe '#remove_storage_from_path' do
let(:storage_path) { project.repository_storage_path }
......@@ -1715,6 +1714,4 @@ describe Repository, models: true do
rugged = repository.rugged
rugged.references.create("refs/remotes/#{remote_name}/#{branch_name}", target.id)
end
=======
>>>>>>> ce-dev/master
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