diff options
-rw-r--r-- | .gitlab/ci/cache-repo.gitlab-ci.yml | 13 | ||||
-rw-r--r-- | app/assets/javascripts/feature_highlight/feature_highlight_options.js | 4 | ||||
-rw-r--r-- | app/assets/javascripts/frequent_items/utils.js | 8 | ||||
-rw-r--r-- | config/initializers/rspec_profiling.rb | 5 | ||||
-rw-r--r-- | lib/api/namespaces.rb | 2 | ||||
-rw-r--r-- | spec/frontend/feature_highlight/feature_highlight_options_spec.js | 10 | ||||
-rw-r--r-- | spec/javascripts/frequent_items/utils_spec.js | 18 |
7 files changed, 40 insertions, 20 deletions
diff --git a/.gitlab/ci/cache-repo.gitlab-ci.yml b/.gitlab/ci/cache-repo.gitlab-ci.yml index f856afd3a02..1162e98e246 100644 --- a/.gitlab/ci/cache-repo.gitlab-ci.yml +++ b/.gitlab/ci/cache-repo.gitlab-ci.yml @@ -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 diff --git a/app/assets/javascripts/feature_highlight/feature_highlight_options.js b/app/assets/javascripts/feature_highlight/feature_highlight_options.js index 212643b1e04..c5553f0243f 100644 --- a/app/assets/javascripts/feature_highlight/feature_highlight_options.js +++ b/app/assets/javascripts/feature_highlight/feature_highlight_options.js @@ -1,8 +1,8 @@ +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; } diff --git a/app/assets/javascripts/frequent_items/utils.js b/app/assets/javascripts/frequent_items/utils.js index aba692e4b99..cc1668b1a0d 100644 --- a/app/assets/javascripts/frequent_items/utils.js +++ b/app/assets/javascripts/frequent_items/utils.js @@ -1,12 +1,8 @@ import _ from 'underscore'; -import bp from '~/breakpoints'; +import { GlBreakpointInstance as bp } from '@gitlab/ui/dist/utils'; 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) { diff --git a/config/initializers/rspec_profiling.rb b/config/initializers/rspec_profiling.rb index 715e17057e0..9f29e48a63e 100644 --- a/config/initializers/rspec_profiling.rb +++ b/config/initializers/rspec_profiling.rb @@ -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 diff --git a/lib/api/namespaces.rb b/lib/api/namespaces.rb index c51417d2889..e40a5dde7ce 100644 --- a/lib/api/namespaces.rb +++ b/lib/api/namespaces.rb @@ -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 } diff --git a/spec/frontend/feature_highlight/feature_highlight_options_spec.js b/spec/frontend/feature_highlight/feature_highlight_options_spec.js index cd41d1ed091..8b75c46fd4c 100644 --- a/spec/frontend/feature_highlight/feature_highlight_options_spec.js +++ b/spec/frontend/feature_highlight/feature_highlight_options_spec.js @@ -1,5 +1,5 @@ +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); }); }); diff --git a/spec/javascripts/frequent_items/utils_spec.js b/spec/javascripts/frequent_items/utils_spec.js index cd27d79b29a..2480af5b31d 100644 --- a/spec/javascripts/frequent_items/utils_spec.js +++ b/spec/javascripts/frequent_items/utils_spec.js @@ -1,10 +1,16 @@ -import bp from '~/breakpoints'; +import { GlBreakpointInstance as bp } from '@gitlab/ui/dist/utils'; 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); |