Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-09-20 15:11:04 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-09-20 15:11:04 +0300
commit41a63a43b8d0c498638af0b14cf854d6a446a35b (patch)
treeef76eae534402b4a2a75ba27b5e81153c2582014
parent9cc74486f532cbcbf9da100ee00bfe00b145971a (diff)
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--Gemfile2
-rw-r--r--Gemfile.lock4
-rw-r--r--app/assets/javascripts/tracking/constants.js3
-rw-r--r--app/assets/javascripts/tracking/tracking.js6
-rw-r--r--app/assets/javascripts/tracking/utils.js8
-rw-r--r--app/controllers/concerns/issuable_actions.rb4
-rw-r--r--app/graphql/types/milestone_wildcard_id_enum.rb2
-rw-r--r--app/models/user.rb4
-rw-r--r--app/presenters/alert_management/alert_presenter.rb2
-rw-r--r--config/initializers_before_autoloader/grape_entity_patch.rb27
-rw-r--r--config/metrics/counts_7d/20210916100524_groups_gitlab_slack_application_active.yml23
-rw-r--r--config/metrics/counts_7d/20210916101641_projects_gitlab_slack_application_active.yml23
-rw-r--r--config/metrics/counts_7d/20210916101837_instances_gitlab_slack_application_active.yml23
-rw-r--r--config/metrics/counts_7d/20210916102312_templates_gitlab_slack_application_active.yml23
-rw-r--r--config/metrics/counts_7d/20210917040700_groups_inheriting_gitlab_slack_application_active.yml23
-rw-r--r--config/metrics/counts_7d/20210917040956_projects_inheriting_gitlab_slack_application_active.yml23
-rw-r--r--doc/api/experiments.md2
-rw-r--r--doc/api/graphql/reference/index.md2
-rw-r--r--doc/ci/secrets/index.md4
-rw-r--r--doc/install/installation.md7
-rw-r--r--doc/integration/jira/configure.md4
-rw-r--r--doc/integration/jira/connect-app.md4
-rw-r--r--doc/integration/jira/development_panel.md4
-rw-r--r--doc/integration/jira/index.md6
-rw-r--r--doc/integration/jira/issues.md2
-rw-r--r--doc/user/group/insights/index.md22
-rw-r--r--lib/gitlab/ci/templates/Security/DAST.gitlab-ci.yml7
-rw-r--r--lib/gitlab/ci/templates/Security/DAST.latest.gitlab-ci.yml7
-rw-r--r--lib/gitlab/doctor/secrets.rb2
-rw-r--r--locale/gitlab.pot3
-rw-r--r--qa/qa/resource/group_badge.rb73
-rw-r--r--qa/qa/resource/group_base.rb16
-rw-r--r--qa/qa/specs/features/api/1_manage/bulk_import_group_spec.rb13
-rw-r--r--spec/config/grape_entity_patch_spec.rb21
-rw-r--r--spec/factories/packages/build_infos.rb (renamed from spec/factories/packages/build_info.rb)0
-rw-r--r--spec/factories/packages/composer/cache_files.rb20
-rw-r--r--spec/factories/packages/composer/metadata.rb10
-rw-r--r--spec/factories/packages/conan/file_metadata.rb20
-rw-r--r--spec/factories/packages/conan/metadata.rb9
-rw-r--r--spec/factories/packages/dependencies.rb12
-rw-r--r--spec/factories/packages/dependency_links.rb20
-rw-r--r--spec/factories/packages/maven/maven_metadata.rb11
-rw-r--r--spec/factories/packages/nuget/dependency_link_metadata.rb8
-rw-r--r--spec/factories/packages/nuget/metadata.rb11
-rw-r--r--spec/factories/packages/package_files.rb (renamed from spec/factories/packages/package_file.rb)0
-rw-r--r--spec/factories/packages/package_tags.rb8
-rw-r--r--spec/factories/packages/packages.rb (renamed from spec/factories/packages.rb)113
-rw-r--r--spec/factories/packages/pypi/metadata.rb8
-rw-r--r--spec/frontend/tracking_spec.js58
-rw-r--r--spec/lib/gitlab/doctor/secrets_spec.rb10
-rw-r--r--spec/models/packages/package_spec.rb2
-rw-r--r--spec/requests/projects/merge_requests_discussions_spec.rb18
-rw-r--r--spec/tooling/danger/product_intelligence_spec.rb2
-rw-r--r--tooling/danger/product_intelligence.rb1
54 files changed, 486 insertions, 254 deletions
diff --git a/Gemfile b/Gemfile
index 39e61564968..3b637a02538 100644
--- a/Gemfile
+++ b/Gemfile
@@ -92,7 +92,7 @@ gem 'net-ldap', '~> 0.16.3'
# API
gem 'grape', '~> 1.5.2'
-gem 'grape-entity', '~> 0.9.0'
+gem 'grape-entity', '~> 0.10.0'
gem 'rack-cors', '~> 1.0.6', require: 'rack/cors'
# GraphQL API
diff --git a/Gemfile.lock b/Gemfile.lock
index d62e948e636..99cd6b8bab6 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -543,7 +543,7 @@ GEM
mustermann-grape (~> 1.0.0)
rack (>= 1.3.0)
rack-accept
- grape-entity (0.9.0)
+ grape-entity (0.10.0)
activesupport (>= 3.0.0)
multi_json (>= 1.3.2)
grape-path-helpers (1.7.0)
@@ -1485,7 +1485,7 @@ DEPENDENCIES
google-protobuf (~> 3.17.1)
gpgme (~> 2.0.19)
grape (~> 1.5.2)
- grape-entity (~> 0.9.0)
+ grape-entity (~> 0.10.0)
grape-path-helpers (~> 1.7.0)
grape_logging (~> 1.7)
graphiql-rails (~> 1.4.10)
diff --git a/app/assets/javascripts/tracking/constants.js b/app/assets/javascripts/tracking/constants.js
index 062a3404355..4753d483f15 100644
--- a/app/assets/javascripts/tracking/constants.js
+++ b/app/assets/javascripts/tracking/constants.js
@@ -22,9 +22,6 @@ export const DEFAULT_SNOWPLOW_OPTIONS = {
export const ACTION_ATTR_SELECTOR = '[data-track-action]';
export const LOAD_ACTION_ATTR_SELECTOR = '[data-track-action="render"]';
-export const DEPRECATED_EVENT_ATTR_SELECTOR = '[data-track-event]';
-export const DEPRECATED_LOAD_EVENT_ATTR_SELECTOR = '[data-track-event="render"]';
-
export const URLS_CACHE_STORAGE_KEY = 'gl-snowplow-pseudonymized-urls';
export const REFERRER_TTL = 24 * 60 * 60 * 1000;
diff --git a/app/assets/javascripts/tracking/tracking.js b/app/assets/javascripts/tracking/tracking.js
index 657e0a79911..c305709a22b 100644
--- a/app/assets/javascripts/tracking/tracking.js
+++ b/app/assets/javascripts/tracking/tracking.js
@@ -1,4 +1,4 @@
-import { LOAD_ACTION_ATTR_SELECTOR, DEPRECATED_LOAD_EVENT_ATTR_SELECTOR } from './constants';
+import { LOAD_ACTION_ATTR_SELECTOR } from './constants';
import { dispatchSnowplowEvent } from './dispatch_snowplow_event';
import getStandardContext from './get_standard_context';
import {
@@ -105,9 +105,7 @@ export default class Tracking {
return [];
}
- const loadEvents = parent.querySelectorAll(
- `${LOAD_ACTION_ATTR_SELECTOR}, ${DEPRECATED_LOAD_EVENT_ATTR_SELECTOR}`,
- );
+ const loadEvents = parent.querySelectorAll(LOAD_ACTION_ATTR_SELECTOR);
loadEvents.forEach((element) => {
const { action, data } = createEventPayload(element);
diff --git a/app/assets/javascripts/tracking/utils.js b/app/assets/javascripts/tracking/utils.js
index 3507872b511..cc0d7e7a44a 100644
--- a/app/assets/javascripts/tracking/utils.js
+++ b/app/assets/javascripts/tracking/utils.js
@@ -4,8 +4,6 @@ import { getExperimentData } from '~/experimentation/utils';
import {
ACTION_ATTR_SELECTOR,
LOAD_ACTION_ATTR_SELECTOR,
- DEPRECATED_EVENT_ATTR_SELECTOR,
- DEPRECATED_LOAD_EVENT_ATTR_SELECTOR,
URLS_CACHE_STORAGE_KEY,
REFERRER_TTL,
} from './constants';
@@ -27,7 +25,6 @@ export const addExperimentContext = (opts) => {
export const createEventPayload = (el, { suffix = '' } = {}) => {
const {
trackAction,
- trackEvent,
trackValue,
trackExtra,
trackExperiment,
@@ -36,7 +33,7 @@ export const createEventPayload = (el, { suffix = '' } = {}) => {
trackProperty,
} = el?.dataset || {};
- const action = (trackAction || trackEvent) + (suffix || '');
+ const action = `${trackAction}${suffix || ''}`;
let value = trackValue || el.value || undefined;
if (el.type === 'checkbox' && !el.checked) {
@@ -74,8 +71,7 @@ export const createEventPayload = (el, { suffix = '' } = {}) => {
export const eventHandler = (e, func, opts = {}) => {
const actionSelector = `${ACTION_ATTR_SELECTOR}:not(${LOAD_ACTION_ATTR_SELECTOR})`;
- const deprecatedEventSelector = `${DEPRECATED_EVENT_ATTR_SELECTOR}:not(${DEPRECATED_LOAD_EVENT_ATTR_SELECTOR})`;
- const el = e.target.closest(`${actionSelector}, ${deprecatedEventSelector}`);
+ const el = e.target.closest(actionSelector);
if (!el) {
return;
diff --git a/app/controllers/concerns/issuable_actions.rb b/app/controllers/concerns/issuable_actions.rb
index 7ee680db7f9..2462df77884 100644
--- a/app/controllers/concerns/issuable_actions.rb
+++ b/app/controllers/concerns/issuable_actions.rb
@@ -159,7 +159,9 @@ module IssuableActions
discussions = Discussion.build_collection(notes, issuable)
if issuable.is_a?(MergeRequest) && Feature.enabled?(:merge_request_discussion_cache, issuable.target_project, default_enabled: :yaml)
- render_cached(discussions, with: discussion_serializer, context: self)
+ cache_context = [current_user&.cache_key, project.team.human_max_access(current_user&.id)].join(':')
+
+ render_cached(discussions, with: discussion_serializer, cache_context: -> (_) { cache_context }, context: self)
else
render json: discussion_serializer.represent(discussions, context: self)
end
diff --git a/app/graphql/types/milestone_wildcard_id_enum.rb b/app/graphql/types/milestone_wildcard_id_enum.rb
index 12e8e07fb05..ad9651a26dc 100644
--- a/app/graphql/types/milestone_wildcard_id_enum.rb
+++ b/app/graphql/types/milestone_wildcard_id_enum.rb
@@ -8,6 +8,6 @@ module Types
value 'NONE', 'No milestone is assigned.'
value 'ANY', 'Milestone is assigned.'
value 'STARTED', 'Milestone assigned is open and started (start date <= today).'
- value 'UPCOMING', 'Milestone assigned is due closest in the future (due date > today).'
+ value 'UPCOMING', 'Milestone assigned is due in the future (due date > today).'
end
end
diff --git a/app/models/user.rb b/app/models/user.rb
index b5f0251f639..311712bba1e 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -229,9 +229,9 @@ class User < ApplicationRecord
validates :first_name, length: { maximum: 127 }
validates :last_name, length: { maximum: 127 }
validates :email, confirmation: true
- validates :notification_email, devise_email: true, allow_blank: true, if: ->(user) { user.notification_email != user.email }
+ validates :notification_email, devise_email: true, allow_blank: true
validates :public_email, uniqueness: true, devise_email: true, allow_blank: true
- validates :commit_email, devise_email: true, allow_blank: true, if: ->(user) { user.commit_email != user.email && user.commit_email != Gitlab::PrivateCommitEmail::TOKEN }
+ validates :commit_email, devise_email: true, allow_blank: true, unless: ->(user) { user.commit_email == Gitlab::PrivateCommitEmail::TOKEN }
validates :projects_limit,
presence: true,
numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: Gitlab::Database::MAX_INT_VALUE }
diff --git a/app/presenters/alert_management/alert_presenter.rb b/app/presenters/alert_management/alert_presenter.rb
index c6c6fe837a0..93983c989c8 100644
--- a/app/presenters/alert_management/alert_presenter.rb
+++ b/app/presenters/alert_management/alert_presenter.rb
@@ -2,7 +2,6 @@
module AlertManagement
class AlertPresenter < Gitlab::View::Presenter::Delegated
- include Gitlab::Utils::StrongMemoize
include IncidentManagement::Settings
include ActionView::Helpers::UrlHelper
@@ -65,6 +64,7 @@ module AlertManagement
private
attr_reader :alert, :project
+
delegate :alert_markdown, :full_query, to: :parsed_payload
def issue_summary_markdown
diff --git a/config/initializers_before_autoloader/grape_entity_patch.rb b/config/initializers_before_autoloader/grape_entity_patch.rb
deleted file mode 100644
index 2db5876e75f..00000000000
--- a/config/initializers_before_autoloader/grape_entity_patch.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-# This can be removed after the problem gets fixed on upstream.
-# You can follow https://github.com/ruby-grape/grape-entity/pull/355 to see the progress.
-#
-# For more information about the issue;
-# https://github.com/ruby/did_you_mean/issues/158#issuecomment-906056018
-
-require 'grape-entity'
-
-module Grape
- class Entity
- # Upstream version: https://github.com/ruby-grape/grape-entity/blob/675d3c0e20dfc1d6cf6f5ba5b46741bd404c8be7/lib/grape_entity/entity.rb#L520
- def exec_with_object(options, &block)
- if block.parameters.count == 1
- instance_exec(object, &block)
- else
- instance_exec(object, options, &block)
- end
- rescue StandardError => e
- # it handles: https://github.com/ruby/ruby/blob/v3_0_0_preview1/NEWS.md#language-changes point 3, Proc
- raise Grape::Entity::Deprecated.new e.message, 'in ruby 3.0' if e.is_a?(ArgumentError)
-
- raise e
- end
- end
-end
diff --git a/config/metrics/counts_7d/20210916100524_groups_gitlab_slack_application_active.yml b/config/metrics/counts_7d/20210916100524_groups_gitlab_slack_application_active.yml
new file mode 100644
index 00000000000..9a23d73b136
--- /dev/null
+++ b/config/metrics/counts_7d/20210916100524_groups_gitlab_slack_application_active.yml
@@ -0,0 +1,23 @@
+---
+key_path: counts.groups_gitlab_slack_application_active
+name: count_groups_gitlab_slack_application_active
+description: Count groups with active slack application
+product_section: dev
+product_stage: ecosystem
+product_group: group::integrations
+product_category: integrations
+value_type: number
+status: active
+milestone: "14.3"
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70496
+time_frame: 7d
+data_source: database
+data_category: optional
+performance_indicator_type: []
+distribution:
+- ce
+- ee
+tier:
+- free
+- premium
+- ultimate
diff --git a/config/metrics/counts_7d/20210916101641_projects_gitlab_slack_application_active.yml b/config/metrics/counts_7d/20210916101641_projects_gitlab_slack_application_active.yml
new file mode 100644
index 00000000000..2d1124a5971
--- /dev/null
+++ b/config/metrics/counts_7d/20210916101641_projects_gitlab_slack_application_active.yml
@@ -0,0 +1,23 @@
+---
+key_path: counts.projects_gitlab_slack_application_active
+name: count_project_gitlab_slack_application_active
+description: Count projects with active slack application
+product_section: dev
+product_stage: ecosystem
+product_group: group::integrations
+product_category: integrations
+value_type: number
+status: active
+milestone: "14.3"
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70496
+time_frame: 7d
+data_source: database
+data_category: optional
+performance_indicator_type: []
+distribution:
+- ce
+- ee
+tier:
+- free
+- premium
+- ultimate
diff --git a/config/metrics/counts_7d/20210916101837_instances_gitlab_slack_application_active.yml b/config/metrics/counts_7d/20210916101837_instances_gitlab_slack_application_active.yml
new file mode 100644
index 00000000000..8a04e024eba
--- /dev/null
+++ b/config/metrics/counts_7d/20210916101837_instances_gitlab_slack_application_active.yml
@@ -0,0 +1,23 @@
+---
+key_path: counts.instances_gitlab_slack_application_active
+name: count_instances_gitlab_slack_application_active
+description: Count instances with active slack application
+product_section: dev
+product_stage: ecosystem
+product_group: group::integrations
+product_category: integrations
+value_type: number
+status: active
+milestone: "14.3"
+introduced_by_url: https://gilab.com/gitlab-org/gitlab/-/merge_requests/70496
+time_frame: 7d
+data_source: database
+data_category: optional
+performance_indicator_type: []
+distribution:
+- ce
+- ee
+tier:
+- free
+- premium
+- ultimate
diff --git a/config/metrics/counts_7d/20210916102312_templates_gitlab_slack_application_active.yml b/config/metrics/counts_7d/20210916102312_templates_gitlab_slack_application_active.yml
new file mode 100644
index 00000000000..d465e1b3d03
--- /dev/null
+++ b/config/metrics/counts_7d/20210916102312_templates_gitlab_slack_application_active.yml
@@ -0,0 +1,23 @@
+---
+key_path: counts.templates_gitlab_slack_application_active
+name: count_templates_gitlab_slack_application_active
+description: Count templates with active slack application
+product_section: dev
+product_stage: ecosystem
+product_group: group::integrations
+product_category: integrations
+value_type: number
+status: active
+milestone: "14.3"
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70496
+time_frame: 7d
+data_source: database
+data_category: optional
+performance_indicator_type: []
+distribution:
+- ce
+- ee
+tier:
+- free
+- premium
+- ultimate
diff --git a/config/metrics/counts_7d/20210917040700_groups_inheriting_gitlab_slack_application_active.yml b/config/metrics/counts_7d/20210917040700_groups_inheriting_gitlab_slack_application_active.yml
new file mode 100644
index 00000000000..2a62c45c54a
--- /dev/null
+++ b/config/metrics/counts_7d/20210917040700_groups_inheriting_gitlab_slack_application_active.yml
@@ -0,0 +1,23 @@
+---
+key_path: counts.groups_inheriting_gitlab_slack_application_active
+name: count_groups_inheriting_gitlab_slack_application_active
+description: Count groups inheriting active slack application
+product_section: dev
+product_stage: ecosystem
+product_group: group::integrations
+product_category: integrations
+value_type: number
+status: active
+milestone: "14.3"
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70496
+time_frame: 7d
+data_source: database
+data_category: optional
+performance_indicator_type: []
+distribution:
+- ce
+- ee
+tier:
+- free
+- premium
+- ultimate
diff --git a/config/metrics/counts_7d/20210917040956_projects_inheriting_gitlab_slack_application_active.yml b/config/metrics/counts_7d/20210917040956_projects_inheriting_gitlab_slack_application_active.yml
new file mode 100644
index 00000000000..266670159b6
--- /dev/null
+++ b/config/metrics/counts_7d/20210917040956_projects_inheriting_gitlab_slack_application_active.yml
@@ -0,0 +1,23 @@
+---
+key_path: counts.projects_inheriting_gitlab_slack_application_active
+name: count_project_inheriting_gitlab_slack_application_active
+description: Count projects inheriting active slack application
+product_section: dev
+product_stage: ecosystem
+product_group: group::integrations
+product_category: integrations
+value_type: number
+status: active
+milestone: "14.3"
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70496
+time_frame: 7d
+data_source: database
+data_category: optional
+performance_indicator_type: []
+distribution:
+- ce
+- ee
+tier:
+- free
+- premium
+- ultimate
diff --git a/doc/api/experiments.md b/doc/api/experiments.md
index c5e217a3d66..669d00454bd 100644
--- a/doc/api/experiments.md
+++ b/doc/api/experiments.md
@@ -4,7 +4,7 @@ group: Expansion
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---
-# Experiments API
+# Experiments API (GitLab team only) **(FREE SAAS)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/262725) in GitLab 13.5.
diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md
index c4e73f9c058..ba09660186b 100644
--- a/doc/api/graphql/reference/index.md
+++ b/doc/api/graphql/reference/index.md
@@ -16013,7 +16013,7 @@ Milestone ID wildcard values.
| <a id="milestonewildcardidany"></a>`ANY` | Milestone is assigned. |
| <a id="milestonewildcardidnone"></a>`NONE` | No milestone is assigned. |
| <a id="milestonewildcardidstarted"></a>`STARTED` | Milestone assigned is open and started (start date <= today). |
-| <a id="milestonewildcardidupcoming"></a>`UPCOMING` | Milestone assigned is due closest in the future (due date > today). |
+| <a id="milestonewildcardidupcoming"></a>`UPCOMING` | Milestone assigned is due in the future (due date > today). |
### `MoveType`
diff --git a/doc/ci/secrets/index.md b/doc/ci/secrets/index.md
index 898d310598f..4d42bc69df8 100644
--- a/doc/ci/secrets/index.md
+++ b/doc/ci/secrets/index.md
@@ -1,6 +1,6 @@
---
-stage: Release
-group: Release
+stage: Configure
+group: Configure
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
type: concepts, howto
---
diff --git a/doc/install/installation.md b/doc/install/installation.md
index b524177abc4..7114a0a147c 100644
--- a/doc/install/installation.md
+++ b/doc/install/installation.md
@@ -557,9 +557,10 @@ sudo -u git cp config/database.yml.postgresql config/database.yml
# Once modified, the `production` settings will be as follows:
#
# production:
-# adapter: postgresql
-# encoding: unicode
-# database: gitlabhq_production
+# main:
+# adapter: postgresql
+# encoding: unicode
+# database: gitlabhq_production
#
sudo -u git -H editor config/database.yml
diff --git a/doc/integration/jira/configure.md b/doc/integration/jira/configure.md
index d4e5a1bfca1..979d8a52fb8 100644
--- a/doc/integration/jira/configure.md
+++ b/doc/integration/jira/configure.md
@@ -41,7 +41,7 @@ To configure your project:
For **Jira Server**, use `username`. For **Jira on Atlassian cloud**, use `email`.
- **Password/API token**:
Use `password` for **Jira Server** or `API token` for **Jira on Atlassian cloud**.
-1. To enable users to view Jira issues inside the GitLab project **(PREMIUM)**, select **Enable Jira issues** and
+1. To enable users to [view Jira issues](issues.md#view-jira-issues) inside the GitLab project, select **Enable Jira issues** and
enter a Jira project key.
You can display issues only from a single Jira project in a given GitLab project.
@@ -50,7 +50,7 @@ To configure your project:
If you enable Jira issues with this setting, all users with access to this GitLab project
can view all issues from the specified Jira project.
-1. To enable issue creation for vulnerabilities **(ULTIMATE)**, select **Enable Jira issues creation from vulnerabilities**.
+1. To enable [issue creation for vulnerabilities](../../user/application_security/vulnerabilities/index.md#create-a-jira-issue-for-a-vulnerability), select **Enable Jira issues creation from vulnerabilities**.
1. Select the **Jira issue type**. If the dropdown is empty, select refresh (**{retry}**) and try again.
1. To verify the Jira connection is working, select **Test settings**.
1. Select **Save changes**.
diff --git a/doc/integration/jira/connect-app.md b/doc/integration/jira/connect-app.md
index 7d32c080fff..d274710b3cd 100644
--- a/doc/integration/jira/connect-app.md
+++ b/doc/integration/jira/connect-app.md
@@ -81,7 +81,7 @@ self-managed GitLab instances with Jira Cloud, you can either:
- [Install the application manually](#install-the-application-manually).
- [Create a Marketplace listing](#create-a-marketplace-listing).
-### Install the application manually **(FREE SELF)**
+### Install the application manually
You can configure your Atlassian Cloud instance to allow you to install applications
from outside the Marketplace, which allows you to install the application:
@@ -114,7 +114,7 @@ NOTE:
If a GitLab update makes changes to the application descriptor, you must uninstall, then reinstall, the
application.
-### Create a Marketplace listing **(FREE SELF)**
+### Create a Marketplace listing
If you prefer to not use development mode on your Jira instance, you can create
your own Marketplace listing for your instance. This enables your application
diff --git a/doc/integration/jira/development_panel.md b/doc/integration/jira/development_panel.md
index 5a2ce8a0a75..c34dd2fb30e 100644
--- a/doc/integration/jira/development_panel.md
+++ b/doc/integration/jira/development_panel.md
@@ -6,7 +6,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# GitLab Jira Development panel integration **(FREE)**
-> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/233149) to GitLab Free in 13.4.
+> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/233149) from GitLab Premium to GitLab Free in 13.4.
With the Jira Development panel integration, you can reference Jira issues in GitLab.
When configured, activity (such as pipeline, deployment, and feature flags) displays in the Jira issue's
@@ -75,7 +75,7 @@ To simplify administration, we recommend that a GitLab group maintainer or group
Each GitLab project can be configured to connect to an entire Jira instance. That means after
configuration, one GitLab project can interact with all Jira projects in that instance. For:
-- The [view Jira issues](issues.md#view-jira-issues) feature **(PREMIUM)**, you must associate a GitLab project with a
+- The [view Jira issues](issues.md#view-jira-issues) feature, you must associate a GitLab project with a
specific Jira project.
- Other features, you do not have to explicitly associate a GitLab project with any single Jira
project.
diff --git a/doc/integration/jira/index.md b/doc/integration/jira/index.md
index 85f99b49c41..1882c74fa1e 100644
--- a/doc/integration/jira/index.md
+++ b/doc/integration/jira/index.md
@@ -7,7 +7,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Jira integrations **(FREE)**
If your organization uses [Jira](https://www.atlassian.com/software/jira) issues,
-you can [migrate your issues from Jira](../../user/project/import/jira.md) **(PREMIUM)** and work
+you can [migrate your issues from Jira](../../user/project/import/jira.md) and work
exclusively in GitLab. However, if you'd like to continue to use Jira, you can
integrate it with GitLab. GitLab offers two types of Jira integrations, and you
can use one or both depending on the capabilities you need. It is recommended that you enable both.
@@ -49,8 +49,8 @@ or the Jira DVCS (distributed version control system) connector,
| Mention a Jira issue ID in a GitLab branch name and the Jira issue shows the branch name. | No. | Yes, in the issue's [development panel](https://support.atlassian.com/jira-software-cloud/docs/view-development-information-for-an-issue/). |
| Add Jira time tracking to an issue. | No. | Yes. Time can be specified using Jira Smart Commits. |
| Use a Git commit or merge request to transition or close a Jira issue. | Yes. Only a single transition type, typically configured to close the issue by setting it to Done. | Yes. Transition to any state using Jira Smart Commits. |
-| Display a list of Jira issues. | Yes. **(PREMIUM)** | No. |
-| Create a Jira issue from a vulnerability or finding. | Yes. **(ULTIMATE)** | No. |
+| Display a list of [Jira issues](issues.md#view-jira-issues). | Yes. | No. |
+| Create a Jira issue from a [vulnerability or finding](../../user/application_security/vulnerabilities/index.md#create-a-jira-issue-for-a-vulnerability). | Yes. | No. |
| Create a GitLab branch from a Jira issue. | No. | Yes, in the issue's [development panel](https://support.atlassian.com/jira-software-cloud/docs/view-development-information-for-an-issue/). |
## Authentication in Jira
diff --git a/doc/integration/jira/issues.md b/doc/integration/jira/issues.md
index 0373506062c..70e938a24d4 100644
--- a/doc/integration/jira/issues.md
+++ b/doc/integration/jira/issues.md
@@ -96,7 +96,7 @@ Consider this example:
## View Jira issues **(PREMIUM)**
-> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/3622) in [GitLab Premium](https://about.gitlab.com/pricing/) 13.2.
+> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/3622) in GitLab 13.2.
You can browse, search, and view issues from a selected Jira project directly in GitLab,
if your GitLab administrator [has configured it](configure.md).
diff --git a/doc/user/group/insights/index.md b/doc/user/group/insights/index.md
index 18177d656ab..b1ca02963e5 100644
--- a/doc/user/group/insights/index.md
+++ b/doc/user/group/insights/index.md
@@ -17,22 +17,26 @@ requests to be merged and much more.
## View your group's Insights
-You can access your group's Insights by clicking the **Analytics > Insights**
-link in the left sidebar.
+To access your group's Insights:
+
+1. On the top bar, select **Menu > Groups** and find your group.
+1. On the left sidebar, select **Analytics > Insights**.
## Configure your Insights
-Navigate to your group's **Settings > General**, expand **Insights**, and choose
-the project that holds your `.gitlab/insights.yml` configuration file:
+1. On the top bar, select **Menu > Groups** and find your group.
+1. On the left sidebar, select **Settings > General**.
+1. Expand **Insights**.
+1. Choose the project that contains your `.gitlab/insights.yml` configuration file:
![group insights configuration](img/insights_group_configuration.png)
-If no configuration was set, a [default configuration file](
-https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/fixtures/insights/default.yml)
-will be used.
+If no configuration was set, a
+[default configuration file](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/fixtures/insights/default.yml)
+is used.
-See the [Project's Insights documentation](../../project/insights/index.md) for
-more details about the `.gitlab/insights.yml` configuration file.
+See the [project's Insights documentation](../../project/insights/index.md) for
+details about the `.gitlab/insights.yml` configuration file.
## Permissions
diff --git a/lib/gitlab/ci/templates/Security/DAST.gitlab-ci.yml b/lib/gitlab/ci/templates/Security/DAST.gitlab-ci.yml
index 0802868d67f..4c9721b208f 100644
--- a/lib/gitlab/ci/templates/Security/DAST.gitlab-ci.yml
+++ b/lib/gitlab/ci/templates/Security/DAST.gitlab-ci.yml
@@ -27,20 +27,23 @@ variables:
# (SAST, Dependency Scanning, ...)
SECURE_ANALYZERS_PREFIX: "registry.gitlab.com/gitlab-org/security-products/analyzers"
-dast:
+.dast_base:
stage: dast
image:
name: "$SECURE_ANALYZERS_PREFIX/dast:$DAST_VERSION"
variables:
GIT_STRATEGY: none
- allow_failure: true
script:
- export DAST_WEBSITE=${DAST_WEBSITE:-$(cat environment_url.txt)}
- if [ -z "$DAST_WEBSITE$DAST_API_SPECIFICATION" ]; then echo "Either DAST_WEBSITE or DAST_API_SPECIFICATION must be set. See https://docs.gitlab.com/ee/user/application_security/dast/#configuration for more details." && exit 1; fi
- /analyze
+ allow_failure: true
artifacts:
reports:
dast: gl-dast-report.json
+
+dast:
+ extends: .dast_base
rules:
- if: $DAST_DISABLED
when: never
diff --git a/lib/gitlab/ci/templates/Security/DAST.latest.gitlab-ci.yml b/lib/gitlab/ci/templates/Security/DAST.latest.gitlab-ci.yml
index ac7d87a4cda..4c944969197 100644
--- a/lib/gitlab/ci/templates/Security/DAST.latest.gitlab-ci.yml
+++ b/lib/gitlab/ci/templates/Security/DAST.latest.gitlab-ci.yml
@@ -27,20 +27,23 @@ variables:
# (SAST, Dependency Scanning, ...)
SECURE_ANALYZERS_PREFIX: "registry.gitlab.com/gitlab-org/security-products/analyzers"
-dast:
+.dast_base:
stage: dast
image:
name: "$SECURE_ANALYZERS_PREFIX/dast:$DAST_VERSION"
variables:
GIT_STRATEGY: none
- allow_failure: true
script:
- export DAST_WEBSITE=${DAST_WEBSITE:-$(cat environment_url.txt)}
- if [ -z "$DAST_WEBSITE$DAST_API_SPECIFICATION" ]; then echo "Either DAST_WEBSITE or DAST_API_SPECIFICATION must be set. See https://docs.gitlab.com/ee/user/application_security/dast/#configuration for more details." && exit 1; fi
- /analyze
+ allow_failure: true
artifacts:
reports:
dast: gl-dast-report.json
+
+dast:
+ extends: .dast_base
rules:
- if: $DAST_DISABLED
when: never
diff --git a/lib/gitlab/doctor/secrets.rb b/lib/gitlab/doctor/secrets.rb
index 1a1e9fafb1e..44f5c97c70c 100644
--- a/lib/gitlab/doctor/secrets.rb
+++ b/lib/gitlab/doctor/secrets.rb
@@ -72,7 +72,7 @@ module Gitlab
end
def valid_attribute?(data, attr)
- data.public_send(attr) # rubocop:disable GitlabSecurity/PublicSend
+ data.send(attr) # rubocop:disable GitlabSecurity/PublicSend
true
rescue OpenSSL::Cipher::CipherError, TypeError
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index ae3fbe248bb..cfb5d02d4ab 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -25075,6 +25075,9 @@ msgstr ""
msgid "Pipeline|Source|Schedule"
msgstr ""
+msgid "Pipeline|Source|Security Policy"
+msgstr ""
+
msgid "Pipeline|Source|Trigger"
msgstr ""
diff --git a/qa/qa/resource/group_badge.rb b/qa/qa/resource/group_badge.rb
new file mode 100644
index 00000000000..fd76f066e8b
--- /dev/null
+++ b/qa/qa/resource/group_badge.rb
@@ -0,0 +1,73 @@
+# frozen_string_literal: true
+
+module QA
+ module Resource
+ class GroupBadge < Base
+ attributes :id,
+ :name,
+ :link_url,
+ :image_url,
+ :group
+
+ # API get path
+ #
+ # @return [String]
+ def api_get_path
+ "/groups/#{CGI.escape(group.full_path)}/badges/#{id}"
+ end
+
+ # API post path
+ #
+ # @return [String]
+ def api_post_path
+ "/groups/#{CGI.escape(group.full_path)}/badges"
+ end
+
+ # Params for label creation
+ #
+ # @return [Hash]
+ def api_post_body
+ {
+ link_url: link_url,
+ image_url: image_url
+ }
+ end
+
+ # Override base method as this particular resource does not expose a web_url property
+ #
+ # @param [Hash] resource
+ # @return [String]
+ def resource_web_url(_resource); end
+
+ # Object comparison
+ #
+ # @param [QA::Resource::GroupBadge] other
+ # @return [Boolean]
+ def ==(other)
+ other.is_a?(GroupBadge) && comparable_badge == other.comparable_badge
+ end
+
+ # Override inspect for a better rspec failure diff output
+ #
+ # @return [String]
+ def inspect
+ JSON.pretty_generate(comparable_badge)
+ end
+
+ protected
+
+ # Return subset of fields for comparing badges
+ #
+ # @return [Hash]
+ def comparable_badge
+ reload! unless api_response
+
+ api_response.slice(
+ :name,
+ :link_url,
+ :image_url
+ )
+ end
+ end
+ end
+end
diff --git a/qa/qa/resource/group_base.rb b/qa/qa/resource/group_base.rb
index a1e5b19f409..a483a8e0462 100644
--- a/qa/qa/resource/group_base.rb
+++ b/qa/qa/resource/group_base.rb
@@ -46,6 +46,22 @@ module QA
end
end
+ # Get group badges
+ #
+ # @return [Array<QA::Resource::GroupBadge>]
+ def badges
+ parse_body(api_get_from("#{api_get_path}/badges")).map do |badge|
+ GroupBadge.init do |resource|
+ resource.api_client = api_client
+ resource.group = self
+ resource.id = badge[:id]
+ resource.name = badge[:name]
+ resource.link_url = badge[:link_url]
+ resource.image_url = badge[:image_url]
+ end
+ end
+ end
+
# API get path
#
# @return [String]
diff --git a/qa/qa/specs/features/api/1_manage/bulk_import_group_spec.rb b/qa/qa/specs/features/api/1_manage/bulk_import_group_spec.rb
index 1422dd5a029..cf81802ee13 100644
--- a/qa/qa/specs/features/api/1_manage/bulk_import_group_spec.rb
+++ b/qa/qa/specs/features/api/1_manage/bulk_import_group_spec.rb
@@ -89,7 +89,7 @@ module QA
end
end
- context 'with milestones' do
+ context 'with milestones and badges' do
let(:source_milestone) do
Resource::GroupMilestone.fabricate_via_api! do |milestone|
milestone.api_client = api_client
@@ -99,10 +99,17 @@ module QA
before do
source_milestone
+
+ Resource::GroupBadge.fabricate_via_api! do |badge|
+ badge.api_client = api_client
+ badge.group = source_group
+ badge.link_url = "http://example.com/badge"
+ badge.image_url = "http://shields.io/badge"
+ end
end
it(
- 'successfully imports group milestones',
+ 'successfully imports group milestones and badges',
testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/2245'
) do
expect { imported_group.import_status }.to eventually_eq('finished').within(import_wait_duration)
@@ -113,6 +120,8 @@ module QA
expect(imported_milestone.iid).to eq(source_milestone.iid)
expect(imported_milestone.created_at).to eq(source_milestone.created_at)
expect(imported_milestone.updated_at).to eq(source_milestone.updated_at)
+
+ expect(imported_group.badges).to eq(source_group.badges)
end
end
end
diff --git a/spec/config/grape_entity_patch_spec.rb b/spec/config/grape_entity_patch_spec.rb
deleted file mode 100644
index 7334f270ca1..00000000000
--- a/spec/config/grape_entity_patch_spec.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe 'Grape::Entity patch' do
- let(:entity_class) { Class.new(Grape::Entity) }
-
- describe 'NameError in block exposure with argument' do
- subject(:represent) { entity_class.represent({}, serializable: true) }
-
- before do
- entity_class.expose :raise_no_method_error do |_|
- foo
- end
- end
-
- it 'propagates the error to the caller' do
- expect { represent }.to raise_error(NameError)
- end
- end
-end
diff --git a/spec/factories/packages/build_info.rb b/spec/factories/packages/build_infos.rb
index dc6208d72a9..dc6208d72a9 100644
--- a/spec/factories/packages/build_info.rb
+++ b/spec/factories/packages/build_infos.rb
diff --git a/spec/factories/packages/composer/cache_files.rb b/spec/factories/packages/composer/cache_files.rb
new file mode 100644
index 00000000000..30c28ec175b
--- /dev/null
+++ b/spec/factories/packages/composer/cache_files.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+FactoryBot.define do
+ factory :composer_cache_file, class: 'Packages::Composer::CacheFile' do
+ group
+
+ file_sha256 { '1' * 64 }
+
+ transient do
+ file_fixture { 'spec/fixtures/packages/composer/package.json' }
+ end
+
+ after(:build) do |cache_file, evaluator|
+ cache_file.file = fixture_file_upload(evaluator.file_fixture)
+ end
+
+ trait(:object_storage) do
+ file_store { Packages::Composer::CacheUploader::Store::REMOTE }
+ end
+ end
+end
diff --git a/spec/factories/packages/composer/metadata.rb b/spec/factories/packages/composer/metadata.rb
new file mode 100644
index 00000000000..e4b38faa9ba
--- /dev/null
+++ b/spec/factories/packages/composer/metadata.rb
@@ -0,0 +1,10 @@
+# frozen_string_literal: true
+
+FactoryBot.define do
+ factory :composer_metadatum, class: 'Packages::Composer::Metadatum' do
+ package { association(:composer_package) }
+
+ target_sha { '123' }
+ composer_json { { name: 'foo' } }
+ end
+end
diff --git a/spec/factories/packages/conan/file_metadata.rb b/spec/factories/packages/conan/file_metadata.rb
new file mode 100644
index 00000000000..609f80e54c7
--- /dev/null
+++ b/spec/factories/packages/conan/file_metadata.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+FactoryBot.define do
+ factory :conan_file_metadatum, class: 'Packages::Conan::FileMetadatum' do
+ package_file { association(:conan_package_file, :conan_recipe_file, without_loaded_metadatum: true) }
+ recipe_revision { '0' }
+ conan_file_type { 'recipe_file' }
+
+ trait(:recipe_file) do
+ conan_file_type { 'recipe_file' }
+ end
+
+ trait(:package_file) do
+ package_file { association(:conan_package_file, :conan_package, without_loaded_metadatum: true) }
+ conan_file_type { 'package_file' }
+ package_revision { '0' }
+ conan_package_reference { '123456789' }
+ end
+ end
+end
diff --git a/spec/factories/packages/conan/metadata.rb b/spec/factories/packages/conan/metadata.rb
new file mode 100644
index 00000000000..81ded799684
--- /dev/null
+++ b/spec/factories/packages/conan/metadata.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+FactoryBot.define do
+ factory :conan_metadatum, class: 'Packages::Conan::Metadatum' do
+ association :package, factory: [:conan_package, :without_loaded_metadatum], without_package_files: true
+ package_username { 'username' }
+ package_channel { 'stable' }
+ end
+end
diff --git a/spec/factories/packages/dependencies.rb b/spec/factories/packages/dependencies.rb
new file mode 100644
index 00000000000..a62d48c2e73
--- /dev/null
+++ b/spec/factories/packages/dependencies.rb
@@ -0,0 +1,12 @@
+# frozen_string_literal: true
+
+FactoryBot.define do
+ factory :packages_dependency, class: 'Packages::Dependency' do
+ sequence(:name) { |n| "@test/package-#{n}"}
+ sequence(:version_pattern) { |n| "~6.2.#{n}" }
+
+ trait(:rubygems) do
+ sequence(:name) { |n| "gem-dependency-#{n}"}
+ end
+ end
+end
diff --git a/spec/factories/packages/dependency_links.rb b/spec/factories/packages/dependency_links.rb
new file mode 100644
index 00000000000..6470cbdc9a6
--- /dev/null
+++ b/spec/factories/packages/dependency_links.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+FactoryBot.define do
+ factory :packages_dependency_link, class: 'Packages::DependencyLink' do
+ package { association(:nuget_package) }
+ dependency { association(:packages_dependency) }
+ dependency_type { :dependencies }
+
+ trait(:with_nuget_metadatum) do
+ after :build do |link|
+ link.nuget_metadatum = build(:nuget_dependency_link_metadatum)
+ end
+ end
+
+ trait(:rubygems) do
+ package { association(:rubygems_package) }
+ dependency { association(:packages_dependency, :rubygems) }
+ end
+ end
+end
diff --git a/spec/factories/packages/maven/maven_metadata.rb b/spec/factories/packages/maven/maven_metadata.rb
new file mode 100644
index 00000000000..861daab3a74
--- /dev/null
+++ b/spec/factories/packages/maven/maven_metadata.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+FactoryBot.define do
+ factory :maven_metadatum, class: 'Packages::Maven::Metadatum' do
+ association :package, package_type: :maven
+ path { 'my/company/app/my-app/1.0-SNAPSHOT' }
+ app_group { 'my.company.app' }
+ app_name { 'my-app' }
+ app_version { '1.0-SNAPSHOT' }
+ end
+end
diff --git a/spec/factories/packages/nuget/dependency_link_metadata.rb b/spec/factories/packages/nuget/dependency_link_metadata.rb
new file mode 100644
index 00000000000..ed632e72cbf
--- /dev/null
+++ b/spec/factories/packages/nuget/dependency_link_metadata.rb
@@ -0,0 +1,8 @@
+# frozen_string_literal: true
+
+FactoryBot.define do
+ factory :nuget_dependency_link_metadatum, class: 'Packages::Nuget::DependencyLinkMetadatum' do
+ dependency_link { association(:packages_dependency_link) }
+ target_framework { '.NETStandard2.0' }
+ end
+end
diff --git a/spec/factories/packages/nuget/metadata.rb b/spec/factories/packages/nuget/metadata.rb
new file mode 100644
index 00000000000..d2a2a666928
--- /dev/null
+++ b/spec/factories/packages/nuget/metadata.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+FactoryBot.define do
+ factory :nuget_metadatum, class: 'Packages::Nuget::Metadatum' do
+ package { association(:nuget_package) }
+
+ license_url { 'http://www.gitlab.com' }
+ project_url { 'http://www.gitlab.com' }
+ icon_url { 'http://www.gitlab.com' }
+ end
+end
diff --git a/spec/factories/packages/package_file.rb b/spec/factories/packages/package_files.rb
index d9afbac1048..d9afbac1048 100644
--- a/spec/factories/packages/package_file.rb
+++ b/spec/factories/packages/package_files.rb
diff --git a/spec/factories/packages/package_tags.rb b/spec/factories/packages/package_tags.rb
new file mode 100644
index 00000000000..3d2eea4a73b
--- /dev/null
+++ b/spec/factories/packages/package_tags.rb
@@ -0,0 +1,8 @@
+# frozen_string_literal: true
+
+FactoryBot.define do
+ factory :packages_tag, class: 'Packages::Tag' do
+ package
+ sequence(:name) { |n| "tag-#{n}"}
+ end
+end
diff --git a/spec/factories/packages.rb b/spec/factories/packages/packages.rb
index b04b7e691fe..bb9aa95fe08 100644
--- a/spec/factories/packages.rb
+++ b/spec/factories/packages/packages.rb
@@ -249,117 +249,4 @@ FactoryBot.define do
package_type { :generic }
end
end
-
- factory :composer_metadatum, class: 'Packages::Composer::Metadatum' do
- package { association(:composer_package) }
-
- target_sha { '123' }
- composer_json { { name: 'foo' } }
- end
-
- factory :composer_cache_file, class: 'Packages::Composer::CacheFile' do
- group
-
- file_sha256 { '1' * 64 }
-
- transient do
- file_fixture { 'spec/fixtures/packages/composer/package.json' }
- end
-
- after(:build) do |cache_file, evaluator|
- cache_file.file = fixture_file_upload(evaluator.file_fixture)
- end
-
- trait(:object_storage) do
- file_store { Packages::Composer::CacheUploader::Store::REMOTE }
- end
- end
-
- factory :maven_metadatum, class: 'Packages::Maven::Metadatum' do
- association :package, package_type: :maven
- path { 'my/company/app/my-app/1.0-SNAPSHOT' }
- app_group { 'my.company.app' }
- app_name { 'my-app' }
- app_version { '1.0-SNAPSHOT' }
- end
-
- factory :conan_metadatum, class: 'Packages::Conan::Metadatum' do
- association :package, factory: [:conan_package, :without_loaded_metadatum], without_package_files: true
- package_username { 'username' }
- package_channel { 'stable' }
- end
-
- factory :pypi_metadatum, class: 'Packages::Pypi::Metadatum' do
- package { association(:pypi_package, without_loaded_metadatum: true) }
- required_python { '>=2.7' }
- end
-
- factory :nuget_metadatum, class: 'Packages::Nuget::Metadatum' do
- package { association(:nuget_package) }
-
- license_url { 'http://www.gitlab.com' }
- project_url { 'http://www.gitlab.com' }
- icon_url { 'http://www.gitlab.com' }
- end
-
- factory :conan_file_metadatum, class: 'Packages::Conan::FileMetadatum' do
- package_file { association(:conan_package_file, :conan_recipe_file, without_loaded_metadatum: true) }
- recipe_revision { '0' }
- conan_file_type { 'recipe_file' }
-
- trait(:recipe_file) do
- conan_file_type { 'recipe_file' }
- end
-
- trait(:package_file) do
- package_file { association(:conan_package_file, :conan_package, without_loaded_metadatum: true) }
- conan_file_type { 'package_file' }
- package_revision { '0' }
- conan_package_reference { '123456789' }
- end
- end
-
- factory :packages_dependency, class: 'Packages::Dependency' do
- sequence(:name) { |n| "@test/package-#{n}"}
- sequence(:version_pattern) { |n| "~6.2.#{n}" }
-
- trait(:rubygems) do
- sequence(:name) { |n| "gem-dependency-#{n}"}
- end
- end
-
- factory :packages_dependency_link, class: 'Packages::DependencyLink' do
- package { association(:nuget_package) }
- dependency { association(:packages_dependency) }
- dependency_type { :dependencies }
-
- trait(:with_nuget_metadatum) do
- after :build do |link|
- link.nuget_metadatum = build(:nuget_dependency_link_metadatum)
- end
- end
-
- trait(:rubygems) do
- package { association(:rubygems_package) }
- dependency { association(:packages_dependency, :rubygems) }
- end
- end
-
- factory :nuget_dependency_link_metadatum, class: 'Packages::Nuget::DependencyLinkMetadatum' do
- dependency_link { association(:packages_dependency_link) }
- target_framework { '.NETStandard2.0' }
- end
-
- factory :packages_tag, class: 'Packages::Tag' do
- package
- sequence(:name) { |n| "tag-#{n}"}
- end
-
- factory :packages_build_info, class: 'Packages::BuildInfo' do
- package
-
- trait :with_pipeline do
- association :pipeline, factory: [:ci_pipeline, :with_job]
- end
- end
end
diff --git a/spec/factories/packages/pypi/metadata.rb b/spec/factories/packages/pypi/metadata.rb
new file mode 100644
index 00000000000..00abe403bd1
--- /dev/null
+++ b/spec/factories/packages/pypi/metadata.rb
@@ -0,0 +1,8 @@
+# frozen_string_literal: true
+
+FactoryBot.define do
+ factory :pypi_metadatum, class: 'Packages::Pypi::Metadatum' do
+ package { association(:pypi_package, without_loaded_metadatum: true) }
+ required_python { '>=2.7' }
+ end
+end
diff --git a/spec/frontend/tracking_spec.js b/spec/frontend/tracking_spec.js
index 21fed51ff10..1aa64e049bb 100644
--- a/spec/frontend/tracking_spec.js
+++ b/spec/frontend/tracking_spec.js
@@ -409,31 +409,27 @@ describe('Tracking', () => {
});
});
- describe.each`
- term
- ${'event'}
- ${'action'}
- `('tracking interface events with data-track-$term', ({ term }) => {
+ describe('tracking interface events with data-track-action', () => {
let eventSpy;
beforeEach(() => {
eventSpy = jest.spyOn(Tracking, 'event');
Tracking.bindDocument('_category_'); // only happens once
setHTMLFixture(`
- <input data-track-${term}="click_input1" data-track-label="_label_" value=0 />
- <input data-track-${term}="click_input2" data-track-value=0 value=0/>
- <input type="checkbox" data-track-${term}="toggle_checkbox" value=1 checked/>
- <input class="dropdown" data-track-${term}="toggle_dropdown"/>
- <div data-track-${term}="nested_event"><span class="nested"></span></div>
+ <input data-track-action="click_input1" data-track-label="_label_" value=0 />
+ <input data-track-action="click_input2" data-track-value=0 value=0/>
+ <input type="checkbox" data-track-action="toggle_checkbox" value=1 checked/>
+ <input class="dropdown" data-track-action="toggle_dropdown"/>
+ <div data-track-action="nested_event"><span class="nested"></span></div>
<input data-track-bogus="click_bogusinput" data-track-label="_label_" value="_value_"/>
- <input data-track-${term}="click_input3" data-track-experiment="example" value="_value_"/>
- <input data-track-${term}="event_with_extra" data-track-extra='{ "foo": "bar" }' />
- <input data-track-${term}="event_with_invalid_extra" data-track-extra="invalid_json" />
+ <input data-track-action="click_input3" data-track-experiment="example" value="_value_"/>
+ <input data-track-action="event_with_extra" data-track-extra='{ "foo": "bar" }' />
+ <input data-track-action="event_with_invalid_extra" data-track-extra="invalid_json" />
`);
});
- it(`binds to clicks on elements matching [data-track-${term}]`, () => {
- document.querySelector(`[data-track-${term}="click_input1"]`).click();
+ it(`binds to clicks on elements matching [data-track-action]`, () => {
+ document.querySelector(`[data-track-action="click_input1"]`).click();
expect(eventSpy).toHaveBeenCalledWith('_category_', 'click_input1', {
label: '_label_',
@@ -441,14 +437,14 @@ describe('Tracking', () => {
});
});
- it(`does not bind to clicks on elements without [data-track-${term}]`, () => {
+ it(`does not bind to clicks on elements without [data-track-action]`, () => {
document.querySelector('[data-track-bogus="click_bogusinput"]').click();
expect(eventSpy).not.toHaveBeenCalled();
});
it('allows value override with the data-track-value attribute', () => {
- document.querySelector(`[data-track-${term}="click_input2"]`).click();
+ document.querySelector(`[data-track-action="click_input2"]`).click();
expect(eventSpy).toHaveBeenCalledWith('_category_', 'click_input2', {
value: '0',
@@ -456,7 +452,7 @@ describe('Tracking', () => {
});
it('handles checkbox values correctly', () => {
- const checkbox = document.querySelector(`[data-track-${term}="toggle_checkbox"]`);
+ const checkbox = document.querySelector(`[data-track-action="toggle_checkbox"]`);
checkbox.click(); // unchecking
@@ -472,7 +468,7 @@ describe('Tracking', () => {
});
it('handles bootstrap dropdowns', () => {
- const dropdown = document.querySelector(`[data-track-${term}="toggle_dropdown"]`);
+ const dropdown = document.querySelector(`[data-track-action="toggle_dropdown"]`);
dropdown.dispatchEvent(new Event('show.bs.dropdown', { bubbles: true }));
@@ -497,7 +493,7 @@ describe('Tracking', () => {
};
getExperimentData.mockReturnValue(mockExperimentData);
- document.querySelector(`[data-track-${term}="click_input3"]`).click();
+ document.querySelector(`[data-track-action="click_input3"]`).click();
expect(eventSpy).toHaveBeenCalledWith('_category_', 'click_input3', {
value: '_value_',
@@ -506,7 +502,7 @@ describe('Tracking', () => {
});
it('supports extra data as JSON', () => {
- document.querySelector(`[data-track-${term}="event_with_extra"]`).click();
+ document.querySelector(`[data-track-action="event_with_extra"]`).click();
expect(eventSpy).toHaveBeenCalledWith('_category_', 'event_with_extra', {
extra: { foo: 'bar' },
@@ -514,34 +510,30 @@ describe('Tracking', () => {
});
it('ignores extra if provided JSON is invalid', () => {
- document.querySelector(`[data-track-${term}="event_with_invalid_extra"]`).click();
+ document.querySelector(`[data-track-action="event_with_invalid_extra"]`).click();
expect(eventSpy).toHaveBeenCalledWith('_category_', 'event_with_invalid_extra', {});
});
});
- describe.each`
- term
- ${'event'}
- ${'action'}
- `('tracking page loaded events with -$term', ({ term }) => {
+ describe('tracking page loaded events with -action', () => {
let eventSpy;
beforeEach(() => {
eventSpy = jest.spyOn(Tracking, 'event');
setHTMLFixture(`
- <div data-track-${term}="click_link" data-track-label="all_nested_links">
- <input data-track-${term}="render" data-track-label="label1" value=1 data-track-property="_property_"/>
- <span data-track-${term}="render" data-track-label="label2" data-track-value=1>
+ <div data-track-action="click_link" data-track-label="all_nested_links">
+ <input data-track-action="render" data-track-label="label1" value=1 data-track-property="_property_"/>
+ <span data-track-action="render" data-track-label="label2" data-track-value=1>
<a href="#" id="link">Something</a>
</span>
- <input data-track-${term}="_render_bogus_" data-track-label="label3" value="_value_" data-track-property="_property_"/>
+ <input data-track-action="_render_bogus_" data-track-label="label3" value="_value_" data-track-property="_property_"/>
</div>
`);
Tracking.trackLoadEvents('_category_'); // only happens once
});
- it(`sends tracking events when [data-track-${term}="render"] is on an element`, () => {
+ it(`sends tracking events when [data-track-action="render"] is on an element`, () => {
expect(eventSpy.mock.calls).toEqual([
[
'_category_',
@@ -576,7 +568,7 @@ describe('Tracking', () => {
eventSpy.mockClear();
});
- it(`avoids using ancestor [data-track-${term}="render"] tracking configurations`, () => {
+ it(`avoids using ancestor [data-track-action="render"] tracking configurations`, () => {
link.dispatchEvent(new Event(event, { bubbles: true }));
expect(eventSpy).not.toHaveBeenCalledWith(
diff --git a/spec/lib/gitlab/doctor/secrets_spec.rb b/spec/lib/gitlab/doctor/secrets_spec.rb
index b9e054ce14f..f95a7eb1492 100644
--- a/spec/lib/gitlab/doctor/secrets_spec.rb
+++ b/spec/lib/gitlab/doctor/secrets_spec.rb
@@ -5,6 +5,8 @@ require 'spec_helper'
RSpec.describe Gitlab::Doctor::Secrets do
let!(:user) { create(:user, otp_secret: "test") }
let!(:group) { create(:group, runners_token: "test") }
+ let!(:project) { create(:project) }
+ let!(:grafana_integration) { create(:grafana_integration, project: project, token: "test") }
let(:logger) { double(:logger).as_null_object }
subject { described_class.new(logger).run! }
@@ -39,4 +41,12 @@ RSpec.describe Gitlab::Doctor::Secrets do
subject
end
end
+
+ context 'when GrafanaIntegration token is set via private method' do
+ it 'can access GrafanaIntegration token value' do
+ expect(logger).to receive(:info).with(/GrafanaIntegration failures: 0/)
+
+ subject
+ end
+ end
end
diff --git a/spec/models/packages/package_spec.rb b/spec/models/packages/package_spec.rb
index 99e5769fc1f..2573c01d686 100644
--- a/spec/models/packages/package_spec.rb
+++ b/spec/models/packages/package_spec.rb
@@ -1184,7 +1184,7 @@ RSpec.describe Packages::Package, type: :model do
end
context 'with an already existing build info' do
- let_it_be(:build_info) { create(:packages_build_info, package: package, pipeline: pipeline) }
+ let_it_be(:build_info) { create(:package_build_info, package: package, pipeline: pipeline) }
it 'does not create a build info' do
expect { subject }.not_to change { ::Packages::BuildInfo.count }
diff --git a/spec/requests/projects/merge_requests_discussions_spec.rb b/spec/requests/projects/merge_requests_discussions_spec.rb
index 8057a091bba..26402bad8aa 100644
--- a/spec/requests/projects/merge_requests_discussions_spec.rb
+++ b/spec/requests/projects/merge_requests_discussions_spec.rb
@@ -5,11 +5,13 @@ require 'spec_helper'
RSpec.describe 'merge requests discussions' do
# Further tests can be found at merge_requests_controller_spec.rb
describe 'GET /:namespace/:project/-/merge_requests/:iid/discussions' do
- let(:project) { create(:project, :repository) }
- let(:user) { project.owner }
+ let(:project) { create(:project, :repository, :public) }
+ let(:owner) { project.owner }
+ let(:user) { create(:user) }
let(:merge_request) { create(:merge_request_with_diffs, target_project: project, source_project: project) }
before do
+ project.add_maintainer(owner)
project.add_developer(user)
login_as(user)
end
@@ -232,7 +234,17 @@ RSpec.describe 'merge requests discussions' do
context 'when author role changes' do
before do
- Members::UpdateService.new(user, access_level: Gitlab::Access::GUEST).execute(author_membership)
+ Members::UpdateService.new(owner, access_level: Gitlab::Access::GUEST).execute(author_membership)
+ end
+
+ it_behaves_like 'cache miss' do
+ let(:changed_notes) { [first_note, second_note] }
+ end
+ end
+
+ context 'when current_user role changes' do
+ before do
+ Members::UpdateService.new(owner, access_level: Gitlab::Access::GUEST).execute(project.project_member(user))
end
it_behaves_like 'cache miss' do
diff --git a/spec/tooling/danger/product_intelligence_spec.rb b/spec/tooling/danger/product_intelligence_spec.rb
index 4ab911b6590..bccbb26c847 100644
--- a/spec/tooling/danger/product_intelligence_spec.rb
+++ b/spec/tooling/danger/product_intelligence_spec.rb
@@ -74,7 +74,7 @@ RSpec.describe Tooling::Danger::ProductIntelligence do
context 'with snowplow files changed' do
context 'when vue file changed' do
- let(:changed_lines) { ['+data-track-event'] }
+ let(:changed_lines) { ['+data-track-action'] }
it { is_expected.to match_array(['components/welcome.vue']) }
end
diff --git a/tooling/danger/product_intelligence.rb b/tooling/danger/product_intelligence.rb
index 30c961184f5..ae92fd684d8 100644
--- a/tooling/danger/product_intelligence.rb
+++ b/tooling/danger/product_intelligence.rb
@@ -66,7 +66,6 @@ module Tooling
js_patterns = Regexp.union(
'Tracking.event',
/\btrack\(/,
- 'data-track-event',
'data-track-action'
)
all_changed_files.select do |file|