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
fda87350
Commit
fda87350
authored
Dec 23, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add latest changes from gitlab-org/gitlab@master
parent
4aeb8a02
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
40 additions
and
20 deletions
+40
-20
.gitlab/ci/cache-repo.gitlab-ci.yml
.gitlab/ci/cache-repo.gitlab-ci.yml
+10
-3
app/assets/javascripts/feature_highlight/feature_highlight_options.js
...avascripts/feature_highlight/feature_highlight_options.js
+2
-2
app/assets/javascripts/frequent_items/utils.js
app/assets/javascripts/frequent_items/utils.js
+2
-6
config/initializers/rspec_profiling.rb
config/initializers/rspec_profiling.rb
+4
-1
lib/api/namespaces.rb
lib/api/namespaces.rb
+2
-0
spec/frontend/feature_highlight/feature_highlight_options_spec.js
...ntend/feature_highlight/feature_highlight_options_spec.js
+8
-2
spec/javascripts/frequent_items/utils_spec.js
spec/javascripts/frequent_items/utils_spec.js
+12
-6
No files found.
.gitlab/ci/cache-repo.gitlab-ci.yml
View file @
fda87350
...
...
@@ -18,16 +18,23 @@
# runner, or network egress charges will apply:
# https://cloud.google.com/storage/pricing
cache-repo
:
extends
:
-
.only:variables_refs-canonical-dot-com-schedules
image
:
gcr.io/google.com/cloudsdktool/cloud-sdk:alpine
stage
:
sync
allow_failure
:
true
variables
:
GIT_
DEPTH
:
0
GIT_
STRATEGY
:
none
TAR_FILENAME
:
/tmp/gitlab-master.tar
script
:
-
cd ..
-
rm -rf $CI_PROJECT_NAME
-
git clone --progress $CI_REPOSITORY_URL $CI_PROJECT_NAME
-
cd $CI_PROJECT_NAME
-
gcloud auth activate-service-account --key-file=$CI_REPO_CACHE_CREDENTIALS
-
tar cf $TAR_FILENAME .
-
gzip $TAR_FILENAME
-
gsutil cp $TAR_FILENAME.gz gs://gitlab-ci-git-repo-cache/project-$CI_PROJECT_ID/gitlab-master.tar.gz
only
:
variables
:
-
$CI_REPO_CACHE_CREDENTIALS
refs
:
-
schedules
app/assets/javascripts/feature_highlight/feature_highlight_options.js
View file @
fda87350
import
{
GlBreakpointInstance
as
bp
}
from
'
@gitlab/ui/dist/utils
'
;
import
{
highlightFeatures
}
from
'
./feature_highlight
'
;
import
bp
from
'
../breakpoints
'
;
export
default
function
domContentLoaded
()
{
if
(
bp
.
getBreakpointSize
()
===
'
lg
'
)
{
if
(
bp
.
getBreakpointSize
()
===
'
xl
'
)
{
highlightFeatures
();
return
true
;
}
...
...
app/assets/javascripts/frequent_items/utils.js
View file @
fda87350
import
_
from
'
underscore
'
;
import
bp
from
'
~/breakpoint
s
'
;
import
{
GlBreakpointInstance
as
bp
}
from
'
@gitlab/ui/dist/util
s
'
;
import
{
FREQUENT_ITEMS
,
HOUR_IN_MS
}
from
'
./constants
'
;
export
const
isMobile
=
()
=>
{
const
screenSize
=
bp
.
getBreakpointSize
();
return
screenSize
===
'
sm
'
||
screenSize
===
'
xs
'
;
};
export
const
isMobile
=
()
=>
[
'
md
'
,
'
sm
'
,
'
xs
'
].
includes
(
bp
.
getBreakpointSize
());
export
const
getTopFrequentItems
=
items
=>
{
if
(
!
items
)
{
...
...
config/initializers/rspec_profiling.rb
View file @
fda87350
...
...
@@ -60,6 +60,9 @@ RspecProfiling.configure do |config|
RspecProfiling
::
VCS
::
Git
.
prepend
(
RspecProfilingExt
::
Git
)
RspecProfiling
::
Run
.
prepend
(
RspecProfilingExt
::
Run
)
config
.
collector
=
RspecProfilingExt
::
Collectors
::
CSVWithTimestamps
config
.
csv_path
=
->
{
"rspec_profiling/
#{
Time
.
now
.
to_i
}
-
#{
SecureRandom
.
hex
(
8
)
}
-rspec-data.csv"
}
config
.
csv_path
=
->
do
prefix
=
"
#{
ENV
[
'CI_JOB_NAME'
]
}
-"
.
tr
(
' '
,
'-'
)
if
ENV
[
'CI_JOB_NAME'
]
"rspec_profiling/
#{
prefix
}#{
Time
.
now
.
to_i
}
-
#{
SecureRandom
.
hex
(
8
)
}
-rspec-data.csv"
end
end
end
lib/api/namespaces.rb
View file @
fda87350
...
...
@@ -32,6 +32,8 @@ module API
get
do
namespaces
=
current_user
.
admin
?
Namespace
.
all
:
current_user
.
namespaces
namespaces
=
namespaces
.
include_gitlab_subscription
if
Gitlab
.
ee?
namespaces
=
namespaces
.
search
(
params
[
:search
])
if
params
[
:search
].
present?
options
=
{
with:
Entities
::
Namespace
,
current_user:
current_user
}
...
...
spec/frontend/feature_highlight/feature_highlight_options_spec.js
View file @
fda87350
import
{
GlBreakpointInstance
as
bp
}
from
'
@gitlab/ui/dist/utils
'
;
import
domContentLoaded
from
'
~/feature_highlight/feature_highlight_options
'
;
import
bp
from
'
~/breakpoints
'
;
describe
(
'
feature highlight options
'
,
()
=>
{
describe
(
'
domContentLoaded
'
,
()
=>
{
...
...
@@ -21,9 +21,15 @@ describe('feature highlight options', () => {
expect
(
domContentLoaded
()).
toBe
(
false
);
});
it
(
'
should
call highlightFeatures when breakpoint is lg
'
,
()
=>
{
it
(
'
should
not call highlightFeatures when breakpoint is not xl
'
,
()
=>
{
jest
.
spyOn
(
bp
,
'
getBreakpointSize
'
).
mockReturnValue
(
'
lg
'
);
expect
(
domContentLoaded
()).
toBe
(
false
);
});
it
(
'
should call highlightFeatures when breakpoint is xl
'
,
()
=>
{
jest
.
spyOn
(
bp
,
'
getBreakpointSize
'
).
mockReturnValue
(
'
xl
'
);
expect
(
domContentLoaded
()).
toBe
(
true
);
});
});
...
...
spec/javascripts/frequent_items/utils_spec.js
View file @
fda87350
import
bp
from
'
~/breakpoint
s
'
;
import
{
GlBreakpointInstance
as
bp
}
from
'
@gitlab/ui/dist/util
s
'
;
import
{
isMobile
,
getTopFrequentItems
,
updateExistingFrequentItem
}
from
'
~/frequent_items/utils
'
;
import
{
HOUR_IN_MS
,
FREQUENT_ITEMS
}
from
'
~/frequent_items/constants
'
;
import
{
mockProject
,
unsortedFrequentItems
,
sortedFrequentItems
}
from
'
./mock_data
'
;
describe
(
'
Frequent Items utils spec
'
,
()
=>
{
describe
(
'
isMobile
'
,
()
=>
{
it
(
'
returns true when the screen is medium
'
,
()
=>
{
spyOn
(
bp
,
'
getBreakpointSize
'
).
and
.
returnValue
(
'
md
'
);
expect
(
isMobile
()).
toBe
(
true
);
});
it
(
'
returns true when the screen is small
'
,
()
=>
{
spyOn
(
bp
,
'
getBreakpointSize
'
).
and
.
returnValue
(
'
sm
'
);
...
...
@@ -17,8 +23,8 @@ describe('Frequent Items utils spec', () => {
expect
(
isMobile
()).
toBe
(
true
);
});
it
(
'
returns false when the screen is larger than
small
'
,
()
=>
{
spyOn
(
bp
,
'
getBreakpointSize
'
).
and
.
returnValue
(
'
md
'
);
it
(
'
returns false when the screen is larger than
medium
'
,
()
=>
{
spyOn
(
bp
,
'
getBreakpointSize
'
).
and
.
returnValue
(
'
lg
'
);
expect
(
isMobile
()).
toBe
(
false
);
});
...
...
@@ -32,21 +38,21 @@ describe('Frequent Items utils spec', () => {
});
it
(
'
returns correct amount of items for mobile
'
,
()
=>
{
spyOn
(
bp
,
'
getBreakpointSize
'
).
and
.
returnValue
(
'
sm
'
);
spyOn
(
bp
,
'
getBreakpointSize
'
).
and
.
returnValue
(
'
md
'
);
const
result
=
getTopFrequentItems
(
unsortedFrequentItems
);
expect
(
result
.
length
).
toBe
(
FREQUENT_ITEMS
.
LIST_COUNT_MOBILE
);
});
it
(
'
returns correct amount of items for desktop
'
,
()
=>
{
spyOn
(
bp
,
'
getBreakpointSize
'
).
and
.
returnValue
(
'
lg
'
);
spyOn
(
bp
,
'
getBreakpointSize
'
).
and
.
returnValue
(
'
xl
'
);
const
result
=
getTopFrequentItems
(
unsortedFrequentItems
);
expect
(
result
.
length
).
toBe
(
FREQUENT_ITEMS
.
LIST_COUNT_DESKTOP
);
});
it
(
'
sorts frequent items in order of frequency and lastAccessedOn
'
,
()
=>
{
spyOn
(
bp
,
'
getBreakpointSize
'
).
and
.
returnValue
(
'
lg
'
);
spyOn
(
bp
,
'
getBreakpointSize
'
).
and
.
returnValue
(
'
xl
'
);
const
result
=
getTopFrequentItems
(
unsortedFrequentItems
);
const
expectedResult
=
sortedFrequentItems
.
slice
(
0
,
FREQUENT_ITEMS
.
LIST_COUNT_DESKTOP
);
...
...
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