Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2022-10-04 03:08:52 +00:00
parent e3bac3b0e2
commit 7e96b8ca7a
28 changed files with 332 additions and 18 deletions

View file

@ -164,11 +164,10 @@ cache-gems:
_ee:quarantine:
extends:
- .qa
- .rules:test:quarantine
- .rules:test:manual
needs:
- trigger-omnibus
stage: test
allow_failure: true
variables:
QA_RSPEC_TAGS: --tag quarantine
@ -344,6 +343,7 @@ ee:update-minor:
rules:
- !reference [.rules:test:qa, rules]
- if: $QA_SUITES =~ /Test::Instance::Smoke/
- !reference [.rules:test:manual, rules]
ee:update-major:
extends:
@ -355,6 +355,7 @@ ee:update-major:
rules:
- !reference [.rules:test:qa, rules]
- if: $QA_SUITES =~ /Test::Instance::Smoke/
- !reference [.rules:test:manual, rules]
ee:gitaly-cluster:
extends: .qa
@ -363,6 +364,7 @@ ee:gitaly-cluster:
rules:
- !reference [.rules:test:qa, rules]
- if: $QA_SUITES =~ /Test::Integration::GitalyCluster/
- !reference [.rules:test:manual, rules]
ee:group-saml:
extends: .qa
@ -371,6 +373,7 @@ ee:group-saml:
rules:
- !reference [.rules:test:qa, rules]
- if: $QA_SUITES =~ /Test::Integration::GroupSAML/
- !reference [.rules:test:manual, rules]
ee:instance-saml:
extends: .qa
@ -379,6 +382,7 @@ ee:instance-saml:
rules:
- !reference [.rules:test:qa, rules]
- if: $QA_SUITES =~ /Test::Integration::InstanceSAML/
- !reference [.rules:test:manual, rules]
ee:jira:
extends: .qa
@ -389,6 +393,7 @@ ee:jira:
rules:
- !reference [.rules:test:qa, rules]
- if: $QA_SUITES =~ /Test::Integration::Jira/
- !reference [.rules:test:manual, rules]
ee:ldap-no-server:
extends: .qa
@ -397,6 +402,7 @@ ee:ldap-no-server:
rules:
- !reference [.rules:test:qa, rules]
- if: $QA_SUITES =~ /Test::Integration::LDAPNoServer/
- !reference [.rules:test:manual, rules]
ee:ldap-tls:
extends: .qa
@ -405,6 +411,7 @@ ee:ldap-tls:
rules:
- !reference [.rules:test:qa, rules]
- if: $QA_SUITES =~ /Test::Integration::LDAPTLS/
- !reference [.rules:test:manual, rules]
ee:ldap-no-tls:
extends: .qa
@ -413,6 +420,7 @@ ee:ldap-no-tls:
rules:
- !reference [.rules:test:qa, rules]
- if: $QA_SUITES =~ /Test::Integration::LDAPNoTLS/
- !reference [.rules:test:manual, rules]
ee:mtls:
extends: .qa
@ -421,6 +429,7 @@ ee:mtls:
rules:
- !reference [.rules:test:qa, rules]
- if: $QA_SUITES =~ /Test::Integration::MTLS/
- !reference [.rules:test:manual, rules]
ee:mattermost:
extends: .qa
@ -429,6 +438,7 @@ ee:mattermost:
rules:
- !reference [.rules:test:qa, rules]
- if: $QA_SUITES =~ /Test::Integration::Mattermost/
- !reference [.rules:test:manual, rules]
ee:registry:
extends: .qa
@ -437,6 +447,7 @@ ee:registry:
rules:
- !reference [.rules:test:qa, rules]
- if: $QA_SUITES =~ /Test::Integration::Registry/
- !reference [.rules:test:manual, rules]
ee:registry-with-cdn:
extends: .qa
@ -453,6 +464,7 @@ ee:registry-with-cdn:
rules:
- !reference [.rules:test:qa, rules]
- if: $QA_SUITES =~ /Test::Integration::RegistryWithCDN/
- !reference [.rules:test:manual, rules]
ee:repository-storage:
extends: .qa
@ -461,6 +473,7 @@ ee:repository-storage:
rules:
- !reference [.rules:test:qa, rules]
- if: $QA_SUITES =~ /Test::Instance::RepositoryStorage/
- !reference [.rules:test:manual, rules]
ee:service-ping-disabled:
extends: .qa
@ -469,6 +482,7 @@ ee:service-ping-disabled:
rules:
- !reference [.rules:test:qa, rules]
- if: $QA_SUITES =~ /Test::Integration::ServicePingDisabled/
- !reference [.rules:test:manual, rules]
ee:smtp:
extends: .qa
@ -477,6 +491,7 @@ ee:smtp:
rules:
- !reference [.rules:test:qa, rules]
- if: $QA_SUITES =~ /Test::Integration::SMTP/
- !reference [.rules:test:manual, rules]
ee:cloud-activation:
extends: .qa
@ -486,6 +501,7 @@ ee:cloud-activation:
rules:
- !reference [.rules:test:qa, rules]
- if: $QA_SUITES =~ /Test::Integration::CloudActivation/
- !reference [.rules:test:manual, rules]
ee:large-setup:
extends: .qa
@ -495,6 +511,7 @@ ee:large-setup:
rules:
- !reference [.rules:test:qa, rules]
- if: $QA_SUITES =~ /Test::Instance::LargeSetup/
- !reference [.rules:test:manual, rules]
ee:metrics:
extends: .qa
@ -503,6 +520,7 @@ ee:metrics:
rules:
- !reference [.rules:test:qa, rules]
- if: $QA_SUITES =~ /Test::Instance::Metrics/
- !reference [.rules:test:manual, rules]
ee:elasticsearch:
extends: .qa
@ -514,6 +532,7 @@ ee:elasticsearch:
rules:
- !reference [.rules:test:qa, rules]
- if: $QA_SUITES =~ /Test::Integration::Elasticsearch/
- !reference [.rules:test:manual, rules]
ee:registry-object-storage-tls:
extends: ee:object-storage-aws

