Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2022-11-05 00:07:57 +00:00
parent 8fc2555ccc
commit eaa9a0adf9
42 changed files with 118 additions and 52 deletions

View File

@ -153,7 +153,7 @@ Dangerfile @gl-quality/eng-prod
/app/assets/javascripts/pipeline_new/ @gitlab-org/ci-cd/verify/frontend /app/assets/javascripts/pipeline_new/ @gitlab-org/ci-cd/verify/frontend
/app/assets/javascripts/ci_lint/ @gitlab-org/ci-cd/verify/frontend /app/assets/javascripts/ci_lint/ @gitlab-org/ci-cd/verify/frontend
/app/assets/javascripts/ci_variable_list/ @gitlab-org/ci-cd/verify/frontend /app/assets/javascripts/ci_variable_list/ @gitlab-org/ci-cd/verify/frontend
/app/assets/javascripts/pipeline_schedules/ @gitlab-org/ci-cd/verify/frontend /app/assets/javascripts/ci/pipeline_schedules/ @gitlab-org/ci-cd/verify/frontend
/app/assets/javascripts/pipeline_editor/ @gitlab-org/ci-cd/verify/frontend /app/assets/javascripts/pipeline_editor/ @gitlab-org/ci-cd/verify/frontend
/ee/app/assets/javascripts/ci/ci_minutes_usage/ @gitlab-org/ci-cd/verify/frontend /ee/app/assets/javascripts/ci/ci_minutes_usage/ @gitlab-org/ci-cd/verify/frontend
/ee/app/assets/javascripts/usage_quotas/ci_minutes_usage/ @gitlab-org/ci-cd/verify/frontend /ee/app/assets/javascripts/usage_quotas/ci_minutes_usage/ @gitlab-org/ci-cd/verify/frontend

View File

@ -27,7 +27,7 @@ workhorse:test go:
extends: .workhorse:test extends: .workhorse:test
parallel: parallel:
matrix: matrix:
- GO_VERSION: ["1.17", "1.18", "1.19"] - GO_VERSION: ["1.18", "1.19"]
script: script:
- make -C workhorse test-coverage - make -C workhorse test-coverage
coverage: '/\d+.\d+%/' coverage: '/\d+.\d+%/'

View File

