From df6d6623faac958bea9787a1cda4259cbcdc1287 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 24 Feb 2022 03:15:17 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- app/assets/javascripts/google_tag_manager/index.js | 11 +++++++++++ doc/ci/lint.md | 6 ++---- doc/ci/metrics_reports.md | 11 +++++++++++ spec/frontend/google_tag_manager/index_spec.js | 9 +++++++++ 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/google_tag_manager/index.js b/app/assets/javascripts/google_tag_manager/index.js index aca0f93a4d1..826ebaa7f4a 100644 --- a/app/assets/javascripts/google_tag_manager/index.js +++ b/app/assets/javascripts/google_tag_manager/index.js @@ -260,3 +260,14 @@ export const trackAddToCartUsageTab = () => { }); }); }; + +export const trackCombinedGroupProjectForm = () => { + if (!isSupported()) { + return; + } + + const form = document.querySelector('.js-groups-projects-form'); + form.addEventListener('submit', () => { + pushEvent('combinedGroupProjectFormSubmit'); + }); +}; diff --git a/doc/ci/lint.md b/doc/ci/lint.md index c0df0b2a439..256e669a66e 100644 --- a/doc/ci/lint.md +++ b/doc/ci/lint.md @@ -25,9 +25,8 @@ configuration added with the [`includes` keyword](yaml/index.md#include). To check CI/CD configuration with the CI lint tool: 1. On the top bar, select **Menu > Projects** and find your project. -1. On the left sidebar, select one of: +1. On the left sidebar, select: - **CI/CD > Pipelines** - - **CI/CD > Jobs** 1. In the top right, select **CI lint**. 1. Paste a copy of the CI/CD configuration you want to check into the text box. 1. Select **Validate**. @@ -48,9 +47,8 @@ Prerequisites: To simulate a pipeline: 1. On the top bar, select **Menu > Projects** and find your project. -1. On the left sidebar, select one of: +1. On the left sidebar, select: - **CI/CD > Pipelines** - - **CI/CD > Jobs** 1. In the top right, select **CI lint**. 1. Paste a copy of the CI/CD configuration you want to check into the text box. 1. Select **Simulate pipeline creation for the default branch**. diff --git a/doc/ci/metrics_reports.md b/doc/ci/metrics_reports.md index 5b472eec7b5..542d55665c7 100644 --- a/doc/ci/metrics_reports.md +++ b/doc/ci/metrics_reports.md @@ -55,3 +55,14 @@ An advanced example of an OpenMetrics text file (from the [Prometheus documentat renders in the merge request widget as: ![Metrics Reports Advanced](img/metrics_reports_advanced_v13_0.png) + +## Troubleshooting + +### Metrics reports did not change + +You can see `Metrics reports did not change` when trying to view metrics reports in merge requests. Reasons for this are: + +- The target branch for the merge request doesn't have a baseline metrics report for comparison. +- You don't have GitLab license at the Premium tier or above. + +There is [an issue open](https://gitlab.com/gitlab-org/gitlab/-/issues/343065) to improve this message. diff --git a/spec/frontend/google_tag_manager/index_spec.js b/spec/frontend/google_tag_manager/index_spec.js index 498e60778c6..fd8cfa4cd0b 100644 --- a/spec/frontend/google_tag_manager/index_spec.js +++ b/spec/frontend/google_tag_manager/index_spec.js @@ -1,6 +1,7 @@ import { merge } from 'lodash'; import { v4 as uuidv4 } from 'uuid'; import { + trackCombinedGroupProjectForm, trackFreeTrialAccountSubmissions, trackNewRegistrations, trackSaasTrialSubmit, @@ -200,6 +201,14 @@ describe('~/google_tag_manager/index', () => { }, ], }), + createTestCase(trackCombinedGroupProjectForm, { + forms: [ + { + cls: 'js-groups-projects-form', + expectation: { event: 'combinedGroupProjectFormSubmit' }, + }, + ], + }), ])('%p', (subject, { links = [], forms = [], expectedEvents }) => { beforeEach(() => { setHTMLFixture(createHTML({ links, forms }));