Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2022-05-11 06:08:03 +00:00
parent defc424997
commit 18b54e46b7
26 changed files with 218 additions and 45 deletions

View file

@ -199,11 +199,6 @@ Style/FormatString:
Style/HashAsLastArrayItem:
Enabled: false
# Offense count: 70
# Cop supports --auto-correct.
Style/HashEachMethods:
Enabled: false
# Offense count: 64
# Cop supports --auto-correct.
Style/KeywordParametersOrder:

View file

@ -0,0 +1,91 @@
---
# Cop supports --auto-correct.
Style/HashEachMethods:
# Offense count: 95
# Temporarily disabled due to too many offenses
Enabled: false
Exclude:
- 'app/graphql/resolvers/concerns/caching_array_resolver.rb'
- 'app/graphql/types/alert_management/severity_enum.rb'
- 'app/graphql/types/availability_enum.rb'
- 'app/graphql/types/ci/code_quality_degradation_severity_enum.rb'
- 'app/graphql/types/ci/job_artifact_file_type_enum.rb'
- 'app/graphql/types/ci/pipeline_config_source_enum.rb'
- 'app/graphql/types/ci/runner_access_level_enum.rb'
- 'app/graphql/types/clusters/agent_token_status_enum.rb'
- 'app/graphql/types/container_repository_status_enum.rb'
- 'app/graphql/types/data_visualization_palette/color_enum.rb'
- 'app/graphql/types/data_visualization_palette/weight_enum.rb'
- 'app/graphql/types/dependency_proxy/manifest_type_enum.rb'
- 'app/graphql/types/design_management/design_collection_copy_state_enum.rb'
- 'app/graphql/types/design_management/design_version_event_enum.rb'
- 'app/graphql/types/event_action_enum.rb'
- 'app/graphql/types/issuable_severity_enum.rb'
- 'app/graphql/types/packages/conan/metadatum_file_type_enum.rb'
- 'app/graphql/types/packages/package_dependency_type_enum.rb'
- 'app/graphql/types/packages/package_status_enum.rb'
- 'app/graphql/types/packages/package_type_enum.rb'
- 'app/graphql/types/release_asset_link_type_enum.rb'
- 'app/graphql/types/user_callout_feature_name_enum.rb'
- 'app/helpers/routing/pseudonymization_helper.rb'
- 'app/models/application_setting.rb'
- 'app/services/security/merge_reports_service.rb'
- 'config/initializers/6_validations.rb'
- 'config/initializers/8_gitaly.rb'
- 'ee/app/graphql/types/compliance_management/merge_requests/compliance_violation_reason_enum.rb'
- 'ee/app/graphql/types/compliance_management/merge_requests/compliance_violation_severity_enum.rb'
- 'ee/app/graphql/types/incident_management/oncall_rotation_length_unit_enum.rb'
- 'ee/app/graphql/types/security_report_summary_type.rb'
- 'ee/app/graphql/types/vulnerabilities_count_by_day_type.rb'
- 'ee/app/graphql/types/vulnerability/external_issue_link_external_tracker_enum.rb'
- 'ee/app/graphql/types/vulnerability/external_issue_link_type_enum.rb'
- 'ee/app/graphql/types/vulnerability/issue_link_type_enum.rb'
- 'ee/app/graphql/types/vulnerability_confidence_enum.rb'
- 'ee/app/graphql/types/vulnerability_grade_enum.rb'
- 'ee/app/graphql/types/vulnerability_report_type_enum.rb'
- 'ee/app/graphql/types/vulnerability_severities_count_type.rb'
- 'ee/app/graphql/types/vulnerability_severity_enum.rb'
- 'ee/app/models/geo/secondary_usage_data.rb'
- 'ee/db/fixtures/development/32_compliance_report_violations.rb'
- 'ee/lib/gitlab/ci/reports/license_scanning/report.rb'
- 'ee/spec/factories/vulnerabilities.rb'
- 'ee/spec/factories/vulnerabilities/findings.rb'
- 'ee/spec/helpers/application_helper_spec.rb'
- 'ee/spec/lib/gitlab/geo_spec.rb'
- 'lib/api/todos.rb'
- 'lib/backup/manager.rb'
- 'lib/gitlab/changelog/release.rb'
- 'lib/gitlab/ci/parsers.rb'
- 'lib/gitlab/ci/reports/test_suite.rb'
- 'lib/gitlab/metrics/samplers/ruby_sampler.rb'
- 'lib/gitlab/metrics/subscribers/active_record.rb'
- 'lib/gitlab/metrics/subscribers/load_balancing.rb'
- 'lib/gitlab/middleware/multipart.rb'
- 'lib/gitlab/sidekiq_middleware/duplicate_jobs/duplicate_job.rb'
- 'lib/gitlab/usage_data.rb'
- 'spec/controllers/projects_controller_spec.rb'
- 'spec/factories/ci/reports/codequality_degradations.rb'
- 'spec/finders/packages/group_packages_finder_spec.rb'
- 'spec/helpers/application_helper_spec.rb'
- 'spec/lib/gitlab/ci/status/build/failed_spec.rb'
- 'spec/lib/gitlab/metrics/samplers/ruby_sampler_spec.rb'
- 'spec/lib/gitlab/template/gitlab_ci_yml_template_spec.rb'
- 'spec/lib/gitlab/usage_data_spec.rb'
- 'spec/models/ci/build_spec.rb'
- 'spec/models/ci/job_artifact_spec.rb'
- 'spec/models/ci/resource_group_spec.rb'
- 'spec/models/clusters/cluster_spec.rb'
- 'spec/models/concerns/has_user_type_spec.rb'
- 'spec/models/packages/package_spec.rb'
- 'spec/models/user_spec.rb'
- 'spec/presenters/ci/pipeline_presenter_spec.rb'
- 'spec/presenters/commit_status_presenter_spec.rb'
- 'spec/presenters/packages/npm/package_presenter_spec.rb'
- 'spec/services/system_notes/incident_service_spec.rb'
- 'spec/support/helpers/multipart_helpers.rb'
- 'spec/support/helpers/reactive_caching_helpers.rb'
- 'spec/support/import_export/project_tree_expectations.rb'
- 'spec/support/shared_examples/requests/api/npm_packages_shared_examples.rb'
- 'spec/support/shared_examples/services/packages_shared_examples.rb'
- 'spec/tasks/gitlab/packages/events_rake_spec.rb'
- 'tooling/graphql/docs/helper.rb'