@ -1,4 +1,4 @@
import initPipelineSchedulesFormApp from '~/pipeline_schedules/mount_pipeline_schedules_form_app'; import initPipelineSchedulesFormApp from '~/ci/pipeline_schedules/mount_pipeline_schedules_form_app';
import initForm from '../shared/init_form'; import initForm from '../shared/init_form';
if (gon.features?.pipelineSchedulesVue) { if (gon.features?.pipelineSchedulesVue) {

View File

@ -1,7 +1,7 @@
import Vue from 'vue'; import Vue from 'vue';
import { BV_SHOW_MODAL } from '~/lib/utils/constants'; import { BV_SHOW_MODAL } from '~/lib/utils/constants';
import initPipelineSchedulesApp from '~/pipeline_schedules/mount_pipeline_schedules_app'; import initPipelineSchedulesApp from '~/ci/pipeline_schedules/mount_pipeline_schedules_app';
import PipelineSchedulesTakeOwnershipModalLegacy from '~/pipeline_schedules/components/take_ownership_modal_legacy.vue'; import PipelineSchedulesTakeOwnershipModalLegacy from '~/ci/pipeline_schedules/components/take_ownership_modal_legacy.vue';
import PipelineSchedulesCallout from '../shared/components/pipeline_schedules_callout.vue'; import PipelineSchedulesCallout from '../shared/components/pipeline_schedules_callout.vue';
function initPipelineSchedulesCallout() { function initPipelineSchedulesCallout() {

View File

@ -1,4 +1,4 @@
import initPipelineSchedulesFormApp from '~/pipeline_schedules/mount_pipeline_schedules_form_app'; import initPipelineSchedulesFormApp from '~/ci/pipeline_schedules/mount_pipeline_schedules_form_app';
import initForm from '../shared/init_form'; import initForm from '../shared/init_form';
if (gon.features?.pipelineSchedulesVue) { if (gon.features?.pipelineSchedulesVue) {

View File

@ -2,6 +2,8 @@
import { GlTabs, GlTab } from '@gitlab/ui'; import { GlTabs, GlTab } from '@gitlab/ui';
import API from '~/api'; import API from '~/api';
import { mergeUrlParams, updateHistory, getParameterValues } from '~/lib/utils/url_utility'; import { mergeUrlParams, updateHistory, getParameterValues } from '~/lib/utils/url_utility';
import Tracking from '~/tracking';
import { SNOWPLOW_DATA_SOURCE, SNOWPLOW_LABEL, SNOWPLOW_SCHEMA } from '../constants';
import PipelineCharts from './pipeline_charts.vue'; import PipelineCharts from './pipeline_charts.vue';
export default { export default {
@ -23,6 +25,7 @@ export default {
leadTimeTabEvent: 'p_analytics_ci_cd_lead_time', leadTimeTabEvent: 'p_analytics_ci_cd_lead_time',
timeToRestoreServiceTabEvent: 'p_analytics_ci_cd_time_to_restore_service', timeToRestoreServiceTabEvent: 'p_analytics_ci_cd_time_to_restore_service',
changeFailureRateTabEvent: 'p_analytics_ci_cd_change_failure_rate', changeFailureRateTabEvent: 'p_analytics_ci_cd_change_failure_rate',
mixins: [Tracking.mixin()],
inject: { inject: {
shouldRenderDoraCharts: { shouldRenderDoraCharts: {
type: Boolean, type: Boolean,
@ -75,8 +78,21 @@ export default {
updateHistory({ url: path, title: window.title }); updateHistory({ url: path, title: window.title });
} }
}, },
trackTabClick(tab) { trackTabClick(event, snowplow = false) {
API.trackRedisHllUserEvent(tab); API.trackRedisHllUserEvent(event);
if (snowplow) {
this.track('click_tab', {
label: SNOWPLOW_LABEL,
context: {
schema: SNOWPLOW_SCHEMA,
data: {
event_name: event,
data_source: SNOWPLOW_DATA_SOURCE,
},
},
});
}
}, },
}, },
}; };
@ -87,7 +103,7 @@ export default {
<gl-tab <gl-tab
:title="__('Pipelines')" :title="__('Pipelines')"
data-testid="pipelines-tab" data-testid="pipelines-tab"
@click="trackTabClick($options.piplelinesTabEvent)" @click="trackTabClick($options.piplelinesTabEvent, true)"
> >
<pipeline-charts /> <pipeline-charts />
</gl-tab> </gl-tab>
@ -95,14 +111,14 @@ export default {
<gl-tab <gl-tab
:title="__('Deployment frequency')" :title="__('Deployment frequency')"
data-testid="deployment-frequency-tab" data-testid="deployment-frequency-tab"
@click="trackTabClick($options.deploymentFrequencyTabEvent)" @click="trackTabClick($options.deploymentFrequencyTabEvent, true)"
> >
<deployment-frequency-charts /> <deployment-frequency-charts />
</gl-tab> </gl-tab>
<gl-tab <gl-tab
:title="__('Lead time')" :title="__('Lead time')"
data-testid="lead-time-tab" data-testid="lead-time-tab"
@click="trackTabClick($options.leadTimeTabEvent)" @click="trackTabClick($options.leadTimeTabEvent, true)"
> >
<lead-time-charts /> <lead-time-charts />
</gl-tab> </gl-tab>

View File

@ -19,3 +19,7 @@ export const PARSE_FAILURE = 'parse_failure';
export const LOAD_ANALYTICS_FAILURE = 'load_analytics_failure'; export const LOAD_ANALYTICS_FAILURE = 'load_analytics_failure';
export const LOAD_PIPELINES_FAILURE = 'load_analytics_failure'; export const LOAD_PIPELINES_FAILURE = 'load_analytics_failure';
export const UNSUPPORTED_DATA = 'unsupported_data'; export const UNSUPPORTED_DATA = 'unsupported_data';
export const SNOWPLOW_LABEL = 'redis_hll_counters.analytics.analytics_total_unique_counts_monthly';
export const SNOWPLOW_SCHEMA = 'iglu:com.gitlab/gitlab_service_ping/jsonschema/1-0-0';
export const SNOWPLOW_DATA_SOURCE = 'redis_hll';

View File

@ -124,6 +124,7 @@ From there, you can see the following actions:
- Require user password to approve. - Require user password to approve.
- Remove all approvals when commits are added to the source branch. - Remove all approvals when commits are added to the source branch.
- Changes to streaming audit destination custom HTTP headers. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/366350) in GitLab 15.3. - Changes to streaming audit destination custom HTTP headers. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/366350) in GitLab 15.3.
- Group had a security policy project linked, changed, or unlinked. ([Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/377877) in GitLab 15.6)
Group events can also be accessed via the [Group Audit Events API](../api/audit_events.md#group-audit-events) Group events can also be accessed via the [Group Audit Events API](../api/audit_events.md#group-audit-events)
@ -194,6 +195,7 @@ From there, you can see the following actions:
- Squash commit message template is updated ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/355805) in GitLab 15.0) - Squash commit message template is updated ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/355805) in GitLab 15.0)
- Default description template for merge requests is updated ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/355805) in GitLab 15.0) - Default description template for merge requests is updated ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/355805) in GitLab 15.0)
- Project was scheduled for deletion due to inactivity ([introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/85689) in GitLab 15.0) - Project was scheduled for deletion due to inactivity ([introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/85689) in GitLab 15.0)
- Project had a security policy project linked, changed, or unlinked ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/377877) in GitLab 15.6)
Project events can also be accessed via the [Project Audit Events API](../api/audit_events.md#project-audit-events). Project events can also be accessed via the [Project Audit Events API](../api/audit_events.md#project-audit-events).

View File

@ -49,7 +49,7 @@ If the highest number stable branch is unclear, check the [GitLab blog](https://
| Software | Minimum version | Notes | | Software | Minimum version | Notes |
| ------------------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | ------------------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [Ruby](#2-ruby) | `2.7` | From GitLab 13.6, Ruby 2.7 is required. Ruby 3.0 is not supported yet (see [the relevant epic](https://gitlab.com/groups/gitlab-org/-/epics/5149) for the current status). You must use the standard MRI implementation of Ruby. We love [JRuby](https://www.jruby.org/) and [Rubinius](https://github.com/rubinius/rubinius#the-rubinius-language-platform), but GitLab needs several Gems that have native extensions. | | [Ruby](#2-ruby) | `2.7` | From GitLab 13.6, Ruby 2.7 is required. Ruby 3.0 is not supported yet (see [the relevant epic](https://gitlab.com/groups/gitlab-org/-/epics/5149) for the current status). You must use the standard MRI implementation of Ruby. We love [JRuby](https://www.jruby.org/) and [Rubinius](https://github.com/rubinius/rubinius#the-rubinius-language-platform), but GitLab needs several Gems that have native extensions. |
| [Go](#3-go) | `1.17` | From GitLab 15.2, Go 1.17 or later is required. | | [Go](#3-go) | `1.18` | From GitLab 15.6, Go 1.18 or later is required. |
| [Git](#git) | `2.37.x` | From GitLab 15.6, Git 2.37.x and later is required. It's highly recommended that you use the [Git version provided by Gitaly](#git). | | [Git](#git) | `2.37.x` | From GitLab 15.6, Git 2.37.x and later is required. It's highly recommended that you use the [Git version provided by Gitaly](#git). |
| [Node.js](#4-node) | `14.15.0` | GitLab uses [webpack](https://webpack.js.org/) to compile frontend assets. Node.js 16.x is recommended, as it's faster. You can check which version you're running with `node -v`. You must update it to a newer version if needed. | | [Node.js](#4-node) | `14.15.0` | GitLab uses [webpack](https://webpack.js.org/) to compile frontend assets. Node.js 16.x is recommended, as it's faster. You can check which version you're running with `node -v`. You must update it to a newer version if needed. |
@ -250,11 +250,11 @@ Linux. You can find downloads for other platforms at the
# Remove former Go installation folder # Remove former Go installation folder
sudo rm -rf /usr/local/go sudo rm -rf /usr/local/go
curl --remote-name --location --progress-bar "https://go.dev/dl/go1.17.10.linux-amd64.tar.gz" curl --remote-name --location --progress-bar "https://go.dev/dl/go1.18.8.linux-amd64.tar.gz"
echo '87fc728c9c731e2f74e4a999ef53cf07302d7ed3504b0839027bd9c10edaa3fd go1.17.10.linux-amd64.tar.gz' | shasum -a256 -c - && \ echo '4d854c7bad52d53470cf32f1b287a5c0c441dc6b98306dea27358e099698142a go1.18.8.linux-amd64.tar.gz' | shasum -a256 -c - && \
sudo tar -C /usr/local -xzf go1.17.10.linux-amd64.tar.gz sudo tar -C /usr/local -xzf go1.18.8.linux-amd64.tar.gz
sudo ln -sf /usr/local/go/bin/{go,gofmt} /usr/local/bin/ sudo ln -sf /usr/local/go/bin/{go,gofmt} /usr/local/bin/
rm go1.17.10.linux-amd64.tar.gz rm go1.18.8.linux-amd64.tar.gz
``` ```
## 4. Node ## 4. Node

View File

@ -107,11 +107,11 @@ Download and install Go (for Linux, 64-bit):
# Remove former Go installation folder # Remove former Go installation folder
sudo rm -rf /usr/local/go sudo rm -rf /usr/local/go
curl --remote-name --location --progress-bar "https://go.dev/dl/go1.17.10.linux-amd64.tar.gz" curl --remote-name --location --progress-bar "https://go.dev/dl/go1.18.8.linux-amd64.tar.gz"
echo '87fc728c9c731e2f74e4a999ef53cf07302d7ed3504b0839027bd9c10edaa3fd go1.17.10.linux-amd64.tar.gz' | shasum -a256 -c - && \ echo '4d854c7bad52d53470cf32f1b287a5c0c441dc6b98306dea27358e099698142a go1.18.8.linux-amd64.tar.gz' | shasum -a256 -c - && \
sudo tar -C /usr/local -xzf go1.17.10.linux-amd64.tar.gz sudo tar -C /usr/local -xzf go1.18.8.linux-amd64.tar.gz
sudo ln -sf /usr/local/go/bin/{go,gofmt} /usr/local/bin/ sudo ln -sf /usr/local/go/bin/{go,gofmt} /usr/local/bin/
rm go1.17.10.linux-amd64.tar.gz rm go1.18.8.linux-amd64.tar.gz
``` ```
### 6. Update Git ### 6. Update Git

View File

@ -4,7 +4,7 @@ group: Anti-Abuse
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
--- ---
# Git abuse rate limit **(ULTIMATE SELF)** # Git abuse rate limit (administration) **(ULTIMATE SELF)**
> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/8066) in GitLab 15.2 [with a flag](../../../administration/feature_flags.md) named `git_abuse_rate_limit_feature_flag`. Disabled by default. > [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/8066) in GitLab 15.2 [with a flag](../../../administration/feature_flags.md) named `git_abuse_rate_limit_feature_flag`. Disabled by default.

View File

@ -4,7 +4,7 @@ group: Anti-Abuse
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
--- ---
# Git abuse rate limit (administration) **(ULTIMATE SELF)** # Git abuse rate limit **(ULTIMATE SELF)**
> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/8066) in GitLab 15.2 [with a flag](../../../administration/feature_flags.md) named `limit_unique_project_downloads_per_namespace_user`. Disabled by default. > [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/8066) in GitLab 15.2 [with a flag](../../../administration/feature_flags.md) named `limit_unique_project_downloads_per_namespace_user`. Disabled by default.

View File

@ -1,6 +1,6 @@
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlModal } from '@gitlab/ui'; import { GlModal } from '@gitlab/ui';
import DeletePipelineScheduleModal from '~/pipeline_schedules/components/delete_pipeline_schedule_modal.vue'; import DeletePipelineScheduleModal from '~/ci/pipeline_schedules/components/delete_pipeline_schedule_modal.vue';
describe('Delete pipeline schedule modal', () => { describe('Delete pipeline schedule modal', () => {
let wrapper; let wrapper;

View File

@ -1,6 +1,6 @@
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlForm } from '@gitlab/ui'; import { GlForm } from '@gitlab/ui';
import PipelineSchedulesForm from '~/pipeline_schedules/components/pipeline_schedules_form.vue'; import PipelineSchedulesForm from '~/ci/pipeline_schedules/components/pipeline_schedules_form.vue';
describe('Pipeline schedules form', () => { describe('Pipeline schedules form', () => {
let wrapper; let wrapper;

View File

@ -5,13 +5,13 @@ import { trimText } from 'helpers/text_helper';
import createMockApollo from 'helpers/mock_apollo_helper'; import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises'; import waitForPromises from 'helpers/wait_for_promises';
import { mountExtended } from 'helpers/vue_test_utils_helper'; import { mountExtended } from 'helpers/vue_test_utils_helper';
import PipelineSchedules from '~/pipeline_schedules/components/pipeline_schedules.vue'; import PipelineSchedules from '~/ci/pipeline_schedules/components/pipeline_schedules.vue';
import DeletePipelineScheduleModal from '~/pipeline_schedules/components/delete_pipeline_schedule_modal.vue'; import DeletePipelineScheduleModal from '~/ci/pipeline_schedules/components/delete_pipeline_schedule_modal.vue';
import TakeOwnershipModal from '~/pipeline_schedules/components/take_ownership_modal.vue'; import TakeOwnershipModal from '~/ci/pipeline_schedules/components/take_ownership_modal.vue';
import PipelineSchedulesTable from '~/pipeline_schedules/components/table/pipeline_schedules_table.vue'; import PipelineSchedulesTable from '~/ci/pipeline_schedules/components/table/pipeline_schedules_table.vue';
import deletePipelineScheduleMutation from '~/pipeline_schedules/graphql/mutations/delete_pipeline_schedule.mutation.graphql'; import deletePipelineScheduleMutation from '~/ci/pipeline_schedules/graphql/mutations/delete_pipeline_schedule.mutation.graphql';
import takeOwnershipMutation from '~/pipeline_schedules/graphql/mutations/take_ownership.mutation.graphql'; import takeOwnershipMutation from '~/ci/pipeline_schedules/graphql/mutations/take_ownership.mutation.graphql';
import getPipelineSchedulesQuery from '~/pipeline_schedules/graphql/queries/get_pipeline_schedules.query.graphql'; import getPipelineSchedulesQuery from '~/ci/pipeline_schedules/graphql/queries/get_pipeline_schedules.query.graphql';
import { import {
mockGetPipelineSchedulesGraphQLResponse, mockGetPipelineSchedulesGraphQLResponse,
mockPipelineScheduleNodes, mockPipelineScheduleNodes,

View File

@ -1,6 +1,6 @@
import { GlButton } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import PipelineScheduleActions from '~/pipeline_schedules/components/table/cells/pipeline_schedule_actions.vue'; import PipelineScheduleActions from '~/ci/pipeline_schedules/components/table/cells/pipeline_schedule_actions.vue';
import { import {
mockPipelineScheduleNodes, mockPipelineScheduleNodes,
mockPipelineScheduleAsGuestNodes, mockPipelineScheduleAsGuestNodes,

View File

@ -1,6 +1,6 @@
import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import CiBadge from '~/vue_shared/components/ci_badge_link.vue'; import CiBadge from '~/vue_shared/components/ci_badge_link.vue';
import PipelineScheduleLastPipeline from '~/pipeline_schedules/components/table/cells/pipeline_schedule_last_pipeline.vue'; import PipelineScheduleLastPipeline from '~/ci/pipeline_schedules/components/table/cells/pipeline_schedule_last_pipeline.vue';
import { mockPipelineScheduleNodes } from '../../../mock_data'; import { mockPipelineScheduleNodes } from '../../../mock_data';
describe('Pipeline schedule last pipeline', () => { describe('Pipeline schedule last pipeline', () => {

View File

@ -1,5 +1,5 @@
import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import PipelineScheduleNextRun from '~/pipeline_schedules/components/table/cells/pipeline_schedule_next_run.vue'; import PipelineScheduleNextRun from '~/ci/pipeline_schedules/components/table/cells/pipeline_schedule_next_run.vue';
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue'; import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
import { mockPipelineScheduleNodes } from '../../../mock_data'; import { mockPipelineScheduleNodes } from '../../../mock_data';

View File

@ -1,6 +1,6 @@
import { GlAvatar, GlAvatarLink } from '@gitlab/ui'; import { GlAvatar, GlAvatarLink } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import PipelineScheduleOwner from '~/pipeline_schedules/components/table/cells/pipeline_schedule_owner.vue'; import PipelineScheduleOwner from '~/ci/pipeline_schedules/components/table/cells/pipeline_schedule_owner.vue';
import { mockPipelineScheduleNodes } from '../../../mock_data'; import { mockPipelineScheduleNodes } from '../../../mock_data';
describe('Pipeline schedule owner', () => { describe('Pipeline schedule owner', () => {

View File

@ -1,6 +1,6 @@
import { GlIcon, GlLink } from '@gitlab/ui'; import { GlIcon, GlLink } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import PipelineScheduleTarget from '~/pipeline_schedules/components/table/cells/pipeline_schedule_target.vue'; import PipelineScheduleTarget from '~/ci/pipeline_schedules/components/table/cells/pipeline_schedule_target.vue';
import { mockPipelineScheduleNodes } from '../../../mock_data'; import { mockPipelineScheduleNodes } from '../../../mock_data';
describe('Pipeline schedule target', () => { describe('Pipeline schedule target', () => {

View File

@ -1,6 +1,6 @@
import { GlTableLite } from '@gitlab/ui'; import { GlTableLite } from '@gitlab/ui';
import { mountExtended } from 'helpers/vue_test_utils_helper'; import { mountExtended } from 'helpers/vue_test_utils_helper';
import PipelineSchedulesTable from '~/pipeline_schedules/components/table/pipeline_schedules_table.vue'; import PipelineSchedulesTable from '~/ci/pipeline_schedules/components/table/pipeline_schedules_table.vue';
import { mockPipelineScheduleNodes } from '../../mock_data'; import { mockPipelineScheduleNodes } from '../../mock_data';
describe('Pipeline schedules table', () => { describe('Pipeline schedules table', () => {

View File

@ -1,6 +1,6 @@
import { GlModal } from '@gitlab/ui'; import { GlModal } from '@gitlab/ui';
import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import TakeOwnershipModalLegacy from '~/pipeline_schedules/components/take_ownership_modal_legacy.vue'; import TakeOwnershipModalLegacy from '~/ci/pipeline_schedules/components/take_ownership_modal_legacy.vue';
describe('Take ownership modal', () => { describe('Take ownership modal', () => {
let wrapper; let wrapper;

View File

@ -1,6 +1,6 @@
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlModal } from '@gitlab/ui'; import { GlModal } from '@gitlab/ui';
import TakeOwnershipModal from '~/pipeline_schedules/components/take_ownership_modal.vue'; import TakeOwnershipModal from '~/ci/pipeline_schedules/components/take_ownership_modal.vue';
describe('Take ownership modal', () => { describe('Take ownership modal', () => {
let wrapper; let wrapper;

View File

@ -54,7 +54,7 @@ RSpec.describe 'Pipeline schedules (JavaScript fixtures)' do
get_pipeline_schedules_query = 'get_pipeline_schedules.query.graphql' get_pipeline_schedules_query = 'get_pipeline_schedules.query.graphql'
let_it_be(:query) do let_it_be(:query) do
get_graphql_query_as_string("pipeline_schedules/graphql/queries/#{get_pipeline_schedules_query}") get_graphql_query_as_string("ci/pipeline_schedules/graphql/queries/#{get_pipeline_schedules_query}")
end end
it "#{fixtures_path}#{get_pipeline_schedules_query}.json" do it "#{fixtures_path}#{get_pipeline_schedules_query}.json" do

View File

@ -8,6 +8,12 @@ import { mergeUrlParams, updateHistory, getParameterValues } from '~/lib/utils/u
import Component from '~/projects/pipelines/charts/components/app.vue'; import Component from '~/projects/pipelines/charts/components/app.vue';
import PipelineCharts from '~/projects/pipelines/charts/components/pipeline_charts.vue'; import PipelineCharts from '~/projects/pipelines/charts/components/pipeline_charts.vue';
import API from '~/api'; import API from '~/api';
import { mockTracking } from 'helpers/tracking_helper';
import {
SNOWPLOW_DATA_SOURCE,
SNOWPLOW_LABEL,
SNOWPLOW_SCHEMA,
} from '~/projects/pipelines/charts/constants';
jest.mock('~/lib/utils/url_utility'); jest.mock('~/lib/utils/url_utility');
@ -125,21 +131,59 @@ describe('ProjectsPipelinesChartsApp', () => {
}); });
describe('event tracking', () => { describe('event tracking', () => {
it.each` describe('RedisHLL events', () => {
testId | event it.each`
${'pipelines-tab'} | ${'p_analytics_ci_cd_pipelines'} testId | event
${'deployment-frequency-tab'} | ${'p_analytics_ci_cd_deployment_frequency'} ${'pipelines-tab'} | ${'p_analytics_ci_cd_pipelines'}
${'lead-time-tab'} | ${'p_analytics_ci_cd_lead_time'} ${'deployment-frequency-tab'} | ${'p_analytics_ci_cd_deployment_frequency'}
${'time-to-restore-service-tab'} | ${'p_analytics_ci_cd_time_to_restore_service'} ${'lead-time-tab'} | ${'p_analytics_ci_cd_lead_time'}
${'change-failure-rate-tab'} | ${'p_analytics_ci_cd_change_failure_rate'} ${'time-to-restore-service-tab'} | ${'p_analytics_ci_cd_time_to_restore_service'}
`('tracks the $event event when clicked', ({ testId, event }) => { ${'change-failure-rate-tab'} | ${'p_analytics_ci_cd_change_failure_rate'}
jest.spyOn(API, 'trackRedisHllUserEvent'); `('tracks the $event event when clicked', ({ testId, event }) => {
const trackApiSpy = jest.spyOn(API, 'trackRedisHllUserEvent');
expect(API.trackRedisHllUserEvent).not.toHaveBeenCalled(); expect(trackApiSpy).not.toHaveBeenCalled();
wrapper.findByTestId(testId).vm.$emit('click'); wrapper.findByTestId(testId).vm.$emit('click');
expect(API.trackRedisHllUserEvent).toHaveBeenCalledWith(event); expect(trackApiSpy).toHaveBeenCalledWith(event);
});
});
describe('Snowplow events', () => {
it.each`
testId | event
${'pipelines-tab'} | ${'p_analytics_ci_cd_pipelines'}
${'deployment-frequency-tab'} | ${'p_analytics_ci_cd_deployment_frequency'}
${'lead-time-tab'} | ${'p_analytics_ci_cd_lead_time'}
`('tracks the $event event when clicked', ({ testId, event }) => {
const trackingSpy = mockTracking(undefined, wrapper.element, jest.spyOn);
wrapper.findByTestId(testId).vm.$emit('click');
expect(trackingSpy).toHaveBeenCalledWith(undefined, 'click_tab', {
label: SNOWPLOW_LABEL,
context: {
schema: SNOWPLOW_SCHEMA,
data: {
event_name: event,
data_source: SNOWPLOW_DATA_SOURCE,
},
},
});
});
it.each`
tab
${'time-to-restore-service-tab'}
${'change-failure-rate-tab'}
`('does not track when tab $tab is clicked', ({ tab }) => {
const trackingSpy = mockTracking(undefined, wrapper.element, jest.spyOn);
wrapper.findByTestId(tab).vm.$emit('click');
expect(trackingSpy).not.toHaveBeenCalled();
});
}); });
}); });
}); });