View file

@ -52,9 +52,10 @@
# ------------------------------------------
# Test
# ------------------------------------------
.rules:test:quarantine:
.rules:test:manual:
rules:
- when: manual
allow_failure: true
variables:
QA_TESTS: ""
@ -86,7 +87,10 @@
rules:
- *qa-framework-changes
- <<: *specific-specs
when: never
when: manual
allow_failure: true
variables:
QA_TESTS: ""
- *feature-flags-set-manual
# general qa job rule for jobs without the need to run in parallel

View file

@ -58,7 +58,7 @@ include:
download-knapsack-report:
extends:
- .bundle-base
- .rules:app-or-qa-framework-changes-or-review-scenarios
- .rules:prepare-report
stage: prepare
script:
- bundle exec rake "knapsack:download[qa]"
@ -134,7 +134,7 @@ review-performance:
e2e-test-report:
extends:
- .generate-allure-report-base
- .rules:app-or-qa-framework-changes-or-review-scenarios
- .rules:prepare-report
stage: post-qa
variables:
ALLURE_JOB_NAME: e2e-review-qa
@ -162,7 +162,7 @@ upload-knapsack-report:
delete-test-resources:
extends:
- .bundle-base
- .rules:app-or-qa-framework-changes-or-review-scenarios
- .rules:prepare-report
stage: post-qa
variables:
QA_TEST_RESOURCES_FILE_PATTERN: $CI_PROJECT_DIR/qa/tmp/test-resources-*.json

View file

@ -19,6 +19,12 @@
.qa-framework-changes: &qa-framework-changes
if: $QA_FRAMEWORK_CHANGES == "true"
.qa-manual: &qa-manual
when: manual
allow_failure: true
variables:
QA_TESTS: ""
.never-when-qa-framework-changes-or-no-specific-specs:
- <<: *qa-framework-changes
when: never
@ -27,7 +33,10 @@
.never-when-specific-specs-always-when-qa-framework-changes:
- <<: *specific-specs
when: never
when: manual
allow_failure: true
variables:
QA_TESTS: ""
- *qa-framework-changes
# ------------------------------------------
@ -52,6 +61,7 @@
QA_TESTS: "" # unset QA_TESTS even if specific tests were inferred from stage label
- *qa-framework-changes
- if: $QA_SUITES =~ /Test::Instance::Smoke/
- *qa-manual
.rules:qa-blocking:
rules:
@ -81,12 +91,6 @@
# ------------------------------------------
# Prepare/Report
# ------------------------------------------
# if no rules for test execution are matched, pipeline will not have e2e test jobs
# so we need to skip knapsack, allure and test resource deletion jobs as well
.rules:app-or-qa-framework-changes-or-review-scenarios:
.rules:prepare-report:
rules:
- *app-changes
- *qa-framework-changes
- if: $QA_SUITES =~ /Test::Instance::Smoke/
- if: $QA_SUITES =~ /Test::Instance::ReviewBlocking/
- if: $QA_SUITES =~ /Test::Instance::ReviewNonBlocking/
- when: always

View file

@ -1839,6 +1839,11 @@
- when: manual
allow_failure: true
.setup:rules:gitlab_git_test:
rules:
- <<: *if-default-refs
changes: *code-backstage-patterns
.setup:rules:no-ee-check:
rules:
- <<: *if-not-foss

View file

@ -43,6 +43,14 @@ dont-interrupt-me:
script:
- echo "This jobs makes sure this pipeline won't be interrupted! See https://docs.gitlab.com/ee/ci/yaml/#interruptible."
gitlab_git_test:
extends:
- .minimal-job
- .setup:rules:gitlab_git_test
stage: test
script:
- spec/support/prepare-gitlab-git-test-for-commit --check-for-changes
no-ee-check:
extends:
- .minimal-job

View file

@ -45,6 +45,7 @@ AllCops:
- 'file_hooks/**/*'
- 'workhorse/**/*'
- 'shared/packages/**/*'
- 'spec/support/*.git/**/*' # e.g. spec/support/gitlab-git-test.git
- 'db/ci_migrate/*.rb' # since the `db/ci_migrate` is a symlinked to `db/migrate`
# Use absolute path to avoid orphan directories with changed workspace root.
CacheRootDirectory: <%= Dir.getwd %>/tmp

View file

@ -329,6 +329,7 @@ Style/StringConcatenation:
- 'spec/support/shared_examples/models/wiki_shared_examples.rb'
- 'spec/support/shared_examples/requests/api/hooks_shared_examples.rb'
- 'spec/support/shared_examples/requests/snippet_shared_examples.rb'
- 'spec/support/unpack-gitlab-git-test'
- 'spec/tooling/lib/tooling/kubernetes_client_spec.rb'
- 'spec/uploaders/job_artifact_uploader_spec.rb'
- 'spec/validators/addressable_url_validator_spec.rb'

View file

@ -20664,7 +20664,8 @@ Iteration sort values.
| Value | Description |
| ----- | ----------- |
| <a id="iterationsortcadence_and_due_date_asc"></a>`CADENCE_AND_DUE_DATE_ASC` | Sort by cadence id and due date in ascending order. |
| <a id="iterationsortcadence_and_due_date_asc"></a>`CADENCE_AND_DUE_DATE_ASC` | Sort by cadence id in ascending and due date in ascending order. |
| <a id="iterationsortcadence_and_due_date_desc"></a>`CADENCE_AND_DUE_DATE_DESC` | Sort by cadence id in ascending and due date in descending order. |
### `IterationState`

View file

@ -2,7 +2,7 @@
module QA
RSpec.describe 'Create' do
describe 'Repository License Detection', :reliable, product_group: :source_code do
describe 'Repository License Detection', product_group: :source_code do
after do
project.remove_via_api!
end

View file

