Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
af5bf83315
commit
5d3fb47a05
2
Gemfile
2
Gemfile
|
|
@ -347,7 +347,7 @@ gem 'gon', '~> 6.4.0' # rubocop:todo Gemfile/MissingFeatureCategory
|
|||
gem 'request_store', '~> 1.5.1' # rubocop:todo Gemfile/MissingFeatureCategory
|
||||
gem 'base32', '~> 0.3.0' # rubocop:todo Gemfile/MissingFeatureCategory
|
||||
|
||||
gem 'gitlab-license', '~> 2.3' # rubocop:todo Gemfile/MissingFeatureCategory
|
||||
gem 'gitlab-license', '~> 2.4', feature_category: :shared
|
||||
|
||||
# Protect against bruteforcing
|
||||
gem 'rack-attack', '~> 6.7.0' # rubocop:todo Gemfile/MissingFeatureCategory
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@
|
|||
{"name":"gitlab-glfm-markdown","version":"0.0.10","platform":"x86_64-darwin","checksum":"5f5b054cdf8a514ff3fae96b9a86a16933d67ef90f25381a47f769ee96b30a4f"},
|
||||
{"name":"gitlab-glfm-markdown","version":"0.0.10","platform":"x86_64-linux","checksum":"ce623675f0206d62520384fdd49f2aab9f4586c4f5cbb74362f390bda73dec97"},
|
||||
{"name":"gitlab-labkit","version":"0.35.0","platform":"ruby","checksum":"26ff06aa4e34ee7b01ead44cc56d01e45822845da70408ca35ff3b20e3c84679"},
|
||||
{"name":"gitlab-license","version":"2.3.0","platform":"ruby","checksum":"60cae3871c46607dde58994faf761c6755adc61133a92e5ab59ab26a8b9b4157"},
|
||||
{"name":"gitlab-license","version":"2.4.0","platform":"ruby","checksum":"fd238fb1e605a6b9250d4eb1744434ffd131f18d50a3be32f613c883f7635e20"},
|
||||
{"name":"gitlab-mail_room","version":"0.0.24","platform":"ruby","checksum":"c7bf3df73dbcc024bc98dbf72514520ac2ff2b6d0124de496279fe56c13c3cb3"},
|
||||
{"name":"gitlab-markup","version":"1.9.0","platform":"ruby","checksum":"7eda045a08ec2d110084252fa13a8c9eac8bdac0e302035ca7db4b82bcbd7ed4"},
|
||||
{"name":"gitlab-net-dns","version":"0.9.2","platform":"ruby","checksum":"f726d978479d43810819f12a45c0906d775a07e34df111bbe693fffbbef3059d"},
|
||||
|
|
|
|||
|
|
@ -703,7 +703,7 @@ GEM
|
|||
opentracing (~> 0.4)
|
||||
pg_query (>= 4.2.3, < 6.0)
|
||||
redis (> 3.0.0, < 6.0.0)
|
||||
gitlab-license (2.3.0)
|
||||
gitlab-license (2.4.0)
|
||||
gitlab-mail_room (0.0.24)
|
||||
jwt (>= 2.0)
|
||||
net-imap (>= 0.2.1)
|
||||
|
|
@ -1895,7 +1895,7 @@ DEPENDENCIES
|
|||
gitlab-housekeeper!
|
||||
gitlab-http!
|
||||
gitlab-labkit (~> 0.35.0)
|
||||
gitlab-license (~> 2.3)
|
||||
gitlab-license (~> 2.4)
|
||||
gitlab-mail_room (~> 0.0.24)
|
||||
gitlab-markup (~> 1.9.0)
|
||||
gitlab-net-dns (~> 0.9.2)
|
||||
|
|
|
|||
|
|
@ -244,7 +244,7 @@ export default {
|
|||
<gl-icon
|
||||
v-else-if="isInPinnedSection"
|
||||
name="grip"
|
||||
class="gl-m-auto gl-text-gray-400 js-draggable-icon gl-cursor-grab show-on-focus-or-hover--target"
|
||||
class="gl-m-auto gl-text-gray-400 js-draggable-icon gl-cursor-grab show-on-focus-or-hover--target super-sidebar-mix-blend-mode"
|
||||
/>
|
||||
<gl-avatar
|
||||
v-else-if="hasAvatar"
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ export default {
|
|||
</draggable>
|
||||
<li
|
||||
v-else
|
||||
class="gl-text-secondary gl-font-sm gl-py-3 super-sidebar-empty-pinned-text"
|
||||
class="gl-text-secondary gl-font-sm gl-py-3 super-sidebar-mix-blend-mode"
|
||||
style="margin-left: 2.5rem"
|
||||
>
|
||||
{{ $options.i18n.emptyHint }}
|
||||
|
|
|
|||
|
|
@ -568,7 +568,7 @@ $super-sidebar-transition-hint-duration: $super-sidebar-transition-duration / 4;
|
|||
}
|
||||
}
|
||||
|
||||
.super-sidebar-empty-pinned-text {
|
||||
.super-sidebar-mix-blend-mode {
|
||||
mix-blend-mode: multiply;
|
||||
|
||||
.gl-dark & {
|
||||
|
|
|
|||
|
|
@ -337,6 +337,10 @@ class User < MainClusterwide::ApplicationRecord
|
|||
|
||||
validates :color_scheme_id, allow_nil: true, inclusion: { in: Gitlab::ColorSchemes.valid_ids,
|
||||
message: ->(*) { _("%{placeholder} is not a valid color scheme") % { placeholder: '%{value}' } } }
|
||||
validates :hide_no_ssh_key, allow_nil: false, inclusion: { in: [true, false] }
|
||||
validates :hide_no_password, allow_nil: false, inclusion: { in: [true, false] }
|
||||
validates :notified_of_own_activity, allow_nil: false, inclusion: { in: [true, false] }
|
||||
validates :project_view, presence: true
|
||||
|
||||
after_initialize :set_projects_limit
|
||||
before_validation :sanitize_attrs
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@ class UserPreference < MainClusterwide::ApplicationRecord
|
|||
format: { with: ColorsHelper::HEX_COLOR_PATTERN },
|
||||
allow_blank: true
|
||||
|
||||
validates :time_display_relative, allow_nil: false, inclusion: { in: [true, false] }
|
||||
validates :render_whitespace_in_code, allow_nil: false, inclusion: { in: [true, false] }
|
||||
validates :pass_user_identities_to_ci_jwt, allow_nil: false, inclusion: { in: [true, false] }
|
||||
|
||||
validates :pinned_nav_items, json_schema: { filename: 'pinned_nav_items' }
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ Use the Import API to import repositories from GitHub or Bitbucket Server.
|
|||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/381902) in GitLab 15.8, GitLab no longer automatically creates namespaces or groups if the namespace or group name specified in `target_namespace` doesn't exist. GitLab also no longer falls back to using the user's personal namespace if the namespace or group name is taken or `target_namespace` is blank.
|
||||
> - Requirement for Maintainer role instead of Developer role introduced in GitLab 16.0 and backported to GitLab 15.11.1 and GitLab 15.10.5.
|
||||
> - `collaborators_import` key in `optional_stages` was [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/398154) in GitLab 16.0.
|
||||
> - Feature flag `github_import_extended_events` was introduced in GitLab 16.8. Disabled by default. This flag improves the performance of imports but disables the `single_endpoint_issue_events_import` optional stage.
|
||||
|
||||
Import your projects from GitHub to GitLab using the API.
|
||||
|
||||
|
|
@ -58,7 +59,8 @@ curl --request POST \
|
|||
|
||||
The following keys are available for `optional_stages`:
|
||||
|
||||
- `single_endpoint_issue_events_import`, for issue and pull request events import.
|
||||
- `single_endpoint_issue_events_import`, for issue and pull request events import. If the `github_import_extended_events` feature flag is enabled, this optional stage
|
||||
is unavailable.
|
||||
- `single_endpoint_notes_import`, for an alternative and more thorough comments import.
|
||||
- `attachments_import`, for Markdown attachments import.
|
||||
- `collaborators_import`, for importing direct repository collaborators who are not outside collaborators.
|
||||
|
|
|
|||
|
|
@ -138,6 +138,7 @@ When the **Organization** tab is selected, you can further narrow down your sear
|
|||
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/373705) in GitLab 15.5.
|
||||
> - Importing collaborators as an additional item was [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/398154) in GitLab 16.0.
|
||||
> - Feature flag `github_import_extended_events` was introduced in GitLab 16.8. Disabled by default. This flag improves the performance of imports but removes the **Import issue and pull request events** option.
|
||||
|
||||
To make imports as fast as possible, the following items aren't imported from GitHub by default:
|
||||
|
||||
|
|
@ -148,7 +149,7 @@ To make imports as fast as possible, the following items aren't imported from Gi
|
|||
|
||||
You can choose to import these items, but this could significantly increase import time. To import these items, select the appropriate fields in the UI:
|
||||
|
||||
- **Import issue and pull request events**.
|
||||
- **Import issue and pull request events**. If the `github_import_extended_events` feature flag is enabled, this option is unavailable.
|
||||
- **Use alternative comments import method**. If importing GitHub projects with more than approximately 30,000 comments across all issues and pull requests, you should enable this method because of a
|
||||
[limitation of the GitHub API](#missing-comments).
|
||||
- **Import Markdown attachments**.
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ module Sidebars
|
|||
link: admin_users_path,
|
||||
active_routes: { controller: 'users' },
|
||||
item_id: :users,
|
||||
container_html_options: { 'data-qa-selector': 'admin_overview_users_link' }
|
||||
container_html_options: { 'data-testid': 'admin-overview-users-link' }
|
||||
)
|
||||
end
|
||||
|
||||
|
|
@ -67,7 +67,7 @@ module Sidebars
|
|||
link: admin_groups_path,
|
||||
active_routes: { controller: 'groups' },
|
||||
item_id: :groups,
|
||||
container_html_options: { 'data-qa-selector': 'admin_overview_groups_link' }
|
||||
container_html_options: { 'data-testid': 'admin-overview-groups-link' }
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ module Sidebars
|
|||
|
||||
override :extra_container_html_options
|
||||
def extra_container_html_options
|
||||
{ 'data-qa-selector': 'admin_settings_menu_link' }
|
||||
{ testid: 'admin-settings-menu-link' }
|
||||
end
|
||||
|
||||
override :separated?
|
||||
|
|
@ -47,7 +47,7 @@ module Sidebars
|
|||
link: general_admin_application_settings_path,
|
||||
active_routes: { path: 'admin/application_settings#general' },
|
||||
item_id: :general_settings,
|
||||
container_html_options: { 'data-qa-selector': 'admin_settings_general_link' }
|
||||
container_html_options: { 'data-testid': 'admin-settings-general-link' }
|
||||
)
|
||||
end
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ module Sidebars
|
|||
link: integrations_admin_application_settings_path,
|
||||
active_routes: { path: %w[application_settings#integrations integrations#edit] },
|
||||
item_id: :admin_integrations,
|
||||
container_html_options: { 'data-qa-selector': 'admin_settings_integrations_link' }
|
||||
container_html_options: { 'data-testid': 'admin-settings-integrations-link' }
|
||||
)
|
||||
end
|
||||
|
||||
|
|
@ -69,7 +69,7 @@ module Sidebars
|
|||
link: repository_admin_application_settings_path,
|
||||
active_routes: { path: 'admin/application_settings#repository' },
|
||||
item_id: :admin_repository,
|
||||
container_html_options: { 'data-qa-selector': 'admin_settings_repository_link' }
|
||||
container_html_options: { 'data-testid': 'admin-settings-repository-link' }
|
||||
)
|
||||
end
|
||||
|
||||
|
|
@ -97,7 +97,7 @@ module Sidebars
|
|||
link: metrics_and_profiling_admin_application_settings_path,
|
||||
active_routes: { path: 'admin/application_settings#metrics_and_profiling' },
|
||||
item_id: :admin_metrics,
|
||||
container_html_options: { 'data-qa-selector': 'admin_settings_metrics_and_profiling_link' }
|
||||
container_html_options: { 'data-testid': 'admin-settings-metrics-and-profiling-link' }
|
||||
)
|
||||
end
|
||||
|
||||
|
|
@ -107,7 +107,7 @@ module Sidebars
|
|||
link: network_admin_application_settings_path,
|
||||
active_routes: { path: 'admin/application_settings#network' },
|
||||
item_id: :admin_network,
|
||||
container_html_options: { 'data-qa-selector': 'admin_settings_network_link' }
|
||||
container_html_options: { 'data-testid': 'admin-settings-network-link' }
|
||||
)
|
||||
end
|
||||
|
||||
|
|
@ -126,7 +126,7 @@ module Sidebars
|
|||
link: preferences_admin_application_settings_path,
|
||||
active_routes: { path: 'admin/application_settings#preferences' },
|
||||
item_id: :admin_preferences,
|
||||
container_html_options: { 'data-qa-selector': 'admin_settings_preferences_link' }
|
||||
container_html_options: { 'data-testid': 'admin-settings-preferences-link' }
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ module Sidebars
|
|||
link: admin_dev_ops_reports_path,
|
||||
active_routes: { controller: 'dev_ops_report' },
|
||||
item_id: :dev_ops_reports,
|
||||
container_html_options: { 'data-qa-selector': 'admin_analytics_link' }
|
||||
container_html_options: { 'data-testid': 'admin-analytics-link' }
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,20 @@ RSpec.describe Settings, feature_category: :system_access do
|
|||
end
|
||||
end
|
||||
|
||||
describe 'cron_jobs job_class can be resolved' do
|
||||
it 'resolves all defined cron job worker classes' do
|
||||
Settings.cron_jobs.each_value do |job_config|
|
||||
next unless job_config
|
||||
|
||||
job_class = job_config['job_class']
|
||||
|
||||
next unless job_class
|
||||
|
||||
expect(job_class.safe_constantize).not_to eq(nil), "The defined job class (#{job_class}) in the cron job settings cannot be resolved."
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '.build_ci_component_fqdn' do
|
||||
subject(:fqdn) { described_class.build_ci_component_fqdn }
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ export const mockFindings = [
|
|||
},
|
||||
remediations: [null],
|
||||
solution: 'Upgrade to version 2.1.1 or above.',
|
||||
state: 'opened',
|
||||
state: 'detected',
|
||||
blob_path: '/gitlab-org/gitlab-ui/blob/ad137f0a8ac59af961afe47d04e5cc062c6864a9/yarn.lock',
|
||||
evidence: 'Credit Card Detected: Diners Card',
|
||||
},
|
||||
|
|
|
|||
|
|
@ -9,4 +9,7 @@ RSpec.describe Sidebars::Admin::Menus::AdminOverviewMenu, feature_category: :nav
|
|||
icon: 'overview'
|
||||
|
||||
it_behaves_like 'Admin menu with sub menus'
|
||||
|
||||
it_behaves_like 'Admin menu with extra container html options',
|
||||
extra_container_html_options: { testid: 'admin-overview-submenu-content' }
|
||||
end
|
||||
|
|
|
|||
|
|
@ -10,4 +10,7 @@ RSpec.describe Sidebars::Admin::Menus::AdminSettingsMenu, feature_category: :nav
|
|||
separated: true
|
||||
|
||||
it_behaves_like 'Admin menu with sub menus'
|
||||
|
||||
it_behaves_like 'Admin menu with extra container html options',
|
||||
extra_container_html_options: { testid: 'admin-settings-menu-link' }
|
||||
end
|
||||
|
|
|
|||
|
|
@ -8,6 +8,16 @@ RSpec.describe UserPreference, feature_category: :user_profile do
|
|||
let(:user_preference) { create(:user_preference, user: user) }
|
||||
|
||||
describe 'validations' do
|
||||
it { is_expected.to validate_inclusion_of(:time_display_relative).in_array([true, false]) }
|
||||
it { is_expected.to validate_inclusion_of(:render_whitespace_in_code).in_array([true, false]) }
|
||||
|
||||
it do
|
||||
is_expected.to validate_numericality_of(:tab_width)
|
||||
.only_integer
|
||||
.is_greater_than_or_equal_to(Gitlab::TabWidth::MIN)
|
||||
.is_less_than_or_equal_to(Gitlab::TabWidth::MAX)
|
||||
end
|
||||
|
||||
describe 'diffs_deletion_color and diffs_addition_color' do
|
||||
using RSpec::Parameterized::TableSyntax
|
||||
|
||||
|
|
@ -163,13 +173,6 @@ RSpec.describe UserPreference, feature_category: :user_profile do
|
|||
|
||||
expect(pref.reload.tab_width).to eq(8)
|
||||
end
|
||||
|
||||
it do
|
||||
is_expected.to validate_numericality_of(:tab_width)
|
||||
.only_integer
|
||||
.is_greater_than_or_equal_to(1)
|
||||
.is_less_than_or_equal_to(12)
|
||||
end
|
||||
end
|
||||
|
||||
describe '#tab_width=' do
|
||||
|
|
|
|||
|
|
@ -728,6 +728,10 @@ RSpec.describe User, feature_category: :user_profile do
|
|||
end
|
||||
|
||||
it { is_expected.to validate_presence_of(:projects_limit) }
|
||||
it { is_expected.to define_enum_for(:project_view).with_values(%i[readme activity files wiki]) }
|
||||
it { is_expected.to validate_inclusion_of(:hide_no_ssh_key).in_array([true, false]) }
|
||||
it { is_expected.to validate_inclusion_of(:hide_no_password).in_array([true, false]) }
|
||||
it { is_expected.to validate_inclusion_of(:notified_of_own_activity).in_array([true, false]) }
|
||||
it { is_expected.to validate_numericality_of(:projects_limit) }
|
||||
it { is_expected.to allow_value(0).for(:projects_limit) }
|
||||
it { is_expected.not_to allow_value(-1).for(:projects_limit) }
|
||||
|
|
|
|||
|
|
@ -76,3 +76,15 @@ RSpec.shared_examples 'Admin menu with sub menus' do
|
|||
expect(subject.has_items?).to be true
|
||||
end
|
||||
end
|
||||
|
||||
RSpec.shared_examples 'Admin menu with extra container html options' do |extra_container_html_options:|
|
||||
let_it_be(:user) { build(:user, :admin) }
|
||||
|
||||
let(:context) { Sidebars::Context.new(current_user: user, container: nil) }
|
||||
|
||||
subject { described_class.new(context) }
|
||||
|
||||
it 'contains extra container html options' do
|
||||
expect(subject.extra_container_html_options).to eq extra_container_html_options
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ func TestS3SessionExpiry(t *testing.T) {
|
|||
require.Equal(t, aws.StringValue(sess.Config.Region), "us-west-1")
|
||||
require.True(t, aws.BoolValue(sess.Config.S3ForcePathStyle))
|
||||
|
||||
firstSession, ok := sessionCache.sessions[cfg]
|
||||
firstSession, ok := getS3Session(cfg)
|
||||
require.True(t, ok)
|
||||
require.False(t, firstSession.isExpired())
|
||||
|
||||
|
|
@ -75,7 +75,7 @@ func TestS3SessionExpiry(t *testing.T) {
|
|||
_, err = setupS3Session(credentials, cfg)
|
||||
require.NoError(t, err)
|
||||
|
||||
nextSession, ok := sessionCache.sessions[cfg]
|
||||
nextSession, ok := getS3Session(cfg)
|
||||
require.True(t, ok)
|
||||
require.False(t, nextSession.isExpired())
|
||||
}
|
||||
|
|
@ -85,3 +85,10 @@ func resetS3Sessions() {
|
|||
defer sessionCache.Unlock()
|
||||
sessionCache.sessions = make(map[config.S3Config]*s3Session)
|
||||
}
|
||||
|
||||
func getS3Session(cfg config.S3Config) (*s3Session, bool) {
|
||||
sessionCache.Lock()
|
||||
defer sessionCache.Unlock()
|
||||
session, ok := sessionCache.sessions[cfg]
|
||||
return session, ok
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue