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
cec843b2
Commit
cec843b2
authored
Aug 10, 2021
by
GitLab Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add latest changes from gitlab-org/gitlab@13-12-stable-ee
parent
2dd5a517
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
8 deletions
+12
-8
app/models/namespace/traversal_hierarchy.rb
app/models/namespace/traversal_hierarchy.rb
+4
-4
app/models/user.rb
app/models/user.rb
+1
-1
config.ru
config.ru
+6
-0
config/initializers/7_prometheus_metrics.rb
config/initializers/7_prometheus_metrics.rb
+0
-3
spec/models/user_spec.rb
spec/models/user_spec.rb
+1
-0
No files found.
app/models/namespace/traversal_hierarchy.rb
View file @
cec843b2
...
@@ -36,7 +36,7 @@ class Namespace
...
@@ -36,7 +36,7 @@ class Namespace
SET traversal_ids = cte.traversal_ids
SET traversal_ids = cte.traversal_ids
FROM (
#{
recursive_traversal_ids
}
) as cte
FROM (
#{
recursive_traversal_ids
}
) as cte
WHERE namespaces.id = cte.id
WHERE namespaces.id = cte.id
AND namespaces.traversal_ids <> cte.traversal_ids
AND namespaces.traversal_ids
::bigint[]
<> cte.traversal_ids
"""
"""
Namespace
.
transaction
do
Namespace
.
transaction
do
@root
.
lock!
@root
.
lock!
...
@@ -51,7 +51,7 @@ class Namespace
...
@@ -51,7 +51,7 @@ class Namespace
def
incorrect_traversal_ids
def
incorrect_traversal_ids
Namespace
Namespace
.
joins
(
"INNER JOIN (
#{
recursive_traversal_ids
}
) as cte ON namespaces.id = cte.id"
)
.
joins
(
"INNER JOIN (
#{
recursive_traversal_ids
}
) as cte ON namespaces.id = cte.id"
)
.
where
(
'namespaces.traversal_ids <> cte.traversal_ids'
)
.
where
(
'namespaces.traversal_ids
::bigint[]
<> cte.traversal_ids'
)
end
end
private
private
...
@@ -66,9 +66,9 @@ class Namespace
...
@@ -66,9 +66,9 @@ class Namespace
<<~
SQL
<<~
SQL
WITH RECURSIVE cte(id, traversal_ids, cycle) AS (
WITH RECURSIVE cte(id, traversal_ids, cycle) AS (
VALUES(
#{
root_id
}
, ARRAY[
#{
root_id
}
], false)
VALUES(
#{
root_id
}
::bigint, ARRAY[
#{
root_id
}
]::bigint[
], false)
UNION ALL
UNION ALL
SELECT n.id, cte.traversal_ids || n.id, n.id = ANY(cte.traversal_ids)
SELECT n.id, cte.traversal_ids || n.id
::bigint
, n.id = ANY(cte.traversal_ids)
FROM namespaces n, cte
FROM namespaces n, cte
WHERE n.parent_id = cte.id AND NOT cycle
WHERE n.parent_id = cte.id AND NOT cycle
)
)
...
...
app/models/user.rb
View file @
cec843b2
...
@@ -2085,7 +2085,7 @@ class User < ApplicationRecord
...
@@ -2085,7 +2085,7 @@ class User < ApplicationRecord
end
end
def
check_username_format
def
check_username_format
return
if
username
.
blank?
||
Mime
::
EXTENSION_LOOKUP
.
keys
.
none?
{
|
type
|
username
.
end_with?
(
type
)
}
return
if
username
.
blank?
||
Mime
::
EXTENSION_LOOKUP
.
keys
.
none?
{
|
type
|
username
.
end_with?
(
".
#{
type
}
"
)
}
errors
.
add
(
:username
,
_
(
'ending with MIME type format is not allowed.'
))
errors
.
add
(
:username
,
_
(
'ending with MIME type format is not allowed.'
))
end
end
...
...
config.ru
View file @
cec843b2
...
@@ -24,6 +24,12 @@ def master_process?
...
@@ -24,6 +24,12 @@ def master_process?
end
end
warmup
do
|
app
|
warmup
do
|
app
|
# The following is necessary to ensure stale Prometheus metrics don't accumulate over time.
# It needs to be done as early as here to ensure metrics files aren't deleted.
# After we hit our app in `warmup`, first metrics and corresponding files already being created,
# for example in `lib/gitlab/metrics/requests_rack_middleware.rb`.
Prometheus
::
CleanupMultiprocDirService
.
new
.
execute
if
master_process?
client
=
Rack
::
MockRequest
.
new
(
app
)
client
=
Rack
::
MockRequest
.
new
(
app
)
client
.
get
(
'/'
)
client
.
get
(
'/'
)
end
end
...
...
config/initializers/7_prometheus_metrics.rb
View file @
cec843b2
...
@@ -44,9 +44,6 @@ if !Rails.env.test? && Gitlab::Metrics.prometheus_metrics_enabled?
...
@@ -44,9 +44,6 @@ if !Rails.env.test? && Gitlab::Metrics.prometheus_metrics_enabled?
# When running Puma in a Single mode, `on_master_start` and `on_worker_start` are the same.
# When running Puma in a Single mode, `on_master_start` and `on_worker_start` are the same.
# Thus, we order these events to run `reinitialize_on_pid_change` with `force: true` first.
# Thus, we order these events to run `reinitialize_on_pid_change` with `force: true` first.
Gitlab
::
Cluster
::
LifecycleEvents
.
on_master_start
do
Gitlab
::
Cluster
::
LifecycleEvents
.
on_master_start
do
# Ensure that stale Prometheus metrics don't accumulate over time
Prometheus
::
CleanupMultiprocDirService
.
new
.
execute
::
Prometheus
::
Client
.
reinitialize_on_pid_change
(
force:
true
)
::
Prometheus
::
Client
.
reinitialize_on_pid_change
(
force:
true
)
if
Gitlab
::
Runtime
.
unicorn?
if
Gitlab
::
Runtime
.
unicorn?
...
...
spec/models/user_spec.rb
View file @
cec843b2
...
@@ -383,6 +383,7 @@ RSpec.describe User do
...
@@ -383,6 +383,7 @@ RSpec.describe User do
expect
(
user
).
not_to
be_valid
expect
(
user
).
not_to
be_valid
expect
(
user
.
errors
.
full_messages
).
to
include
(
'Username ending with MIME type format is not allowed.'
)
expect
(
user
.
errors
.
full_messages
).
to
include
(
'Username ending with MIME type format is not allowed.'
)
expect
(
build
(
:user
,
username:
"test
#{
type
}
"
)).
to
be_valid
end
end
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