Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2021-04-12 03:09:13 +00:00
parent 2aa98751c9
commit 08c975cb5d
17 changed files with 66 additions and 85 deletions

View file

@ -114,7 +114,7 @@ class Issue < ApplicationRecord
scope :order_severity_desc, -> { includes(:issuable_severity).order('issuable_severities.severity DESC NULLS LAST') } scope :order_severity_desc, -> { includes(:issuable_severity).order('issuable_severities.severity DESC NULLS LAST') }
scope :preload_associated_models, -> { preload(:assignees, :labels, project: :namespace) } scope :preload_associated_models, -> { preload(:assignees, :labels, project: :namespace) }
scope :with_web_entity_associations, -> { preload(:author, :project) } scope :with_web_entity_associations, -> { preload(:author, project: [:project_feature, :route, namespace: :route]) }
scope :with_label_attributes, ->(label_attributes) { joins(:labels).where(labels: label_attributes) } scope :with_label_attributes, ->(label_attributes) { joins(:labels).where(labels: label_attributes) }
scope :with_alert_management_alerts, -> { joins(:alert_management_alert) } scope :with_alert_management_alerts, -> { joins(:alert_management_alert) }
scope :with_prometheus_alert_events, -> { joins(:issues_prometheus_alert_events) } scope :with_prometheus_alert_events, -> { joins(:issues_prometheus_alert_events) }

View file

@ -21,20 +21,8 @@ class BuildArtifactEntity < Grape::Entity
) )
end end
expose :keep_path, if: -> (*) { artifact.expiring? && show_duplicated_paths?(project) } do |artifact|
fast_keep_project_job_artifacts_path(project, artifact.job)
end
expose :browse_path, if: -> (*) { show_duplicated_paths?(project) } do |artifact|
fast_browse_project_job_artifacts_path(project, artifact.job)
end
private private
def show_duplicated_paths?(project)
!Gitlab::Ci::Features.remove_duplicate_artifact_exposure_paths?(project)
end
def project def project
options[:project] || artifact.project options[:project] || artifact.project
end end

View file

@ -50,23 +50,6 @@
} }
], ],
"analyzers": [ "analyzers": [
{
"name": "brakeman",
"label": "Brakeman",
"enabled" : true,
"description": "Ruby on Rails",
"variables": [
{
"field" : "SAST_BRAKEMAN_LEVEL",
"label" : "Brakeman confidence level.",
"type": "string",
"default_value": "1",
"value": "",
"size": "SMALL",
"description": "Ignore Brakeman vulnerabilities under given confidence level. Integer, 1=Low, 2=Medium, 3=High."
}
]
},
{ {
"name": "bandit", "name": "bandit",
"label": "Bandit", "label": "Bandit",
@ -75,7 +58,7 @@
"variables": [ "variables": [
{ {
"field" : "SAST_BANDIT_EXCLUDED_PATHS", "field" : "SAST_BANDIT_EXCLUDED_PATHS",
"label" : "Paths to exclude from scan.", "label" : "Paths to exclude from scan",
"type": "string", "type": "string",
"default_value": "", "default_value": "",
"value": "", "value": "",
@ -84,6 +67,23 @@
} }
] ]
}, },
{
"name": "brakeman",
"label": "Brakeman",
"enabled" : true,
"description": "Ruby on Rails",
"variables": [
{
"field" : "SAST_BRAKEMAN_LEVEL",
"label" : "Brakeman confidence level",
"type": "string",
"default_value": "1",
"value": "",
"size": "SMALL",
"description": "Ignore Brakeman vulnerabilities under given confidence level. Integer, 1=Low, 2=Medium, 3=High."
}
]
},
{ {
"name": "eslint", "name": "eslint",
"label": "ESLint", "label": "ESLint",
@ -110,7 +110,7 @@
}, },
{ {
"name": "kubesec", "name": "kubesec",
"label": "kubesec", "label": "Kubesec",
"enabled" : true, "enabled" : true,
"description": "Kubernetes manifests, Helm Charts", "description": "Kubernetes manifests, Helm Charts",
"variables": [] "variables": []
@ -124,7 +124,7 @@
}, },
{ {
"name": "gosec", "name": "gosec",
"label": "Golang Security Checker", "label": "Gosec",
"enabled" : true, "enabled" : true,
"description": "Go", "description": "Go",
"variables": [ "variables": [

View file

@ -0,0 +1,5 @@
---
title: Fix N+1 queries for issues search
merge_request: 58915
author:
type: performance

View file

@ -0,0 +1,5 @@
---
title: Small text updates on the SAST Config UI page
merge_request: 58188
author:
type: changed

View file

@ -0,0 +1,5 @@
---
title: Remove paths from BuildArtifactEntity
merge_request: 58818
author:
type: performance

View file

@ -0,0 +1,5 @@
---
title: Fix user reference transformation in EpicsPipeline
merge_request: 58913
author:
type: fixed

View file

@ -1,8 +0,0 @@
---
name: remove_duplicate_artifact_exposure_paths
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/54611
rollout_issue_url:
milestone: '13.10'
type: development
group: group::testing
default_enabled: false

View file

@ -89,7 +89,7 @@ with secure tokens as you complete the setup process.
We note in the instructions below where these secrets are required. We note in the instructions below where these secrets are required.
NOTE: NOTE:
Omnibus GitLab installations can use `gitlab-secrets.json`. Omnibus GitLab installations can use `gitlab-secrets.json` for `GITLAB_SHELL_SECRET_TOKEN`.
### PostgreSQL ### PostgreSQL

View file

@ -2782,7 +2782,7 @@ To follow progress on support for GitLab-managed clusters, see the
#### `environment:deployment_tier` #### `environment:deployment_tier`
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/27630) in GitLab 13.10. > [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/300741) in GitLab 13.10.
Use the `deployment_tier` keyword to specify the tier of the deployment environment: Use the `deployment_tier` keyword to specify the tier of the deployment environment:

View file

@ -36,13 +36,13 @@ For example:
To minimize problems during the documentation release process, use the following timeline: To minimize problems during the documentation release process, use the following timeline:
- Before the 20nd of the month: - Any time before the 17th of the month:
[Add the charts version](#add-chart-version), so that the documentation is built using the [Add the charts version](#add-chart-version), so that the documentation is built using the
[version of the charts project that maps to](https://docs.gitlab.com/charts/installation/version_mappings.html) [version of the charts project that maps to](https://docs.gitlab.com/charts/installation/version_mappings.html)
the GitLab release. This step may have been completed already. the GitLab release. This step may have been completed already.
- On or near the 20th of the month: - Between the 17th and the 20th of the month:
1. [Create a stable branch and Docker image](#create-stable-branch-and-docker-image-for-release) for 1. [Create a stable branch and Docker image](#create-stable-branch-and-docker-image-for-release) for
the new version. the new version.

View file

@ -12,7 +12,7 @@ module BulkImports
DEFAULT_REFERENCE = 'user' DEFAULT_REFERENCE = 'user'
def initialize(options = {}) def initialize(options = {})
@reference = options[:reference] || DEFAULT_REFERENCE @reference = options[:reference].to_s.presence || DEFAULT_REFERENCE
@suffixed_reference = "#{@reference}_id" @suffixed_reference = "#{@reference}_id"
end end

View file

@ -63,10 +63,6 @@ module Gitlab
def self.multiple_cache_per_job? def self.multiple_cache_per_job?
::Feature.enabled?(:multiple_cache_per_job, default_enabled: :yaml) ::Feature.enabled?(:multiple_cache_per_job, default_enabled: :yaml)
end end
def self.remove_duplicate_artifact_exposure_paths?(project)
::Feature.enabled?(:remove_duplicate_artifact_exposure_paths, project, default_enabled: :yaml)
end
end end
end end
end end

View file

@ -125,8 +125,8 @@ RSpec.describe GitlabSchema.types['Project'] do
it "returns the project's sast configuration for analyzer variables" do it "returns the project's sast configuration for analyzer variables" do
analyzer = subject.dig('data', 'project', 'sastCiConfiguration', 'analyzers', 'nodes').first analyzer = subject.dig('data', 'project', 'sastCiConfiguration', 'analyzers', 'nodes').first
expect(analyzer['name']).to eq('brakeman') expect(analyzer['name']).to eq('bandit')
expect(analyzer['label']).to eq('Brakeman') expect(analyzer['label']).to eq('Bandit')
expect(analyzer['enabled']).to eq(true) expect(analyzer['enabled']).to eq(true)
end end

View file

@ -52,19 +52,26 @@ RSpec.describe BulkImports::Common::Transformers::UserReferenceTransformer do
end end
context 'when custom reference is provided' do context 'when custom reference is provided' do
it 'updates provided reference' do shared_examples 'updates provided reference' do |reference|
hash = { let(:hash) do
{
'author' => { 'author' => {
'public_email' => user.email 'public_email' => user.email
} }
} }
end
transformer = described_class.new(reference: 'author') it 'updates provided reference' do
transformer = described_class.new(reference: reference)
result = transformer.transform(context, hash) result = transformer.transform(context, hash)
expect(result['author']).to be_nil expect(result['author']).to be_nil
expect(result['author_id']).to eq(user.id) expect(result['author_id']).to eq(user.id)
end end
end end
include_examples 'updates provided reference', 'author'
include_examples 'updates provided reference', :author
end
end end
end end

View file

@ -27,28 +27,6 @@ RSpec.describe BuildArtifactEntity do
expect(subject[:path]).to include "jobs/#{job.id}/artifacts/download?file_type=codequality" expect(subject[:path]).to include "jobs/#{job.id}/artifacts/download?file_type=codequality"
end end
context 'with remove_duplicate_artifact_exposure_paths enabled' do
before do
stub_feature_flags(remove_duplicate_artifact_exposure_paths: true)
end
it 'has no keep or browse path' do
expect(subject).not_to include(:keep_path)
expect(subject).not_to include(:browse_path)
end
end
context 'with remove_duplicate_artifact_exposure_paths disabled' do
before do
stub_feature_flags(remove_duplicate_artifact_exposure_paths: false)
end
it 'has keep and browse paths' do
expect(subject[:keep_path]).to be_present
expect(subject[:browse_path]).to be_present
end
end
context 'when project is specified in options' do context 'when project is specified in options' do
let(:options) { super().merge(project: job.project) } let(:options) { super().merge(project: job.project) }

View file

@ -12,8 +12,8 @@ RSpec.describe Security::CiConfiguration::SastParserService do
let(:sast_analyzer_image_tag) { configuration['global'][2] } let(:sast_analyzer_image_tag) { configuration['global'][2] }
let(:sast_pipeline_stage) { configuration['pipeline'][0] } let(:sast_pipeline_stage) { configuration['pipeline'][0] }
let(:sast_search_max_depth) { configuration['pipeline'][1] } let(:sast_search_max_depth) { configuration['pipeline'][1] }
let(:brakeman) { configuration['analyzers'][0] } let(:bandit) { configuration['analyzers'][0] }
let(:bandit) { configuration['analyzers'][1] } let(:brakeman) { configuration['analyzers'][1] }
let(:sast_brakeman_level) { brakeman['variables'][0] } let(:sast_brakeman_level) { brakeman['variables'][0] }
it 'parses the configuration for SAST' do it 'parses the configuration for SAST' do