Commit 0603cfbb authored by Valery Sizov's avatar Valery Sizov

Resolve a bunch of conflicts

parent 6a733664
......@@ -25,12 +25,10 @@ class Projects::DeployKeysController < Projects::ApplicationController
unless @key.valid? && @project.deploy_keys << @key
flash[:alert] = @key.errors.full_messages.join(', ').html_safe
<<<<<<< HEAD
else
log_audit_event(@key.title, action: :create)
=======
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
end
redirect_to_repository_settings(@project)
end
......@@ -51,17 +49,12 @@ class Projects::DeployKeysController < Projects::ApplicationController
load_key
deploy_key_project.destroy!
<<<<<<< HEAD
log_audit_event(@key.title, action: :destroy)
redirect_to_repository_settings(@project)
=======
respond_to do |format|
format.html { redirect_to_repository_settings(@project) }
format.json { head :ok }
end
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
end
protected
......
......@@ -291,11 +291,7 @@ class Projects::IssuesController < Projects::ApplicationController
def issue_params
params.require(:issue).permit(
<<<<<<< HEAD
:title, :position, :description, :confidential, :weight,
=======
:title, :assignee_id, :position, :description, :confidential,
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
:milestone_id, :due_date, :state_event, :task_num, :lock_version, label_ids: [], assignee_ids: [],
)
end
......
......@@ -7,7 +7,6 @@ class IssueAssignee < ActiveRecord::Base
after_create :update_assignee_cache_counts
after_destroy :update_assignee_cache_counts
<<<<<<< HEAD
# EE-specific
after_create :update_elasticsearch_index
after_destroy :update_elasticsearch_index
......@@ -27,9 +26,4 @@ class IssueAssignee < ActiveRecord::Base
)
end
end
=======
def update_assignee_cache_counts
assignee&.update_cache_counts
end
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
end
......@@ -125,10 +125,7 @@ class MergeRequest < ActiveRecord::Base
scope :unassigned, -> { where("assignee_id IS NULL") }
scope :assigned_to, ->(u) { where(assignee_id: u.id)}
<<<<<<< HEAD
participant :approvers_left
=======
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
participant :assignee
after_save :keep_around_commit
......
class MergeRequestEntity < IssuableEntity
<<<<<<< HEAD
expose :approvals_before_merge
=======
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
expose :assignee_id
expose :in_progress_merge_commit_sha
expose :locked_at
......
......@@ -24,12 +24,6 @@ module Issues
def filter_assignee(issuable)
return if params[:assignee_ids].blank?
<<<<<<< HEAD
=======
# The number of assignees is limited by one for GitLab CE
params[:assignee_ids] = params[:assignee_ids][0, 1]
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
assignee_ids = params[:assignee_ids].select { |assignee_id| assignee_can_read?(issuable, assignee_id) }
if params[:assignee_ids].map(&:to_s) == [IssuableFinder::NONE]
......
......@@ -76,21 +76,14 @@ class NotificationService
previous_assignee: previous_assignees
)
<<<<<<< HEAD
=======
previous_assignee_ids = previous_assignees.map(&:id)
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
recipients.each do |recipient|
mailer.send(
:reassigned_issue_email,
recipient.id,
issue.id,
<<<<<<< HEAD
previous_assignees.map(&:id),
=======
previous_assignee_ids,
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
current_user.id
).deliver_later
end
......
......@@ -100,7 +100,6 @@ module SlashCommands
end
parse_params do |assignee_param|
users = extract_references(assignee_param, :user)
<<<<<<< HEAD
if users.empty?
users = User.where(username: assignee_param.split(' ').map(&:strip))
......@@ -111,18 +110,6 @@ module SlashCommands
command :assign do |users|
next if users.empty?
=======
if users.empty?
users = User.where(username: assignee_param.split(' ').map(&:strip))
end
users
end
command :assign do |users|
next if users.empty?
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
if issuable.is_a?(Issue)
@updates[:assignee_ids] = users.map(&:id)
else
......@@ -132,11 +119,7 @@ module SlashCommands
desc 'Remove assignee'
explanation do
<<<<<<< HEAD
"Removes assignee #{issuable.assignee.to_reference}."
=======
"Removes assignee #{issuable.assignees.first.to_reference}."
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
end
condition do
issuable.persisted? &&
......@@ -516,21 +499,12 @@ module SlashCommands
def find_label_ids(labels_param)
find_labels(labels_param).map(&:id)
end
<<<<<<< HEAD
def explain_commands(commands, opts)
commands.map do |name, arg|
definition = self.class.definition_by_name(name)
next unless definition
=======
def explain_commands(commands, opts)
commands.map do |name, arg|
definition = self.class.definition_by_name(name)
next unless definition
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
definition.explain(self, opts, arg)
end.compact
end
......
......@@ -84,11 +84,7 @@ module SystemNoteService
"assigned to #{issue.assignees.map(&:to_reference).to_sentence}"
end
<<<<<<< HEAD
create_note(noteable: issue, project: project, author: author, note: body)
=======
create_note(NoteSummary.new(issue, project, author, body, action: 'assignee'))
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
end
# Called when one or more labels on a Noteable are added and/or removed
......
......@@ -26,11 +26,6 @@ xml.entry do
if issue.assignees.any?
xml.assignees do
issue.assignees.each do |assignee|
<<<<<<< HEAD
xml.name assignee.name
xml.email assignee.public_email
end
=======
xml.assignee do
xml.name assignee.name
xml.email assignee.public_email
......@@ -41,7 +36,6 @@ xml.entry do
xml.assignee do
xml.name issue.assignees.first.name
xml.email issue.assignees.first.public_email
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
end
end
end
......@@ -26,11 +26,7 @@ class CreateIssueAssigneesTable < ActiveRecord::Migration
# disable_ddl_transaction!
def up
<<<<<<< HEAD
create_table :issue_assignees, id: false do |t|
=======
create_table :issue_assignees do |t|
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
t.references :user, foreign_key: { on_delete: :cascade }, index: true, null: false
t.references :issue, foreign_key: { on_delete: :cascade }, null: false
end
......
......@@ -168,12 +168,8 @@ module API
optional :state_event, type: String, values: %w[reopen close], desc: 'State of the issue'
use :issue_params
at_least_one_of :title, :description, :assignee_ids, :assignee_id, :milestone_id,
<<<<<<< HEAD
:labels, :created_at, :due_date, :confidential, :state_event,
:weight
=======
:labels, :created_at, :due_date, :confidential, :state_event
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
end
put ':id/issues/:issue_iid' do
issue = user_project.issues.find_by!(iid: params.delete(:issue_iid))
......
......@@ -63,10 +63,6 @@ module API
end
get do
issues = find_issues(scope: 'authored')
<<<<<<< HEAD
=======
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
present paginate(issues), with: ::API::V3::Entities::Issue, current_user: current_user
end
end
......
......@@ -87,13 +87,10 @@ excluded_attributes:
- :last_activity_at
- :last_repository_updated_at
- :last_repository_check_at
<<<<<<< HEAD
- :mirror_last_update_at
- :mirror_last_successful_update_at
- :mirror_user_id
- :mirror_trigger_builds
=======
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
snippets:
- :expired_at
merge_request_diff:
......
......@@ -22,12 +22,8 @@ describe 'Issues Feed', feature: true do
to have_content('application/atom+xml')
expect(body).to have_selector('title', text: "#{project.name} issues")
expect(body).to have_selector('author email', text: issue.author_public_email)
<<<<<<< HEAD
expect(body).to have_selector('assignees email', text: issue.author_public_email)
=======
expect(body).to have_selector('assignees assignee email', text: issue.assignees.first.public_email)
expect(body).to have_selector('assignee email', text: issue.assignees.first.public_email)
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
expect(body).to have_selector('entry summary', text: issue.title)
end
end
......@@ -41,12 +37,8 @@ describe 'Issues Feed', feature: true do
to have_content('application/atom+xml')
expect(body).to have_selector('title', text: "#{project.name} issues")
expect(body).to have_selector('author email', text: issue.author_public_email)
<<<<<<< HEAD
expect(body).to have_selector('assignees email', text: issue.author_public_email)
=======
expect(body).to have_selector('assignees assignee email', text: issue.assignees.first.public_email)
expect(body).to have_selector('assignee email', text: issue.assignees.first.public_email)
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
expect(body).to have_selector('entry summary', text: issue.title)
end
end
......
......@@ -18,11 +18,8 @@ describe 'Navigation bar counter', feature: true, caching: true do
expect_counters('issues', '1')
issue.assignees = []
<<<<<<< HEAD
=======
user.update_cache_counts
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
Timecop.travel(3.minutes.from_now) do
visit issues_path
......
......@@ -507,7 +507,6 @@ describe 'Issues', feature: true do
visit namespace_project_issue_path(project.namespace, project, issue)
expect(page).to have_content issue.assignees.first.name
<<<<<<< HEAD
end
end
end
......@@ -529,8 +528,6 @@ describe 'Issues', feature: true do
page.within('.value') do
expect(page).to have_content "1"
end
=======
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
end
end
end
......
require 'spec_helper'
describe IssuesFinder do
<<<<<<< HEAD
let(:user) { create(:user) }
let(:user2) { create(:user) }
let(:project1) { create(:empty_project) }
let(:project2) { create(:empty_project) }
let(:milestone) { create(:milestone, project: project1) }
let(:label) { create(:label, project: project2) }
let(:issue1) { create(:issue, author: user, assignees: [user], project: project1, milestone: milestone, title: 'gitlab') }
let(:issue2) { create(:issue, author: user, assignees: [user], project: project2, description: 'gitlab') }
let(:issue3) { create(:issue, author: user2, assignees: [user2], project: project2, title: 'tanuki', description: 'tanuki') }
describe '#execute' do
let(:closed_issue) { create(:issue, author: user2, assignees: [user2], project: project2, state: 'closed') }
let!(:label_link) { create(:label_link, label: label, target: issue2) }
=======
set(:user) { create(:user) }
set(:user2) { create(:user) }
set(:project1) { create(:empty_project) }
......@@ -29,7 +14,6 @@ describe IssuesFinder do
describe '#execute' do
set(:closed_issue) { create(:issue, author: user2, assignees: [user2], project: project2, state: 'closed') }
set(:label_link) { create(:label_link, label: label, target: issue2) }
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
let(:search_user) { user }
let(:params) { {} }
let(:issues) { described_class.new(search_user, params.reverse_merge(scope: scope, state: 'opened')).execute }
......
......@@ -188,7 +188,6 @@ describe Group, models: true do
let(:avatar_path) { "/uploads/group/avatar/#{group.id}/dk.png" }
it { should eq "http://#{Gitlab.config.gitlab.host}#{avatar_path}" }
<<<<<<< HEAD
context 'when in a geo secondary node' do
let(:geo_url) { 'http://geo.example.com' }
......@@ -200,8 +199,6 @@ describe Group, models: true do
it { should eq "#{geo_url}#{avatar_path}" }
end
=======
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
end
end
......
......@@ -971,7 +971,6 @@ describe Project, models: true do
context 'when avatar file is uploaded' do
let(:project) { create(:empty_project, :with_avatar) }
let(:avatar_path) { "/uploads/project/avatar/#{project.id}/dk.png" }
<<<<<<< HEAD
it { should eq "http://#{Gitlab.config.gitlab.host}#{avatar_path}" }
......@@ -985,10 +984,6 @@ describe Project, models: true do
it { should eq "#{geo_url}#{avatar_path}" }
end
=======
it { should eq "http://#{Gitlab.config.gitlab.host}#{avatar_path}" }
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
end
context 'When avatar file in git' do
......
......@@ -906,7 +906,6 @@ describe User, models: true do
let(:avatar_path) { "/uploads/user/avatar/#{user.id}/dk.png" }
it { should eq "http://#{Gitlab.config.gitlab.host}#{avatar_path}" }
<<<<<<< HEAD
context 'when in a geo secondary node' do
let(:geo_url) { 'http://geo.example.com' }
......@@ -918,8 +917,6 @@ describe User, models: true do
it { should eq "#{geo_url}#{avatar_path}" }
end
=======
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
end
end
......
......@@ -773,20 +773,6 @@ describe API::Issues do
end
end
<<<<<<< HEAD
=======
context 'CE restrictions' do
it 'creates a new project issue with no more than one assignee' do
post api("/projects/#{project.id}/issues", user),
title: 'new issue', assignee_ids: [user2.id, guest.id]
expect(response).to have_http_status(201)
expect(json_response['title']).to eq('new issue')
expect(json_response['assignees'].count).to eq(1)
end
end
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
it 'creates a new project issue' do
post api("/projects/#{project.id}/issues", user),
title: 'new issue', labels: 'label, label2', weight: 3,
......@@ -797,10 +783,7 @@ describe API::Issues do
expect(json_response['description']).to be_nil
expect(json_response['labels']).to eq(%w(label label2))
expect(json_response['confidential']).to be_falsy
<<<<<<< HEAD
expect(json_response['weight']).to eq(3)
=======
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
expect(json_response['assignee']['name']).to eq(user2.name)
expect(json_response['assignees'].first['name']).to eq(user2.name)
end
......@@ -1130,20 +1113,6 @@ describe API::Issues do
expect(json_response['assignees'].first['name']).to eq(user2.name)
end
<<<<<<< HEAD
=======
context 'CE restrictions' do
it 'updates an issue with several assignee but only one has been applied' do
put api("/projects/#{project.id}/issues/#{issue.iid}", user),
assignee_ids: [user2.id, guest.id]
expect(response).to have_http_status(200)
expect(json_response['assignees'].size).to eq(1)
end
end
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
end
describe 'PUT /projects/:id/issues/:issue_iid to update labels' do
......
......@@ -738,21 +738,14 @@ describe API::V3::Issues do
describe "POST /projects/:id/issues" do
it 'creates a new project issue' do
post v3_api("/projects/#{project.id}/issues", user),
<<<<<<< HEAD
title: 'new issue', labels: 'label, label2', weight: 3, assignee_id: assignee.id
=======
title: 'new issue', labels: 'label, label2', assignee_id: assignee.id
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
expect(response).to have_http_status(201)
expect(json_response['title']).to eq('new issue')
expect(json_response['description']).to be_nil
expect(json_response['labels']).to eq(%w(label label2))
expect(json_response['confidential']).to be_falsy
<<<<<<< HEAD
expect(json_response['weight']).to eq(3)
=======
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
expect(json_response['assignee']['name']).to eq(assignee.name)
end
......@@ -1166,7 +1159,6 @@ describe API::V3::Issues do
end
end
<<<<<<< HEAD
describe 'PUT /projects/:id/issues/:issue_id to update weight' do
it 'updates an issue with no weight' do
put v3_api("/projects/#{project.id}/issues/#{issue.id}", user), weight: 5
......@@ -1199,8 +1191,6 @@ describe API::V3::Issues do
end
end
=======
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
describe "DELETE /projects/:id/issues/:issue_id" do
it "rejects a non member from deleting an issue" do
delete v3_api("/projects/#{project.id}/issues/#{issue.id}", non_member)
......
......@@ -40,11 +40,7 @@ describe Issues::UpdateService, services: true do
{
title: 'New title',
description: 'Also please fix',
<<<<<<< HEAD
assignee_ids: [user2.id, user3.id],
=======
assignee_ids: [user2.id],
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
state_event: 'close',
label_ids: [label.id],
due_date: Date.tomorrow
......@@ -57,11 +53,7 @@ describe Issues::UpdateService, services: true do
expect(issue).to be_valid
expect(issue.title).to eq 'New title'
expect(issue.description).to eq 'Also please fix'
<<<<<<< HEAD
expect(issue.assignees).to match_array([user2, user3])
=======
expect(issue.assignees).to match_array([user2])
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
expect(issue).to be_closed
expect(issue.labels).to match_array [label]
expect(issue.due_date).to eq Date.tomorrow
......
......@@ -901,11 +901,7 @@ describe SlashCommands::InterpretService, services: true do
describe 'unassign command' do
let(:content) { '/unassign' }
<<<<<<< HEAD
let(:issue) { create(:issue, project: project, assignee: developer) }
=======
let(:issue) { create(:issue, project: project, assignees: [developer]) }
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
it 'includes current assignee reference' do
_, explanations = service.explain(content, issue)
......@@ -1063,7 +1059,6 @@ describe SlashCommands::InterpretService, services: true do
expect(explanations).to eq(["Moves issue to ~#{bug.id} column in the board."])
end
end
<<<<<<< HEAD
# EE-specific tests
......@@ -1075,7 +1070,5 @@ describe SlashCommands::InterpretService, services: true do
expect(explanations).to eq(['Sets weight to 4.'])
end
end
=======
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
end
end
......@@ -164,13 +164,9 @@ describe SystemNoteService, services: true do
let(:assignee2) { create(:user) }
let(:assignee3) { create(:user) }
<<<<<<< HEAD
it_behaves_like 'a system note'
=======
it_behaves_like 'a system note' do
let(:action) { 'assignee' }
end
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
def build_note(old_assignees, new_assignees)
issue.assignees = new_assignees
......
......@@ -97,7 +97,6 @@ describe PostReceive do
it "fetches the correct project" do
expect(Project).to receive(:find_by).with(id: project.id.to_s)
described_class.new.perform(project_identifier, key_id, base64_changes)
<<<<<<< HEAD
end
it "triggers wiki index update" do
......@@ -109,8 +108,6 @@ describe PostReceive do
repo_path = "#{pwd(project)}.wiki"
described_class.new.perform(repo_path, key_id, base64_changes)
=======
>>>>>>> 6ce1df41e175c7d62ca760b1e66cf1bf86150284
end
it "does not run if the author is not in the project" do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment