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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
ef4b3a39
Commit
ef4b3a39
authored
Aug 28, 2017
by
Ashley Dumaine
Committed by
Sean McGivern
Sep 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add functionality to collapse outdated diff comments regardless of discussion resolution
parent
446c7fc6
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
74 additions
and
4 deletions
+74
-4
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+1
-0
app/models/diff_discussion.rb
app/models/diff_discussion.rb
+8
-0
app/models/project.rb
app/models/project.rb
+1
-0
app/views/projects/_merge_request_merge_settings.html.haml
app/views/projects/_merge_request_merge_settings.html.haml
+4
-0
changelogs/unreleased/36994-toggle-for-automatically-collapsing-outdated-diff-comments.yml
...e-for-automatically-collapsing-outdated-diff-comments.yml
+6
-0
db/migrate/20170825154015_collapse_outdated_diff_comments.rb
db/migrate/20170825154015_collapse_outdated_diff_comments.rb
+18
-0
db/schema.rb
db/schema.rb
+1
-0
doc/api/projects.md
doc/api/projects.md
+12
-0
doc/user/discussions/img/automatically_collapse_outdated_diff_comments_regardless_of_discussion_resolution.png
...ted_diff_comments_regardless_of_discussion_resolution.png
+0
-0
doc/user/discussions/index.md
doc/user/discussions/index.md
+13
-0
lib/api/entities.rb
lib/api/entities.rb
+1
-0
lib/api/projects.rb
lib/api/projects.rb
+2
-0
lib/api/v3/entities.rb
lib/api/v3/entities.rb
+1
-0
lib/api/v3/projects.rb
lib/api/v3/projects.rb
+4
-3
spec/lib/gitlab/background_migration/migrate_events_to_push_event_payloads_spec.rb
...d_migration/migrate_events_to_push_event_payloads_spec.rb
+1
-1
spec/lib/gitlab/import_export/safe_model_attributes.yml
spec/lib/gitlab/import_export/safe_model_attributes.yml
+1
-0
No files found.
app/controllers/projects_controller.rb
View file @
ef4b3a39
...
...
@@ -323,6 +323,7 @@ class ProjectsController < Projects::ApplicationController
:build_allow_git_fetch
,
:build_coverage_regex
,
:build_timeout_in_minutes
,
:collapse_outdated_diff_comments
,
:container_registry_enabled
,
:default_branch
,
:description
,
...
...
app/models/diff_discussion.rb
View file @
ef4b3a39
...
...
@@ -18,6 +18,14 @@ class DiffDiscussion < Discussion
false
end
def
collapsed?
resolved?
||
(
project
.
collapse_outdated_diff_comments
&&
!
active?
)
end
def
expanded?
!
collapsed?
end
def
merge_request_version_params
return
unless
for_merge_request?
return
{}
if
active?
...
...
app/models/project.rb
View file @
ef4b3a39
...
...
@@ -37,6 +37,7 @@ class Project < ActiveRecord::Base
default_value_for
:archived
,
false
default_value_for
:visibility_level
,
gitlab_config_features
.
visibility_level
default_value_for
:collapse_outdated_diff_comments
,
false
default_value_for
:container_registry_enabled
,
gitlab_config_features
.
container_registry
default_value_for
(
:repository_storage
)
{
current_application_settings
.
pick_repository_storage
}
default_value_for
(
:shared_runners_enabled
)
{
current_application_settings
.
shared_runners_enabled
}
...
...
app/views/projects/_merge_request_merge_settings.html.haml
View file @
ef4b3a39
...
...
@@ -17,3 +17,7 @@
=
form
.
label
:printing_merge_request_link_enabled
do
=
form
.
check_box
:printing_merge_request_link_enabled
%strong
Show link to create/view merge request when pushing from the command line
.checkbox
=
form
.
label
:collapse_outdated_diff_comments
do
=
form
.
check_box
:collapse_outdated_diff_comments
%strong
Collapse outdated diffs regardless of discussion resolution
changelogs/unreleased/36994-toggle-for-automatically-collapsing-outdated-diff-comments.yml
0 → 100644
View file @
ef4b3a39
---
title
:
Add repository toggle for automatically collapsing outdated diff comments regardless
of discussion resolution
merge_request
:
author
:
type
:
added
db/migrate/20170825154015_collapse_outdated_diff_comments.rb
0 → 100644
View file @
ef4b3a39
# rubocop:disable Migration/AddColumnWithDefaultToLargeTable
class
CollapseOutdatedDiffComments
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
add_column_with_default
(
:projects
,
:collapse_outdated_diff_comments
,
:boolean
,
default:
false
)
end
def
down
remove_column
(
:projects
,
:collapse_outdated_diff_comments
)
end
end
db/schema.rb
View file @
ef4b3a39
...
...
@@ -1202,6 +1202,7 @@ ActiveRecord::Schema.define(version: 20170901071411) do
t
.
boolean
"public_builds"
,
default:
true
,
null:
false
t
.
boolean
"last_repository_check_failed"
t
.
datetime
"last_repository_check_at"
t
.
boolean
"collapse_outdated_diff_comments"
,
default:
false
,
null:
false
t
.
boolean
"container_registry_enabled"
t
.
boolean
"only_allow_merge_if_pipeline_succeeds"
,
default:
false
,
null:
false
t
.
boolean
"has_external_issue_tracker"
...
...
doc/api/projects.md
View file @
ef4b3a39
...
...
@@ -70,6 +70,7 @@ Parameters:
"jobs_enabled"
:
true
,
"wiki_enabled"
:
true
,
"snippets_enabled"
:
false
,
"collapse_outdated_diff_comments"
:
false
,
"container_registry_enabled"
:
false
,
"created_at"
:
"2013-09-30T13:46:02Z"
,
"last_activity_at"
:
"2013-09-30T13:46:02Z"
,
...
...
@@ -137,6 +138,7 @@ Parameters:
"jobs_enabled"
:
true
,
"wiki_enabled"
:
true
,
"snippets_enabled"
:
false
,
"collapse_outdated_diff_comments"
:
false
,
"container_registry_enabled"
:
false
,
"created_at"
:
"2013-09-30T13:46:02Z"
,
"last_activity_at"
:
"2013-09-30T13:46:02Z"
,
...
...
@@ -246,6 +248,7 @@ Parameters:
"jobs_enabled"
:
true
,
"wiki_enabled"
:
true
,
"snippets_enabled"
:
false
,
"collapse_outdated_diff_comments"
:
false
,
"container_registry_enabled"
:
false
,
"created_at"
:
"2013-09-30T13:46:02Z"
,
"last_activity_at"
:
"2013-09-30T13:46:02Z"
,
...
...
@@ -313,6 +316,7 @@ Parameters:
"jobs_enabled"
:
true
,
"wiki_enabled"
:
true
,
"snippets_enabled"
:
false
,
"collapse_outdated_diff_comments"
:
false
,
"container_registry_enabled"
:
false
,
"created_at"
:
"2013-09-30T13:46:02Z"
,
"last_activity_at"
:
"2013-09-30T13:46:02Z"
,
...
...
@@ -411,6 +415,7 @@ Parameters:
"jobs_enabled"
:
true
,
"wiki_enabled"
:
true
,
"snippets_enabled"
:
false
,
"collapse_outdated_diff_comments"
:
false
,
"container_registry_enabled"
:
false
,
"created_at"
:
"2013-09-30T13:46:02Z"
,
"last_activity_at"
:
"2013-09-30T13:46:02Z"
,
...
...
@@ -537,6 +542,7 @@ Parameters:
|
`jobs_enabled`
| boolean | no | Enable jobs for this project |
|
`wiki_enabled`
| boolean | no | Enable wiki for this project |
|
`snippets_enabled`
| boolean | no | Enable snippets for this project |
|
`collapse_outdated_diff_comments`
| boolean | no | Collapse outdated diffs regardless of discussion resolution |
|
`container_registry_enabled`
| boolean | no | Enable container registry for this project |
|
`shared_runners_enabled`
| boolean | no | Enable shared runners for this project |
|
`visibility`
| string | no | See
[
project visibility level
](
#project-visibility-level
)
|
...
...
@@ -574,6 +580,7 @@ Parameters:
|
`jobs_enabled`
| boolean | no | Enable jobs for this project |
|
`wiki_enabled`
| boolean | no | Enable wiki for this project |
|
`snippets_enabled`
| boolean | no | Enable snippets for this project |
|
`collapse_outdated_diff_comments`
| boolean | no | Collapse outdated diffs regardless of discussion resolution |
|
`container_registry_enabled`
| boolean | no | Enable container registry for this project |
|
`shared_runners_enabled`
| boolean | no | Enable shared runners for this project |
|
`visibility`
| string | no | See
[
project visibility level
](
#project-visibility-level
)
|
...
...
@@ -610,6 +617,7 @@ Parameters:
|
`jobs_enabled`
| boolean | no | Enable jobs for this project |
|
`wiki_enabled`
| boolean | no | Enable wiki for this project |
|
`snippets_enabled`
| boolean | no | Enable snippets for this project |
|
`collapse_outdated_diff_comments`
| boolean | no | Collapse outdated diffs regardless of discussion resolution |
|
`container_registry_enabled`
| boolean | no | Enable container registry for this project |
|
`shared_runners_enabled`
| boolean | no | Enable shared runners for this project |
|
`visibility`
| string | no | See
[
project visibility level
](
#project-visibility-level
)
|
...
...
@@ -683,6 +691,7 @@ Example response:
"jobs_enabled"
:
true
,
"wiki_enabled"
:
true
,
"snippets_enabled"
:
false
,
"collapse_outdated_diff_comments"
:
false
,
"container_registry_enabled"
:
false
,
"created_at"
:
"2013-09-30T13:46:02Z"
,
"last_activity_at"
:
"2013-09-30T13:46:02Z"
,
...
...
@@ -758,6 +767,7 @@ Example response:
"jobs_enabled"
:
true
,
"wiki_enabled"
:
true
,
"snippets_enabled"
:
false
,
"collapse_outdated_diff_comments"
:
false
,
"container_registry_enabled"
:
false
,
"created_at"
:
"2013-09-30T13:46:02Z"
,
"last_activity_at"
:
"2013-09-30T13:46:02Z"
,
...
...
@@ -839,6 +849,7 @@ Example response:
"jobs_enabled"
:
true
,
"wiki_enabled"
:
true
,
"snippets_enabled"
:
false
,
"collapse_outdated_diff_comments"
:
false
,
"container_registry_enabled"
:
false
,
"created_at"
:
"2013-09-30T13:46:02Z"
,
"last_activity_at"
:
"2013-09-30T13:46:02Z"
,
...
...
@@ -932,6 +943,7 @@ Example response:
"jobs_enabled"
:
true
,
"wiki_enabled"
:
true
,
"snippets_enabled"
:
false
,
"collapse_outdated_diff_comments"
:
false
,
"container_registry_enabled"
:
false
,
"created_at"
:
"2013-09-30T13:46:02Z"
,
"last_activity_at"
:
"2013-09-30T13:46:02Z"
,
...
...
doc/user/discussions/img/automatically_collapse_outdated_diff_comments_regardless_of_discussion_resolution.png
0 → 100644
View file @
ef4b3a39
127 KB
doc/user/discussions/index.md
View file @
ef4b3a39
...
...
@@ -116,6 +116,19 @@ are resolved.
![
Only allow merge if all the discussions are resolved message
](
img/only_allow_merge_if_all_discussions_are_resolved_msg.png
)
### Automatically collapse outdated diff comments regardless of discussion resolution
You can automatically collapse comments on outdated diffs regardless of whether
the discussion is resolved.
Navigate to your project's settings page, select the
**Collapse outdated diffs regardless of discussion resolution**
check box and hit
**Save**
for the changes to take effect.
![
Automatically collapse outdated diff comments regardless of discussion resolution
](
img/automatically_collapse_outdated_diff_comments_regardless_of_discussion_resolution.png
)
From now on, any discussions on an outdated diff will be collapsed by default.
## Threaded discussions
> [Introduced][ce-7527] in GitLab 9.1.
...
...
lib/api/entities.rb
View file @
ef4b3a39
...
...
@@ -119,6 +119,7 @@ module API
expose
:archived?
,
as: :archived
expose
:visibility
expose
:owner
,
using:
Entities
::
UserBasic
,
unless:
->
(
project
,
options
)
{
project
.
group
}
expose
:collapse_outdated_diff_comments
expose
:container_registry_enabled
# Expose old field names with the new permissions methods to keep API compatible
...
...
lib/api/projects.rb
View file @
ef4b3a39
...
...
@@ -16,6 +16,7 @@ module API
optional
:jobs_enabled
,
type:
Boolean
,
desc:
'Flag indication if jobs are enabled'
optional
:snippets_enabled
,
type:
Boolean
,
desc:
'Flag indication if snippets are enabled'
optional
:shared_runners_enabled
,
type:
Boolean
,
desc:
'Flag indication if shared runners are enabled for that project'
optional
:collapse_outdated_diff_comments
,
type:
Boolean
,
desc:
'Collapse outdated diffs regardless of discussion resolution'
optional
:container_registry_enabled
,
type:
Boolean
,
desc:
'Flag indication if the container registry is enabled for that project'
optional
:lfs_enabled
,
type:
Boolean
,
desc:
'Flag indication if Git LFS is enabled for that project'
optional
:visibility
,
type:
String
,
values:
Gitlab
::
VisibilityLevel
.
string_values
,
desc:
'The visibility of the project.'
...
...
@@ -236,6 +237,7 @@ module API
at_least_one_of_ce
=
[
:jobs_enabled
,
:collapse_outdated_diff_comments
,
:container_registry_enabled
,
:default_branch
,
:description
,
...
...
lib/api/v3/entities.rb
View file @
ef4b3a39
...
...
@@ -64,6 +64,7 @@ module API
expose
:owner
,
using:
::
API
::
Entities
::
UserBasic
,
unless:
->
(
project
,
options
)
{
project
.
group
}
expose
:name
,
:name_with_namespace
expose
:path
,
:path_with_namespace
expose
:collapse_outdated_diff_comments
expose
:container_registry_enabled
# Expose old field names with the new permissions methods to keep API compatible
...
...
lib/api/v3/projects.rb
View file @
ef4b3a39
...
...
@@ -18,6 +18,7 @@ module API
optional
:builds_enabled
,
type:
Boolean
,
desc:
'Flag indication if builds are enabled'
optional
:snippets_enabled
,
type:
Boolean
,
desc:
'Flag indication if snippets are enabled'
optional
:shared_runners_enabled
,
type:
Boolean
,
desc:
'Flag indication if shared runners are enabled for that project'
optional
:collapse_outdated_diff_comments
,
type:
Boolean
,
desc:
'Collapse outdated diffs regardless of discussion resolution'
optional
:container_registry_enabled
,
type:
Boolean
,
desc:
'Flag indication if the container registry is enabled for that project'
optional
:lfs_enabled
,
type:
Boolean
,
desc:
'Flag indication if Git LFS is enabled for that project'
optional
:public
,
type:
Boolean
,
desc:
'Create a public project. The same as visibility_level = 20.'
...
...
@@ -296,9 +297,9 @@ module API
use
:optional_params
at_least_one_of
:name
,
:description
,
:issues_enabled
,
:merge_requests_enabled
,
:wiki_enabled
,
:builds_enabled
,
:snippets_enabled
,
:shared_runners_enabled
,
:co
ntainer_registry_enabled
,
:
lfs_enabled
,
:public
,
:visibility_level
,
:public_builds
,
:request_access_enabled
,
:only_allow_merge_if_build_succeeds
,
:shared_runners_enabled
,
:co
llapse_outdated_diff_comments
,
:
container_registry_enabled
,
:lfs_enabled
,
:public
,
:visibility_level
,
:
public_builds
,
:
request_access_enabled
,
:only_allow_merge_if_build_succeeds
,
:only_allow_merge_if_all_discussions_are_resolved
,
:path
,
:default_branch
end
...
...
spec/lib/gitlab/background_migration/migrate_events_to_push_event_payloads_spec.rb
View file @
ef4b3a39
...
...
@@ -214,7 +214,7 @@ end
# The background migration relies on a temporary table, hence we're migrating
# to a specific version of the database where said table is still present.
#
describe
Gitlab
::
BackgroundMigration
::
MigrateEventsToPushEventPayloads
,
:migration
,
schema:
20170
608152748
do
describe
Gitlab
::
BackgroundMigration
::
MigrateEventsToPushEventPayloads
,
:migration
,
schema:
20170
825154015
do
let
(
:migration
)
{
described_class
.
new
}
let
(
:project
)
{
create
(
:project_empty_repo
)
}
let
(
:author
)
{
create
(
:user
)
}
...
...
spec/lib/gitlab/import_export/safe_model_attributes.yml
View file @
ef4b3a39
...
...
@@ -398,6 +398,7 @@ Project:
-
public_builds
-
last_repository_check_failed
-
last_repository_check_at
-
collapse_outdated_diff_comments
-
container_registry_enabled
-
only_allow_merge_if_pipeline_succeeds
-
has_external_issue_tracker
...
...
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