View file

@ -1,6 +1,6 @@
<script>
import { GlDeprecatedSkeletonLoading as GlSkeletonLoading } from '@gitlab/ui';
import { flatten, isEqual } from 'lodash';
import { flatten, isEqual, keyBy } from 'lodash';
import createFlash from '~/flash';
import { sprintf, s__ } from '~/locale';
import { METRICS_POPOVER_CONTENT } from '../constants';
@ -30,7 +30,8 @@ const fetchMetricsData = (reqs = [], path, params) => {
const extractMetricsGroupData = (keyList = [], data = []) => {
if (!keyList.length || !data.length) return [];
return data.filter(({ identifier = '' }) => identifier.length && keyList.includes(identifier));
const kv = keyBy(data, 'identifier');
return keyList.map((id) => kv[id] || null).filter((obj) => Boolean(obj));
};
const groupRawMetrics = (groups = [], rawData = []) => {

View file

@ -55,13 +55,38 @@ export const METRICS_POPOVER_CONTENT = {
commits: {
description: s__('ValueStreamAnalytics|Number of commits pushed to the default branch'),
},
'time-to-restore-service': {
description: s__(
'ValueStreamAnalytics|Median time an incident was open on a production environment in the given time period.',
),
},
time_to_restore_service: {
description: s__(
'ValueStreamAnalytics|Median time an incident was open on a production environment in the given time period.',
),
},
'change-failure-rate': {
description: s__(
'ValueStreamAnalytics|Percentage of deployments that cause an incident in production.',
),
},
change_failure_rate: {
description: s__(
'ValueStreamAnalytics|Percentage of deployments that cause an incident in production.',
),
},
};
const KEY_METRICS_TITLE = s__('ValueStreamAnalytics|Key metrics');
const KEY_METRICS_KEYS = ['lead_time', 'cycle_time', 'issues', 'commits', 'deploys'];
const DORA_METRICS_TITLE = s__('ValueStreamAnalytics|DORA metrics');
const DORA_METRICS_KEYS = ['deployment_frequency', 'lead_time_for_changes'];
const DORA_METRICS_KEYS = [
'deployment_frequency',
'lead_time_for_changes',
'time_to_restore_service',
'change_failure_rate',
];
export const VSA_METRICS_GROUPS = [
{ key: 'key_metrics', title: KEY_METRICS_TITLE, keys: KEY_METRICS_KEYS },

View file

@ -140,7 +140,7 @@ export default {
<div v-if="editable" class="form group gl-display-flex gl-justify-content-end">
<gl-button
category="primary"
variant="success"
variant="confirm"
type="submit"
:disabled="!canSubmit"
:aria-disabled="!canSubmit"

View file

@ -238,7 +238,7 @@ export default {
</div>
</template>
<template v-if="dagDocPath" #actions>
<gl-button :href="dagDocPath" target="__blank" variant="success">
<gl-button :href="dagDocPath" target="_blank" variant="confirm">
{{ $options.emptyStateTexts.button }}
</gl-button>
</template>

View file

@ -64,7 +64,7 @@ class GraphqlController < ApplicationController
log_exception(exception)
if Rails.env.test? || Rails.env.development?
render_error("Internal server error: #{exception.message}", raised_at: exception.backtrace.first)
render_error("Internal server error: #{exception.message}", raised_at: exception.backtrace[0..10].join(' <-- '))
else
render_error("Internal server error")
end

View file

@ -13,7 +13,7 @@
= prometheus_form.gitlab_ui_checkbox_component :enabled,
s_('ClusterIntegration|Enable Prometheus integration'),
help_text: '%{help_text} %{help_link}'.html_safe % { help_text: help_text, help_link: help_link }
= prometheus_form.submit _('Save changes'), class: 'btn gl-button btn-success'
= prometheus_form.submit _('Save changes'), class: 'btn gl-button btn-confirm'
.sub-section.form-group
= gitlab_ui_form_for @elastic_stack_integration, as: :integration, namespace: :elastic_stack, url: @cluster.integrations_path, method: :post, html: { class: 'js-cluster-integrations-form' } do |elastic_stack_form|
@ -24,4 +24,4 @@
= elastic_stack_form.gitlab_ui_checkbox_component :enabled,
s_('ClusterIntegration|Enable Elastic Stack integration'),
help_text: '%{help_text} %{help_link}'.html_safe % { help_text: help_text, help_link: help_link }
= elastic_stack_form.submit _('Save changes'), class: 'btn gl-button btn-success'
= elastic_stack_form.submit _('Save changes'), class: 'btn gl-button btn-confirm'

View file

@ -2,8 +2,8 @@
- can_update_merge_request = can?(current_user, :update_merge_request, @merge_request)
- can_reopen_merge_request = can?(current_user, :reopen_merge_request, @merge_request)
- are_close_and_open_buttons_hidden = merge_request_button_hidden?(@merge_request, true) && merge_request_button_hidden?(@merge_request, false)
- cache_key = [@project, @merge_request, can_update_merge_request, can_reopen_merge_request, are_close_and_open_buttons_hidden, current_user&.preferred_language]
- moved_sidebar_enabled = Feature.enabled?(:updated_mr_header, @project)
- updated_mr_header_enabled = Feature.enabled?(:updated_mr_header, @project)
- cache_key = [@project, @merge_request, can_update_merge_request, can_reopen_merge_request, are_close_and_open_buttons_hidden, current_user&.preferred_language, updated_mr_header_enabled]
= cache(cache_key, expires_in: 1.day) do
- if @merge_request.closed_or_merged_without_fork?
@ -13,12 +13,12 @@
= c.body do
= _('The source project of this merge request has been removed.')
.detail-page-header.border-bottom-0.pt-0.pb-0{ class: "#{'gl-display-block gl-md-display-flex!' if moved_sidebar_enabled}" }
.detail-page-header.border-bottom-0.pt-0.pb-0{ class: "#{'gl-display-block gl-md-display-flex!' if updated_mr_header_enabled}" }
.detail-page-header-body
- unless moved_sidebar_enabled
- unless updated_mr_header_enabled
= render "shared/issuable/status_box", issuable: @merge_request
.issuable-meta{ class: "#{'gl-display-flex' if moved_sidebar_enabled}" }
- if moved_sidebar_enabled
.issuable-meta{ class: "#{'gl-display-flex' if updated_mr_header_enabled}" }
- if updated_mr_header_enabled
#js-issuable-header-warnings
%h2.title.gl-my-0.gl-display-inline-block{ data: { qa_selector: 'title_content' } }
= markdown_field(@merge_request, :title)
@ -30,7 +30,7 @@
%button.gl-button.btn.btn-default.btn-icon.float-right.d-block.d-sm-none.gutter-toggle.issuable-gutter-toggle.js-sidebar-toggle{ type: 'button' }
= sprite_icon('chevron-double-lg-left')
.detail-page-header-actions.js-issuable-actions{ class: "#{'gl-align-self-start is-merge-request' if moved_sidebar_enabled}" }
.detail-page-header-actions.js-issuable-actions{ class: "#{'gl-align-self-start is-merge-request' if updated_mr_header_enabled}" }
- if @merge_request.source_project
= render 'projects/merge_requests/code_dropdown'

View file

@ -37,7 +37,7 @@ module GitGarbageCollectMethods
# Refresh the branch cache in case garbage collection caused a ref lookup to fail
flush_ref_caches(resource) if gc?(task)
update_repository_statistics(resource) if task != :pack_refs
update_repository_statistics(resource, task)
# In case pack files are deleted, release libgit2 cache and open file
# descriptors ASAP instead of waiting for Ruby garbage collection
@ -135,15 +135,25 @@ module GitGarbageCollectMethods
resource.repository.has_visible_content?
end
def update_repository_statistics(resource)
def update_repository_statistics(resource, task)
return if task == :pack_refs
resource.repository.expire_statistics_caches
return if Gitlab::Database.read_only? # GitGarbageCollectWorker may be run on a Geo secondary
update_db_repository_statistics(resource)
stats_to_update = stats
stats_to_update.delete(:repository_size) if task == :incremental_repack
update_db_repository_statistics(resource, stats_to_update)
end
def update_db_repository_statistics(resource)
def update_db_repository_statistics(resource, stats)
# no-op
end
def stats
[]
end
end

View file

@ -44,8 +44,12 @@ module Projects
end
override :update_db_repository_statistics
def update_db_repository_statistics(resource)
Projects::UpdateStatisticsService.new(resource, nil, statistics: [:repository_size, :lfs_objects_size]).execute
def update_db_repository_statistics(resource, stats)
Projects::UpdateStatisticsService.new(resource, nil, statistics: stats).execute
end
def stats
[:repository_size, :lfs_objects_size]
end
end
end

View file

@ -19,8 +19,12 @@ module Wikis
end
override :update_db_repository_statistics
def update_db_repository_statistics(resource)
Projects::UpdateStatisticsService.new(resource.container, nil, statistics: [:wiki_size]).execute
def update_db_repository_statistics(resource, stats)
Projects::UpdateStatisticsService.new(resource.container, nil, statistics: stats).execute
end
def stats
[:wiki_size]
end
end
end

View file

@ -5,5 +5,5 @@ classes:
feature_categories:
- build_artifacts
description: TODO
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/44928
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/9bf76fe03f8edf4f67023448161af27abb8fb521
milestone: '13.5'

View file

@ -3,7 +3,7 @@ table_name: ci_unit_tests
classes:
- Ci::UnitTest
feature_categories:
- continuous_integration
- code_testing
description: TODO
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56137
milestone: '13.11'

View file

@ -3,7 +3,7 @@ table_name: reviews
classes:
- Review
feature_categories:
- review_apps
- code_review
description: TODO
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/8442
milestone: '11.6'

View file

@ -43,6 +43,7 @@ This workflow is considered push-based, because GitLab is pushing requests from
GitLab supports the following Kubernetes versions. You can upgrade your
Kubernetes version to a supported version at any time:
- 1.22 (support ends on March 22, 2023)
- 1.21 (support ends on November 22, 2022)
- 1.20 (support ends on July 22, 2022)

View file

@ -1,5 +1,5 @@
variables:
DAST_AUTO_DEPLOY_IMAGE_VERSION: 'v2.23.0'
DAST_AUTO_DEPLOY_IMAGE_VERSION: 'v2.26.0'
.dast-auto-deploy:
image: "registry.gitlab.com/gitlab-org/cluster-integration/auto-deploy-image:${DAST_AUTO_DEPLOY_IMAGE_VERSION}"

View file

@ -1,5 +1,5 @@
variables:
AUTO_DEPLOY_IMAGE_VERSION: 'v2.23.0'
AUTO_DEPLOY_IMAGE_VERSION: 'v2.26.0'
.auto-deploy:
image: "registry.gitlab.com/gitlab-org/cluster-integration/auto-deploy-image:${AUTO_DEPLOY_IMAGE_VERSION}"

View file

@ -1,5 +1,5 @@
variables:
AUTO_DEPLOY_IMAGE_VERSION: 'v2.23.0'
AUTO_DEPLOY_IMAGE_VERSION: 'v2.26.0'
.auto-deploy:
image: "registry.gitlab.com/gitlab-org/cluster-integration/auto-deploy-image:${AUTO_DEPLOY_IMAGE_VERSION}"

View file

@ -47,10 +47,8 @@ container_scanning:
- if: $CONTAINER_SCANNING_DISABLED
when: never
- if: $CI_COMMIT_BRANCH &&
$GITLAB_FEATURES =~ /\bcontainer_scanning\b/ &&
$CI_GITLAB_FIPS_MODE == "true" &&
$CS_ANALYZER_IMAGE !~ /-(fips|ubi)\z/
variables:
CS_IMAGE_SUFFIX: -fips
- if: $CI_COMMIT_BRANCH &&
$GITLAB_FEATURES =~ /\bcontainer_scanning\b/
- if: $CI_COMMIT_BRANCH

View file

@ -7104,6 +7104,9 @@ msgstr ""
msgid "Certificate Subject"
msgstr ""
msgid "Change Failure Rate"
msgstr ""
msgid "Change assignee"
msgstr ""
@ -10966,6 +10969,9 @@ msgstr ""
msgid "CycleAnalytics|Average time to completion"
msgstr ""
msgid "CycleAnalytics|Change Failure Rate"
msgstr ""
msgid "CycleAnalytics|Create a custom value stream to view metrics about stages specific to your development process. Use your value stream to visualize your DevSecOps lifecycle, determine the velocity of your group, and identify inefficient processes."
msgstr ""
@ -11039,6 +11045,9 @@ msgstr ""
msgid "CycleAnalytics|There is no data for 'Total time' available. Adjust the current filters."
msgstr ""
msgid "CycleAnalytics|Time to Restore Service"
msgstr ""
msgid "CycleAnalytics|Total time"
msgstr ""
@ -13426,6 +13435,9 @@ msgstr ""
msgid "Edit Pipeline Schedule"
msgstr ""
msgid "Edit Profile"
msgstr ""
msgid "Edit Release"
msgstr ""
@ -26043,6 +26055,9 @@ msgstr ""
msgid "OnDemandScans|%{learnMoreLinkStart}Learn more about on-demand scans%{learnMoreLinkEnd}."
msgstr ""
msgid "OnDemandScans|%{scannerType} profile library"
msgstr ""
msgid "OnDemandScans|Add a schedule to run this scan at a specified date and time or on a recurring basis. Scheduled scans are automatically saved to scan library."
msgstr ""
@ -26118,15 +26133,24 @@ msgstr ""
msgid "OnDemandScans|My daily scan"
msgstr ""
msgid "OnDemandScans|New %{scannerType} profile"
msgstr ""
msgid "OnDemandScans|New on-demand DAST scan"
msgstr ""
msgid "OnDemandScans|New on-demand scan"
msgstr ""
msgid "OnDemandScans|New profile"
msgstr ""
msgid "OnDemandScans|New scan"
msgstr ""
msgid "OnDemandScans|No %{scannerType} profiles found for DAST"
msgstr ""
msgid "OnDemandScans|No profile yet. In order to create a new scan, you need to have at least one completed scanner profile."
msgstr ""
@ -26184,6 +26208,9 @@ msgstr ""
msgid "OnDemandScans|Site profile"
msgstr ""
msgid "OnDemandScans|Start by creating a new profile. Profiles make it easy to save and reuse configuration details for GitLabs security tools."
msgstr ""
msgid "OnDemandScans|Start time"
msgstr ""
@ -34058,6 +34085,9 @@ msgstr ""
msgid "Select Page"
msgstr ""
msgid "Select Profile"
msgstr ""
msgid "Select a branch"
msgstr ""
@ -38919,6 +38949,9 @@ msgstr ""
msgid "Time spent"
msgstr ""
msgid "Time to Restore Service"
msgstr ""
msgid "Time to merge"
msgstr ""
@ -41206,6 +41239,9 @@ msgstr ""
msgid "ValueStreamAnalytics|Key metrics"
msgstr ""
msgid "ValueStreamAnalytics|Median time an incident was open on a production environment in the given time period."
msgstr ""
msgid "ValueStreamAnalytics|Median time between merge request merge and deployment to a production environment for all MRs deployed in the given time period."
msgstr ""
@ -41221,6 +41257,9 @@ msgstr ""
msgid "ValueStreamAnalytics|Number of new issues created."
msgstr ""
msgid "ValueStreamAnalytics|Percentage of deployments that cause an incident in production."
msgstr ""
msgid "ValueStreamAnalytics|There was an error while fetching value stream analytics %{requestTypeName} data."
msgstr ""

View file

@ -1,7 +1,10 @@
# frozen_string_literal: true
module QA
RSpec.describe 'Package', :orchestrated, :packages, :object_storage, :reliable do
RSpec.describe 'Package', :orchestrated, :packages, :object_storage, :reliable, quarantine: {
type: :flaky,
issue: "https://gitlab.com/gitlab-org/gitlab/-/issues/361704"
} do
describe 'NuGet project level endpoint' do
include Support::Helpers::MaskToken

View file

@ -96,7 +96,7 @@ RSpec.describe 'getting merge request listings nested in a project' do
where(:field, :subfield, :is_connection) do
nested_fields_of('MergeRequest').flat_map do |name, field|
type = field_type(field)
is_connection = type.name.ends_with?('Connection')
is_connection = type.graphql_name.ends_with?('Connection')
type = field_type(type.fields['nodes']) if is_connection
type.fields

View file

@ -466,7 +466,7 @@ RSpec.describe Ci::CreatePipelineService do
it 'pull it from Auto-DevOps' do
pipeline = execute_service.payload
expect(pipeline).to be_auto_devops_source
expect(pipeline.builds.map(&:name)).to match_array(%w[brakeman-sast build code_quality eslint-sast secret_detection semgrep-sast test])
expect(pipeline.builds.map(&:name)).to match_array(%w[brakeman-sast build code_quality container_scanning eslint-sast secret_detection semgrep-sast test])
end
end

View file

@ -250,10 +250,10 @@ module GraphqlHelpers
mutation_field = GitlabSchema.mutation.fields[mutation_name]
fields = yield if block_given?
fields ||= all_graphql_fields_for(mutation_field.type.to_graphql)
fields ||= all_graphql_fields_for(mutation_field.type.to_type_signature)
query = <<~MUTATION
mutation(#{input_variable_name}: #{mutation_field.arguments['input'].type.to_graphql}) {
mutation(#{input_variable_name}: #{mutation_field.arguments['input'].type.to_type_signature}) {
#{mutation_name}(input: #{input_variable_name}) {
#{fields}
}
@ -302,7 +302,7 @@ module GraphqlHelpers
def input_variable_name_for_mutation(mutation_name)
mutation_name = GraphqlHelpers.fieldnamerize(mutation_name)
mutation_field = GitlabSchema.mutation.fields[mutation_name]
input_type = field_type(mutation_field.arguments['input'])
input_type = mutation_field.arguments['input'].type.unwrap.to_type_signature
GraphqlHelpers.fieldnamerize(input_type)
end

View file

@ -202,6 +202,8 @@ RSpec.shared_examples 'can collect git garbage' do |update_statistics: true|
before do
expect(subject).to receive(:get_lease_uuid).and_return(lease_uuid)
statistics_keys.delete(:repository_size)
end
it_behaves_like 'it calls Gitaly'