Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2022-05-25 06:08:38 +00:00
parent d7f1d79eb5
commit e83b20c4f3
16 changed files with 87 additions and 8 deletions

View File

@ -503,7 +503,7 @@ gem 'gitlab-experiment', '~> 0.7.1'
# Structured logging # Structured logging
gem 'lograge', '~> 0.5' gem 'lograge', '~> 0.5'
gem 'grape_logging', '~> 1.7' gem 'grape_logging', '~> 1.8'
# DNS Lookup # DNS Lookup
gem 'gitlab-net-dns', '~> 0.9.1' gem 'gitlab-net-dns', '~> 0.9.1'

View File

@ -571,7 +571,7 @@ GEM
grape (~> 1.3) grape (~> 1.3)
rake (> 12) rake (> 12)
ruby2_keywords (~> 0.0.2) ruby2_keywords (~> 0.0.2)
grape_logging (1.8.3) grape_logging (1.8.4)
grape grape
rack rack
graphiql-rails (1.8.0) graphiql-rails (1.8.0)
@ -1523,7 +1523,7 @@ DEPENDENCIES
grape (~> 1.5.2) grape (~> 1.5.2)
grape-entity (~> 0.10.0) grape-entity (~> 0.10.0)
grape-path-helpers (~> 1.7.0) grape-path-helpers (~> 1.7.0)
grape_logging (~> 1.7) grape_logging (~> 1.8)
graphiql-rails (~> 1.8) graphiql-rails (~> 1.8)
graphlient (~> 0.5.0) graphlient (~> 0.5.0)
graphql (~> 1.11.10) graphql (~> 1.11.10)

View File

@ -30,6 +30,10 @@ class AnalyticsIssueEntity < Grape::Entity
url_to(:namespace_project_issue, object) url_to(:namespace_project_issue, object)
end end
expose :end_event_timestamp do |object|
object[:end_event_timestamp] && interval_in_words(object[:end_event_timestamp])
end
private private
def url_to(route, object) def url_to(route, object)

View File

@ -0,0 +1,10 @@
# frozen_string_literal: true
class AddPasswordCharsRequirementToApplicationSettings < Gitlab::Database::Migration[2.0]
def change
add_column :application_settings, :password_uppercase_required, :boolean, default: false, null: false
add_column :application_settings, :password_lowercase_required, :boolean, default: false, null: false
add_column :application_settings, :password_number_required, :boolean, default: false, null: false
add_column :application_settings, :password_symbol_required, :boolean, default: false, null: false
end
end

View File

@ -0,0 +1 @@
79643fafa7ebc5374980fc1ef34b3f5ee5a231172420192895b227a31c552e6a

View File

@ -11288,6 +11288,10 @@ CREATE TABLE application_settings (
database_grafana_api_url text, database_grafana_api_url text,
database_grafana_tag text, database_grafana_tag text,
public_runner_releases_url text DEFAULT 'https://gitlab.com/api/v4/projects/gitlab-org%2Fgitlab-runner/releases'::text NOT NULL, public_runner_releases_url text DEFAULT 'https://gitlab.com/api/v4/projects/gitlab-org%2Fgitlab-runner/releases'::text NOT NULL,
password_uppercase_required boolean DEFAULT false NOT NULL,
password_lowercase_required boolean DEFAULT false NOT NULL,
password_number_required boolean DEFAULT false NOT NULL,
password_symbol_required boolean DEFAULT false NOT NULL,
encrypted_arkose_labs_public_api_key bytea, encrypted_arkose_labs_public_api_key bytea,
encrypted_arkose_labs_public_api_key_iv bytea, encrypted_arkose_labs_public_api_key_iv bytea,
encrypted_arkose_labs_private_api_key bytea, encrypted_arkose_labs_private_api_key bytea,

View File

@ -316,7 +316,7 @@ RSpec.describe MergeRequests::UpdateHeadPipelineWorker do
let(:pipeline_created_event) { Ci::PipelineCreatedEvent.new(data: ({ pipeline_id: pipeline.id })) } let(:pipeline_created_event) { Ci::PipelineCreatedEvent.new(data: ({ pipeline_id: pipeline.id })) }
# This shared example ensures that an event is published and correctly processed by # This shared example ensures that an event is published and correctly processed by
# the current subscriber (`described_class`). # the current subscriber (`described_class`). It also ensures that the worker is idempotent.
it_behaves_like 'subscribes to event' do it_behaves_like 'subscribes to event' do
let(:event) { pipeline_created_event } let(:event) { pipeline_created_event }
end end

View File

@ -199,6 +199,14 @@ For groups the `--group` flag is available:
/chatops run feature set --group=gitlab-org some_feature true /chatops run feature set --group=gitlab-org some_feature true
``` ```
Note that `--group` does not work with user namespaces. To enable a feature flag for a
generic namespace (including groups) use `--namespace`:
```shell
/chatops run feature set --namespace=gitlab-org some_feature true
/chatops run feature set --namespace=myusername some_feature true
```
Note that actor-based gates are applied before percentages. For example, considering the Note that actor-based gates are applied before percentages. For example, considering the
`group/project` as `gitlab-org/gitlab` and a given example feature as `some_feature`, if `group/project` as `gitlab-org/gitlab` and a given example feature as `some_feature`, if
you run these 2 commands: you run these 2 commands:

View File

@ -971,7 +971,7 @@ module Gitlab
"but it is '#{migration.status_name}':" \ "but it is '#{migration.status_name}':" \
"\t#{configuration}" \ "\t#{configuration}" \
"\n\n" \ "\n\n" \
"Finalize it manually by running" \ "Finalize it manually by running the following command in a `bash` or `sh` shell:" \
"\n\n" \ "\n\n" \
"\tsudo gitlab-rake gitlab:background_migrations:finalize[#{job_class_name},#{table_name},#{column_name},'#{job_arguments.to_json.gsub(',', '\,')}']" \ "\tsudo gitlab-rake gitlab:background_migrations:finalize[#{job_class_name},#{table_name},#{column_name},'#{job_arguments.to_json.gsub(',', '\,')}']" \
"\n\n" \ "\n\n" \

View File

@ -23,6 +23,7 @@ module Gitlab
include ApplicationWorker include ApplicationWorker
loggable_arguments 0, 1 loggable_arguments 0, 1
idempotent!
end end
def perform(event_type, data) def perform(event_type, data)

View File

@ -27337,6 +27337,18 @@ msgstr ""
msgid "Passwords should be unique and not used for any other sites or services." msgid "Passwords should be unique and not used for any other sites or services."
msgstr "" msgstr ""
msgid "Password|requires at least one lowercase letter"
msgstr ""
msgid "Password|requires at least one number"
msgstr ""
msgid "Password|requires at least one symbol character"
msgstr ""
msgid "Password|requires at least one uppercase letter"
msgstr ""
msgid "Past due" msgid "Past due"
msgstr "" msgstr ""

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'spec_helper'
RSpec.describe API::Integrations::Slack::Events::UrlVerification do RSpec.describe API::Integrations::Slack::Events::UrlVerification do
describe '.call' do describe '.call' do

View File

@ -2269,7 +2269,7 @@ RSpec.describe Gitlab::Database::MigrationHelpers do
.to raise_error "Expected batched background migration for the given configuration to be marked as 'finished', but it is 'active':" \ .to raise_error "Expected batched background migration for the given configuration to be marked as 'finished', but it is 'active':" \
"\t#{configuration}" \ "\t#{configuration}" \
"\n\n" \ "\n\n" \
"Finalize it manually by running" \ "Finalize it manually by running the following command in a `bash` or `sh` shell:" \
"\n\n" \ "\n\n" \
"\tsudo gitlab-rake gitlab:background_migrations:finalize[CopyColumnUsingBackgroundMigrationJob,events,id,'[[\"id\"]\\,[\"id_convert_to_bigint\"]\\,null]']" \ "\tsudo gitlab-rake gitlab:background_migrations:finalize[CopyColumnUsingBackgroundMigrationJob,events,id,'[[\"id\"]\\,[\"id_convert_to_bigint\"]\\,null]']" \
"\n\n" \ "\n\n" \

View File

@ -11,6 +11,7 @@ RSpec.describe AnalyticsIssueEntity do
iid: "1", iid: "1",
id: "1", id: "1",
created_at: "2016-11-12 15:04:02.948604", created_at: "2016-11-12 15:04:02.948604",
end_event_timestamp: "2022-05-24 14:33:01.529701",
author: user, author: user,
project_path: project.path, project_path: project.path,
namespace_path: project.namespace.route.path namespace_path: project.namespace.route.path
@ -40,10 +41,34 @@ RSpec.describe AnalyticsIssueEntity do
expect(subject).to include(:namespace_full_path) expect(subject).to include(:namespace_full_path)
end end
it 'contains the end event timestamp' do
expect(entity.as_json[:end_event_timestamp]).to match(/ ago$/)
end
it 'does not contain sensitive information' do it 'does not contain sensitive information' do
expect(subject).not_to include(/token/) expect(subject).not_to include(/token/)
expect(subject).not_to include(/variables/) expect(subject).not_to include(/variables/)
end end
context 'when end_event_timestamp is nil' do
let(:entity_hash) do
{
total_time: "172802.724419",
title: "Eos voluptatem inventore in sed.",
iid: "1",
id: "1",
created_at: "2016-11-12 15:04:02.948604",
end_event_timestamp: nil,
author: user,
project_path: project.path,
namespace_path: project.namespace.route.path
}
end
it 'contains a nil end_event_timestamp' do
expect(entity.as_json[:end_event_timestamp]).to be_nil
end
end
end end
context 'without subgroup' do context 'without subgroup' do

View File

@ -11,6 +11,8 @@ RSpec.shared_examples 'subscribes to event' do
::Gitlab::EventStore.publish(event) ::Gitlab::EventStore.publish(event)
end end
it_behaves_like 'an idempotent worker'
end end
def consume_event(subscriber:, event:) def consume_event(subscriber:, event:)

View File

@ -20,7 +20,11 @@ RSpec.shared_examples 'an idempotent worker' do
# Avoid stubbing calls for a more accurate run. # Avoid stubbing calls for a more accurate run.
subject do subject do
defined?(job_args) ? perform_multiple(job_args) : perform_multiple if described_class.include?(::Gitlab::EventStore::Subscriber)
event_worker
else
standard_worker
end
end end
it 'is labeled as idempotent' do it 'is labeled as idempotent' do
@ -30,4 +34,12 @@ RSpec.shared_examples 'an idempotent worker' do
it 'performs multiple times sequentially without raising an exception' do it 'performs multiple times sequentially without raising an exception' do
expect { subject }.not_to raise_error expect { subject }.not_to raise_error
end end
def event_worker
consume_event(subscriber: described_class, event: event)
end
def standard_worker
defined?(job_args) ? perform_multiple(job_args) : perform_multiple
end
end end