From 534ce3b2d0a6ec24de9c370e5b85c9528ff63e34 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 5 Jan 2024 18:21:08 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- .rubocop.yml | 2 +- Gemfile.lock | 1 + app/assets/javascripts/dropzone_input.js | 3 +- .../organizations/new/components/app.vue | 7 +- app/assets/javascripts/organizations/new/index.js | 5 +- .../general/components/organization_settings.vue | 4 +- .../organizations/settings/general/index.js | 10 +- .../shared/components/new_edit_form.vue | 63 ++++- .../shared/components/organization_url_field.vue | 4 +- .../javascripts/organizations/shared/constants.js | 1 + .../organizations/show/components/app.vue | 4 +- .../show/components/organization_description.vue | 24 ++ .../vue_shared/components/markdown/header.vue | 1 + app/assets/stylesheets/application.scss | 6 +- app/assets/stylesheets/emoji_sprites.scss | 4 +- app/assets/stylesheets/fonts.scss | 8 +- app/assets/stylesheets/framework/diffs.scss | 18 +- app/assets/stylesheets/framework/dropdowns.scss | 2 +- app/assets/stylesheets/framework/files.scss | 2 +- .../stylesheets/framework/source_editor.scss | 2 +- app/assets/stylesheets/framework/typography.scss | 2 +- app/assets/stylesheets/highlight/common.scss | 2 +- app/assets/stylesheets/pages/issues.scss | 2 +- app/assets/stylesheets/pages/notes.scss | 2 +- app/assets/stylesheets/print.scss | 162 ++++++------ app/assets/stylesheets/snippets.scss | 3 +- app/controllers/concerns/preview_markdown.rb | 1 + .../organizations/organizations_controller.rb | 4 +- app/finders/ci/runner_jobs_finder.rb | 8 +- app/helpers/organizations/organization_helper.rb | 23 +- app/models/ci/build.rb | 4 + app/models/ci/runner_manager.rb | 4 + app/models/organizations/organization.rb | 2 +- app/models/organizations/organization_detail.rb | 2 +- config/routes/organizations.rb | 4 + doc/administration/auth/index.md | 1 + doc/administration/configure.md | 1 + doc/administration/dedicated/index.md | 4 +- doc/administration/license.md | 2 +- doc/administration/operations/index.md | 1 + .../reference_architectures/index.md | 1 + doc/administration/settings/index.md | 1 + doc/api/runners.md | 16 +- .../blueprints/cells/routing-service.md | 2 +- .../runner_admission_controller/index.md | 2 +- doc/architecture/blueprints/runner_tokens/index.md | 10 +- .../blueprints/secret_manager/index.md | 6 +- doc/ci/runners/runner_fleet_dashboard.md | 13 +- doc/development/code_review.md | 6 +- doc/development/contributing/design.md | 10 +- .../documentation/site_architecture/global_nav.md | 2 +- doc/development/documentation/styleguide/index.md | 2 +- .../documentation/styleguide/word_list.md | 2 +- .../documentation/topic_types/troubleshooting.md | 2 +- doc/development/ee_features.md | 2 +- doc/development/go_guide/index.md | 2 +- doc/development/i18n/translation.md | 2 +- doc/development/migration_style_guide.md | 4 +- doc/development/sec/analyzer_development_guide.md | 14 +- doc/development/secure_coding_guidelines.md | 2 +- .../testing_guide/end_to_end/feature_flags.md | 4 +- doc/development/testing_guide/flaky_tests.md | 2 +- doc/install/cloud_providers.md | 2 +- doc/install/install_methods.md | 2 +- doc/install/requirements.md | 1 + doc/security/index.md | 1 + doc/subscriptions/gitlab_com/index.md | 18 +- doc/topics/offline/index.md | 1 + doc/update/versions/gitlab_16_changes.md | 2 +- .../container_scanning/index.md | 8 +- .../troubleshooting_dependency_scanning.md | 2 +- doc/user/application_security/sast/index.md | 8 +- .../application_security/secret_detection/index.md | 8 +- doc/user/feature_flags.md | 4 +- doc/user/organization/index.md | 14 + doc/user/profile/account/create_accounts.md | 1 + .../repository/code_suggestions/self_managed.md | 2 +- gems/gitlab-database-load_balancing/Gemfile.lock | 1 + gems/gitlab-safe_request_store/Gemfile.lock | 3 +- .../gitlab-safe_request_store.gemspec | 1 + lib/api/ci/runners.rb | 25 +- lib/gitlab/dependency_linker/base_linker.rb | 10 +- .../middleware/unauthenticated_session_expiry.rb | 3 +- locale/gitlab.pot | 21 ++ rubocop/cop/scalability/file_uploads.rb | 2 +- spec/factories/projects.rb | 33 +++ spec/finders/ci/runner_jobs_finder_spec.rb | 88 ++++--- .../organizations/new/components/app_spec.js | 27 +- .../components/organization_settings_spec.js | 14 +- .../shared/components/new_edit_form_spec.js | 34 ++- .../organizations/show/components/app_spec.js | 7 + .../components/organization_description_spec.js | 46 ++++ .../organizations/organization_helper_spec.rb | 13 +- .../dependency_linker/package_json_linker_spec.rb | 16 ++ spec/models/ci/build_spec.rb | 52 +++- spec/models/ci/runner_manager_spec.rb | 273 +++++++++++--------- .../organizations/organization_detail_spec.rb | 9 + spec/models/organizations/organization_spec.rb | 1 + spec/requests/api/ci/runners_spec.rb | 281 ++++++++++++++------- .../organizations/organizations_controller_spec.rb | 24 ++ .../organizations_controller_routing_spec.rb | 5 + spec/rubocop/cop/scalability/file_uploads_spec.rb | 2 +- spec/support/helpers/debug_with_puts.rb | 13 + spec/support/helpers/stub_requests.rb | 18 +- vendor/gems/bundler-checksum/Gemfile.lock | 2 +- .../gems/bundler-checksum/lib/bundler_checksum.rb | 18 +- .../test/project_with_checksum_lock/Gemfile.lock | 2 +- 107 files changed, 1101 insertions(+), 529 deletions(-) create mode 100644 app/assets/javascripts/organizations/show/components/organization_description.vue create mode 100644 spec/frontend/organizations/show/components/organization_description_spec.js create mode 100644 spec/support/helpers/debug_with_puts.rb diff --git a/.rubocop.yml b/.rubocop.yml index dac452cb484..dd43221d20e 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -994,7 +994,7 @@ Gemspec/AvoidExecutingGit: Lint/BinaryOperatorWithIdenticalOperands: Exclude: - - '{,ee/,qa/}spec/**/*_{spec,shared_examples,shared_context}.rb' + - '{,ee/,qa/,jh/}spec/**/*_{spec,shared_examples,shared_context}.rb' Cop/SidekiqRedisCall: Enabled: true diff --git a/Gemfile.lock b/Gemfile.lock index 3cbaf38ed71..69a3a0356cf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -67,6 +67,7 @@ PATH remote: gems/gitlab-safe_request_store specs: gitlab-safe_request_store (0.1.0) + rack (~> 2.2.8) request_store PATH diff --git a/app/assets/javascripts/dropzone_input.js b/app/assets/javascripts/dropzone_input.js index 9ee4f7cf4aa..17744e2c6ab 100644 --- a/app/assets/javascripts/dropzone_input.js +++ b/app/assets/javascripts/dropzone_input.js @@ -46,7 +46,6 @@ export default function dropzoneInput(form, config = { parallelUploads: 2 }) { let hasPlainText; formTextarea.wrap('
'); - formTextarea.on('paste', (event) => handlePaste(event)); // Add dropzone area to the form. const $mdArea = formTextarea.closest('.md-area'); @@ -60,6 +59,8 @@ export default function dropzoneInput(form, config = { parallelUploads: 2 }) { return null; } + formTextarea.on('paste', (event) => handlePaste(event)); + const dropzone = $formDropzone.dropzone({ url: uploadsPath, dictDefaultMessage: '', diff --git a/app/assets/javascripts/organizations/new/components/app.vue b/app/assets/javascripts/organizations/new/components/app.vue index ee50afd3613..3a2b786dbae 100644 --- a/app/assets/javascripts/organizations/new/components/app.vue +++ b/app/assets/javascripts/organizations/new/components/app.vue @@ -42,7 +42,12 @@ export default { } = await this.$apollo.mutate({ mutation: organizationCreateMutation, variables: { - input: { name: formValues.name, path: formValues.path, avatar: formValues.avatar }, + input: { + name: formValues.name, + path: formValues.path, + description: formValues.description, + avatar: formValues.avatar, + }, }, context: { hasUpload: formValues.avatar instanceof File, diff --git a/app/assets/javascripts/organizations/new/index.js b/app/assets/javascripts/organizations/new/index.js index 9c7e5344800..563e366b2c6 100644 --- a/app/assets/javascripts/organizations/new/index.js +++ b/app/assets/javascripts/organizations/new/index.js @@ -13,7 +13,9 @@ export const initOrganizationsNew = () => { const { dataset: { appData }, } = el; - const { organizationsPath, rootUrl } = convertObjectPropsToCamelCase(JSON.parse(appData)); + const { organizationsPath, rootUrl, previewMarkdownPath } = convertObjectPropsToCamelCase( + JSON.parse(appData), + ); const apolloProvider = new VueApollo({ defaultClient: createDefaultClient(), @@ -26,6 +28,7 @@ export const initOrganizationsNew = () => { provide: { organizationsPath, rootUrl, + previewMarkdownPath, }, render(createElement) { return createElement(App); diff --git a/app/assets/javascripts/organizations/settings/general/components/organization_settings.vue b/app/assets/javascripts/organizations/settings/general/components/organization_settings.vue index 283a652f90e..1cea2ceeb90 100644 --- a/app/assets/javascripts/organizations/settings/general/components/organization_settings.vue +++ b/app/assets/javascripts/organizations/settings/general/components/organization_settings.vue @@ -6,6 +6,7 @@ import NewEditForm from '~/organizations/shared/components/new_edit_form.vue'; import { FORM_FIELD_NAME, FORM_FIELD_ID, + FORM_FIELD_DESCRIPTION, FORM_FIELD_AVATAR, } from '~/organizations/shared/constants'; import SettingsBlock from '~/vue_shared/components/settings/settings_block.vue'; @@ -29,7 +30,7 @@ export default { ), successMessage: s__('Organization|Organization was successfully updated.'), }, - fieldsToRender: [FORM_FIELD_NAME, FORM_FIELD_ID, FORM_FIELD_AVATAR], + fieldsToRender: [FORM_FIELD_NAME, FORM_FIELD_ID, FORM_FIELD_DESCRIPTION, FORM_FIELD_AVATAR], data() { return { loading: false, @@ -66,6 +67,7 @@ export default { input: { id: convertToGraphQLId(TYPE_ORGANIZATION, this.organization.id), name: formValues.name, + description: formValues.description, ...this.avatarInput(formValues), }, }, diff --git a/app/assets/javascripts/organizations/settings/general/index.js b/app/assets/javascripts/organizations/settings/general/index.js index 138606a0aab..3ac1243ff0f 100644 --- a/app/assets/javascripts/organizations/settings/general/index.js +++ b/app/assets/javascripts/organizations/settings/general/index.js @@ -13,9 +13,12 @@ export const initOrganizationsSettingsGeneral = () => { const { dataset: { appData }, } = el; - const { organization, organizationsPath, rootUrl } = convertObjectPropsToCamelCase( - JSON.parse(appData), - ); + const { + organization, + organizationsPath, + rootUrl, + previewMarkdownPath, + } = convertObjectPropsToCamelCase(JSON.parse(appData)); const apolloProvider = new VueApollo({ defaultClient: createDefaultClient(), @@ -29,6 +32,7 @@ export const initOrganizationsSettingsGeneral = () => { organization, organizationsPath, rootUrl, + previewMarkdownPath, }, render(createElement) { return createElement(App); diff --git a/app/assets/javascripts/organizations/shared/components/new_edit_form.vue b/app/assets/javascripts/organizations/shared/components/new_edit_form.vue index 3567fa490ea..49519369e9a 100644 --- a/app/assets/javascripts/organizations/shared/components/new_edit_form.vue +++ b/app/assets/javascripts/organizations/shared/components/new_edit_form.vue @@ -4,10 +4,13 @@ import { formValidators } from '@gitlab/ui/dist/utils'; import { s__, __ } from '~/locale'; import { slugify } from '~/lib/utils/text_utility'; import AvatarUploadDropzone from '~/vue_shared/components/upload_dropzone/avatar_upload_dropzone.vue'; +import MarkdownField from '~/vue_shared/components/markdown/field.vue'; +import { helpPagePath } from '~/helpers/help_page_helper'; import { FORM_FIELD_NAME, FORM_FIELD_ID, FORM_FIELD_PATH, + FORM_FIELD_DESCRIPTION, FORM_FIELD_AVATAR, FORM_FIELD_PATH_VALIDATORS, } from '../constants'; @@ -21,12 +24,27 @@ export default { GlButton, OrganizationUrlField, AvatarUploadDropzone, + MarkdownField, }, i18n: { cancel: __('Cancel'), }, formId: 'new-organization-form', - inject: ['organizationsPath'], + markdownDocsPath: helpPagePath('user/organization/index', { + anchor: 'organization-description-supported-markdown', + }), + restrictedToolBarItems: [ + 'code', + 'quote', + 'bullet-list', + 'numbered-list', + 'task-list', + 'collapsible-section', + 'table', + 'attach-file', + 'full-screen', + ], + inject: ['organizationsPath', 'previewMarkdownPath'], props: { loading: { type: Boolean, @@ -39,6 +57,7 @@ export default { return { [FORM_FIELD_NAME]: '', [FORM_FIELD_PATH]: '', + [FORM_FIELD_DESCRIPTION]: '', [FORM_FIELD_AVATAR]: null, }; }, @@ -47,7 +66,7 @@ export default { type: Array, required: false, default() { - return [FORM_FIELD_NAME, FORM_FIELD_PATH, FORM_FIELD_AVATAR]; + return [FORM_FIELD_NAME, FORM_FIELD_PATH, FORM_FIELD_DESCRIPTION, FORM_FIELD_AVATAR]; }, }, submitButtonText: { @@ -102,6 +121,12 @@ export default { class: 'gl-w-full', }, }, + [FORM_FIELD_DESCRIPTION]: { + label: s__('Organization|Organization description (optional)'), + groupAttrs: { + class: 'gl-w-full common-note-form', + }, + }, [FORM_FIELD_AVATAR]: { label: s__('Organization|Organization avatar'), groupAttrs: { @@ -137,6 +162,7 @@ export default { formFieldsInputEvent(event); this.hasPathBeenManuallySet = true; }, + helpPagePath, }, }; @@ -159,6 +185,28 @@ export default { @blur="blur" /> +