Skip to content

Commit 115c175

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent ce3c924 commit 115c175

File tree

83 files changed

+976
-1487
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+976
-1487
lines changed

.gitlab/ci/package-and-test-nightly/main.gitlab-ci.yml

+14
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,20 @@ gitlab-pages:
199199
- if: $QA_SUITES =~ /Test::Instance::GitlabPages/
200200
- !reference [.rules:test:manual, rules]
201201

202+
# ========== git sha256 enabled ===========
203+
git-sha256-repositories:
204+
when: manual
205+
extends:
206+
- .parallel
207+
- .qa
208+
variables:
209+
QA_SCENARIO: Test::Instance::Image
210+
QA_USE_SHA256_REPOSITORY_OBJECT_STORAGE: true
211+
GITLAB_QA_OPTS: "--enable-feature support_sha256_repositories"
212+
rules:
213+
- !reference [.rules:test:qa-parallel, rules]
214+
- if: $QA_SUITES =~ /Test::Instance::All/
215+
202216
# ==========================================
203217
# Post test stage
204218
# ==========================================

.gitlab/ci/package-and-test/main.gitlab-ci.yml

+16
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,22 @@ gitaly-transactions-selective-parallel:
192192
variables:
193193
QA_TESTS: ""
194194

195+
# ========== git sha256 enabled ===========
196+
git-sha256-repositories:
197+
when: manual
198+
extends:
199+
- .parallel
200+
- .qa
201+
parallel: 5
202+
variables:
203+
QA_SCENARIO: Test::Instance::Image
204+
QA_USE_SHA256_REPOSITORY_OBJECT_STORAGE: true
205+
GITLAB_QA_OPTS: "--enable-feature support_sha256_repositories"
206+
rules:
207+
- !reference [.rules:test:smoke-for-omnibus-mr, rules]
208+
- !reference [.rules:test:feature-flags-set, rules]
209+
- !reference [.rules:test:qa-parallel, rules]
210+
- if: $QA_SUITES =~ /Test::Instance::All/
195211
# ------------------------------------------
196212
# Non parallel jobs
197213
# ------------------------------------------

.yamllint

-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ ignore: |
2727
# Has some special indentation
2828
doc/user/project/integrations/samples/cloudwatch.yml
2929

30-
# Broken on purpose (for testing)
31-
spec/fixtures/lib/gitlab/metrics/dashboard/broken_yml_syntax.yml
32-
3330
# Dynamic YAML files have syntax errors sometimes.
3431
*.erb
3532

GITALY_SERVER_VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
e9200d13237f94877ae69dd6391b23d5ca1402e8
1+
67840bedbf1fda223cbb9ebae021db71c31b69aa

app/assets/javascripts/webhooks/components/form_custom_headers.vue

+10-16
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<script>
22
import { isEmpty } from 'lodash';
3-
import { GlCard, GlIcon, GlButton } from '@gitlab/ui';
3+
import { GlButton } from '@gitlab/ui';
44
import { __, s__ } from '~/locale';
55
import { scrollToElement } from '~/lib/utils/common_utils';
6+
import CrudComponent from '~/vue_shared/components/crud_component.vue';
67
import { CUSTOM_HEADER_KEY_PATTERN } from '../constants';
78
import FormCustomHeaderItem from './form_custom_header_item.vue';
89
910
const MAXIMUM_CUSTOM_HEADERS = 20;
1011
1112
export default {
1213
components: {
14+
CrudComponent,
1315
FormCustomHeaderItem,
14-
GlCard,
15-
GlIcon,
1616
GlButton,
1717
},
1818
props: {
@@ -100,21 +100,15 @@ export default {
100100
</script>
101101
102102
<template>
103-
<gl-card
103+
<crud-component
104104
ref="customHeaderCard"
105+
:title="s__('Webhooks|Custom headers')"
106+
icon="code"
107+
:count="customHeaders.length"
108+
class="gl-mt-3 gl-mb-5"
105109
data-testid="custom-headers-card"
106-
class="gl-new-card gl-my-4"
107-
header-class="gl-new-card-header"
108-
body-class="gl-new-card-body gl-px-5 gl-py-4"
109110
>
110-
<template #header>
111-
<div class="gl-new-card-title-wrapper">
112-
<h3 class="gl-new-card-title">{{ s__('Webhooks|Custom headers') }}</h3>
113-
<div class="gl-new-card-count">
114-
<gl-icon name="code" class="gl-mr-2" />
115-
{{ customHeaders.length }}
116-
</div>
117-
</div>
111+
<template #actions>
118112
<gl-button
119113
v-if="!maximumCustomHeadersReached"
120114
size="small"
@@ -147,5 +141,5 @@ export default {
147141
<span v-if="customHeaders.length === 0" class="gl-text-secondary">
148142
{{ s__('Webhooks|No custom headers configured.') }}
149143
</span>
150-
</gl-card>
144+
</crud-component>
151145
</template>

app/components/layouts/crud_component.haml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
= description || @description
1616
.gl-flex.gl-gap-3.gl-items-baseline{ data: { testid: 'crud-actions' } }
1717
- if @toggle_text
18-
= render Pajamas::ButtonComponent.new(size: :small, button_options: button_options_attrs) do
18+
= render Pajamas::ButtonComponent.new(size: :small, button_options: toggle_button_options_attrs) do
1919
= @toggle_text
2020
= actions
2121

app/components/layouts/crud_component.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def body_options_attrs
4343
@body_options.merge(default_attrs(@body_options, default_testid, default_classes))
4444
end
4545

46-
def button_options_attrs
46+
def toggle_button_options_attrs
4747
default_testid = 'crud-action-toggle'
4848
default_classes = ['js-toggle-button js-toggle-content']
4949
@toggle_options.merge(default_attrs(@toggle_options, default_testid, default_classes))
@@ -53,7 +53,7 @@ def form_options_attrs
5353
default_testid = 'crud-form'
5454
default_classes = [
5555
('js-toggle-content' if @toggle_text),
56-
('gl-hidden' if @toggle_text && !@form_options[:class])
56+
('gl-hidden' if @toggle_text && !@form_options[:form_errors])
5757
]
5858
@form_options.merge(default_attrs(@form_options, default_testid, default_classes))
5959
end

app/components/layouts/settings_section_component.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ class SettingsSectionComponent < ViewComponent::Base
77
# @param [String] id
88
# @param [String] testid
99
# @param [Hash] options
10-
def initialize(heading, description: nil, id: nil, testid: nil, options: nil)
10+
def initialize(heading, description: nil, id: nil, testid: nil, options: {})
1111
@heading = heading
1212
@description = description
1313
@id = id
1414
@testid = testid
15-
@options = options || {}
15+
@options = options
1616
end
1717

1818
renders_one :heading

app/controllers/application_controller.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,9 @@ def set_current_organization
534534
return if ::Current.lock_organization
535535

536536
::Current.organization = Gitlab::Current::Organization.new(
537-
params: params.permit(:controller, :namespace_id, :group_id, :id),
537+
params: params.permit(
538+
:controller, :namespace_id, :group_id, :id, :organization_path
539+
),
538540
user: current_user
539541
).organization
540542
end

app/models/organizations/organization.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Organization < MainClusterwide::ApplicationRecord
1313
joins(namespaces: :route).where(route: { path: path.to_s })
1414
}
1515
scope :with_user, ->(user) {
16-
joins(:users).where(users: user).order(Arel.sql('organization_users.id asc'))
16+
joins(:organization_users).merge(Organizations::OrganizationUser.by_user(user).order(:id))
1717
}
1818

1919
before_destroy :check_if_default_organization

app/models/organizations/organization_user.rb

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class OrganizationUser < ApplicationRecord
2020
scope :owners, -> { where(access_level: Gitlab::Access::OWNER) }
2121
scope :in_organization, ->(organization) { where(organization: organization) }
2222
scope :with_active_users, -> { joins(:user).merge(User.active) }
23+
scope :by_user, ->(user) { where(user: user) }
2324

2425
def self.create_default_organization_record_for(user_id, user_is_admin:)
2526
upsert(

app/models/snippet.rb

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ class Snippet < ApplicationRecord
2020
include CreatedAtFilterable
2121
include EachBatch
2222
include Import::HasImportSource
23+
include SafelyChangeColumnDefault
24+
25+
columns_changing_default :organization_id
2326

2427
MAX_FILE_COUNT = 10
2528

app/services/bulk_imports/file_download_service.rb

+8-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def execute
4949
private
5050

5151
attr_reader :configuration, :relative_url, :tmpdir, :file_size_limit, :allowed_content_types,
52-
:response_headers, :last_chunk_context, :response_code
52+
:response_headers, :response_code
5353

5454
def download_file
5555
File.open(filepath, 'wb') do |file|
@@ -67,7 +67,7 @@ def download_file
6767

6868
@response_code = chunk.code
6969
@response_headers ||= Gitlab::HTTP::Response::Headers.new(chunk.http_response.to_hash)
70-
@last_chunk_context = chunk.to_s.truncate(LAST_CHUNK_CONTEXT_CHAR_LIMIT)
70+
@last_chunk_context = chunk
7171

7272
unless @remote_content_validated
7373
validate_content_type
@@ -141,5 +141,11 @@ def validate_url
141141
def default_file_size_limit
142142
Gitlab::CurrentSettings.current_application_settings.bulk_import_max_download_file_size.megabytes
143143
end
144+
145+
# Before logging, we truncate the context to a reasonable length and scrub
146+
# any non-printable characters.
147+
def last_chunk_context
148+
@last_chunk_context.to_s.truncate(LAST_CHUNK_CONTEXT_CHAR_LIMIT).scrub
149+
end
144150
end
145151
end

app/views/admin/applications/index.html.haml

+5-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
= s_('AdminArea|Manage applications for your instance that can use GitLab as an OAuth provider, start by creating a new one above.')
1717

1818
- else
19-
= render ::Layouts::CrudComponent.new(s_('AdminArea|Instance OAuth applications'), icon: 'applications', count: @applications.size, options: { class: 'gl-mt-5' }) do |c|
19+
= render ::Layouts::CrudComponent.new(s_('AdminArea|Instance OAuth applications'),
20+
icon: 'applications',
21+
count: @applications.size,
22+
options: { class: 'gl-mt-5', data: { testid: 'oauth-applications' } }) do |c|
2023
- c.with_description do
2124
- docs_link_path = help_page_path('integration/oauth_provider')
2225
- docs_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer nofollow">'.html_safe % { url: docs_link_path }
@@ -34,7 +37,7 @@
3437
%th= _('Trusted')
3538
%th= _('Confidential')
3639
%th.gl-text-right= _('Actions')
37-
%tbody{ data: { testid: "oauth-applications" } }
40+
%tbody
3841
- @applications.each do |application|
3942
%tr{ id: "application_#{application.id}" }
4043
%td{ data: { label: _('Name') } }= link_to application.name, admin_application_path(application)

app/views/admin/hooks/edit.html.haml

+11-11
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33

44
= render 'shared/web_hooks/hook_errors', hook: @hook
55

6-
.gl-mt-5
7-
= render 'shared/web_hooks/title_and_docs', hook: @hook
6+
= render ::Layouts::SettingsSectionComponent.new(page_title) do |c|
7+
- c.with_description do
8+
= render 'shared/web_hooks/description', hook: @hook
9+
- c.with_body do
10+
= gitlab_ui_form_for @hook, as: :hook, url: admin_hook_path do |f|
11+
= render partial: 'form', locals: { form: f, hook: @hook }
812

9-
= gitlab_ui_form_for @hook, as: :hook, url: admin_hook_path do |f|
10-
= render partial: 'form', locals: { form: f, hook: @hook }
11-
12-
.gl-display-flex.gl-justify-content-space-between
13-
%div
14-
= f.submit _('Save changes'), pajamas_button: true, class: 'gl-sm-mr-3'
13+
.settings-sticky-footer
14+
= f.submit _('Save changes'), pajamas_button: true, class: 'gl-mr-2'
1515
= render 'shared/web_hooks/test_button', hook: @hook
16-
= link_button_to _('Delete'), admin_hook_path(@hook), method: :delete, aria: { label: s_('Webhooks|Delete webhook') }, data: { confirm: s_('Webhooks|Are you sure you want to delete this webhook?'), confirm_btn_variant: 'danger' }, variant: :danger
16+
= link_button_to _('Delete'), admin_hook_path(@hook), method: :delete, class: 'gl-float-right', aria: { label: s_('Webhooks|Delete webhook') }, data: { confirm: s_('Webhooks|Are you sure you want to delete this webhook?'), confirm_btn_variant: 'danger' }, variant: :danger
1717

18-
%hr
18+
%hr
1919

20-
= render partial: 'shared/hook_logs/index', locals: { hook: @hook, hook_logs: @hook_logs }
20+
= render partial: 'shared/hook_logs/index', locals: { hook: @hook, hook_logs: @hook_logs }

app/views/admin/hooks/index.html.haml

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
- page_title @hook.pluralized_name
22

3-
.settings-section{ data: { event_tracking_load: 'true', event_tracking: 'view_admin_hooks_pageload' } }
4-
= render 'shared/web_hooks/title_and_docs', hook: @hook
5-
= render 'shared/web_hooks/index', hooks: @hooks, title: @hook.pluralized_name, partial: 'form', url: admin_hooks_path
3+
= render ::Layouts::SettingsSectionComponent.new(page_title, options: { data: { event_tracking_load: 'true', event_tracking: 'view_admin_hooks_pageload' } }) do |c|
4+
- c.with_description do
5+
= render 'shared/web_hooks/description', hook: @hook
6+
- c.with_body do
7+
= render 'shared/web_hooks/index', hooks: @hooks, title: @hook.pluralized_name, partial: 'form', url: admin_hooks_path
68

79
= render 'shared/file_hooks/index'
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
- page_title _("Edit"), @application.name, _("Group applications")
22

3-
%h1.page-title.gl-font-size-h-display= _('Edit group application')
3+
= render ::Layouts::PageHeadingComponent.new(_('Edit group application'))
44
= render 'shared/doorkeeper/applications/form', url: group_settings_application_path(@group, @application)

app/views/groups/settings/applications/show.html.haml

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
- breadcrumb_title @application.name
33
- page_title @application.name, _("Group applications")
44

5-
%h1.page-title.gl-font-size-h-display
6-
= _("Group application: %{name}") % { name: @application.name }
7-
5+
= render ::Layouts::PageHeadingComponent.new(safe_format(_("Group application: %{name}"), name: @application.name))
86
= render 'shared/doorkeeper/applications/show',
97
edit_path: edit_group_settings_application_path(@group, @application),
108
delete_path: group_settings_application_path(@group, @application),

app/views/projects/hooks/edit.html.haml

+12-11
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@
33

44
= render 'shared/web_hooks/hook_errors', hook: @hook
55

6-
.gl-mt-5
7-
= render 'shared/web_hooks/title_and_docs', hook: @hook
6+
= render ::Layouts::SettingsSectionComponent.new(page_title) do |c|
7+
- c.with_description do
8+
= render 'shared/web_hooks/description', hook: @hook
9+
- c.with_body do
10+
= gitlab_ui_form_for [@project, @hook], as: :hook, url: project_hook_path(@project, @hook), html: { class: 'js-webhook-form' } do |f|
11+
= render partial: 'shared/web_hooks/form', locals: { form: f, hook: @hook }
812

9-
= gitlab_ui_form_for [@project, @hook], as: :hook, url: project_hook_path(@project, @hook), html: { class: 'js-webhook-form' } do |f|
10-
= render partial: 'shared/web_hooks/form', locals: { form: f, hook: @hook }
13+
.settings-sticky-footer
14+
= f.submit _('Save changes'), pajamas_button: true, class: 'gl-mr-2'
15+
= render 'shared/web_hooks/test_button', hook: @hook
16+
= link_button_to _('Delete'), project_hook_path(@project, @hook), method: :delete, class: 'gl-float-right', aria: { label: s_('Webhooks|Delete webhook') }, data: { confirm: s_('Webhooks|Are you sure you want to delete this project hook?'), confirm_btn_variant: 'danger' }, variant: :danger
1117

12-
%div
13-
= f.submit _('Save changes'), pajamas_button: true, class: 'gl-sm-mr-3'
14-
= render 'shared/web_hooks/test_button', hook: @hook
15-
= link_button_to _('Delete'), project_hook_path(@project, @hook), method: :delete, class: 'gl-float-right', aria: { label: s_('Webhooks|Delete webhook') }, data: { confirm: s_('Webhooks|Are you sure you want to delete this project hook?'), confirm_btn_variant: 'danger' }, variant: :danger
18+
%hr
1619

17-
%hr
18-
19-
= render partial: 'shared/hook_logs/index', locals: { hook: @hook, hook_logs: @hook_logs, project: @project }
20+
= render partial: 'shared/hook_logs/index', locals: { hook: @hook, hook_logs: @hook_logs, project: @project }

app/views/projects/hooks/index.html.haml

+6-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
- page_title _('Webhooks')
33
- @force_desktop_expanded_sidebar = true
44

5-
.gl-mt-3.js-search-settings-section
6-
= render 'shared/web_hooks/title_and_docs', hook: @hook
7-
= render 'shared/web_hooks/index', hooks: @hooks, title: @hook.pluralized_name, partial: 'shared/web_hooks/form', url: polymorphic_path([@project, :hooks])
5+
.js-search-settings-section
6+
= render ::Layouts::SettingsSectionComponent.new(page_title) do |c|
7+
- c.with_description do
8+
= render 'shared/web_hooks/description', hook: @hook
9+
- c.with_body do
10+
= render 'shared/web_hooks/index', hooks: @hooks, title: @hook.pluralized_name, partial: 'shared/web_hooks/form', url: polymorphic_path([@project, :hooks])

0 commit comments

Comments
 (0)