Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
4aeb8a02c5
commit
fda8735029
|
|
@ -18,16 +18,23 @@
|
||||||
# runner, or network egress charges will apply:
|
# runner, or network egress charges will apply:
|
||||||
# https://cloud.google.com/storage/pricing
|
# https://cloud.google.com/storage/pricing
|
||||||
cache-repo:
|
cache-repo:
|
||||||
extends:
|
|
||||||
- .only:variables_refs-canonical-dot-com-schedules
|
|
||||||
image: gcr.io/google.com/cloudsdktool/cloud-sdk:alpine
|
image: gcr.io/google.com/cloudsdktool/cloud-sdk:alpine
|
||||||
stage: sync
|
stage: sync
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
variables:
|
variables:
|
||||||
GIT_DEPTH: 0
|
GIT_STRATEGY: none
|
||||||
TAR_FILENAME: /tmp/gitlab-master.tar
|
TAR_FILENAME: /tmp/gitlab-master.tar
|
||||||
script:
|
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
|
- gcloud auth activate-service-account --key-file=$CI_REPO_CACHE_CREDENTIALS
|
||||||
- tar cf $TAR_FILENAME .
|
- tar cf $TAR_FILENAME .
|
||||||
- gzip $TAR_FILENAME
|
- gzip $TAR_FILENAME
|
||||||
- gsutil cp $TAR_FILENAME.gz gs://gitlab-ci-git-repo-cache/project-$CI_PROJECT_ID/gitlab-master.tar.gz
|
- 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
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
|
import { GlBreakpointInstance as bp } from '@gitlab/ui/dist/utils';
|
||||||
import { highlightFeatures } from './feature_highlight';
|
import { highlightFeatures } from './feature_highlight';
|
||||||
import bp from '../breakpoints';
|
|
||||||
|
|
||||||
export default function domContentLoaded() {
|
export default function domContentLoaded() {
|
||||||
if (bp.getBreakpointSize() === 'lg') {
|
if (bp.getBreakpointSize() === 'xl') {
|
||||||
highlightFeatures();
|
highlightFeatures();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,8 @@
|
||||||
import _ from 'underscore';
|
import _ from 'underscore';
|
||||||
import bp from '~/breakpoints';
|
import { GlBreakpointInstance as bp } from '@gitlab/ui/dist/utils';
|
||||||
import { FREQUENT_ITEMS, HOUR_IN_MS } from './constants';
|
import { FREQUENT_ITEMS, HOUR_IN_MS } from './constants';
|
||||||
|
|
||||||
export const isMobile = () => {
|
export const isMobile = () => ['md', 'sm', 'xs'].includes(bp.getBreakpointSize());
|
||||||
const screenSize = bp.getBreakpointSize();
|
|
||||||
|
|
||||||
return screenSize === 'sm' || screenSize === 'xs';
|
|
||||||
};
|
|
||||||
|
|
||||||
export const getTopFrequentItems = items => {
|
export const getTopFrequentItems = items => {
|
||||||
if (!items) {
|
if (!items) {
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,9 @@ RspecProfiling.configure do |config|
|
||||||
RspecProfiling::VCS::Git.prepend(RspecProfilingExt::Git)
|
RspecProfiling::VCS::Git.prepend(RspecProfilingExt::Git)
|
||||||
RspecProfiling::Run.prepend(RspecProfilingExt::Run)
|
RspecProfiling::Run.prepend(RspecProfilingExt::Run)
|
||||||
config.collector = RspecProfilingExt::Collectors::CSVWithTimestamps
|
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
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,8 @@ module API
|
||||||
get do
|
get do
|
||||||
namespaces = current_user.admin ? Namespace.all : current_user.namespaces
|
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?
|
namespaces = namespaces.search(params[:search]) if params[:search].present?
|
||||||
|
|
||||||
options = { with: Entities::Namespace, current_user: current_user }
|
options = { with: Entities::Namespace, current_user: current_user }
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
|
import { GlBreakpointInstance as bp } from '@gitlab/ui/dist/utils';
|
||||||
import domContentLoaded from '~/feature_highlight/feature_highlight_options';
|
import domContentLoaded from '~/feature_highlight/feature_highlight_options';
|
||||||
import bp from '~/breakpoints';
|
|
||||||
|
|
||||||
describe('feature highlight options', () => {
|
describe('feature highlight options', () => {
|
||||||
describe('domContentLoaded', () => {
|
describe('domContentLoaded', () => {
|
||||||
|
|
@ -21,9 +21,15 @@ describe('feature highlight options', () => {
|
||||||
expect(domContentLoaded()).toBe(false);
|
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');
|
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);
|
expect(domContentLoaded()).toBe(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -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 { isMobile, getTopFrequentItems, updateExistingFrequentItem } from '~/frequent_items/utils';
|
||||||
import { HOUR_IN_MS, FREQUENT_ITEMS } from '~/frequent_items/constants';
|
import { HOUR_IN_MS, FREQUENT_ITEMS } from '~/frequent_items/constants';
|
||||||
import { mockProject, unsortedFrequentItems, sortedFrequentItems } from './mock_data';
|
import { mockProject, unsortedFrequentItems, sortedFrequentItems } from './mock_data';
|
||||||
|
|
||||||
describe('Frequent Items utils spec', () => {
|
describe('Frequent Items utils spec', () => {
|
||||||
describe('isMobile', () => {
|
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 ', () => {
|
it('returns true when the screen is small ', () => {
|
||||||
spyOn(bp, 'getBreakpointSize').and.returnValue('sm');
|
spyOn(bp, 'getBreakpointSize').and.returnValue('sm');
|
||||||
|
|
||||||
|
|
@ -17,8 +23,8 @@ describe('Frequent Items utils spec', () => {
|
||||||
expect(isMobile()).toBe(true);
|
expect(isMobile()).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns false when the screen is larger than small ', () => {
|
it('returns false when the screen is larger than medium ', () => {
|
||||||
spyOn(bp, 'getBreakpointSize').and.returnValue('md');
|
spyOn(bp, 'getBreakpointSize').and.returnValue('lg');
|
||||||
|
|
||||||
expect(isMobile()).toBe(false);
|
expect(isMobile()).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
@ -32,21 +38,21 @@ describe('Frequent Items utils spec', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns correct amount of items for mobile', () => {
|
it('returns correct amount of items for mobile', () => {
|
||||||
spyOn(bp, 'getBreakpointSize').and.returnValue('sm');
|
spyOn(bp, 'getBreakpointSize').and.returnValue('md');
|
||||||
const result = getTopFrequentItems(unsortedFrequentItems);
|
const result = getTopFrequentItems(unsortedFrequentItems);
|
||||||
|
|
||||||
expect(result.length).toBe(FREQUENT_ITEMS.LIST_COUNT_MOBILE);
|
expect(result.length).toBe(FREQUENT_ITEMS.LIST_COUNT_MOBILE);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns correct amount of items for desktop', () => {
|
it('returns correct amount of items for desktop', () => {
|
||||||
spyOn(bp, 'getBreakpointSize').and.returnValue('lg');
|
spyOn(bp, 'getBreakpointSize').and.returnValue('xl');
|
||||||
const result = getTopFrequentItems(unsortedFrequentItems);
|
const result = getTopFrequentItems(unsortedFrequentItems);
|
||||||
|
|
||||||
expect(result.length).toBe(FREQUENT_ITEMS.LIST_COUNT_DESKTOP);
|
expect(result.length).toBe(FREQUENT_ITEMS.LIST_COUNT_DESKTOP);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('sorts frequent items in order of frequency and lastAccessedOn', () => {
|
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 result = getTopFrequentItems(unsortedFrequentItems);
|
||||||
const expectedResult = sortedFrequentItems.slice(0, FREQUENT_ITEMS.LIST_COUNT_DESKTOP);
|
const expectedResult = sortedFrequentItems.slice(0, FREQUENT_ITEMS.LIST_COUNT_DESKTOP);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue