From 770adf92515e4311dfb42d89750d32a1e0628913 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 4 Mar 2021 15:11:19 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .rubocop_todo.yml | 2 - GITALY_SERVER_VERSION | 2 +- .../components/alert_management_table.vue | 20 +- .../fragments/alert.fragment.graphql | 6 +- .../edit/components/confirmation_modal.vue | 2 +- .../edit/components/integration_form.vue | 10 +- .../javascripts/pages/search/show/index.js | 4 +- .../header/pipeline_editor_header.vue | 5 + .../components/header/validation_segment.vue | 18 +- .../ui/pipeline_editor_empty_state.vue | 26 ++- .../pipeline_editor/pipeline_editor_app.vue | 19 +- .../pipeline_editor/pipeline_editor_home.vue | 1 + .../components/alert_details.vue | 4 +- .../projects/ci/pipeline_editor_controller.rb | 1 + .../oldest_per_commit_finder.rb | 32 +++- .../alert_management/alert_resolver.rb | 3 +- .../types/alert_management/alert_type.rb | 6 + app/models/bulk_imports/entity.rb | 10 - .../project_error_tracking_setting.rb | 10 +- app/models/merge_request.rb | 10 +- app/services/members/invite_service.rb | 101 +++++----- .../merge_requests/after_create_service.rb | 7 - app/services/merge_requests/create_service.rb | 2 - .../merged_merge_request_email.text.haml | 1 + .../error_tracking_issue_link_worker.rb | 4 +- .../unreleased/228733-alert-issue-status.yml | 5 + .../unreleased/291012-preparing-mr-state.yml | 5 - ...ormation-to-merged-merge-request-email.yml | 5 + .../changelog-include-merge-commits.yml | 5 + .../move-cancel-btn-integrations.yml | 5 + .../pipeline_editor_empty_state_action.yml | 8 + doc/administration/gitaly/index.md | 2 +- .../troubleshooting.md | 2 +- doc/administration/troubleshooting/debug.md | 6 +- doc/api/graphql/reference/index.md | 3 +- doc/api/merge_request_approvals.md | 29 +++ doc/ci/docker/using_docker_build.md | 95 ++++------ doc/development/architecture.md | 2 +- doc/development/internal_api.md | 10 +- doc/development/maintenance_mode.md | 2 +- .../upgrading_auto_deploy_dependencies.md | 2 +- doc/user/clusters/agent/index.md | 75 +++++++- .../sentry_client.rb} | 18 +- lib/error_tracking/sentry_client/api_urls.rb | 41 ++++ .../sentry_client}/event.rb | 4 +- .../sentry_client}/issue.rb | 8 +- .../sentry_client}/issue_link.rb | 4 +- .../sentry_client/pagination_parser.rb | 25 +++ .../sentry_client}/projects.rb | 4 +- .../sentry_client}/repo.rb | 4 +- lib/gitlab/error_tracking/detailed_error.rb | 2 + lib/gitlab/error_tracking/error.rb | 2 + lib/gitlab/error_tracking/error_collection.rb | 2 + lib/gitlab/error_tracking/error_event.rb | 2 + lib/gitlab/error_tracking/project.rb | 2 + lib/gitlab/error_tracking/repo.rb | 2 + .../stack_trace_highlight_decorator.rb | 2 + .../relative_positioning/closed_range.rb | 13 ++ lib/gitlab/relative_positioning/ending_at.rb | 18 ++ lib/gitlab/relative_positioning/range.rb | 34 ---- .../relative_positioning/starting_from.rb | 18 ++ lib/sentry/api_urls.rb | 39 ---- lib/sentry/pagination_parser.rb | 23 --- locale/gitlab.pot | 36 +++- .../oldest_per_commit_finder_spec.rb | 65 ++++++- spec/frontend/.eslintrc.yml | 1 - .../__helpers__/fake_date/fixtures.js | 4 + spec/frontend/__helpers__/fake_date/index.js | 1 + .../components/alert_management_table_spec.js | 82 ++++---- .../authentication/u2f/authenticate_spec.js | 2 - .../authentication/u2f/register_spec.js | 2 - .../webauthn/authenticate_spec.js | 1 - .../authentication/webauthn/register_spec.js | 1 - spec/frontend/awards_handler_spec.js | 1 - spec/frontend/behaviors/quick_submit_spec.js | 2 - .../frontend/behaviors/requires_input_spec.js | 1 - .../shortcuts/shortcuts_issuable_spec.js | 2 - spec/frontend/blob/blob_file_dropzone_spec.js | 1 - spec/frontend/blob/sketch/index_spec.js | 2 - spec/frontend/blob/viewer/index_spec.js | 2 - spec/frontend/bootstrap_linked_tabs_spec.js | 2 - .../ci_variable_list/ci_variable_list_spec.js | 3 - .../native_form_variable_list_spec.js | 2 - spec/frontend/collapsed_sidebar_todo_spec.js | 3 - .../commit/pipelines/pipelines_spec.js | 2 - spec/frontend/create_item_dropdown_spec.js | 2 - .../deprecated_jquery_dropdown_spec.js | 2 - .../diffs/mock_data/diff_with_commit.js | 2 - .../filtered_search/dropdown_user_spec.js | 1 - .../filtered_search/dropdown_utils_spec.js | 1 - .../visual_token_value_spec.js | 2 - spec/frontend/gl_field_errors_spec.js | 2 - spec/frontend/header_spec.js | 1 - .../integration_settings_form_spec.js | 1 - spec/frontend/issue_spec.js | 5 - spec/frontend/line_highlighter_spec.js | 1 - spec/frontend/merge_request_spec.js | 1 - spec/frontend/merge_request_tabs_spec.js | 5 - .../mini_pipeline_graph_dropdown_spec.js | 2 - spec/frontend/new_branch_spec.js | 2 - .../components/diff_discussion_header_spec.js | 4 - .../components/noteable_discussion_spec.js | 2 - spec/frontend/notes/stores/getters_spec.js | 2 - spec/frontend/oauth_remember_me_spec.js | 2 - .../admin/abuse_reports/abuse_reports_spec.js | 2 - .../account_and_limits_spec.js | 1 - .../pages/admin/users/new/index_spec.js | 2 - .../pages/dashboard/todos/index/todos_spec.js | 1 - .../components/timezone_dropdown_spec.js | 2 - .../new/preserve_url_fragment_spec.js | 2 - .../sessions/new/signin_tabs_memoizer_spec.js | 2 - .../header/pipeline_editor_header_spec.js | 5 +- .../header/validation_segment_spec.js | 21 ++- .../ui/pipeline_editor_empty_state_spec.js | 69 +++++-- .../pipeline_editor_app_spec.js | 46 ++++- .../pipelines/pipelines_table_row_spec.js | 2 - .../pipelines/pipelines_table_spec.js | 2 - spec/frontend/pipelines_spec.js | 2 - .../project_select_combo_button_spec.js | 2 - .../prometheus_metrics/custom_metrics_spec.js | 1 - .../prometheus_metrics_spec.js | 1 - spec/frontend/read_more_spec.js | 2 - spec/frontend/right_sidebar_spec.js | 1 - .../highlight_blob_search_result_spec.js | 2 - spec/frontend/search_autocomplete_spec.js | 1 - spec/frontend/settings_panels_spec.js | 2 - spec/frontend/shortcuts_spec.js | 2 - spec/frontend/test_setup.js | 5 - spec/frontend/user_popovers_spec.js | 1 - .../alert_details/alert_details_spec.js | 14 +- .../alert_details/mocks/alerts.json | 2 +- .../user_popover/user_popover_spec.js | 1 - spec/frontend/zen_mode_spec.js | 2 - .../types/alert_management/alert_type_spec.rb | 3 +- .../sentry_client}/api_urls_spec.rb | 4 +- .../sentry_client}/event_spec.rb | 2 +- .../sentry_client}/issue_link_spec.rb | 2 +- .../sentry_client}/issue_spec.rb | 10 +- .../sentry_client}/pagination_parser_spec.rb | 2 +- .../sentry_client}/projects_spec.rb | 6 +- .../sentry_client}/repo_spec.rb | 4 +- .../sentry_client_spec.rb} | 4 +- spec/mailers/emails/merge_requests_spec.rb | 39 +++- spec/mailers/notify_spec.rb | 31 ---- spec/models/bulk_imports/entity_spec.rb | 16 -- .../project_error_tracking_setting_spec.rb | 14 +- spec/models/merge_request_spec.rb | 13 -- .../alerts/create_alert_issue_spec.rb | 6 +- .../alert_management/alert/issue_spec.rb | 71 +++++++ .../project/alert_management/alerts_spec.rb | 4 +- spec/requests/api/invitations_spec.rb | 12 +- spec/services/members/invite_service_spec.rb | 175 +++++++++++++----- .../after_create_service_spec.rb | 22 --- .../merge_requests/create_service_spec.rb | 4 - .../repositories/changelog_service_spec.rb | 2 +- .../helpers/javascript_fixtures_helpers.rb | 1 + .../features/error_tracking_shared_context.rb | 2 +- .../lib/sentry/client_shared_examples.rb | 4 +- .../error_tracking_issue_link_worker_spec.rb | 12 +- vendor/gitignore/C++.gitignore | 0 vendor/gitignore/Java.gitignore | 0 161 files changed, 1059 insertions(+), 696 deletions(-) create mode 100644 changelogs/unreleased/228733-alert-issue-status.yml delete mode 100644 changelogs/unreleased/291012-preparing-mr-state.yml create mode 100644 changelogs/unreleased/300750-add-missing-reviewers-information-to-merged-merge-request-email.yml create mode 100644 changelogs/unreleased/changelog-include-merge-commits.yml create mode 100644 changelogs/unreleased/move-cancel-btn-integrations.yml create mode 100644 config/feature_flags/development/pipeline_editor_empty_state_action.yml rename lib/{sentry/client.rb => error_tracking/sentry_client.rb} (87%) create mode 100644 lib/error_tracking/sentry_client/api_urls.rb rename lib/{sentry/client => error_tracking/sentry_client}/event.rb (95%) rename lib/{sentry/client => error_tracking/sentry_client}/issue.rb (97%) rename lib/{sentry/client => error_tracking/sentry_client}/issue_link.rb (97%) create mode 100644 lib/error_tracking/sentry_client/pagination_parser.rb rename lib/{sentry/client => error_tracking/sentry_client}/projects.rb (95%) rename lib/{sentry/client => error_tracking/sentry_client}/repo.rb (94%) create mode 100644 lib/gitlab/relative_positioning/closed_range.rb create mode 100644 lib/gitlab/relative_positioning/ending_at.rb create mode 100644 lib/gitlab/relative_positioning/starting_from.rb delete mode 100644 lib/sentry/api_urls.rb delete mode 100644 lib/sentry/pagination_parser.rb create mode 100644 spec/frontend/__helpers__/fake_date/fixtures.js rename spec/lib/{sentry => error_tracking/sentry_client}/api_urls_spec.rb (95%) rename spec/lib/{sentry/client => error_tracking/sentry_client}/event_spec.rb (98%) rename spec/lib/{sentry/client => error_tracking/sentry_client}/issue_link_spec.rb (97%) rename spec/lib/{sentry/client => error_tracking/sentry_client}/issue_spec.rb (95%) rename spec/lib/{sentry => error_tracking/sentry_client}/pagination_parser_spec.rb (96%) rename spec/lib/{sentry/client => error_tracking/sentry_client}/projects_spec.rb (91%) rename spec/lib/{sentry/client => error_tracking/sentry_client}/repo_spec.rb (90%) rename spec/lib/{sentry/client_spec.rb => error_tracking/sentry_client_spec.rb} (82%) create mode 100644 spec/requests/api/graphql/project/alert_management/alert/issue_spec.rb mode change 100755 => 100644 vendor/gitignore/C++.gitignore mode change 100755 => 100644 vendor/gitignore/Java.gitignore diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index f15256cae0c..f1d3409c614 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -382,7 +382,6 @@ Performance/DeleteSuffix: - 'app/workers/concerns/application_worker.rb' - 'ee/app/models/geo/upload_registry.rb' - 'ee/app/workers/geo/file_download_dispatch_worker/attachment_job_finder.rb' - - 'lib/sentry/client/issue.rb' # Offense count: 13 # Cop supports --auto-correct. @@ -1042,4 +1041,3 @@ Style/StringLiteralsInInterpolation: # IgnoredMethods: respond_to, define_method Style/SymbolProc: Enabled: false - diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index 08f2908ad47..d282ad48073 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -55bed7acf3bb27ab627272d903d99573c5f009e7 +cdb02af5b322de1f4091b39c349579b2e335b914 diff --git a/app/assets/javascripts/alert_management/components/alert_management_table.vue b/app/assets/javascripts/alert_management/components/alert_management_table.vue index dd702c4a5d3..96279b65452 100644 --- a/app/assets/javascripts/alert_management/components/alert_management_table.vue +++ b/app/assets/javascripts/alert_management/components/alert_management_table.vue @@ -42,6 +42,7 @@ export default { "AlertManagement|There was an error displaying the alerts. Confirm your endpoint's configuration details to ensure alerts appear.", ), unassigned: __('Unassigned'), + closed: __('closed'), }, fields: [ { @@ -75,7 +76,7 @@ export default { { key: 'issue', label: s__('AlertManagement|Incident'), - thClass: 'gl-w-12 gl-pointer-events-none', + thClass: 'gl-w-15p gl-pointer-events-none', tdClass, }, { @@ -221,8 +222,11 @@ export default { hasAssignees(assignees) { return Boolean(assignees.nodes?.length); }, - getIssueLink(item) { - return joinPaths('/', this.projectPath, '-', 'issues', item.issueIid); + getIssueMeta({ issue: { iid, state } }) { + return { + state: state === 'closed' ? `(${this.$options.i18n.closed})` : '', + link: joinPaths('/', this.projectPath, '-', 'issues', iid), + }; }, tbodyTrClass(item) { return { @@ -343,8 +347,14 @@ export default { diff --git a/app/assets/javascripts/graphql_shared/fragments/alert.fragment.graphql b/app/assets/javascripts/graphql_shared/fragments/alert.fragment.graphql index 62119177887..101633ef7a7 100644 --- a/app/assets/javascripts/graphql_shared/fragments/alert.fragment.graphql +++ b/app/assets/javascripts/graphql_shared/fragments/alert.fragment.graphql @@ -5,7 +5,11 @@ fragment AlertListItem on AlertManagementAlert { status startedAt eventCount - issueIid + issue { + iid + state + title + } assignees { nodes { name diff --git a/app/assets/javascripts/integrations/edit/components/confirmation_modal.vue b/app/assets/javascripts/integrations/edit/components/confirmation_modal.vue index bcf4b036fd2..89f7e3b7a89 100644 --- a/app/assets/javascripts/integrations/edit/components/confirmation_modal.vue +++ b/app/assets/javascripts/integrations/edit/components/confirmation_modal.vue @@ -13,7 +13,7 @@ export default { return { text: __('Save'), attributes: [ - { variant: 'success' }, + { variant: 'confirm' }, { category: 'primary' }, { disabled: this.isDisabled }, ], diff --git a/app/assets/javascripts/integrations/edit/components/integration_form.vue b/app/assets/javascripts/integrations/edit/components/integration_form.vue index acf6fed0aee..f9551b43c4a 100644 --- a/app/assets/javascripts/integrations/edit/components/integration_form.vue +++ b/app/assets/javascripts/integrations/edit/components/integration_form.vue @@ -138,7 +138,7 @@ export default { - {{ - __('Cancel') - }} + {{ __('Cancel') }} diff --git a/app/assets/javascripts/pages/search/show/index.js b/app/assets/javascripts/pages/search/show/index.js index a8c288c3663..2ee33584ee1 100644 --- a/app/assets/javascripts/pages/search/show/index.js +++ b/app/assets/javascripts/pages/search/show/index.js @@ -1,5 +1,3 @@ import { initSearchApp } from '~/search'; -document.addEventListener('DOMContentLoaded', () => { - initSearchApp(); -}); +initSearchApp(); diff --git a/app/assets/javascripts/pipeline_editor/components/header/pipeline_editor_header.vue b/app/assets/javascripts/pipeline_editor/components/header/pipeline_editor_header.vue index 1381cd2f6c3..7a35e31e9ce 100644 --- a/app/assets/javascripts/pipeline_editor/components/header/pipeline_editor_header.vue +++ b/app/assets/javascripts/pipeline_editor/components/header/pipeline_editor_header.vue @@ -31,6 +31,10 @@ export default { }, mixins: [glFeatureFlagsMixin()], props: { + ciFileContent: { + type: String, + required: true, + }, ciConfigData: { type: Object, required: true, @@ -60,6 +64,7 @@ export default { diff --git a/app/assets/javascripts/pipeline_editor/components/header/validation_segment.vue b/app/assets/javascripts/pipeline_editor/components/header/validation_segment.vue index 94fb3a66fdd..541ab74b177 100644 --- a/app/assets/javascripts/pipeline_editor/components/header/validation_segment.vue +++ b/app/assets/javascripts/pipeline_editor/components/header/validation_segment.vue @@ -5,6 +5,9 @@ import TooltipOnTruncate from '~/vue_shared/components/tooltip_on_truncate.vue'; import { CI_CONFIG_STATUS_VALID } from '../../constants'; export const i18n = { + empty: __( + "We'll continuously validate your pipeline configuration. The validation results will appear here.", + ), learnMore: __('Learn more'), loading: s__('Pipelines|Validating GitLab CI configuration…'), invalid: s__('Pipelines|This GitLab CI configuration is invalid.'), @@ -26,6 +29,10 @@ export default { }, }, props: { + ciFileContent: { + type: String, + required: true, + }, ciConfig: { type: Object, required: false, @@ -38,17 +45,22 @@ export default { }, }, computed: { + isEmpty() { + return !this.ciFileContent; + }, isValid() { return this.ciConfig?.status === CI_CONFIG_STATUS_VALID; }, icon() { - if (this.isValid) { + if (this.isValid || this.isEmpty) { return 'check'; } return 'warning-solid'; }, message() { - if (this.isValid) { + if (this.isEmpty) { + return this.$options.i18n.empty; + } else if (this.isValid) { return this.$options.i18n.valid; } @@ -74,7 +86,7 @@ export default { {{ message }} - + {{ $options.i18n.learnMore }} diff --git a/app/assets/javascripts/pipeline_editor/components/ui/pipeline_editor_empty_state.vue b/app/assets/javascripts/pipeline_editor/components/ui/pipeline_editor_empty_state.vue index 2864e69505c..d4f04a0d055 100644 --- a/app/assets/javascripts/pipeline_editor/components/ui/pipeline_editor_empty_state.vue +++ b/app/assets/javascripts/pipeline_editor/components/ui/pipeline_editor_empty_state.vue @@ -1,9 +1,11 @@ diff --git a/app/assets/javascripts/pipeline_editor/pipeline_editor_app.vue b/app/assets/javascripts/pipeline_editor/pipeline_editor_app.vue index f0e8a232f71..0145a377598 100644 --- a/app/assets/javascripts/pipeline_editor/pipeline_editor_app.vue +++ b/app/assets/javascripts/pipeline_editor/pipeline_editor_app.vue @@ -36,7 +36,8 @@ export default { // Success and failure state failureType: null, failureReasons: [], - hasNoCiConfigFile: false, + showStartScreen: false, + isNewConfigFile: false, initialCiFileContent: '', lastCommittedContent: '', currentCiFileContent: '', @@ -48,6 +49,11 @@ export default { apollo: { initialCiFileContent: { query: getBlobContent, + // If we are working off a new file, we don't want to fetch + // the base data as there is nothing to fetch. + skip({ isNewConfigFile }) { + return isNewConfigFile; + }, variables() { return { projectPath: this.projectFullPath, @@ -157,7 +163,7 @@ export default { response?.status === httpStatusCodes.NOT_FOUND || response?.status === httpStatusCodes.BAD_REQUEST ) { - this.hasNoCiConfigFile = true; + this.showStartScreen = true; } else { this.reportFailure(LOAD_FAILURE_UNKNOWN); } @@ -183,6 +189,10 @@ export default { resetContent() { this.currentCiFileContent = this.lastCommittedContent; }, + setNewEmptyCiConfigFile() { + this.showStartScreen = false; + this.isNewConfigFile = true; + }, showErrorAlert({ type, reasons = [] }) { this.reportFailure(type, reasons); }, @@ -202,7 +212,10 @@ export default {