Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2022-01-19 09:14:10 +00:00
parent 7aa48fbe89
commit a87e8cad90
15 changed files with 84 additions and 39 deletions

View File

@ -2,13 +2,6 @@
Rails/SaveBang:
Exclude:
- ee/spec/lib/analytics/merge_request_metrics_calculator_spec.rb
- ee/spec/models/application_setting_spec.rb
- ee/spec/models/approval_merge_request_rule_spec.rb
- ee/spec/models/approval_project_rule_spec.rb
- ee/spec/models/burndown_spec.rb
- ee/spec/models/elasticsearch_indexed_namespace_spec.rb
- ee/spec/models/gitlab_subscription_spec.rb
- ee/spec/models/issue_spec.rb
- ee/spec/models/protected_environment_spec.rb
- ee/spec/models/repository_spec.rb
- ee/spec/models/scim_identity_spec.rb

View File

@ -75,7 +75,8 @@ module ResourceAccessTokens
end
def generate_email
email_pattern = "#{resource_type}#{resource.id}_bot%s@example.com"
# Default emaildomain need to be reworked. See gitlab-org/gitlab#260305
email_pattern = "#{resource_type}#{resource.id}_bot%s@noreply.#{Gitlab.config.gitlab.host}"
uniquify.string(-> (n) { Kernel.sprintf(email_pattern, n) }) do |s|
User.find_by_email(s)

View File

@ -58,7 +58,7 @@
.float-right
= form_for project.runner_projects.new, url: admin_namespace_project_runner_projects_path(project.namespace, project), method: :post do |f|
= f.hidden_field :runner_id, value: @runner.id
= f.submit _('Enable'), class: 'gl-button btn btn-sm', data: { confirm: (s_('Runners|You are about to change this instance runner to a project runner. This operation is not reversible. Are you sure you want to continue?') if @runner.instance_type?) }
= f.submit _('Enable'), aria: { label: s_('Runners|Change to project runner') }, class: 'gl-button btn btn-sm', data: { confirm: (s_('Runners|You are about to change this instance runner to a project runner. This operation is not reversible. Are you sure you want to continue?') if @runner.instance_type?), confirm_btn_variant: 'danger' }
= paginate_without_count @projects
.col-md-6

View File

@ -0,0 +1,15 @@
- name: "`fixup!` commit messages setting draft status of associated Merge Request" # The name of the feature to be deprecated
announcement_milestone: "14.8" # The milestone when this feature was first announced as deprecated.
announcement_date: "2022-02-22" # The date of the milestone release when this feature was first announced as deprecated. This should almost always be the 22nd of a month (YYYY-MM-22), unless you did an out of band blog post.
removal_milestone: "15.0" # The milestone when this feature is planned to be removed
removal_date: "2022-06-22" # This should almost always be the 22nd of a month (YYYY-MM-22), the date of the milestone release when this feature is planned to be removed.
body: | # Do not modify this line, instead modify the lines below.
The use of `fixup!` as a commit message to trigger draft status
of the associated Merge Request is generally unused, and can cause
confusion with other uses of the term. "Draft" is the preferred
and supported trigger for triggering draft status from commit
messages, as part of our streamlining of the feature.
Support for `fixup!` is now considered deprecated, and will be
removed in GitLab 15.0.
documentation_url: "https://docs.gitlab.com/ee/user/project/merge_requests/drafts.html#mark-merge-requests-as-drafts"
issue_url: "https://gitlab.com/gitlab-org/gitlab/-/issues/342937"

View File

@ -702,3 +702,17 @@ Tracing in GitLab is an integration with Jaeger, an open-source end-to-end distr
The `merged_by` field in the [merge request API](https://docs.gitlab.com/ee/api/merge_requests.html#list-merge-requests) is being deprecated and will be removed in GitLab 15.0. This field is being replaced with the `merge_user` field (already present in GraphQL) which more correctly identifies who merged a merge request when performing actions (merge when pipeline succeeds, add to merge train) other than a simple merge.
**Planned removal milestone: 15.0 ()**
## 14.8
### `fixup!` commit messages setting draft status of associated Merge Request
The use of `fixup!` as a commit message to trigger draft status
of the associated Merge Request is generally unused, and can cause
confusion with other uses of the term. "Draft" is the preferred
and supported trigger for triggering draft status from commit
messages, as part of our streamlining of the feature.
Support for `fixup!` is now considered deprecated, and will be
removed in GitLab 15.0.
**Planned removal milestone: 15.0 (2022-06-22)**

View File

@ -98,11 +98,11 @@ selected role and [scope](#scopes-for-a-project-access-token) of the project acc
- The name is set to the name of the token.
- The username is set to `project_{project_id}_bot` for the first access token. For example, `project_123_bot`.
- The email is set to `project{project_id}_bot@example.com`. For example, `project123_bot@example.com`.
- The email is set to `project{project_id}_bot@noreply.{Gitlab.config.gitlab.host}`. For example, `project123_bot@noreply.example.com`.
- For additional access tokens in the same project, the username is set to `project_{project_id}_bot{bot_count}`. For
example, `project_123_bot1`.
- For additional access tokens in the same project, the email is set to `project{project_id}_bot{bot_count}@example.com`.
For example, `project123_bot1@example.com`.
- For additional access tokens in the same project, the email is set to `project{project_id}_bot{bot_count}@noreply.{Gitlab.config.gitlab.host}`.
For example, `project123_bot1@noreply.example.com`.
API calls made with a project access token are associated with the corresponding bot user.

View File

@ -30687,6 +30687,9 @@ msgstr ""
msgid "Runners|Can run untagged jobs"
msgstr ""
msgid "Runners|Change to project runner"
msgstr ""
msgid "Runners|Command to register runner"
msgstr ""

View File

@ -212,7 +212,7 @@
"@gitlab/stylelint-config": "2.6.0",
"@graphql-eslint/eslint-plugin": "3.0.0",
"@testing-library/dom": "^7.16.2",
"@vue/test-utils": "1.2.0",
"@vue/test-utils": "1.3.0",
"acorn": "^6.3.0",
"axios-mock-adapter": "^1.15.0",
"babel-jest": "^26.5.2",

View File

@ -174,7 +174,6 @@ module QA
expect { imported_group.import_status }.to eventually_eq('finished').within(import_wait_duration)
imported_member = imported_group.reload!.members.find { |usr| usr.username == member.username }
aggregate_failures do
expect(imported_member).not_to be_nil
expect(imported_member.access_level).to eq(Resource::Members::AccessLevel::DEVELOPER)

View File

@ -65,9 +65,9 @@ module QA
'successfully imports repository',
testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347570'
) do
aggregate_failures do
expect_import_finished
expect_import_finished
aggregate_failures do
expect(imported_commits).to match_array(source_commits)
expect(imported_tags).to match_array(source_tags)
expect(imported_branches).to match_array(source_branches)

View File

@ -11,9 +11,9 @@ module QA
extend self
# Skip tests in quarantine unless we explicitly focus on them.
def skip_or_run_quarantined_tests_or_contexts(filters, example)
def skip_or_run_quarantined_tests_or_contexts(example)
if filters.key?(:quarantine)
included_filters = filters_other_than_quarantine(filters)
included_filters = filters_other_than_quarantine
# If :quarantine is focused, skip the test/context unless its metadata
# includes quarantine and any other filters
@ -29,18 +29,17 @@ module QA
elsif example.metadata.key?(:quarantine)
quarantine_tag = example.metadata[:quarantine]
if quarantine_tag.is_a?(Hash) && quarantine_tag&.key?(:only) && !ContextSelector.context_matches?(quarantine_tag[:only])
# If the :quarantine hash contains :only, we respect that.
# For instance `quarantine: { only: { subdomain: :staging } }` will only quarantine the test when it runs against staging.
return
end
# If the :quarantine hash contains :only, we respect that.
# For instance `quarantine: { only: { subdomain: :staging } }`
# will only quarantine the test when it runs against staging.
return if quarantined_different_context?(quarantine_tag)
example.metadata[:skip] = quarantine_message(quarantine_tag)
end
end
def filters_other_than_quarantine(filter)
filter.reject { |key, _| key == :quarantine }
def filters_other_than_quarantine
filters.reject { |key, _| key == :quarantine }
end
def quarantine_message(quarantine_tag)
@ -70,6 +69,14 @@ module QA
(metadata.keys & included_filters.keys).empty?
end
def quarantined_different_context?(quarantine)
quarantine.is_a?(Hash) && quarantine.key?(:only) && !ContextSelector.context_matches?(quarantine[:only])
end
def filters
@filters ||= ::RSpec.configuration.inclusion_filter.rules
end
end
end
end

View File

@ -18,7 +18,7 @@ module QA
def example_group_started(example_group_notification)
group = example_group_notification.group
skip_or_run_quarantined_tests_or_contexts(filters, group)
skip_or_run_quarantined_tests_or_contexts(group)
end
# Starts example
@ -28,13 +28,7 @@ module QA
example = example_notification.example
# if skip propagated from example_group, do not reset skip metadata
skip_or_run_quarantined_tests_or_contexts(filters, example) unless example.metadata[:skip]
end
private
def filters
@filters ||= ::RSpec.configuration.inclusion_filter.rules
skip_or_run_quarantined_tests_or_contexts(example) unless example.metadata[:skip]
end
end
end

View File

@ -100,8 +100,14 @@ RSpec.configure do |config|
if ENV['CI'] && !QA::Runtime::Env.disable_rspec_retry?
non_quarantine_retries = QA::Runtime::Env.ci_project_name =~ /staging|canary|production/ ? 3 : 2
config.around do |example|
retry_times = example.metadata.key?(:quarantine) ? 1 : non_quarantine_retries
example.run_with_retry retry: retry_times
quarantine = example.metadata[:quarantine]
different_quarantine_context = QA::Specs::Helpers::Quarantine.quarantined_different_context?(quarantine)
focused_quarantine = QA::Specs::Helpers::Quarantine.filters.key?(:quarantine)
# Do not disable retry when spec is quarantined but on different environment
next example.run_with_retry(retry: non_quarantine_retries) if different_quarantine_context && !focused_quarantine
example.run_with_retry(retry: quarantine ? 1 : non_quarantine_retries)
end
end
end

View File

@ -10,6 +10,10 @@ RSpec.describe ResourceAccessTokens::CreateService do
let_it_be(:group) { create(:group, :private) }
let_it_be(:params) { {} }
before do
stub_config_setting(host: 'example.com')
end
describe '#execute' do
shared_examples 'token creation fails' do
let(:resource) { create(:project)}
@ -88,6 +92,15 @@ RSpec.describe ResourceAccessTokens::CreateService do
end
end
context 'bot email' do
it 'check email domain' do
response = subject
access_token = response.payload[:access_token]
expect(access_token.user.email).to end_with("@noreply.#{Gitlab.config.gitlab.host}")
end
end
context 'access level' do
context 'when user does not specify an access level' do
it 'adds the bot user as a maintainer in the resource' do

View File

@ -2045,10 +2045,10 @@
source-map "~0.6.1"
vue-template-es2015-compiler "^1.9.0"
"@vue/test-utils@1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@vue/test-utils/-/test-utils-1.2.0.tgz#3bc8c17ed549157275f0aec6b95da40887f7297f"
integrity sha512-poBTLqeJYNq1TXVhtVfnY8vELUVOFdJY8KZZoUuaAkIqPTWsxonU1M8nMWpZT+xEMrM+49+YcuEqtMHVD9Q9gw==
"@vue/test-utils@1.3.0":
version "1.3.0"
resolved "https://registry.yarnpkg.com/@vue/test-utils/-/test-utils-1.3.0.tgz#d563decdcd9c68a7bca151d4179a2bfd6d5c3e15"
integrity sha512-Xk2Xiyj2k5dFb8eYUKkcN9PzqZSppTlx7LaQWBbdA8tqh3jHr/KHX2/YLhNFc/xwDrgeLybqd+4ZCPJSGPIqeA==
dependencies:
dom-event-types "^1.0.0"
lodash "^4.17.15"