Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
72273d3d
Commit
72273d3d
authored
Oct 05, 2018
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove dead code on main MR page
parent
e13a3c71
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
29 deletions
+6
-29
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+0
-6
app/helpers/notes_helper.rb
app/helpers/notes_helper.rb
+1
-1
changelogs/unreleased/osw-remove-dead-code-on-mr-show.yml
changelogs/unreleased/osw-remove-dead-code-on-mr-show.yml
+5
-0
spec/controllers/projects/merge_requests_controller_spec.rb
spec/controllers/projects/merge_requests_controller_spec.rb
+0
-22
No files found.
app/controllers/projects/merge_requests_controller.rb
View file @
72273d3d
...
...
@@ -44,12 +44,6 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
@noteable
=
@merge_request
@commits_count
=
@merge_request
.
commits_count
# TODO cleanup- Fatih Simon Create an issue to remove these after the refactoring
# we no longer render notes here. I see it will require a small frontend refactoring,
# since we gather some data from this collection.
@discussions
=
@merge_request
.
discussions
@notes
=
prepare_notes_for_rendering
(
@discussions
.
flat_map
(
&
:notes
),
@noteable
)
labels
set_pipeline_variables
...
...
app/helpers/notes_helper.rb
View file @
72273d3d
...
...
@@ -142,7 +142,7 @@ module NotesHelper
def
initial_notes_data
(
autocomplete
)
{
notesUrl:
notes_url
,
notesIds:
@note
s
.
map
(
&
:id
),
notesIds:
@note
able
.
notes
.
pluck
(
:id
),
# rubocop: disable CodeReuse/ActiveRecord
now:
Time
.
now
.
to_i
,
diffView:
diff_view
,
enableGFM:
{
...
...
changelogs/unreleased/osw-remove-dead-code-on-mr-show.yml
0 → 100644
View file @
72273d3d
---
title
:
Removes expensive dead code on main MR page request
merge_request
:
22153
author
:
type
:
performance
spec/controllers/projects/merge_requests_controller_spec.rb
View file @
72273d3d
...
...
@@ -76,28 +76,6 @@ describe Projects::MergeRequestsController do
expect
(
response
).
to
be_success
end
context
"loads notes"
do
let
(
:first_contributor
)
{
create
(
:user
)
}
let
(
:contributor
)
{
create
(
:user
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
author:
first_contributor
,
target_project:
project
,
source_project:
project
)
}
let
(
:contributor_merge_request
)
{
create
(
:merge_request
,
:merged
,
author:
contributor
,
target_project:
project
,
source_project:
project
)
}
# the order here is important
# as the controller reloads these from DB, references doesn't correspond after
let!
(
:first_contributor_note
)
{
create
(
:note
,
author:
first_contributor
,
noteable:
merge_request
,
project:
project
)
}
let!
(
:contributor_note
)
{
create
(
:note
,
author:
contributor
,
noteable:
merge_request
,
project:
project
)
}
let!
(
:owner_note
)
{
create
(
:note
,
author:
user
,
noteable:
merge_request
,
project:
project
)
}
it
"with special_role FIRST_TIME_CONTRIBUTOR"
do
go
(
format: :html
)
notes
=
assigns
(
:notes
)
expect
(
notes
).
to
match
(
a_collection_containing_exactly
(
an_object_having_attributes
(
special_role:
Note
::
SpecialRole
::
FIRST_TIME_CONTRIBUTOR
),
an_object_having_attributes
(
special_role:
nil
),
an_object_having_attributes
(
special_role:
nil
)
))
end
end
context
"that is invalid"
do
let
(
:merge_request
)
{
create
(
:invalid_merge_request
,
target_project:
project
,
source_project:
project
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment