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
b04b1e12
Commit
b04b1e12
authored
May 15, 2020
by
GitLab Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add latest changes from gitlab-org/gitlab@12-10-stable-ee
parent
a5b9fb9a
Changes
25
Show whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
210 additions
and
66 deletions
+210
-66
app/controllers/projects/pages_domains_controller.rb
app/controllers/projects/pages_domains_controller.rb
+8
-2
app/uploaders/file_uploader.rb
app/uploaders/file_uploader.rb
+1
-1
app/views/projects/pages_domains/_certificate.html.haml
app/views/projects/pages_domains/_certificate.html.haml
+4
-4
app/views/projects/pages_domains/_dns.html.haml
app/views/projects/pages_domains/_dns.html.haml
+4
-4
app/views/projects/pages_domains/_form.html.haml
app/views/projects/pages_domains/_form.html.haml
+5
-5
app/views/projects/pages_domains/_lets_encrypt_callout.html.haml
...ws/projects/pages_domains/_lets_encrypt_callout.html.haml
+5
-5
app/views/projects/pages_domains/new.html.haml
app/views/projects/pages_domains/new.html.haml
+1
-1
app/views/projects/pages_domains/show.html.haml
app/views/projects/pages_domains/show.html.haml
+4
-4
changelogs/unreleased/216728-actionview-template-error-undefined-method-pages_domain-for-pagesd.yml
...mplate-error-undefined-method-pages_domain-for-pagesd.yml
+5
-0
changelogs/unreleased/216851-graphql-externallypaginatedarrayconnection-can-return-incorrect-nu.yml
...nallypaginatedarrayconnection-can-return-incorrect-nu.yml
+5
-0
changelogs/unreleased/216970-add-instance-to-service-if-missing.yml
.../unreleased/216970-add-instance-to-service-if-missing.yml
+5
-0
changelogs/unreleased/217602-file-uploads-on-local-storage-with-nil-secret-in-the-db-are-broken.yml
...on-local-storage-with-nil-secret-in-the-db-are-broken.yml
+5
-0
changelogs/unreleased/cat-duplicate-ci-pipelines-index-215790.yml
...gs/unreleased/cat-duplicate-ci-pipelines-index-215790.yml
+5
-0
db/migrate/20191229140154_drop_index_ci_pipelines_on_project_id.rb
...e/20191229140154_drop_index_ci_pipelines_on_project_id.rb
+5
-2
db/post_migrate/20200511162057_add_missing_instance_to_servicess.rb
...grate/20200511162057_add_missing_instance_to_servicess.rb
+30
-0
db/post_migrate/20200511162115_add_missing_index_to_service_unique_instance_per_type.rb
..._add_missing_index_to_service_unique_instance_per_type.rb
+25
-0
db/structure.sql
db/structure.sql
+2
-0
doc/user/project/issues/index.md
doc/user/project/issues/index.md
+2
-2
doc/user/project/issues/issue_data_and_actions.md
doc/user/project/issues/issue_data_and_actions.md
+2
-2
lib/gitlab/graphql/pagination/externally_paginated_array_connection.rb
...aphql/pagination/externally_paginated_array_connection.rb
+14
-0
spec/controllers/projects/pages_domains_controller_spec.rb
spec/controllers/projects/pages_domains_controller_spec.rb
+6
-10
spec/features/projects/pages_spec.rb
spec/features/projects/pages_spec.rb
+11
-0
spec/lib/gitlab/graphql/pagination/externally_paginated_array_connection_spec.rb
.../pagination/externally_paginated_array_connection_spec.rb
+14
-0
spec/uploaders/file_uploader_spec.rb
spec/uploaders/file_uploader_spec.rb
+41
-23
spec/views/projects/pages_domains/show.html.haml_spec.rb
spec/views/projects/pages_domains/show.html.haml_spec.rb
+1
-1
No files found.
app/controllers/projects/pages_domains_controller.rb
View file @
b04b1e12
...
@@ -7,6 +7,8 @@ class Projects::PagesDomainsController < Projects::ApplicationController
...
@@ -7,6 +7,8 @@ class Projects::PagesDomainsController < Projects::ApplicationController
before_action
:authorize_update_pages!
before_action
:authorize_update_pages!
before_action
:domain
,
except:
[
:new
,
:create
]
before_action
:domain
,
except:
[
:new
,
:create
]
helper_method
:domain_presenter
def
show
def
show
end
end
...
@@ -27,7 +29,7 @@ class Projects::PagesDomainsController < Projects::ApplicationController
...
@@ -27,7 +29,7 @@ class Projects::PagesDomainsController < Projects::ApplicationController
end
end
def
retry_auto_ssl
def
retry_auto_ssl
PagesDomains
::
RetryAcmeOrderService
.
new
(
@domain
.
pages_domain
).
execute
PagesDomains
::
RetryAcmeOrderService
.
new
(
@domain
).
execute
redirect_to
project_pages_domain_path
(
@project
,
@domain
)
redirect_to
project_pages_domain_path
(
@project
,
@domain
)
end
end
...
@@ -88,6 +90,10 @@ class Projects::PagesDomainsController < Projects::ApplicationController
...
@@ -88,6 +90,10 @@ class Projects::PagesDomainsController < Projects::ApplicationController
end
end
def
domain
def
domain
@domain
||=
@project
.
pages_domains
.
find_by_domain!
(
params
[
:id
].
to_s
).
present
(
current_user:
current_user
)
@domain
||=
@project
.
pages_domains
.
find_by_domain!
(
params
[
:id
].
to_s
)
end
def
domain_presenter
@domain_presenter
||=
domain
.
present
(
current_user:
current_user
)
end
end
end
end
app/uploaders/file_uploader.rb
View file @
b04b1e12
...
@@ -15,7 +15,7 @@ class FileUploader < GitlabUploader
...
@@ -15,7 +15,7 @@ class FileUploader < GitlabUploader
prepend
ObjectStorage
::
Extension
::
RecordsUploads
prepend
ObjectStorage
::
Extension
::
RecordsUploads
MARKDOWN_PATTERN
=
%r{
\!
?
\[
.*?
\]\(
/uploads/(?<secret>[0-9a-f]{32})/(?<file>.*?)
\)
}
.
freeze
MARKDOWN_PATTERN
=
%r{
\!
?
\[
.*?
\]\(
/uploads/(?<secret>[0-9a-f]{32})/(?<file>.*?)
\)
}
.
freeze
DYNAMIC_PATH_PATTERN
=
%r{.*
/(?<secret>
\h
{10,32})
/(?<identifier>.*)}
.
freeze
DYNAMIC_PATH_PATTERN
=
%r{.*
(?<secret>
\b
(
\h
{10}|
\h
{32}))
\
/
(?<identifier>.*)}
.
freeze
VALID_SECRET_PATTERN
=
%r{
\A\h
{10,32}
\z
}
.
freeze
VALID_SECRET_PATTERN
=
%r{
\A\h
{10,32}
\z
}
.
freeze
InvalidSecret
=
Class
.
new
(
StandardError
)
InvalidSecret
=
Class
.
new
(
StandardError
)
...
...
app/views/projects/pages_domains/_certificate.html.haml
View file @
b04b1e12
-
auto_ssl_available
=
::
Gitlab
::
LetsEncrypt
.
enabled?
-
auto_ssl_available
=
::
Gitlab
::
LetsEncrypt
.
enabled?
-
auto_ssl_enabled
=
@domain
.
auto_ssl_enabled?
-
auto_ssl_enabled
=
domain_presenter
.
auto_ssl_enabled?
-
auto_ssl_available_and_enabled
=
auto_ssl_available
&&
auto_ssl_enabled
-
auto_ssl_available_and_enabled
=
auto_ssl_available
&&
auto_ssl_enabled
-
has_user_defined_certificate
=
@domain
.
certificate
&&
@domain
.
certificate_user_provided?
-
has_user_defined_certificate
=
domain_presenter
.
certificate
&&
domain_presenter
.
certificate_user_provided?
-
if
auto_ssl_available
-
if
auto_ssl_available
.form-group.border-section
.form-group.border-section
...
@@ -36,9 +36,9 @@
...
@@ -36,9 +36,9 @@
=
_
(
'Certificate'
)
=
_
(
'Certificate'
)
.d-flex.justify-content-between.align-items-center.p-3
.d-flex.justify-content-between.align-items-center.p-3
%span
%span
=
@domain
.
pages_domain
.
subject
||
_
(
'missing'
)
=
domain_presenter
.
pages_domain
.
subject
||
_
(
'missing'
)
=
link_to
_
(
'Remove'
),
=
link_to
_
(
'Remove'
),
clean_certificate_project_pages_domain_path
(
@project
,
@domain
),
clean_certificate_project_pages_domain_path
(
@project
,
domain_presenter
),
data:
{
confirm:
_
(
'Are you sure?'
)
},
data:
{
confirm:
_
(
'Are you sure?'
)
},
class:
'btn btn-remove btn-sm'
,
class:
'btn btn-remove btn-sm'
,
method: :delete
method: :delete
...
...
app/views/projects/pages_domains/_dns.html.haml
View file @
b04b1e12
-
verification_enabled
=
Gitlab
::
CurrentSettings
.
pages_domain_verification_enabled?
-
verification_enabled
=
Gitlab
::
CurrentSettings
.
pages_domain_verification_enabled?
-
dns_record
=
"
#{
@domain
.
domain
}
CNAME
#{
@domain
.
project
.
pages_subdomain
}
.
#{
Settings
.
pages
.
host
}
."
-
dns_record
=
"
#{
domain_presenter
.
domain
}
CNAME
#{
domain_presenter
.
project
.
pages_subdomain
}
.
#{
Settings
.
pages
.
host
}
."
.form-group.border-section
.form-group.border-section
.row
.row
...
@@ -13,17 +13,17 @@
...
@@ -13,17 +13,17 @@
%p
.form-text.text-muted
%p
.form-text.text-muted
=
_
(
"To access this domain create a new DNS record"
)
=
_
(
"To access this domain create a new DNS record"
)
-
if
verification_enabled
-
if
verification_enabled
-
verification_record
=
"
#{
@domain
.
verification_domain
}
TXT
#{
@domain
.
keyed_verification_code
}
"
-
verification_record
=
"
#{
domain_presenter
.
verification_domain
}
TXT
#{
domain_presenter
.
keyed_verification_code
}
"
.form-group.border-section
.form-group.border-section
.row
.row
.col-sm-2
.col-sm-2
=
_
(
"Verification status"
)
=
_
(
"Verification status"
)
.col-sm-10
.col-sm-10
.status-badge
.status-badge
-
text
,
status
=
@domain
.
unverified?
?
[
_
(
'Unverified'
),
'badge-danger'
]
:
[
_
(
'Verified'
),
'badge-success'
]
-
text
,
status
=
domain_presenter
.
unverified?
?
[
_
(
'Unverified'
),
'badge-danger'
]
:
[
_
(
'Verified'
),
'badge-success'
]
.badge
{
class:
status
}
.badge
{
class:
status
}
=
text
=
text
=
link_to
sprite_icon
(
"redo"
),
verify_project_pages_domain_path
(
@project
,
@domain
),
method: :post
,
class:
"btn has-tooltip"
,
title:
_
(
"Retry verification"
)
=
link_to
sprite_icon
(
"redo"
),
verify_project_pages_domain_path
(
@project
,
domain_presenter
),
method: :post
,
class:
"btn has-tooltip"
,
title:
_
(
"Retry verification"
)
.input-group
.input-group
=
text_field_tag
:domain_verification
,
verification_record
,
class:
"monospace js-select-on-focus form-control"
,
readonly:
true
=
text_field_tag
:domain_verification
,
verification_record
,
class:
"monospace js-select-on-focus form-control"
,
readonly:
true
.input-group-append
.input-group-append
...
...
app/views/projects/pages_domains/_form.html.haml
View file @
b04b1e12
-
if
@domain
.
errors
.
any?
-
if
domain_presenter
.
errors
.
any?
.alert.alert-danger
.alert.alert-danger
-
@domain
.
errors
.
full_messages
.
each
do
|
msg
|
-
domain_presenter
.
errors
.
full_messages
.
each
do
|
msg
|
=
msg
=
msg
.form-group.border-section
.form-group.border-section
.row
.row
-
if
@domain
.
persisted?
-
if
domain_presenter
.
persisted?
.col-sm-2
.col-sm-2
=
_
(
"Domain"
)
=
_
(
"Domain"
)
.col-sm-10
.col-sm-10
=
external_link
(
@domain
.
url
,
@domain
.
url
)
=
external_link
(
domain_presenter
.
url
,
domain_presenter
.
url
)
-
else
-
else
.col-sm-2
.col-sm-2
=
f
.
label
:domain
,
_
(
"Domain"
)
=
f
.
label
:domain
,
_
(
"Domain"
)
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
.input-group
.input-group
=
f
.
text_field
:domain
,
required:
true
,
autocomplete:
"off"
,
class:
"form-control"
=
f
.
text_field
:domain
,
required:
true
,
autocomplete:
"off"
,
class:
"form-control"
-
if
@domain
.
persisted?
-
if
domain_presenter
.
persisted?
=
render
'dns'
=
render
'dns'
-
if
Gitlab
.
config
.
pages
.
external_https
-
if
Gitlab
.
config
.
pages
.
external_https
...
...
app/views/projects/pages_domains/_lets_encrypt_callout.html.haml
View file @
b04b1e12
-
if
@domain
.
enabled?
-
if
domain_presenter
.
enabled?
-
if
@domain
.
auto_ssl_enabled
-
if
domain_presenter
.
auto_ssl_enabled
-
if
@domain
.
show_auto_ssl_failed_warning?
-
if
domain_presenter
.
show_auto_ssl_failed_warning?
.form-group.border-section.js-shown-if-auto-ssl
{
class:
(
"d-none"
unless
auto_ssl_available_and_enabled
)
}
.form-group.border-section.js-shown-if-auto-ssl
{
class:
(
"d-none"
unless
auto_ssl_available_and_enabled
)
}
.row
.row
.col-sm-10.offset-sm-2
.col-sm-10.offset-sm-2
...
@@ -9,8 +9,8 @@
...
@@ -9,8 +9,8 @@
=
icon
(
'warning'
,
class:
'mr-2'
)
=
icon
(
'warning'
,
class:
'mr-2'
)
=
_
(
"Something went wrong while obtaining the Let's Encrypt certificate."
)
=
_
(
"Something went wrong while obtaining the Let's Encrypt certificate."
)
.row.mx-0.mt-3
.row.mx-0.mt-3
=
link_to
s_
(
'GitLabPagesDomains|Retry'
),
retry_auto_ssl_project_pages_domain_path
(
@project
,
@domain
),
class:
"btn btn-sm btn-grouped btn-warning"
,
method: :post
=
link_to
s_
(
'GitLabPagesDomains|Retry'
),
retry_auto_ssl_project_pages_domain_path
(
@project
,
domain_presenter
),
class:
"btn btn-sm btn-grouped btn-warning"
,
method: :post
-
elsif
!
@domain
.
certificate_gitlab_provided?
-
elsif
!
domain_presenter
.
certificate_gitlab_provided?
.form-group.border-section.js-shown-if-auto-ssl
{
class:
(
"d-none"
unless
auto_ssl_available_and_enabled
)
}
.form-group.border-section.js-shown-if-auto-ssl
{
class:
(
"d-none"
unless
auto_ssl_available_and_enabled
)
}
.row
.row
.col-sm-10.offset-sm-2
.col-sm-10.offset-sm-2
...
...
app/views/projects/pages_domains/new.html.haml
View file @
b04b1e12
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
=
_
(
"New Pages Domain"
)
=
_
(
"New Pages Domain"
)
=
render
'projects/pages_domains/helper_text'
=
render
'projects/pages_domains/helper_text'
%div
%div
=
form_for
[
@project
.
namespace
.
becomes
(
Namespace
),
@project
,
@domain
],
html:
{
class:
'fieldset-form'
}
do
|
f
|
=
form_for
[
@project
.
namespace
.
becomes
(
Namespace
),
@project
,
domain_presenter
],
html:
{
class:
'fieldset-form'
}
do
|
f
|
=
render
'form'
,
{
f:
f
}
=
render
'form'
,
{
f:
f
}
.form-actions
.form-actions
=
f
.
submit
_
(
'Create New Domain'
),
class:
"btn btn-success"
=
f
.
submit
_
(
'Create New Domain'
),
class:
"btn btn-success"
...
...
app/views/projects/pages_domains/show.html.haml
View file @
b04b1e12
-
add_to_breadcrumbs
_
(
"Pages"
),
project_pages_path
(
@project
)
-
add_to_breadcrumbs
_
(
"Pages"
),
project_pages_path
(
@project
)
-
breadcrumb_title
@domain
.
domain
-
breadcrumb_title
domain_presenter
.
domain
-
page_title
@domain
.
domain
-
page_title
domain_presenter
.
domain
-
verification_enabled
=
Gitlab
::
CurrentSettings
.
pages_domain_verification_enabled?
-
verification_enabled
=
Gitlab
::
CurrentSettings
.
pages_domain_verification_enabled?
-
if
verification_enabled
&&
@domain
.
unverified?
-
if
verification_enabled
&&
domain_presenter
.
unverified?
=
content_for
:flash_message
do
=
content_for
:flash_message
do
.alert.alert-warning
.alert.alert-warning
.container-fluid.container-limited
.container-fluid.container-limited
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
=
_
(
'Pages Domain'
)
=
_
(
'Pages Domain'
)
=
render
'projects/pages_domains/helper_text'
=
render
'projects/pages_domains/helper_text'
%div
%div
=
form_for
[
@project
.
namespace
.
becomes
(
Namespace
),
@project
,
@domain
],
html:
{
class:
'fieldset-form'
}
do
|
f
|
=
form_for
[
@project
.
namespace
.
becomes
(
Namespace
),
@project
,
domain_presenter
],
html:
{
class:
'fieldset-form'
}
do
|
f
|
=
render
'form'
,
{
f:
f
}
=
render
'form'
,
{
f:
f
}
.form-actions.d-flex.justify-content-between
.form-actions.d-flex.justify-content-between
=
f
.
submit
_
(
'Save Changes'
),
class:
"btn btn-success"
=
f
.
submit
_
(
'Save Changes'
),
class:
"btn btn-success"
...
...
changelogs/unreleased/216728-actionview-template-error-undefined-method-pages_domain-for-pagesd.yml
0 → 100644
View file @
b04b1e12
---
title
:
Fix 500 on creating an invalid domains and verification
merge_request
:
31190
author
:
type
:
fixed
changelogs/unreleased/216851-graphql-externallypaginatedarrayconnection-can-return-incorrect-nu.yml
0 → 100644
View file @
b04b1e12
---
title
:
Fix incorrect number of errors returned when querying sentry errors
merge_request
:
31252
author
:
type
:
fixed
changelogs/unreleased/216970-add-instance-to-service-if-missing.yml
0 → 100644
View file @
b04b1e12
---
title
:
Add instance column to services table if it's missing
merge_request
:
31631
author
:
type
:
fixed
changelogs/unreleased/217602-file-uploads-on-local-storage-with-nil-secret-in-the-db-are-broken.yml
0 → 100644
View file @
b04b1e12
---
title
:
Fix incorrect regex used in FileUploader#extract_dynamic_path
merge_request
:
32271
author
:
type
:
fixed
changelogs/unreleased/cat-duplicate-ci-pipelines-index-215790.yml
0 → 100644
View file @
b04b1e12
---
title
:
Fix duplicate index removal on ci_pipelines.project_id
merge_request
:
31043
author
:
type
:
fixed
db/migrate/20191229140154_drop_index_ci_pipelines_on_project_id.rb
View file @
b04b1e12
...
@@ -8,10 +8,13 @@ class DropIndexCiPipelinesOnProjectId < ActiveRecord::Migration[5.2]
...
@@ -8,10 +8,13 @@ class DropIndexCiPipelinesOnProjectId < ActiveRecord::Migration[5.2]
disable_ddl_transaction!
disable_ddl_transaction!
def
up
def
up
remove_concurrent_index
:ci_pipelines
,
:project_id
remove_concurrent_index_by_name
:ci_pipelines
,
'index_ci_pipelines_on_project_id'
# extra (duplicate) index that already existed on some installs
remove_concurrent_index_by_name
:ci_pipelines
,
'ci_pipelines_project_id_idx'
end
end
def
down
def
down
add_concurrent_index
:ci_pipelines
,
:project_id
add_concurrent_index
:ci_pipelines
,
:project_id
,
name:
'index_ci_pipelines_on_project_id'
end
end
end
end
db/post_migrate/20200511162057_add_missing_instance_to_servicess.rb
0 → 100644
View file @
b04b1e12
# frozen_string_literal: true
class
AddMissingInstanceToServicess
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
# This is a corrective migration to keep the instance column.
# Upgrade from 12.7 to 12.9 removes the instance column as it was first added
# in the normal migration and then removed in the post migration.
#
# 12.8 removed the instance column in a post deployment migration https://gitlab.com/gitlab-org/gitlab/-/merge_requests/24885
# 12.9 added the instance column in a normal migration https://gitlab.com/gitlab-org/gitlab/-/merge_requests/25714
#
# rubocop:disable Migration/AddColumnWithDefault
# rubocop:disable Migration/UpdateLargeTable
def
up
unless
column_exists?
(
:services
,
:instance
)
add_column_with_default
(
:services
,
:instance
,
:boolean
,
default:
false
)
end
end
# rubocop:enable Migration/AddColumnWithDefault
# rubocop:enable Migration/UpdateLargeTable
def
down
# Does not apply
end
end
db/post_migrate/20200511162115_add_missing_index_to_service_unique_instance_per_type.rb
0 → 100644
View file @
b04b1e12
# frozen_string_literal: true
class
AddMissingIndexToServiceUniqueInstancePerType
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
# This is a corrective migration to keep the index on instance column.
# Upgrade from 12.7 to 12.9 removes the instance column as it was first added
# in the normal migration and then removed in the post migration.
#
# 12.8 removed the instance column in a post deployment migration https://gitlab.com/gitlab-org/gitlab/-/merge_requests/24885
# 12.9 added the instance column in a normal migration https://gitlab.com/gitlab-org/gitlab/-/merge_requests/25714
def
up
unless
index_exists_by_name?
(
:services
,
'index_services_on_type_and_instance'
)
add_concurrent_index
(
:services
,
[
:type
,
:instance
],
unique:
true
,
where:
'instance IS TRUE'
)
end
end
def
down
# Does not apply
end
end
db/structure.sql
View file @
b04b1e12
...
@@ -13214,5 +13214,7 @@ COPY "schema_migrations" (version) FROM STDIN;
...
@@ -13214,5 +13214,7 @@ COPY "schema_migrations" (version) FROM STDIN;
20200416111111
20200416111111
20200416120128
20200416120128
20200416120354
20200416120354
20200511162057
20200511162115
\
.
\
.
doc/user/project/issues/index.md
View file @
b04b1e12
...
@@ -82,7 +82,7 @@ must be set.
...
@@ -82,7 +82,7 @@ must be set.
While you can view and manage the full details of an issue on the
[
issue page
](
#issue-page
)
,
While you can view and manage the full details of an issue on the
[
issue page
](
#issue-page
)
,
you can also work with multiple issues at a time using the
[
Issues List
](
#issues-list
)
,
you can also work with multiple issues at a time using the
[
Issues List
](
#issues-list
)
,
[
Issue Boards
](
#issue-boards
)
, Issue references, and
[
Epics
](
#epics-
ultimate
)
**(ULTIMATE
)**
.
[
Issue Boards
](
#issue-boards
)
, Issue references, and
[
Epics
](
#epics-
premium
)
**(PREMIUM
)**
.
Key actions for Issues include:
Key actions for Issues include:
...
@@ -132,7 +132,7 @@ With [Design Management](design_management.md), you can upload design
...
@@ -132,7 +132,7 @@ With [Design Management](design_management.md), you can upload design
assets to issues and view them all together to easily share and
assets to issues and view them all together to easily share and
collaborate with your team.
collaborate with your team.
### Epics **(
ULTIMATE
)**
### Epics **(
PREMIUM
)**
[
Epics
](
../../group/epics/index.md
)
let you manage your portfolio of projects more
[
Epics
](
../../group/epics/index.md
)
let you manage your portfolio of projects more
efficiently and with less effort by tracking groups of issues that share a theme, across
efficiently and with less effort by tracking groups of issues that share a theme, across
...
...
doc/user/project/issues/issue_data_and_actions.md
View file @
b04b1e12
...
@@ -16,7 +16,7 @@ You can find all the information for that issue on one screen.
...
@@ -16,7 +16,7 @@ You can find all the information for that issue on one screen.
-
**2.**
[
To Do
](
#to-do
)
-
**2.**
[
To Do
](
#to-do
)
-
**3.**
[
Assignee
](
#assignee
)
-
**3.**
[
Assignee
](
#assignee
)
-
**3.1.**
[
Multiple Assignees **(STARTER)**
](
#multiple-assignees-starter
)
-
**3.1.**
[
Multiple Assignees **(STARTER)**
](
#multiple-assignees-starter
)
-
**4.**
[
Epic **(
ULTIMATE)**
](
#epic-ultimate
)
-
**4.**
[
Epic **(
PREMIUM)**
](
#epic-premium
)
-
**5.**
[
Milestone
](
#milestone
)
-
**5.**
[
Milestone
](
#milestone
)
-
**6.**
[
Time tracking
](
#time-tracking
)
-
**6.**
[
Time tracking
](
#time-tracking
)
-
**7.**
[
Due date
](
#due-date
)
-
**7.**
[
Due date
](
#due-date
)
...
@@ -100,7 +100,7 @@ to track in large teams where there is shared ownership of an issue.
...
@@ -100,7 +100,7 @@ to track in large teams where there is shared ownership of an issue.
In
[
GitLab Starter
](
https://about.gitlab.com/pricing/
)
, you can
In
[
GitLab Starter
](
https://about.gitlab.com/pricing/
)
, you can
[
assign multiple people
](
multiple_assignees_for_issues.md
)
to an issue.
[
assign multiple people
](
multiple_assignees_for_issues.md
)
to an issue.
### Epic **(
ULTIMATE
)**
### Epic **(
PREMIUM
)**
You can assign issues to an
[
Epic
](
../../group/epics/index.md
)
, which allows better
You can assign issues to an
[
Epic
](
../../group/epics/index.md
)
, which allows better
management of groups of related issues.
management of groups of related issues.
...
...
lib/gitlab/graphql/pagination/externally_paginated_array_connection.rb
View file @
b04b1e12
...
@@ -23,6 +23,20 @@ module Gitlab
...
@@ -23,6 +23,20 @@ module Gitlab
alias_method
:has_next_page
,
:next_page?
alias_method
:has_next_page
,
:next_page?
alias_method
:has_previous_page
,
:previous_page?
alias_method
:has_previous_page
,
:previous_page?
private
def
load_nodes
@nodes
||=
begin
# As the pagination happens externally we just grab all the nodes
limited_nodes
=
items
limited_nodes
=
limited_nodes
.
first
(
first
)
if
first
limited_nodes
=
limited_nodes
.
last
(
last
)
if
last
limited_nodes
end
end
end
end
end
end
end
end
...
...
spec/controllers/projects/pages_domains_controller_spec.rb
View file @
b04b1e12
...
@@ -148,16 +148,10 @@ describe Projects::PagesDomainsController do
...
@@ -148,16 +148,10 @@ describe Projects::PagesDomainsController do
describe
'POST verify'
do
describe
'POST verify'
do
let
(
:params
)
{
request_params
.
merge
(
id:
pages_domain
.
domain
)
}
let
(
:params
)
{
request_params
.
merge
(
id:
pages_domain
.
domain
)
}
def
stub_service
service
=
double
(
:service
)
expect
(
VerifyPagesDomainService
).
to
receive
(
:new
)
{
service
}
service
end
it
'handles verification success'
do
it
'handles verification success'
do
expect
(
stub_service
).
to
receive
(
:execute
).
and_return
(
status: :success
)
expect_next_instance_of
(
VerifyPagesDomainService
,
pages_domain
)
do
|
service
|
expect
(
service
).
to
receive
(
:execute
).
and_return
(
status: :success
)
end
post
:verify
,
params:
params
post
:verify
,
params:
params
...
@@ -166,7 +160,9 @@ describe Projects::PagesDomainsController do
...
@@ -166,7 +160,9 @@ describe Projects::PagesDomainsController do
end
end
it
'handles verification failure'
do
it
'handles verification failure'
do
expect
(
stub_service
).
to
receive
(
:execute
).
and_return
(
status: :failed
)
expect_next_instance_of
(
VerifyPagesDomainService
,
pages_domain
)
do
|
service
|
expect
(
service
).
to
receive
(
:execute
).
and_return
(
status: :failed
)
end
post
:verify
,
params:
params
post
:verify
,
params:
params
...
...
spec/features/projects/pages_spec.rb
View file @
b04b1e12
...
@@ -158,6 +158,17 @@ shared_examples 'pages settings editing' do
...
@@ -158,6 +158,17 @@ shared_examples 'pages settings editing' do
expect
(
page
).
to
have_content
(
'my.test.domain.com'
)
expect
(
page
).
to
have_content
(
'my.test.domain.com'
)
end
end
it
'shows validation error if domain is duplicated'
do
project
.
pages_domains
.
create!
(
domain:
'my.test.domain.com'
)
visit
new_project_pages_domain_path
(
project
)
fill_in
'Domain'
,
with:
'my.test.domain.com'
click_button
'Create New Domain'
expect
(
page
).
to
have_content
(
'Domain has already been taken'
)
end
describe
'with dns verification enabled'
do
describe
'with dns verification enabled'
do
before
do
before
do
stub_application_setting
(
pages_domain_verification_enabled:
true
)
stub_application_setting
(
pages_domain_verification_enabled:
true
)
...
...
spec/lib/gitlab/graphql/pagination/externally_paginated_array_connection_spec.rb
View file @
b04b1e12
...
@@ -19,6 +19,20 @@ describe Gitlab::Graphql::Pagination::ExternallyPaginatedArrayConnection do
...
@@ -19,6 +19,20 @@ describe Gitlab::Graphql::Pagination::ExternallyPaginatedArrayConnection do
it_behaves_like
'connection with paged nodes'
do
it_behaves_like
'connection with paged nodes'
do
let
(
:paged_nodes_size
)
{
values
.
size
}
let
(
:paged_nodes_size
)
{
values
.
size
}
end
end
context
'when after or before is specified, they are ignored'
do
# after and before are not used to filter the array, as they
# were already used to directly fetch the external array
it_behaves_like
'connection with paged nodes'
do
let
(
:arguments
)
{
{
after:
next_cursor
}
}
let
(
:paged_nodes_size
)
{
values
.
size
}
end
it_behaves_like
'connection with paged nodes'
do
let
(
:arguments
)
{
{
before:
prev_cursor
}
}
let
(
:paged_nodes_size
)
{
values
.
size
}
end
end
end
end
describe
'#start_cursor'
do
describe
'#start_cursor'
do
...
...
spec/uploaders/file_uploader_spec.rb
View file @
b04b1e12
...
@@ -145,9 +145,10 @@ describe FileUploader do
...
@@ -145,9 +145,10 @@ describe FileUploader do
end
end
describe
'.extract_dynamic_path'
do
describe
'.extract_dynamic_path'
do
context
'with a 32-byte hexadecimal secret in the path'
do
shared_examples
'a valid secret'
do
|
root_path
|
context
'with a 32-byte hexadecimal secret'
do
let
(
:secret
)
{
SecureRandom
.
hex
}
let
(
:secret
)
{
SecureRandom
.
hex
}
let
(
:path
)
{
"export/4b227777d4dd1fc61c6f884f48641d02b4d121d3fd328cb08b5531fcacdabf8a/test/uploads/
#{
secret
}
/dummy.txt"
}
let
(
:path
)
{
File
.
join
(
*
[
root_path
,
secret
,
'dummy.txt'
].
compact
)
}
it
'extracts the secret'
do
it
'extracts the secret'
do
expect
(
described_class
.
extract_dynamic_path
(
path
)[
:secret
]).
to
eq
(
secret
)
expect
(
described_class
.
extract_dynamic_path
(
path
)[
:secret
]).
to
eq
(
secret
)
...
@@ -158,9 +159,9 @@ describe FileUploader do
...
@@ -158,9 +159,9 @@ describe FileUploader do
end
end
end
end
context
'with a 10-byte hexadecimal secret in the path
'
do
context
'with a 10-byte hexadecimal secret
'
do
let
(
:secret
)
{
SecureRandom
.
hex
(
10
)
}
let
(
:secret
)
{
SecureRandom
.
hex
[
0
,
10
]
}
let
(
:path
)
{
"export/4b227777d4dd1fc61c6f884f48641d02b4d121d3fd328cb08b5531fcacdabf8a/test/uploads/
#{
secret
}
/dummy.txt"
}
let
(
:path
)
{
File
.
join
(
*
[
root_path
,
secret
,
'dummy.txt'
].
compact
)
}
it
'extracts the secret'
do
it
'extracts the secret'
do
expect
(
described_class
.
extract_dynamic_path
(
path
)[
:secret
]).
to
eq
(
secret
)
expect
(
described_class
.
extract_dynamic_path
(
path
)[
:secret
]).
to
eq
(
secret
)
...
@@ -171,9 +172,9 @@ describe FileUploader do
...
@@ -171,9 +172,9 @@ describe FileUploader do
end
end
end
end
context
'with an invalid secret in the path
'
do
context
'with an invalid secret
'
do
let
(
:secret
)
{
'foo'
}
let
(
:secret
)
{
'foo'
}
let
(
:path
)
{
"export/4b227777d4dd1fc61c6f884f48641d02b4d121d3fd328cb08b5531fcacdabf8a/test/uploads/
#{
secret
}
/dummy.txt"
}
let
(
:path
)
{
File
.
join
(
*
[
root_path
,
secret
,
'dummy.txt'
].
compact
)
}
it
'returns nil'
do
it
'returns nil'
do
expect
(
described_class
.
extract_dynamic_path
(
path
)).
to
be_nil
expect
(
described_class
.
extract_dynamic_path
(
path
)).
to
be_nil
...
@@ -181,6 +182,23 @@ describe FileUploader do
...
@@ -181,6 +182,23 @@ describe FileUploader do
end
end
end
end
context
'with an absolute path without a slash in the beginning'
do
it_behaves_like
'a valid secret'
,
'export/4b227777d4dd1fc61c6f884f48641d02b4d121d3fd328cb08b5531fcacdabf8a/test/uploads'
end
context
'with an absolute path with a slash in the beginning'
do
it_behaves_like
'a valid secret'
,
'/export/4b227777d4dd1fc61c6f884f48641d02b4d121d3fd328cb08b5531fcacdabf8a/test/uploads'
end
context
'with an relative path without a slash in the beginning'
do
it_behaves_like
'a valid secret'
,
nil
end
context
'with an relative path with a slash in the beginning'
do
it_behaves_like
'a valid secret'
,
'/'
end
end
describe
'#secret'
do
describe
'#secret'
do
it
'generates a secret if none is provided'
do
it
'generates a secret if none is provided'
do
expect
(
described_class
).
to
receive
(
:generate_secret
).
and_return
(
secret
)
expect
(
described_class
).
to
receive
(
:generate_secret
).
and_return
(
secret
)
...
@@ -202,7 +220,7 @@ describe FileUploader do
...
@@ -202,7 +220,7 @@ describe FileUploader do
end
end
context
"10-byte hexadecimal"
do
context
"10-byte hexadecimal"
do
let
(
:secret
)
{
SecureRandom
.
hex
(
10
)
}
let
(
:secret
)
{
SecureRandom
.
hex
[
0
,
10
]
}
it
"returns the secret"
do
it
"returns the secret"
do
expect
(
uploader
.
secret
).
to
eq
(
secret
)
expect
(
uploader
.
secret
).
to
eq
(
secret
)
...
...
spec/views/projects/pages_domains/show.html.haml_spec.rb
View file @
b04b1e12
...
@@ -7,7 +7,7 @@ describe 'projects/pages_domains/show' do
...
@@ -7,7 +7,7 @@ describe 'projects/pages_domains/show' do
before
do
before
do
assign
(
:project
,
project
)
assign
(
:project
,
project
)
a
ssign
(
:domain
,
domain
.
present
)
a
llow
(
view
).
to
receive
(
:domain_presenter
).
and_return
(
domain
.
present
)
stub_pages_setting
(
external_https:
true
)
stub_pages_setting
(
external_https:
true
)
end
end
...
...
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