Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2022-11-04 06:09:23 +00:00
parent 6f286d7717
commit 0250f48d9f
15 changed files with 48 additions and 35 deletions

View File

@ -23053,8 +23053,8 @@ CREATE TABLE vulnerability_state_transitions (
author_id bigint,
comment text,
dismissal_reason smallint,
CONSTRAINT check_fca4a7ca39 CHECK ((char_length(comment) <= 255)),
CONSTRAINT state_not_equal CHECK ((from_state <> to_state))
CONSTRAINT check_d1ca8ec043 CHECK ((from_state <> to_state)),
CONSTRAINT check_fca4a7ca39 CHECK ((char_length(comment) <= 255))
);
CREATE SEQUENCE vulnerability_state_transitions_id_seq

View File

@ -143,6 +143,8 @@ GitLab 14.0 introduced [batched background migrations](../user/admin_area/monito
Some installations [may need to run GitLab 14.0 for at least a day](#1400) to complete the database changes introduced by that upgrade.
Batched background migrations are handled by Sidekiq and [run in isolation](../development/database/batched_background_migrations.md#isolation), so an instance can remain operational while the migrations are processed. However, there may be performance degradation on larger instances that are heavily used while batched background migrations are run, so it's a good idea to [actively monitor the Sidekiq status](../user/admin_area/index.md#background-jobs) until all migrations are completed.
#### Check the status of batched background migrations
To check the status of batched background migrations:

View File

@ -159,7 +159,7 @@ module.exports = (path, options = {}) => {
return {
clearMocks: true,
testMatch,
moduleFileExtensions: ['js', 'json', 'vue', 'gql', 'graphql', 'yaml'],
moduleFileExtensions: ['js', 'json', 'vue', 'gql', 'graphql', 'yaml', 'yml'],
moduleNameMapper,
collectCoverageFrom,
coverageDirectory: coverageDirectory(),

View File

@ -67,7 +67,11 @@ module API
end
params do
requires :ref, type: String, desc: 'Reference'
optional :variables, Array, desc: 'Array of variables available in the pipeline'
optional :variables, type: Array, desc: 'Array of variables available in the pipeline' do
optional :key, type: String, desc: 'The key of the variable'
optional :value, type: String, desc: 'The value of the variable'
optional :variable_type, type: String, values: ::Ci::PipelineVariable.variable_types.keys, default: 'env_var', desc: 'The type of variable, must be one of env_var or file. Defaults to env_var'
end
end
post ':id/pipeline', urgency: :low, feature_category: :continuous_integration do
Gitlab::QueryLimiting.disable!('https://gitlab.com/gitlab-org/gitlab/-/issues/20711')

View File

@ -6,7 +6,7 @@ load_performance:
DOCKER_TLS_CERTDIR: ""
K6_IMAGE: loadimpact/k6
K6_VERSION: 0.27.0
K6_TEST_FILE: github.com/loadimpact/k6/samples/http_get.js
K6_TEST_FILE: raw.githubusercontent.com/grafana/k6/master/samples/http_get.js
K6_OPTIONS: ''
K6_DOCKER_OPTIONS: ''
services:

View File

@ -17,7 +17,7 @@ load_performance:
variables:
K6_IMAGE: loadimpact/k6
K6_VERSION: 0.27.0
K6_TEST_FILE: github.com/loadimpact/k6/samples/http_get.js
K6_TEST_FILE: raw.githubusercontent.com/grafana/k6/master/samples/http_get.js
K6_OPTIONS: ''
K6_DOCKER_OPTIONS: ''
services:

View File

@ -56,7 +56,7 @@ module Gitlab
# Note that we use ActiveRecord::Base here and not ApplicationRecord.
# This is deliberate, as we also use these classes to apply load
# balancing to, and the load balancer must be enabled for _all_ models
# that inher from ActiveRecord::Base; not just our own models that
# that inherit from ActiveRecord::Base; not just our own models that
# inherit from ApplicationRecord.
main: ::ActiveRecord::Base,
ci: ::Ci::ApplicationRecord.connection_class? ? ::Ci::ApplicationRecord : nil

View File

@ -6091,6 +6091,12 @@ msgstr ""
msgid "Be careful. Renaming a project's repository can have unintended side effects."
msgstr ""
msgid "Because you enabled auto-banning, we have also automatically banned this user from %{scope}. If this is a mistake, you can %{link_start}unban them%{link_end}."
msgstr ""
msgid "Because you enabled auto-banning, we have also automatically banned this user from %{scope}. If this is a mistake, you can unban them: %{url}."
msgstr ""
msgid "Before enabling this integration, create a webhook for the room in Google Chat where you want to receive notifications from this project. %{docs_link}"
msgstr ""
@ -20371,12 +20377,6 @@ msgstr ""
msgid "If this email was added in error, you can remove it here: %{profile_emails_url}"
msgstr ""
msgid "If this is a mistake, you can %{link_start}unban them%{link_end}."
msgstr ""
msgid "If this is a mistake, you can unban them: %{url}."
msgstr ""
msgid "If this was a mistake you can %{leave_link_start}leave the %{source_type}%{link_end}."
msgstr ""
@ -45283,7 +45283,7 @@ msgstr ""
msgid "We want to be sure it is you, please confirm you are not a robot."
msgstr ""
msgid "We want to let you know %{username} has been banned from %{scope} due to them downloading more than %{max_project_downloads} project repositories within %{within_minutes} minutes."
msgid "We want to let you know %{username} has exceeded the Git rate limit due to them downloading more than %{max_project_downloads} project %{repositories_text} within %{within_text}."
msgstr ""
msgid "We will notify %{inviter} that you declined their invitation to join GitLab. You will stop receiving reminders."
@ -49076,6 +49076,11 @@ msgstr ""
msgid "repositories"
msgstr ""
msgid "repository"
msgid_plural "repositories"
msgstr[0] ""
msgstr[1] ""
msgid "repository:"
msgstr ""

View File

@ -18,6 +18,7 @@ module QA
def context_matches?(*options)
return false unless Runtime::Scenario.attributes[:gitlab_address]
return false if Runtime::Scenario.attributes[:test_metadata_only]
opts = {}
opts[:domain] = '.+'

View File

@ -23,6 +23,8 @@ module QA
def rspec_tags
tags_for_rspec = []
return tags_for_rspec if Runtime::Scenario.attributes[:test_metadata_only]
if tags.any?
tags.each { |tag| tags_for_rspec.push(['--tag', tag.to_s]) }
else

View File

@ -36,6 +36,7 @@ module QA
# @param [<RSpec::Core::ExampleGroup, RSpec::Core::Example>] example
# @return [void]
def set_skip_metadata(example)
return if Runtime::Scenario.attributes[:test_metadata_only]
return skip_only(example.metadata) if example.metadata.key?(:only)
return skip_except(example.metadata) if example.metadata.key?(:except)
end

View File

@ -111,7 +111,7 @@ RSpec.describe QA::Specs::Runner do
it 'sets the `--dry-run` flag' do
expect_rspec_runner_arguments(
['--dry-run'] + DEFAULT_SKIPPED_TAGS + ['--tag', '~geo', *described_class::DEFAULT_TEST_PATH_ARGS],
['--dry-run', *described_class::DEFAULT_TEST_PATH_ARGS],
[$stderr, anything]
)

View File

@ -24,6 +24,9 @@ printf "\nStarting GLFM snapshot example tests. See https://docs.gitlab.com/ee/d
printf "Set 'FOCUSED_MARKDOWN_EXAMPLES=example_name_1[,...]' for focused examples, with example name(s) from https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide/#glfm_specificationexample_snapshotsexamples_indexyml.\n"
printf "${Color_Off}"
# NOTE: Unlike the backend markdown_snapshot_spec.rb which has a CE and EE version, there is only
# one version of this spec. This is because the frontend markdown rendering does not require EE-only
# backend features.
printf "\n${BBlue}Running frontend 'yarn jest spec/frontend/content_editor/markdown_snapshot_spec.js'...${Color_Off}\n\n"
yarn jest spec/frontend/content_editor/markdown_snapshot_spec.js
printf "\n${BBlue}'yarn jest spec/frontend/content_editor/markdown_snapshot_spec.js' passed!${Color_Off}\n\n"

View File

@ -1,10 +1,11 @@
import path from 'path';
import { describeMarkdownSnapshots } from 'jest/content_editor/markdown_snapshot_spec_helper';
jest.mock('~/emoji');
const glfmSpecificationDir = path.join(__dirname, '..', '..', '..', 'glfm_specification');
// See https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide/#markdown-snapshot-testing
// for documentation on this spec.
describeMarkdownSnapshots('CE markdown snapshots in ContentEditor', glfmSpecificationDir);
//
// NOTE: Unlike the backend markdown_snapshot_spec.rb which has a CE and EE version, there is only
// one version of this spec. This is because the frontend markdown rendering does not require EE-only
// backend features.
describeMarkdownSnapshots('markdown example snapshots in ContentEditor');

View File

@ -1,10 +1,12 @@
// See https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide/#markdown-snapshot-testing
// for documentation on this spec.
import fs from 'fs';
import path from 'path';
import jsYaml from 'js-yaml';
import { pick } from 'lodash';
import glfmExampleStatusYml from '../../../glfm_specification/input/gitlab_flavored_markdown/glfm_example_status.yml';
import markdownYml from '../../../glfm_specification/output_example_snapshots/markdown.yml';
import htmlYml from '../../../glfm_specification/output_example_snapshots/html.yml';
import prosemirrorJsonYml from '../../../glfm_specification/output_example_snapshots/prosemirror_json.yml';
import {
IMPLEMENTATION_ERROR_MSG,
renderHtmlAndJsonForAllExamples,
@ -18,29 +20,21 @@ const filterExamples = (examples) => {
return pick(examples, focusedMarkdownExamples);
};
const loadExamples = (dir, fileName) => {
const yaml = fs.readFileSync(path.join(dir, fileName));
const loadExamples = (yaml) => {
const examples = jsYaml.safeLoad(yaml, {});
return filterExamples(examples);
};
// eslint-disable-next-line jest/no-export
export const describeMarkdownSnapshots = (description, glfmSpecificationDir) => {
export const describeMarkdownSnapshots = (description) => {
let actualHtmlAndJsonExamples;
let skipRunningSnapshotWysiwygHtmlTests;
let skipRunningSnapshotProsemirrorJsonTests;
const exampleStatuses = loadExamples(
path.join(glfmSpecificationDir, 'input', 'gitlab_flavored_markdown'),
'glfm_example_status.yml',
);
const outputExampleSnapshotsDir = path.join(glfmSpecificationDir, 'output_example_snapshots');
const markdownExamples = loadExamples(outputExampleSnapshotsDir, 'markdown.yml');
const expectedHtmlExamples = loadExamples(outputExampleSnapshotsDir, 'html.yml');
const expectedProseMirrorJsonExamples = loadExamples(
outputExampleSnapshotsDir,
'prosemirror_json.yml',
);
const exampleStatuses = loadExamples(glfmExampleStatusYml);
const markdownExamples = loadExamples(markdownYml);
const expectedHtmlExamples = loadExamples(htmlYml);
const expectedProseMirrorJsonExamples = loadExamples(prosemirrorJsonYml);
beforeAll(async () => {
return renderHtmlAndJsonForAllExamples(markdownExamples).then((examples) => {