Commit a77833c3 authored by Olena Horal-Koretska's avatar Olena Horal-Koretska

Merge branch '334222-plain-renaming-usage-ping-data-to-service-ping-data-on-frontend' into 'master'

Plain renaming Usage Ping/Data to Service Ping/Data on Frontend

See merge request gitlab-org/gitlab!64855
parents 8bd3a911 99a44615
...@@ -83,8 +83,8 @@ const Api = { ...@@ -83,8 +83,8 @@ const Api = {
tagsPath: '/api/:version/projects/:id/repository/tags', tagsPath: '/api/:version/projects/:id/repository/tags',
freezePeriodsPath: '/api/:version/projects/:id/freeze_periods', freezePeriodsPath: '/api/:version/projects/:id/freeze_periods',
freezePeriodPath: '/api/:version/projects/:id/freeze_periods/:freeze_period_id', freezePeriodPath: '/api/:version/projects/:id/freeze_periods/:freeze_period_id',
usageDataIncrementCounterPath: '/api/:version/usage_data/increment_counter', serviceDataIncrementCounterPath: '/api/:version/usage_data/increment_counter',
usageDataIncrementUniqueUsersPath: '/api/:version/usage_data/increment_unique_users', serviceDataIncrementUniqueUsersPath: '/api/:version/usage_data/increment_unique_users',
featureFlagUserLists: '/api/:version/projects/:id/feature_flags_user_lists', featureFlagUserLists: '/api/:version/projects/:id/feature_flags_user_lists',
featureFlagUserList: '/api/:version/projects/:id/feature_flags_user_lists/:list_iid', featureFlagUserList: '/api/:version/projects/:id/feature_flags_user_lists/:list_iid',
containerRegistryDetailsPath: '/api/:version/registry/repositories/:id/', containerRegistryDetailsPath: '/api/:version/registry/repositories/:id/',
...@@ -875,7 +875,7 @@ const Api = { ...@@ -875,7 +875,7 @@ const Api = {
return null; return null;
} }
const url = Api.buildUrl(this.usageDataIncrementCounterPath); const url = Api.buildUrl(this.serviceDataIncrementCounterPath);
const headers = { const headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}; };
...@@ -888,7 +888,7 @@ const Api = { ...@@ -888,7 +888,7 @@ const Api = {
return null; return null;
} }
const url = Api.buildUrl(this.usageDataIncrementUniqueUsersPath); const url = Api.buildUrl(this.serviceDataIncrementUniqueUsersPath);
const headers = { const headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}; };
......
...@@ -41,7 +41,7 @@ import { ...@@ -41,7 +41,7 @@ import {
TOGGLE_TODO_ERROR, TOGGLE_TODO_ERROR,
designDeletionError, designDeletionError,
} from '../../utils/error_messages'; } from '../../utils/error_messages';
import { trackDesignDetailView, usagePingDesignDetailView } from '../../utils/tracking'; import { trackDesignDetailView, servicePingDesignDetailView } from '../../utils/tracking';
const DEFAULT_SCALE = 1; const DEFAULT_SCALE = 1;
...@@ -292,7 +292,7 @@ export default { ...@@ -292,7 +292,7 @@ export default {
); );
if (this.glFeatures.usageDataDesignAction) { if (this.glFeatures.usageDataDesignAction) {
usagePingDesignDetailView(); servicePingDesignDetailView();
} }
}, },
updateActiveDiscussion(id, source = ACTIVE_DISCUSSION_SOURCE_TYPES.discussion) { updateActiveDiscussion(id, source = ACTIVE_DISCUSSION_SOURCE_TYPES.discussion) {
......
...@@ -14,7 +14,7 @@ export const DESIGN_SNOWPLOW_EVENT_TYPES = { ...@@ -14,7 +14,7 @@ export const DESIGN_SNOWPLOW_EVENT_TYPES = {
UPDATE_DESIGN: 'update_design', UPDATE_DESIGN: 'update_design',
}; };
export const DESIGN_USAGE_PING_EVENT_TYPES = { export const DESIGN_SERVICE_PING_EVENT_TYPES = {
DESIGN_ACTION: 'design_action', DESIGN_ACTION: 'design_action',
}; };
...@@ -52,8 +52,8 @@ export function trackDesignUpdate() { ...@@ -52,8 +52,8 @@ export function trackDesignUpdate() {
} }
/** /**
* Track "design detail" view via usage ping * Track "design detail" view via service ping
*/ */
export function usagePingDesignDetailView() { export function servicePingDesignDetailView() {
Api.trackRedisHllUserEvent(DESIGN_USAGE_PING_EVENT_TYPES.DESIGN_ACTION); Api.trackRedisHllUserEvent(DESIGN_SERVICE_PING_EVENT_TYPES.DESIGN_ACTION);
} }
...@@ -28,7 +28,8 @@ export const TRACKING_ACTION_CREATE_COMMIT = 'create_commit'; ...@@ -28,7 +28,8 @@ export const TRACKING_ACTION_CREATE_COMMIT = 'create_commit';
export const TRACKING_ACTION_CREATE_MERGE_REQUEST = 'create_merge_request'; export const TRACKING_ACTION_CREATE_MERGE_REQUEST = 'create_merge_request';
export const TRACKING_ACTION_INITIALIZE_EDITOR = 'initialize_editor'; export const TRACKING_ACTION_INITIALIZE_EDITOR = 'initialize_editor';
export const USAGE_PING_TRACKING_ACTION_CREATE_COMMIT = 'static_site_editor_commits'; export const SERVICE_PING_TRACKING_ACTION_CREATE_COMMIT = 'static_site_editor_commits';
export const USAGE_PING_TRACKING_ACTION_CREATE_MERGE_REQUEST = 'static_site_editor_merge_requests'; export const SERVICE_PING_TRACKING_ACTION_CREATE_MERGE_REQUEST =
'static_site_editor_merge_requests';
export const MR_META_LOCAL_STORAGE_KEY = 'sse-merge-request-meta-storage-key'; export const MR_META_LOCAL_STORAGE_KEY = 'sse-merge-request-meta-storage-key';
...@@ -9,8 +9,8 @@ import { ...@@ -9,8 +9,8 @@ import {
SUBMIT_CHANGES_MERGE_REQUEST_ERROR, SUBMIT_CHANGES_MERGE_REQUEST_ERROR,
TRACKING_ACTION_CREATE_COMMIT, TRACKING_ACTION_CREATE_COMMIT,
TRACKING_ACTION_CREATE_MERGE_REQUEST, TRACKING_ACTION_CREATE_MERGE_REQUEST,
USAGE_PING_TRACKING_ACTION_CREATE_COMMIT, SERVICE_PING_TRACKING_ACTION_CREATE_COMMIT,
USAGE_PING_TRACKING_ACTION_CREATE_MERGE_REQUEST, SERVICE_PING_TRACKING_ACTION_CREATE_MERGE_REQUEST,
DEFAULT_FORMATTING_CHANGES_COMMIT_MESSAGE, DEFAULT_FORMATTING_CHANGES_COMMIT_MESSAGE,
DEFAULT_FORMATTING_CHANGES_COMMIT_DESCRIPTION, DEFAULT_FORMATTING_CHANGES_COMMIT_DESCRIPTION,
} from '../constants'; } from '../constants';
...@@ -58,7 +58,7 @@ const createUpdateSourceFileAction = (sourcePath, content) => [ ...@@ -58,7 +58,7 @@ const createUpdateSourceFileAction = (sourcePath, content) => [
const commit = (projectId, message, branch, actions) => { const commit = (projectId, message, branch, actions) => {
Tracking.event(document.body.dataset.page, TRACKING_ACTION_CREATE_COMMIT); Tracking.event(document.body.dataset.page, TRACKING_ACTION_CREATE_COMMIT);
Api.trackRedisCounterEvent(USAGE_PING_TRACKING_ACTION_CREATE_COMMIT); Api.trackRedisCounterEvent(SERVICE_PING_TRACKING_ACTION_CREATE_COMMIT);
return Api.commitMultiple( return Api.commitMultiple(
projectId, projectId,
...@@ -74,7 +74,7 @@ const commit = (projectId, message, branch, actions) => { ...@@ -74,7 +74,7 @@ const commit = (projectId, message, branch, actions) => {
const createMergeRequest = (projectId, title, description, sourceBranch, targetBranch) => { const createMergeRequest = (projectId, title, description, sourceBranch, targetBranch) => {
Tracking.event(document.body.dataset.page, TRACKING_ACTION_CREATE_MERGE_REQUEST); Tracking.event(document.body.dataset.page, TRACKING_ACTION_CREATE_MERGE_REQUEST);
Api.trackRedisCounterEvent(USAGE_PING_TRACKING_ACTION_CREATE_MERGE_REQUEST); Api.trackRedisCounterEvent(SERVICE_PING_TRACKING_ACTION_CREATE_MERGE_REQUEST);
return Api.createProjectMergeRequest( return Api.createProjectMergeRequest(
projectId, projectId,
......
...@@ -122,7 +122,7 @@ export default { ...@@ -122,7 +122,7 @@ export default {
this.hasError = true; this.hasError = true;
}, },
onProjectClick() { onProjectClick() {
api.trackRedisHllUserEvent(this.$options.usagePingProjectEvent); api.trackRedisHllUserEvent(this.$options.servicePingProjectEvent);
}, },
selectAllProjects() { selectAllProjects() {
this.allProjectsSelected = true; this.allProjectsSelected = true;
...@@ -179,7 +179,7 @@ export default { ...@@ -179,7 +179,7 @@ export default {
totalHeight: 15, totalHeight: 15,
}, },
averageCoverageFormatter: getFormatter(SUPPORTED_FORMATS.percentHundred), averageCoverageFormatter: getFormatter(SUPPORTED_FORMATS.percentHundred),
usagePingProjectEvent: 'i_testing_group_code_coverage_project_click_total', servicePingProjectEvent: 'i_testing_group_code_coverage_project_click_total',
}; };
</script> </script>
<template> <template>
......
...@@ -36,7 +36,7 @@ describe('Group repository analytics app', () => { ...@@ -36,7 +36,7 @@ describe('Group repository analytics app', () => {
}); });
}); });
describe('usage ping events', () => { describe('service ping events', () => {
describe('with the feature flag enabled', () => { describe('with the feature flag enabled', () => {
beforeEach(() => { beforeEach(() => {
createComponent({ [VISIT_EVENT_FEATURE_FLAG]: true }); createComponent({ [VISIT_EVENT_FEATURE_FLAG]: true });
......
...@@ -180,7 +180,7 @@ describe('Test coverage table component', () => { ...@@ -180,7 +180,7 @@ describe('Test coverage table component', () => {
expect(Api.trackRedisHllUserEvent).toHaveBeenCalledTimes(1); expect(Api.trackRedisHllUserEvent).toHaveBeenCalledTimes(1);
expect(Api.trackRedisHllUserEvent).toHaveBeenCalledWith( expect(Api.trackRedisHllUserEvent).toHaveBeenCalledWith(
wrapper.vm.$options.usagePingProjectEvent, wrapper.vm.$options.servicePingProjectEvent,
); );
}); });
}); });
......
...@@ -43,7 +43,7 @@ describe('Codequality report actions', () => { ...@@ -43,7 +43,7 @@ describe('Codequality report actions', () => {
testAction(actions.requestReport, null, state, [{ type: types.REQUEST_REPORT }], [], done); testAction(actions.requestReport, null, state, [{ type: types.REQUEST_REPORT }], [], done);
}); });
it('tracks a usage ping event when the feature flag is enabled', () => { it('tracks a service ping event when the feature flag is enabled', () => {
window.gon = { features: { [VIEW_EVENT_FEATURE_FLAG]: true } }; window.gon = { features: { [VIEW_EVENT_FEATURE_FLAG]: true } };
actions.requestReport({ commit: jest.fn() }); actions.requestReport({ commit: jest.fn() });
...@@ -51,7 +51,7 @@ describe('Codequality report actions', () => { ...@@ -51,7 +51,7 @@ describe('Codequality report actions', () => {
expect(Api.trackRedisHllUserEvent).toHaveBeenCalledWith(VIEW_EVENT_NAME); expect(Api.trackRedisHllUserEvent).toHaveBeenCalledWith(VIEW_EVENT_NAME);
}); });
it('does not track a usage ping event when the feature flag is disabled', () => { it('does not track a service ping event when the feature flag is disabled', () => {
window.gon = { features: { [VIEW_EVENT_FEATURE_FLAG]: false } }; window.gon = { features: { [VIEW_EVENT_FEATURE_FLAG]: false } };
actions.requestReport({ commit: jest.fn() }); actions.requestReport({ commit: jest.fn() });
......
...@@ -35,7 +35,7 @@ describe('Grouped test reports app', () => { ...@@ -35,7 +35,7 @@ describe('Grouped test reports app', () => {
wrapper = null; wrapper = null;
}); });
describe('usage ping events', () => { describe('service ping events', () => {
describe('when feature flag is enabled', () => { describe('when feature flag is enabled', () => {
beforeEach(() => { beforeEach(() => {
mountComponent({ usageDataITestingWebPerformanceWidgetTotal: true }); mountComponent({ usageDataITestingWebPerformanceWidgetTotal: true });
......
...@@ -35,7 +35,7 @@ describe('Grouped load performance reports app', () => { ...@@ -35,7 +35,7 @@ describe('Grouped load performance reports app', () => {
wrapper = null; wrapper = null;
}); });
describe('usage ping events', () => { describe('service ping events', () => {
describe('when feature flag is enabled', () => { describe('when feature flag is enabled', () => {
beforeEach(() => { beforeEach(() => {
mountComponent({ usageDataITestingLoadPerformanceWidgetTotal: true }); mountComponent({ usageDataITestingLoadPerformanceWidgetTotal: true });
......
...@@ -1481,7 +1481,7 @@ describe('Api', () => { ...@@ -1481,7 +1481,7 @@ describe('Api', () => {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}; };
describe('when usage data increment counter is called with feature flag disabled', () => { describe('when service data increment counter is called with feature flag disabled', () => {
beforeEach(() => { beforeEach(() => {
gon.features = { ...gon.features, usageDataApi: false }; gon.features = { ...gon.features, usageDataApi: false };
}); });
...@@ -1495,7 +1495,7 @@ describe('Api', () => { ...@@ -1495,7 +1495,7 @@ describe('Api', () => {
}); });
}); });
describe('when usage data increment counter is called', () => { describe('when service data increment counter is called', () => {
beforeEach(() => { beforeEach(() => {
gon.features = { ...gon.features, usageDataApi: true }; gon.features = { ...gon.features, usageDataApi: true };
}); });
...@@ -1526,7 +1526,7 @@ describe('Api', () => { ...@@ -1526,7 +1526,7 @@ describe('Api', () => {
window.gon.current_user_id = 1; window.gon.current_user_id = 1;
}); });
describe('when usage data increment unique users is called with feature flag disabled', () => { describe('when service data increment unique users is called with feature flag disabled', () => {
beforeEach(() => { beforeEach(() => {
gon.features = { ...gon.features, usageDataApi: false }; gon.features = { ...gon.features, usageDataApi: false };
}); });
...@@ -1541,7 +1541,7 @@ describe('Api', () => { ...@@ -1541,7 +1541,7 @@ describe('Api', () => {
}); });
}); });
describe('when usage data increment unique users is called', () => { describe('when service data increment unique users is called', () => {
beforeEach(() => { beforeEach(() => {
gon.features = { ...gon.features, usageDataApi: true }; gon.features = { ...gon.features, usageDataApi: true };
}); });
......
...@@ -20,7 +20,7 @@ import { ...@@ -20,7 +20,7 @@ import {
import { import {
DESIGN_TRACKING_PAGE_NAME, DESIGN_TRACKING_PAGE_NAME,
DESIGN_SNOWPLOW_EVENT_TYPES, DESIGN_SNOWPLOW_EVENT_TYPES,
DESIGN_USAGE_PING_EVENT_TYPES, DESIGN_SERVICE_PING_EVENT_TYPES,
} from '~/design_management/utils/tracking'; } from '~/design_management/utils/tracking';
import createFlash from '~/flash'; import createFlash from '~/flash';
import mockAllVersions from '../../mock_data/all_versions'; import mockAllVersions from '../../mock_data/all_versions';
...@@ -391,7 +391,7 @@ describe('Design management design index page', () => { ...@@ -391,7 +391,7 @@ describe('Design management design index page', () => {
}); });
describe('with usage_data_design_action enabled', () => { describe('with usage_data_design_action enabled', () => {
it('tracks design view usage ping', () => { it('tracks design view service ping', () => {
createComponent( createComponent(
{ loading: true }, { loading: true },
{ {
...@@ -402,13 +402,13 @@ describe('Design management design index page', () => { ...@@ -402,13 +402,13 @@ describe('Design management design index page', () => {
); );
expect(Api.trackRedisHllUserEvent).toHaveBeenCalledTimes(1); expect(Api.trackRedisHllUserEvent).toHaveBeenCalledTimes(1);
expect(Api.trackRedisHllUserEvent).toHaveBeenCalledWith( expect(Api.trackRedisHllUserEvent).toHaveBeenCalledWith(
DESIGN_USAGE_PING_EVENT_TYPES.DESIGN_ACTION, DESIGN_SERVICE_PING_EVENT_TYPES.DESIGN_ACTION,
); );
}); });
}); });
describe('with usage_data_design_action disabled', () => { describe('with usage_data_design_action disabled', () => {
it("doesn't track design view usage ping", () => { it("doesn't track design view service ping", () => {
createComponent({ loading: true }); createComponent({ loading: true });
expect(Api.trackRedisHllUserEvent).toHaveBeenCalledTimes(0); expect(Api.trackRedisHllUserEvent).toHaveBeenCalledTimes(0);
}); });
......
...@@ -114,7 +114,7 @@ describe('Grouped test reports app', () => { ...@@ -114,7 +114,7 @@ describe('Grouped test reports app', () => {
setReports(newFailedTestReports); setReports(newFailedTestReports);
}); });
it('tracks usage ping metric when enabled', () => { it('tracks service ping metric when enabled', () => {
mountComponent({ glFeatures: { usageDataITestingSummaryWidgetTotal: true } }); mountComponent({ glFeatures: { usageDataITestingSummaryWidgetTotal: true } });
findExpandButton().trigger('click'); findExpandButton().trigger('click');
...@@ -132,7 +132,7 @@ describe('Grouped test reports app', () => { ...@@ -132,7 +132,7 @@ describe('Grouped test reports app', () => {
expect(Api.trackRedisHllUserEvent).toHaveBeenCalledTimes(1); expect(Api.trackRedisHllUserEvent).toHaveBeenCalledTimes(1);
}); });
it('does not track usage ping metric when disabled', () => { it('does not track service ping metric when disabled', () => {
mountComponent({ glFeatures: { usageDataITestingSummaryWidgetTotal: false } }); mountComponent({ glFeatures: { usageDataITestingSummaryWidgetTotal: false } });
findExpandButton().trigger('click'); findExpandButton().trigger('click');
......
...@@ -8,8 +8,8 @@ import { ...@@ -8,8 +8,8 @@ import {
SUBMIT_CHANGES_MERGE_REQUEST_ERROR, SUBMIT_CHANGES_MERGE_REQUEST_ERROR,
TRACKING_ACTION_CREATE_COMMIT, TRACKING_ACTION_CREATE_COMMIT,
TRACKING_ACTION_CREATE_MERGE_REQUEST, TRACKING_ACTION_CREATE_MERGE_REQUEST,
USAGE_PING_TRACKING_ACTION_CREATE_COMMIT, SERVICE_PING_TRACKING_ACTION_CREATE_COMMIT,
USAGE_PING_TRACKING_ACTION_CREATE_MERGE_REQUEST, SERVICE_PING_TRACKING_ACTION_CREATE_MERGE_REQUEST,
DEFAULT_FORMATTING_CHANGES_COMMIT_MESSAGE, DEFAULT_FORMATTING_CHANGES_COMMIT_MESSAGE,
DEFAULT_FORMATTING_CHANGES_COMMIT_DESCRIPTION, DEFAULT_FORMATTING_CHANGES_COMMIT_DESCRIPTION,
} from '~/static_site_editor/constants'; } from '~/static_site_editor/constants';
...@@ -237,7 +237,7 @@ describe('submitContentChanges', () => { ...@@ -237,7 +237,7 @@ describe('submitContentChanges', () => {
}); });
}); });
describe('sends the correct Usage Ping tracking event', () => { describe('sends the correct Service Ping tracking event', () => {
beforeEach(() => { beforeEach(() => {
jest.spyOn(Api, 'trackRedisCounterEvent').mockResolvedValue({ data: '' }); jest.spyOn(Api, 'trackRedisCounterEvent').mockResolvedValue({ data: '' });
}); });
...@@ -245,7 +245,7 @@ describe('submitContentChanges', () => { ...@@ -245,7 +245,7 @@ describe('submitContentChanges', () => {
it('for commiting changes', () => { it('for commiting changes', () => {
return submitContentChanges(buildPayload()).then(() => { return submitContentChanges(buildPayload()).then(() => {
expect(Api.trackRedisCounterEvent).toHaveBeenCalledWith( expect(Api.trackRedisCounterEvent).toHaveBeenCalledWith(
USAGE_PING_TRACKING_ACTION_CREATE_COMMIT, SERVICE_PING_TRACKING_ACTION_CREATE_COMMIT,
); );
}); });
}); });
...@@ -253,7 +253,7 @@ describe('submitContentChanges', () => { ...@@ -253,7 +253,7 @@ describe('submitContentChanges', () => {
it('for creating a merge request', () => { it('for creating a merge request', () => {
return submitContentChanges(buildPayload()).then(() => { return submitContentChanges(buildPayload()).then(() => {
expect(Api.trackRedisCounterEvent).toHaveBeenCalledWith( expect(Api.trackRedisCounterEvent).toHaveBeenCalledWith(
USAGE_PING_TRACKING_ACTION_CREATE_MERGE_REQUEST, SERVICE_PING_TRACKING_ACTION_CREATE_MERGE_REQUEST,
); );
}); });
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment