From 1ccebc7b3f091ef585dc87a91847aa35f7ae2130 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 23 Sep 2022 12:13:18 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .../capybara/visibility_matcher.yml | 0 GITALY_SERVER_VERSION | 2 +- .../shared/wikis/components/wiki_form.vue | 147 ++-------- .../set_status_modal/set_status_form.vue | 6 +- .../sidebar_subscriptions_widget.vue | 7 +- .../components/markdown/markdown_editor.vue | 178 ++++++++++++ .../javascripts/vue_shared/constants.js | 3 + .../page_bundles/merge_requests.scss | 6 + .../stylesheets/page_bundles/profile.scss | 42 +++ app/assets/stylesheets/pages/profile.scss | 76 ----- app/mailers/previews/notify_preview.rb | 4 + app/models/ci/pipeline.rb | 10 +- ...quest_review_merge_request_email.html.haml | 2 +- app/views/profiles/show.html.haml | 7 +- .../development/ci_rules_changes_compare.yml | 8 - ...220920124709_backfill_internal_on_notes.rb | 26 ++ db/schema_migrations/20220920124709 | 1 + .../ci_data_decay/pipeline_partitioning.md | 16 ++ doc/ci/yaml/index.md | 3 +- .../backfill_internal_on_notes.rb | 16 ++ .../ci/build/rules/rule/clause/changes.rb | 1 - .../ci/templates/Pages/Doxygen.gitlab-ci.yml | 1 + .../ci/templates/Pages/HTML.gitlab-ci.yml | 1 + .../ci/templates/Pages/Hexo.gitlab-ci.yml | 1 + .../ci/templates/Pages/Hyde.gitlab-ci.yml | 1 + .../ci/templates/Pages/JBake.gitlab-ci.yml | 1 + lib/gitlab/usage/metric.rb | 5 +- .../metrics/instrumentations/base_metric.rb | 6 +- .../count_bulk_imports_entities_metric.rb | 2 +- .../count_imported_projects_metric.rb | 2 +- .../instrumentations/generic_metric.rb | 5 +- .../instrumentations/redis_hll_metric.rb | 2 +- .../metrics/instrumentations/redis_metric.rb | 2 +- locale/gitlab.pot | 12 +- qa/qa/page/component/content_editor.rb | 6 +- qa/qa/page/component/wiki_page_form.rb | 7 +- .../user_manages_subscription_spec.rb | 4 - .../shared/wikis/components/wiki_form_spec.js | 270 +++++------------- .../markdown/markdown_editor_spec.js | 226 +++++++++++++++ .../backfill_internal_on_notes_spec.rb | 30 ++ .../build/rules/rule/clause/changes_spec.rb | 36 +-- .../instrumentations/redis_metric_spec.rb | 16 +- ...0124709_backfill_internal_on_notes_spec.rb | 31 ++ spec/models/ci/pipeline_spec.rb | 30 ++ .../ci/create_pipeline_service/rules_spec.rb | 41 --- workhorse/internal/api/api.go | 1 - .../dependencyproxy/dependencyproxy.go | 4 +- .../helper/httptransport/http_transport.go | 37 --- .../internal/imageresizer/image_resizer.go | 4 +- workhorse/internal/sendurl/sendurl.go | 4 +- workhorse/internal/transport/transport.go | 58 ++++ .../upload/destination/objectstore/object.go | 4 +- workhorse/internal/version/version.go | 20 ++ workhorse/internal/version/version_test.go | 19 ++ .../internal/zipartifacts/open_archive.go | 6 +- workhorse/main.go | 5 +- 56 files changed, 888 insertions(+), 573 deletions(-) rename .rubocop_todo/{ => rspec}/capybara/visibility_matcher.yml (100%) create mode 100644 app/assets/javascripts/vue_shared/components/markdown/markdown_editor.vue delete mode 100644 config/feature_flags/development/ci_rules_changes_compare.yml create mode 100644 db/post_migrate/20220920124709_backfill_internal_on_notes.rb create mode 100644 db/schema_migrations/20220920124709 create mode 100644 lib/gitlab/background_migration/backfill_internal_on_notes.rb create mode 100644 spec/frontend/vue_shared/components/markdown/markdown_editor_spec.js create mode 100644 spec/lib/gitlab/background_migration/backfill_internal_on_notes_spec.rb create mode 100644 spec/migrations/20220920124709_backfill_internal_on_notes_spec.rb delete mode 100644 workhorse/internal/helper/httptransport/http_transport.go create mode 100644 workhorse/internal/transport/transport.go create mode 100644 workhorse/internal/version/version.go create mode 100644 workhorse/internal/version/version_test.go diff --git a/.rubocop_todo/capybara/visibility_matcher.yml b/.rubocop_todo/rspec/capybara/visibility_matcher.yml similarity index 100% rename from .rubocop_todo/capybara/visibility_matcher.yml rename to .rubocop_todo/rspec/capybara/visibility_matcher.yml diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index beb66fcc2b4..699e4a0c856 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -e4d8f69ffa2efd3f2cb0adff5fa66f367f66f6fb +c13d9d902ef8175a0b1165ef0bc8643fb37b7897 diff --git a/app/assets/javascripts/pages/shared/wikis/components/wiki_form.vue b/app/assets/javascripts/pages/shared/wikis/components/wiki_form.vue index 9acc1cb62a1..bd3929c5f59 100644 --- a/app/assets/javascripts/pages/shared/wikis/components/wiki_form.vue +++ b/app/assets/javascripts/pages/shared/wikis/components/wiki_form.vue @@ -8,21 +8,18 @@ import { GlFormGroup, GlFormInput, GlFormSelect, - GlSegmentedControl, } from '@gitlab/ui'; -import LocalStorageSync from '~/vue_shared/components/local_storage_sync.vue'; -import axios from '~/lib/utils/axios_utils'; import csrf from '~/lib/utils/csrf'; import { setUrlFragment } from '~/lib/utils/url_utility'; import { s__, sprintf } from '~/locale'; import Tracking from '~/tracking'; -import MarkdownField from '~/vue_shared/components/markdown/field.vue'; +import MarkdownEditor from '~/vue_shared/components/markdown/markdown_editor.vue'; import { - CONTENT_EDITOR_LOADED_ACTION, SAVED_USING_CONTENT_EDITOR_ACTION, WIKI_CONTENT_EDITOR_TRACKING_LABEL, WIKI_FORMAT_LABEL, WIKI_FORMAT_UPDATED_ACTION, + CONTENT_EDITOR_LOADED_ACTION, } from '../constants'; const trackingMixin = Tracking.mixin({ @@ -74,10 +71,6 @@ export default { }, cancel: s__('WikiPage|Cancel'), }, - switchEditingControlOptions: [ - { text: s__('Wiki Page|Source'), value: 'source' }, - { text: s__('Wiki Page|Rich text'), value: 'richText' }, - ], components: { GlIcon, GlForm, @@ -87,13 +80,7 @@ export default { GlSprintf, GlLink, GlButton, - GlSegmentedControl, - MarkdownField, - LocalStorageSync, - ContentEditor: () => - import( - /* webpackChunkName: 'content_editor' */ '~/content_editor/components/content_editor.vue' - ), + MarkdownEditor, }, mixins: [trackingMixin], inject: ['formatOptions', 'pageInfo'], @@ -106,7 +93,7 @@ export default { commitMessage: '', isDirty: false, contentEditorEmpty: false, - switchEditingControlDisabled: false, + isContentEditorActive: false, }; }, computed: { @@ -162,12 +149,6 @@ export default { disableSubmitButton() { return this.noContent || !this.title; }, - isContentEditorActive() { - return this.isMarkdownFormat && this.useContentEditor; - }, - useContentEditor() { - return this.editingMode === 'richText'; - }, }, mounted() { this.updateCommitMessage(); @@ -178,23 +159,10 @@ export default { window.removeEventListener('beforeunload', this.onPageUnload); }, methods: { - renderMarkdown(content) { - return axios - .post(this.pageInfo.markdownPreviewPath, { text: content }) - .then(({ data }) => data.body); - }, - - setEditingMode(editingMode) { - this.editingMode = editingMode; - }, - async handleFormSubmit(e) { e.preventDefault(); - if (this.useContentEditor) { - this.trackFormSubmit(); - } - + this.trackFormSubmit(); this.trackWikiFormat(); // Wait until form field values are refreshed @@ -205,16 +173,6 @@ export default { this.isDirty = false; }, - handleContentChange() { - this.isDirty = true; - }, - - handleContentEditorChange({ empty, markdown, changed }) { - this.contentEditorEmpty = empty; - this.isDirty = changed; - this.content = markdown; - }, - onPageUnload(event) { if (!this.isDirty) return undefined; @@ -235,8 +193,13 @@ export default { this.commitMessage = newCommitMessage; }, - trackContentEditorLoaded() { - this.track(CONTENT_EDITOR_LOADED_ACTION); + notifyContentEditorActive() { + this.isContentEditorActive = true; + this.trackContentEditorLoaded(); + }, + + notifyContentEditorInactive() { + this.isContentEditorActive = false; }, trackFormSubmit() { @@ -256,12 +219,12 @@ export default { }); }, - enableSwitchEditingControl() { - this.switchEditingControlDisabled = false; + trackContentEditorLoaded() { + this.track(CONTENT_EDITOR_LOADED_ACTION); }, - disableSwitchEditingControl() { - this.switchEditingControlDisabled = true; + checkDirty(markdown) { + this.isDirty = this.pageInfo.content !== markdown; }, }, }; @@ -329,74 +292,22 @@ export default {
-
- -
- - - - -
- - -
- -
-
- + :autofocus="pageInfo.persisted" + :form-field-placeholder="$options.i18n.content.placeholder" + :form-field-aria-label="$options.i18n.content.label" + form-field-id="wiki_content" + form-field-name="wiki[content]" + @contentEditor="notifyContentEditorActive" + @markdownField="notifyContentEditorInactive" + @input="checkDirty" + />