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
36c74352
Commit
36c74352
authored
Jun 02, 2018
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-06-02
parents
2f9dfa3c
fe0ebf76
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
3 deletions
+47
-3
app/assets/stylesheets/bootstrap_migration.scss
app/assets/stylesheets/bootstrap_migration.scss
+6
-0
app/services/ci/register_job_service.rb
app/services/ci/register_job_service.rb
+1
-1
config/settings.rb
config/settings.rb
+7
-0
lib/feature.rb
lib/feature.rb
+9
-2
spec/lib/feature_spec.rb
spec/lib/feature_spec.rb
+24
-0
No files found.
app/assets/stylesheets/bootstrap_migration.scss
View file @
36c74352
...
...
@@ -36,6 +36,12 @@ html [type="button"],
cursor
:
pointer
;
}
input
[
type
=
"file"
]
{
// Bootstrap 4 file input height is taller by default
// which makes them look ugly
line-height
:
1
;
}
b
,
strong
{
font-weight
:
bold
;
...
...
app/services/ci/register_job_service.rb
View file @
36c74352
...
...
@@ -92,7 +92,7 @@ module Ci
def
builds_for_group_runner
# Workaround for weird Rails bug, that makes `runner.groups.to_sql` to return `runner_id = NULL`
groups
=
Group
.
joins
(
:runner_namespaces
).
merge
(
runner
.
runner_namespaces
)
groups
=
::
Group
.
joins
(
:runner_namespaces
).
merge
(
runner
.
runner_namespaces
)
hierarchy_groups
=
Gitlab
::
GroupHierarchy
.
new
(
groups
).
base_and_descendants
projects
=
Project
.
where
(
namespace_id:
hierarchy_groups
)
...
...
config/settings.rb
View file @
36c74352
...
...
@@ -110,7 +110,14 @@ class Settings < Settingslogic
File
.
expand_path
(
path
,
Rails
.
root
)
end
# Returns a 256-bit key for attr_encrypted
def
attr_encrypted_db_key_base
# Ruby 2.4+ requires passing in the exact required length for OpenSSL keys
# (https://github.com/ruby/ruby/commit/ce635262f53b760284d56bb1027baebaaec175d1).
# Previous versions quietly truncated the input.
#
# The default mode for the attr_encrypted gem is to use a 256-bit key.
# We truncate the 128-byte string to 32 bytes.
Gitlab
::
Application
.
secrets
.
db_key_base
[
0
..
31
]
end
...
...
lib/feature.rb
View file @
36c74352
...
...
@@ -63,8 +63,15 @@ class Feature
end
def
flipper
Thread
.
current
[
:flipper
]
||=
Flipper
.
new
(
flipper_adapter
).
tap
{
|
flip
|
flip
.
memoize
=
true
}
if
RequestStore
.
active?
RequestStore
[
:flipper
]
||=
build_flipper_instance
else
@flipper
||=
build_flipper_instance
end
end
def
build_flipper_instance
Flipper
.
new
(
flipper_adapter
).
tap
{
|
flip
|
flip
.
memoize
=
true
}
end
# This method is called from config/initializers/flipper.rb and can be used
...
...
spec/lib/feature_spec.rb
View file @
36c74352
...
...
@@ -64,4 +64,28 @@ describe Feature do
expect
(
described_class
.
all
).
to
eq
(
features
.
to_a
)
end
end
describe
'.flipper'
do
shared_examples
'a memoized Flipper instance'
do
it
'memoizes the Flipper instance'
do
expect
(
Flipper
).
to
receive
(
:new
).
once
.
and_call_original
2
.
times
do
described_class
.
flipper
end
end
end
context
'when request store is inactive'
do
before
do
described_class
.
instance_variable_set
(
:@flipper
,
nil
)
end
it_behaves_like
'a memoized Flipper instance'
end
context
'when request store is inactive'
,
:request_store
do
it_behaves_like
'a memoized Flipper instance'
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