@ -0,0 +1,165 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
#
# # generate-seed-repo-rb
#
# This script generates the seed_repo.rb file used by lib/gitlab/git
# tests. The seed_repo.rb file needs to be updated anytime there is a
# Git push to https://gitlab.com/gitlab-org/gitlab-git-test.
#
# Usage:
#
# ./spec/support/generate-seed-repo-rb > spec/support/helpers/seed_repo.rb
#
#
require 'erb'
require 'tempfile'
SOURCE = File.expand_path('gitlab-git-test.git', __dir__)
SCRIPT_NAME = 'generate-seed-repo-rb'
REPO_NAME = 'gitlab-git-test.git'
def main
Dir.mktmpdir do |dir|
unless system(*%W[git clone --bare #{SOURCE} #{REPO_NAME}], chdir: dir)
abort "git clone failed"
end
repo = File.join(dir, REPO_NAME)
erb = ERB.new(DATA.read)
erb.run(binding)
end
end
def capture!(cmd, dir)
output = IO.popen(cmd, 'r', chdir: dir) { |io| io.read }
raise "command failed with #{$?}: #{cmd.join(' ')}" unless $?.success?
output.chomp
end
main
__END__
# This file is generated by <%= SCRIPT_NAME %>. Do not edit this file manually.
#
# Seed repo:
<%= capture!(%w{git log --format=#\ %H\ %s}, repo) %>
module SeedRepo
module BigCommit
ID = "913c66a37b4a45b9769037c55c2d238bd0942d2e".freeze
PARENT_ID = "cfe32cf61b73a0d5e9f13e774abde7ff789b1660".freeze
MESSAGE = "Files, encoding and much more".freeze
AUTHOR_FULL_NAME = "Dmitriy Zaporozhets".freeze
FILES_COUNT = 2
end
module Commit
ID = "570e7b2abdd848b95f2f578043fc23bd6f6fd24d".freeze
PARENT_ID = "6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9".freeze
MESSAGE = "Change some files\n\nSigned-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>\n".freeze
AUTHOR_FULL_NAME = "Dmitriy Zaporozhets".freeze
FILES = ["files/ruby/popen.rb", "files/ruby/regex.rb"].freeze
FILES_COUNT = 2
C_FILE_PATH = "files/ruby".freeze
C_FILES = ["popen.rb", "regex.rb", "version_info.rb"].freeze
BLOB_FILE = %{%h3= @key.title\n%hr\n%pre= @key.key\n.actions\n = link_to 'Remove', @key, :confirm => 'Are you sure?', :method => :delete, :class => \"btn danger delete-key\"\n\n\n}.freeze
BLOB_FILE_PATH = "app/views/keys/show.html.haml".freeze
end
module EmptyCommit
ID = "b0e52af38d7ea43cf41d8a6f2471351ac036d6c9".freeze
PARENT_ID = "40f4a7a617393735a95a0bb67b08385bc1e7c66d".freeze
MESSAGE = "Empty commit".freeze
AUTHOR_FULL_NAME = "Rémy Coutable".freeze
FILES = [].freeze
FILES_COUNT = FILES.count
end
module EncodingCommit
ID = "40f4a7a617393735a95a0bb67b08385bc1e7c66d".freeze
PARENT_ID = "66028349a123e695b589e09a36634d976edcc5e8".freeze
MESSAGE = "Add ISO-8859-encoded file".freeze
AUTHOR_FULL_NAME = "Stan Hu".freeze
FILES = ["encoding/iso8859.txt"].freeze
FILES_COUNT = FILES.count
end
module FirstCommit
ID = "1a0b36b3cdad1d2ee32457c102a8c0b7056fa863".freeze
PARENT_ID = nil
MESSAGE = "Initial commit".freeze
AUTHOR_FULL_NAME = "Dmitriy Zaporozhets".freeze
FILES = ["LICENSE", ".gitignore", "README.md"].freeze
FILES_COUNT = 3
end
module LastCommit
ID = <%= capture!(%w[git show -s --format=%H HEAD], repo).inspect %>.freeze
PARENT_ID = <%= capture!(%w[git show -s --format=%P HEAD], repo).split.last.inspect %>.freeze
MESSAGE = <%= capture!(%w[git show -s --format=%s HEAD], repo).inspect %>.freeze
AUTHOR_FULL_NAME = <%= capture!(%w[git show -s --format=%an HEAD], repo).inspect %>.freeze
FILES = <%=
parents = capture!(%w[git show -s --format=%P HEAD], repo).split
merge_base = parents.size > 1 ? capture!(%w[git merge-base] + parents, repo) : parents.first
capture!( %W[git diff --name-only #{merge_base}..HEAD --], repo).split("\n").inspect
%>.freeze
FILES_COUNT = FILES.count
end
module Repo
HEAD = "master".freeze
BRANCHES = %w[
<%= capture!(%W[git for-each-ref --format=#{' ' * 3}%(refname:strip=2) refs/heads/], repo) %>
].freeze
TAGS = %w[
<%= capture!(%W[git for-each-ref --format=#{' ' * 3}%(refname:strip=2) refs/tags/], repo) %>
].freeze
end
module RubyBlob
ID = "7e3e39ebb9b2bf433b4ad17313770fbe4051649c".freeze
NAME = "popen.rb".freeze
CONTENT = <<-eos.freeze
require 'fileutils'
require 'open3'
module Popen
extend self
def popen(cmd, path=nil)
unless cmd.is_a?(Array)
raise RuntimeError, "System commands must be given as an array of strings"
end
path ||= Dir.pwd
vars = {
"PWD" => path
}
options = {
chdir: path
}
unless File.directory?(path)
FileUtils.mkdir_p(path)
end
@cmd_output = ""
@cmd_status = 0
Open3.popen3(vars, *cmd, options) do |stdin, stdout, stderr, wait_thr|
@cmd_output << stdout.read
@cmd_output << stderr.read
@cmd_status = wait_thr.value.exitstatus
end
return @cmd_output, @cmd_status
end
end
eos
end
end

View file

@ -0,0 +1 @@
ref: refs/heads/master

View file

@ -0,0 +1,16 @@
# Gitlab::Git test repository
This repository is used by (some of) the tests in spec/lib/gitlab/git.
Do not add new large files to this repository. Otherwise we needlessly
inflate the size of the gitlab-ce repository.
## How to make changes to this repository
- (if needed) clone `https://gitlab.com/gitlab-org/gitlab-foss.git` to your local machine
- clone `gitlab-ce/spec/support/gitlab-git-test.git` locally (i.e. clone from your hard drive, not from the internet)
- make changes in your local clone of gitlab-git-test
- run `git push` which will push to your local source `gitlab-ce/spec/support/gitlab-git-test.git`
- in gitlab-ce: run `spec/support/prepare-gitlab-git-test-for-commit`
- in gitlab-ce: `git add spec/support/helpers/seed_repo.rb spec/support/gitlab-git-test.git`
- commit your changes in gitlab-ce

View file

@ -0,0 +1,7 @@
[core]
repositoryformatversion = 0
filemode = true
bare = true
precomposeunicode = true
[remote "origin"]
url = https://gitlab.com/gitlab-org/gitlab-git-test.git

View file

@ -0,0 +1,2 @@
x•OËn1 䜯ð 9&O ¡ž¹"õnoYD6ÕýÒª?Ðã¼ì™Òj<C392>;<3B>w»¾ªÂQ £õGrN˜(ÆHPrAÇr<>RÌ7¯ºtpâ²Mì#MœÂ”c´ê…NrsI­
Ž“%Þú½­páÒ>Û«²®pzüÀ<C3BC>¯¹?Y¥Õ3X<33>äBBÌ°GB4ƒ ûpÿ?k®ÔvÛžúy<E2809A>~Wø])[‡¥Áa<þ“ÍCP_

View file

@ -0,0 +1,2 @@
x¥ŽK
Â0Eg<15>NIÒ|ADtè*^ mZ qGîÄ<C3AE>Y×àð8—×ZK©ý®7"ÈFcÒ%oH¢D²Ü9rZÛLÎs“MJ2Œ™=±ÑÒAå…CmeFg²·V<C2B7>¨xI9øH2†¯þXÜJ…ár»pÅ6‡Ï;NÔà8•zˆ?<3F>?>ß+–ù×z¡¹WÆ<57>BÞ ÎÙf·Ç}«þßb¡N@K\SYîì •iSC

View file

@ -0,0 +1,20 @@
# pack-refs with: peeled fully-peeled sorted
0b4bc9a49b562e85de7cc9e834518ea6828729b9 refs/heads/feature
12d65c8dd2b2676fa3ac47d955accc085a37a9c1 refs/heads/fix
6473c90867124755509e100d0d35ebdc85a0b6ae refs/heads/fix-blob-path
58fa1a3af4de73ea83fe25a1ef1db8e0c56f67e5 refs/heads/fix-existing-submodule-dir
40f4a7a617393735a95a0bb67b08385bc1e7c66d refs/heads/fix-mode
9abd6a8c113a2dd76df3fdb3d58a8cec6db75f8d refs/heads/gitattributes
46e1395e609395de004cacd4b142865ab0e52a29 refs/heads/gitattributes-updated
4b4918a572fa86f9771e5ba40fbd48e1eb03e2c6 refs/heads/master
5937ac0a7beb003549fc5fd26fc247adbce4a52e refs/heads/merge-test
9596bc54a6f0c0c98248fe97077eb5ccf48a98d0 refs/heads/missing-gitmodules
4b4918a572fa86f9771e5ba40fbd48e1eb03e2c6 refs/heads/Ääh-test-utf-8
f4e6814c3e4e7a0de82a9e7cd20c626cc963a2f8 refs/tags/v1.0.0
^6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9
8a2a6eb295bb170b34c24c76c49ed0e9b2eaf34b refs/tags/v1.1.0
^5937ac0a7beb003549fc5fd26fc247adbce4a52e
10d64eed7760f2811ee2d64b44f1f7d3b364f17b refs/tags/v1.2.0
^eb49186cfa5c4338011f5f590fac11bd66c5c631
2ac1f24e253e08135507d0830508febaaccf02ee refs/tags/v1.2.1
^fa1b1e6c004a68b7d8763b86455da9e6b23e36d6

View file

@ -0,0 +1,18 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
abort unless [
system('spec/support/generate-seed-repo-rb', out: 'spec/support/helpers/seed_repo.rb'),
system('spec/support/unpack-gitlab-git-test')
].all?
exit if ARGV.first != '--check-for-changes'
git_status = IO.popen(%w[git status --porcelain], &:read)
abort unless $?.success?
puts git_status
if git_status.lines.grep(%r{^.. spec/support/gitlab-git-test.git}).any?
abort "error: detected changes in gitlab-git-test.git"
end

View file

@ -0,0 +1,40 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'fileutils'
REPO = 'spec/support/gitlab-git-test.git'
PACK_DIR = REPO + '/objects/pack'
GIT = %W[git --git-dir=#{REPO}].freeze
BASE_PACK = 'pack-691247af2a6acb0b63b73ac0cb90540e93614043'
def main
unpack
# We want to store the refs in a packed-refs file because if we don't
# they can get mangled by filesystems.
abort unless system(*GIT, *%w[pack-refs --all])
abort unless system(*GIT, 'fsck')
end
# We don't want contributors to commit new pack files because those
# create unnecessary churn.
def unpack
pack_files = Dir[File.join(PACK_DIR, '*')].reject do |pack|
pack.start_with?(File.join(PACK_DIR, BASE_PACK))
end
return if pack_files.empty?
pack_files.each do |pack|
unless pack.end_with?('.pack')
FileUtils.rm(pack)
next
end
File.open(pack, 'rb') do |open_pack|
File.unlink(pack)
abort unless system(*GIT, 'unpack-objects', in: open_pack)
end
end
end
main