From 442a79b7336b763ad390285ef75f4e4ff48a9cd0 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 19 Jan 2021 12:10:46 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- GITALY_SERVER_VERSION | 2 +- app/assets/javascripts/api.js | 4 +- app/assets/javascripts/diffs/components/app.vue | 6 + app/assets/javascripts/diffs/index.js | 2 + app/assets/javascripts/diffs/store/actions.js | 2 + .../javascripts/diffs/store/modules/diff_state.js | 1 + app/assets/javascripts/diffs/store/mutations.js | 2 + .../javascripts/notes/components/note_body.vue | 14 +- app/assets/javascripts/notes/stores/actions.js | 4 +- .../components/graph/graph_component_wrapper.vue | 2 +- .../components/graph/linked_pipelines_column.vue | 2 +- .../fragments/linked_pipelines.fragment.graphql | 17 - .../queries/get_pipeline_details.query.graphql | 65 - .../components/mr_widget_alert_message.vue | 2 +- .../components/mr_widget_merge_help.vue | 2 +- .../components/mr_widget_related_links.vue | 2 +- .../components/source_branch_removal_status.vue | 2 +- .../components/states/commits_header.vue | 1 + .../components/states/mr_widget_rebase.vue | 21 +- .../javascripts/vue_merge_request_widget/index.js | 6 +- .../vue_merge_request_widget/mr_widget_options.vue | 1 - .../vue_shared/components/deprecated_modal_2.vue | 117 -- .../components/markdown/apply_suggestion.vue | 34 +- .../components/markdown/suggestion_diff.vue | 9 +- .../components/markdown/suggestion_diff_header.vue | 23 +- .../vue_shared/components/markdown/suggestions.vue | 26 +- .../components/batch_comments/review_bar.scss | 2 +- app/assets/stylesheets/framework/awards.scss | 2 +- .../stylesheets/framework/contextual_sidebar.scss | 2 +- app/assets/stylesheets/framework/dropdowns.scss | 2 +- app/assets/stylesheets/framework/sidebar.scss | 2 +- app/assets/stylesheets/framework/variables.scss | 1 + app/assets/stylesheets/pages/merge_requests.scss | 8 +- app/assets/stylesheets/utilities.scss | 2 +- .../projects/merge_requests_controller.rb | 1 + .../pipelines/get_pipeline_details.query.graphql | 101 ++ app/helpers/merge_requests_helper.rb | 4 + app/models/ci/build.rb | 2 - app/models/concerns/cacheable_attributes.rb | 2 +- app/views/abuse_reports/new.html.haml | 2 +- app/views/admin/groups/_group.html.haml | 2 +- app/views/admin/projects/_projects.html.haml | 4 +- app/views/profiles/show.html.haml | 2 +- app/views/projects/edit.html.haml | 8 +- app/views/projects/merge_requests/show.html.haml | 3 +- app/views/projects/milestones/_form.html.haml | 4 +- app/views/projects/pipelines/show.html.haml | 3 + .../projects/services/prometheus/_top.html.haml | 2 +- app/views/projects/settings/_archive.html.haml | 4 +- app/views/projects/settings/_general.html.haml | 2 +- .../projects/settings/integrations/show.html.haml | 2 +- app/views/shared/_file_picker_button.html.haml | 2 +- app/views/shared/_label.html.haml | 4 +- .../shared/empty_states/_profile_tabs.html.haml | 4 +- .../issuable/_board_create_list_dropdown.html.haml | 2 +- .../shared/issuable/_bulk_update_sidebar.html.haml | 4 +- .../shared/issuable/_label_page_create.html.haml | 4 +- ...dd-api-command-to-delete-pending-invitation.yml | 5 + changelogs/unreleased/yo-move-to-gl-button.yml | 5 + .../restrict_access_to_build_debug_mode.yml | 8 - .../development/suggestions_custom_commit.yml | 8 + .../upload_middleware_jwt_params_handler.yml | 8 - config/gitlab.yml.example | 3 + doc/administration/uploads.md | 29 - doc/api/graphql/reference/gitlab_schema.graphql | 365 ++++++ doc/api/graphql/reference/gitlab_schema.json | 1279 ++++++++++++++++++++ doc/api/graphql/reference/index.md | 150 +++ doc/api/invitations.md | 24 + doc/ci/variables/README.md | 27 +- lib/api/invitations.rb | 18 + lib/gitlab/middleware/multipart.rb | 124 +- lib/uploaded_file.rb | 32 +- locale/gitlab.pot | 9 - spec/controllers/projects/jobs_controller_spec.rb | 34 - .../user_suggests_changes_on_diff_spec.rb | 3 + spec/features/projects/jobs/permissions_spec.rb | 57 - .../graph/graph_component_wrapper_spec.js | 2 +- .../graph/linked_pipelines_column_spec.js | 2 +- spec/frontend/pipelines/graph/mock_data.js | 74 +- .../vue_mr_widget/mr_widget_options_spec.js | 384 +++--- .../components/deprecated_modal_2_spec.js | 258 ---- .../__snapshots__/suggestion_diff_spec.js.snap | 1 + .../components/markdown/apply_suggestion_spec.js | 9 +- .../markdown/suggestion_diff_header_spec.js | 3 +- .../components/markdown/suggestion_diff_spec.js | 1 + .../components/markdown/suggestions_spec.js | 1 + .../multipart/handler_for_jwt_params_spec.rb | 53 - spec/lib/gitlab/middleware/multipart_spec.rb | 198 +++ .../multipart_with_handler_for_jwt_params_spec.rb | 202 ---- .../middleware/multipart_with_handler_spec.rb | 196 --- spec/lib/uploaded_file_spec.rb | 194 +-- spec/models/ci/build_spec.rb | 16 - spec/requests/api/invitations_spec.rb | 84 +- spec/requests/api/jobs_spec.rb | 26 - spec/support/helpers/multipart_helpers.rb | 20 +- .../features/file_uploads_shared_examples.rb | 24 +- .../gitlab/middleware/multipart_shared_examples.rb | 24 +- tmp/.gitignore | 7 +- 98 files changed, 2707 insertions(+), 1818 deletions(-) delete mode 100644 app/assets/javascripts/pipelines/graphql/fragments/linked_pipelines.fragment.graphql delete mode 100644 app/assets/javascripts/pipelines/graphql/queries/get_pipeline_details.query.graphql delete mode 100644 app/assets/javascripts/vue_shared/components/deprecated_modal_2.vue create mode 100644 app/graphql/queries/pipelines/get_pipeline_details.query.graphql create mode 100644 changelogs/unreleased/add-api-command-to-delete-pending-invitation.yml create mode 100644 changelogs/unreleased/yo-move-to-gl-button.yml delete mode 100644 config/feature_flags/development/restrict_access_to_build_debug_mode.yml create mode 100644 config/feature_flags/development/suggestions_custom_commit.yml delete mode 100644 config/feature_flags/development/upload_middleware_jwt_params_handler.yml delete mode 100644 spec/frontend/vue_shared/components/deprecated_modal_2_spec.js delete mode 100644 spec/lib/gitlab/middleware/multipart/handler_for_jwt_params_spec.rb create mode 100644 spec/lib/gitlab/middleware/multipart_spec.rb delete mode 100644 spec/lib/gitlab/middleware/multipart_with_handler_for_jwt_params_spec.rb delete mode 100644 spec/lib/gitlab/middleware/multipart_with_handler_spec.rb diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index 7fb9791df63..334d4e7869b 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -64625df11e8add7e64cce44a47984512e5f42d72 +c89fdf6bb2dc9f652f5c724caf13d3bde76e9d90 diff --git a/app/assets/javascripts/api.js b/app/assets/javascripts/api.js index e0b9643f509..0a3db8ad3a6 100644 --- a/app/assets/javascripts/api.js +++ b/app/assets/javascripts/api.js @@ -442,10 +442,10 @@ const Api = { }); }, - applySuggestion(id) { + applySuggestion(id, message) { const url = Api.buildUrl(Api.applySuggestionPath).replace(':id', encodeURIComponent(id)); - return axios.put(url); + return axios.put(url, { commit_message: message }); }, applySuggestionBatch(ids) { diff --git a/app/assets/javascripts/diffs/components/app.vue b/app/assets/javascripts/diffs/components/app.vue index 5c777fc6cb6..32822fe1fe8 100644 --- a/app/assets/javascripts/diffs/components/app.vue +++ b/app/assets/javascripts/diffs/components/app.vue @@ -124,6 +124,11 @@ export default { required: false, default: false, }, + defaultSuggestionCommitMessage: { + type: String, + required: false, + default: '', + }, mrReviews: { type: Object, required: false, @@ -268,6 +273,7 @@ export default { dismissEndpoint: this.dismissEndpoint, showSuggestPopover: this.showSuggestPopover, viewDiffsFileByFile: fileByFile(this.fileByFileUserPreference), + defaultSuggestionCommitMessage: this.defaultSuggestionCommitMessage, mrReviews: this.mrReviews || {}, }); diff --git a/app/assets/javascripts/diffs/index.js b/app/assets/javascripts/diffs/index.js index 35ba937c1e2..4e0720c645a 100644 --- a/app/assets/javascripts/diffs/index.js +++ b/app/assets/javascripts/diffs/index.js @@ -83,6 +83,7 @@ export default function initDiffsApp(store) { showSuggestPopover: parseBoolean(dataset.showSuggestPopover), showWhitespaceDefault: parseBoolean(dataset.showWhitespaceDefault), viewDiffsFileByFile: parseBoolean(dataset.fileByFileDefault), + defaultSuggestionCommitMessage: dataset.defaultSuggestionCommitMessage, }; }, computed: { @@ -123,6 +124,7 @@ export default function initDiffsApp(store) { dismissEndpoint: this.dismissEndpoint, showSuggestPopover: this.showSuggestPopover, fileByFileUserPreference: this.viewDiffsFileByFile, + defaultSuggestionCommitMessage: this.defaultSuggestionCommitMessage, mrReviews: getReviewsForMergeRequest(mrPath), }, }); diff --git a/app/assets/javascripts/diffs/store/actions.js b/app/assets/javascripts/diffs/store/actions.js index ac34684bb16..e95e9ac3ee4 100644 --- a/app/assets/javascripts/diffs/store/actions.js +++ b/app/assets/javascripts/diffs/store/actions.js @@ -62,6 +62,7 @@ export const setBaseConfig = ({ commit }, options) => { projectPath, dismissEndpoint, showSuggestPopover, + defaultSuggestionCommitMessage, viewDiffsFileByFile, mrReviews, } = options; @@ -73,6 +74,7 @@ export const setBaseConfig = ({ commit }, options) => { projectPath, dismissEndpoint, showSuggestPopover, + defaultSuggestionCommitMessage, viewDiffsFileByFile, mrReviews, }); diff --git a/app/assets/javascripts/diffs/store/modules/diff_state.js b/app/assets/javascripts/diffs/store/modules/diff_state.js index 2aa971374ec..aa89c74cef0 100644 --- a/app/assets/javascripts/diffs/store/modules/diff_state.js +++ b/app/assets/javascripts/diffs/store/modules/diff_state.js @@ -45,5 +45,6 @@ export default () => ({ fileFinderVisible: false, dismissEndpoint: '', showSuggestPopover: true, + defaultSuggestionCommitMessage: '', mrReviews: {}, }); diff --git a/app/assets/javascripts/diffs/store/mutations.js b/app/assets/javascripts/diffs/store/mutations.js index 4e772d17c29..06f0f2c3dfb 100644 --- a/app/assets/javascripts/diffs/store/mutations.js +++ b/app/assets/javascripts/diffs/store/mutations.js @@ -36,6 +36,7 @@ export default { projectPath, dismissEndpoint, showSuggestPopover, + defaultSuggestionCommitMessage, viewDiffsFileByFile, mrReviews, } = options; @@ -47,6 +48,7 @@ export default { projectPath, dismissEndpoint, showSuggestPopover, + defaultSuggestionCommitMessage, viewDiffsFileByFile, mrReviews, }); diff --git a/app/assets/javascripts/notes/components/note_body.vue b/app/assets/javascripts/notes/components/note_body.vue index 094ebe5316a..8855ceac3d5 100644 --- a/app/assets/javascripts/notes/components/note_body.vue +++ b/app/assets/javascripts/notes/components/note_body.vue @@ -54,6 +54,7 @@ export default { ...mapState({ batchSuggestionsInfo: (state) => state.notes.batchSuggestionsInfo, }), + ...mapState('diffs', ['defaultSuggestionCommitMessage']), noteBody() { return this.note.note; }, @@ -98,12 +99,16 @@ export default { formCancelHandler(shouldConfirm, isDirty) { this.$emit('cancelForm', shouldConfirm, isDirty); }, - applySuggestion({ suggestionId, flashContainer, callback = () => {} }) { + applySuggestion({ suggestionId, flashContainer, callback = () => {}, message }) { const { discussion_id: discussionId, id: noteId } = this.note; - return this.submitSuggestion({ discussionId, noteId, suggestionId, flashContainer }).then( - callback, - ); + return this.submitSuggestion({ + discussionId, + noteId, + suggestionId, + flashContainer, + message, + }).then(callback); }, applySuggestionBatch({ flashContainer }) { return this.submitSuggestionBatch({ flashContainer }); @@ -130,6 +135,7 @@ export default { :note-html="note.note_html" :line-type="lineType" :help-page-path="helpPagePath" + :default-commit-message="defaultSuggestionCommitMessage" @apply="applySuggestion" @applyBatch="applySuggestionBatch" @addToBatch="addSuggestionToBatch" diff --git a/app/assets/javascripts/notes/stores/actions.js b/app/assets/javascripts/notes/stores/actions.js index 0ab781c13d3..c6684efed4d 100644 --- a/app/assets/javascripts/notes/stores/actions.js +++ b/app/assets/javascripts/notes/stores/actions.js @@ -559,7 +559,7 @@ export const updateResolvableDiscussionsCounts = ({ commit }) => export const submitSuggestion = ( { commit, dispatch }, - { discussionId, suggestionId, flashContainer }, + { discussionId, suggestionId, flashContainer, message }, ) => { const dispatchResolveDiscussion = () => dispatch('resolveDiscussion', { discussionId }).catch(() => {}); @@ -567,7 +567,7 @@ export const submitSuggestion = ( commit(types.SET_RESOLVING_DISCUSSION, true); dispatch('stopPolling'); - return Api.applySuggestion(suggestionId) + return Api.applySuggestion(suggestionId, message) .then(dispatchResolveDiscussion) .catch((err) => { const defaultMessage = __( diff --git a/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue b/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue index f440903d8f2..f596333237d 100644 --- a/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue +++ b/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue @@ -1,8 +1,8 @@