From 26881dd926cfac47c9603d44e8d5a504ab8c4a14 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 10 Nov 2021 15:13:21 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .gitlab/ci/review-apps/qa.gitlab-ci.yml | 2 +- GITALY_SERVER_VERSION | 2 +- .../cancel_auto_stop.mutation.graphql | 2 +- .../delete_environment.mutation.graphql | 2 +- .../rollback_environment.mutation.graphql | 2 +- .../stop_environment.mutation.graphql | 2 +- .../graphql/queries/folder.query.graphql | 2 +- .../environments/graphql/resolvers.js | 9 ++--- .../environments/graphql/typedefs.graphql | 14 +++---- .../javascripts/lib/utils/text_markdown.js | 2 +- .../pipeline_editor/pipeline_editor_app.vue | 13 +++++- .../components/mr_widget_suggest_pipeline.vue | 28 ++----------- .../vue_merge_request_widget/constants.js | 6 +-- .../merge_request_widget_entity.rb | 15 +++---- app/workers/authorized_projects_worker.rb | 4 +- app/workers/build_hooks_worker.rb | 2 +- app/workers/build_queue_worker.rb | 4 +- app/workers/build_success_worker.rb | 4 +- app/workers/chat_notification_worker.rb | 4 +- app/workers/ci/archive_trace_worker.rb | 4 +- app/workers/ci/build_finished_worker.rb | 2 +- .../ci/build_trace_chunk_flush_worker.rb | 4 +- app/workers/cluster_update_app_worker.rb | 4 +- .../github_import/rescheduling_methods.rb | 4 +- .../gitlab/github_import/stage_methods.rb | 6 +-- .../gitlab/jira_import/import_worker.rb | 2 +- app/workers/concerns/new_issuable.rb | 8 +--- app/workers/create_commit_signature_worker.rb | 4 +- .../delete_container_repository_worker.rb | 6 +-- .../detect_repository_languages_worker.rb | 4 +- .../expire_build_instance_artifacts_worker.rb | 6 +-- app/workers/expire_job_cache_worker.rb | 4 +- app/workers/expire_pipeline_cache_worker.rb | 4 +- .../jira_import/stage/start_import_worker.rb | 2 +- .../hashed_storage/project_migrate_worker.rb | 4 +- .../hashed_storage/project_rollback_worker.rb | 4 +- .../invalid_gpg_signature_update_worker.rb | 4 +- app/workers/new_note_worker.rb | 4 +- .../pages_domain_verification_worker.rb | 4 +- app/workers/pages_worker.rb | 4 +- app/workers/pipeline_hooks_worker.rb | 4 +- app/workers/pipeline_metrics_worker.rb | 8 +--- app/workers/pipeline_process_worker.rb | 4 +- app/workers/project_cache_worker.rb | 4 +- .../propagate_service_template_worker.rb | 4 +- app/workers/run_pipeline_schedule_worker.rb | 6 +-- app/workers/update_highest_role_worker.rb | 6 +-- app/workers/update_merge_requests_worker.rb | 6 +-- .../update_project_statistics_worker.rb | 4 +- .../usage_data_instrumentation.yml | 2 +- ...dex_on_events_using_btree_created_at_id.rb | 17 ++++++++ db/schema_migrations/20211103162025 | 1 + db/structure.sql | 2 + lib/gitlab/usage_data.rb | 4 +- locale/gitlab.pot | 27 ++++++------- .../user_sees_suggest_pipeline_spec.rb | 40 ++++++------------- .../environments/graphql/mock_data.js | 14 +++---- spec/frontend/lib/utils/text_markdown_spec.js | 4 +- .../pipeline_editor_app_spec.js | 33 +++++++++++++++ .../mr_widget_suggest_pipeline_spec.js | 25 +----------- spec/frontend/vue_mr_widget/mock_data.js | 2 +- .../stores/mr_widget_store_spec.js | 2 +- .../merge_request_widget_entity_spec.rb | 33 ++------------- 63 files changed, 184 insertions(+), 275 deletions(-) create mode 100644 db/post_migrate/20211103162025_add_index_on_events_using_btree_created_at_id.rb create mode 100644 db/schema_migrations/20211103162025 diff --git a/.gitlab/ci/review-apps/qa.gitlab-ci.yml b/.gitlab/ci/review-apps/qa.gitlab-ci.yml index 6dd0997b3bb..4a6db715f76 100644 --- a/.gitlab/ci/review-apps/qa.gitlab-ci.yml +++ b/.gitlab/ci/review-apps/qa.gitlab-ci.yml @@ -34,7 +34,7 @@ .allure-report-base: image: - name: ${GITLAB_DEPENDENCY_PROXY}andrcuns/allure-report-publisher:0.3.6 + name: ${GITLAB_DEPENDENCY_PROXY}andrcuns/allure-report-publisher:0.4.1 entrypoint: [""] stage: post-qa variables: diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index 42d8be2ef60..87da2143dd2 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -8d7e242576249154697fed7876cd9fe2a31ffdc3 +9de3dd28a5c8248903160ea35d9f718899f51c89 diff --git a/app/assets/javascripts/environments/graphql/mutations/cancel_auto_stop.mutation.graphql b/app/assets/javascripts/environments/graphql/mutations/cancel_auto_stop.mutation.graphql index e69d4587215..22dfb8a7a89 100644 --- a/app/assets/javascripts/environments/graphql/mutations/cancel_auto_stop.mutation.graphql +++ b/app/assets/javascripts/environments/graphql/mutations/cancel_auto_stop.mutation.graphql @@ -1,4 +1,4 @@ -mutation cancelAutoStop($environment: Environment) { +mutation cancelAutoStop($environment: LocalEnvironment) { cancelAutoStop(environment: $environment) @client { errors } diff --git a/app/assets/javascripts/environments/graphql/mutations/delete_environment.mutation.graphql b/app/assets/javascripts/environments/graphql/mutations/delete_environment.mutation.graphql index 4f43db6f3e1..9bb68857923 100644 --- a/app/assets/javascripts/environments/graphql/mutations/delete_environment.mutation.graphql +++ b/app/assets/javascripts/environments/graphql/mutations/delete_environment.mutation.graphql @@ -1,4 +1,4 @@ -mutation deleteEnvironment($environment: Environment) { +mutation deleteEnvironment($environment: LocalEnvironment) { deleteEnvironment(environment: $environment) @client { errors } diff --git a/app/assets/javascripts/environments/graphql/mutations/rollback_environment.mutation.graphql b/app/assets/javascripts/environments/graphql/mutations/rollback_environment.mutation.graphql index 83bda10d054..3db4dc2b9a5 100644 --- a/app/assets/javascripts/environments/graphql/mutations/rollback_environment.mutation.graphql +++ b/app/assets/javascripts/environments/graphql/mutations/rollback_environment.mutation.graphql @@ -1,4 +1,4 @@ -mutation rollbackEnvironment($environment: Environment) { +mutation rollbackEnvironment($environment: LocalEnvironment) { rollbackEnvironment(environment: $environment) @client { errors } diff --git a/app/assets/javascripts/environments/graphql/mutations/stop_environment.mutation.graphql b/app/assets/javascripts/environments/graphql/mutations/stop_environment.mutation.graphql index 86112d8f3f8..7eae0ef4ce4 100644 --- a/app/assets/javascripts/environments/graphql/mutations/stop_environment.mutation.graphql +++ b/app/assets/javascripts/environments/graphql/mutations/stop_environment.mutation.graphql @@ -1,4 +1,4 @@ -mutation stopEnvironment($environment: Environment) { +mutation stopEnvironment($environment: LocalEnvironment) { stopEnvironment(environment: $environment) @client { errors } diff --git a/app/assets/javascripts/environments/graphql/queries/folder.query.graphql b/app/assets/javascripts/environments/graphql/queries/folder.query.graphql index 0943d1aa800..3292c916b2e 100644 --- a/app/assets/javascripts/environments/graphql/queries/folder.query.graphql +++ b/app/assets/javascripts/environments/graphql/queries/folder.query.graphql @@ -1,4 +1,4 @@ -query getEnvironmentFolder($environment: NestedEnvironment) { +query getEnvironmentFolder($environment: NestedLocalEnvironment) { folder(environment: $environment) @client { availableCount environments diff --git a/app/assets/javascripts/environments/graphql/resolvers.js b/app/assets/javascripts/environments/graphql/resolvers.js index c9eb6ccdcae..8322b806370 100644 --- a/app/assets/javascripts/environments/graphql/resolvers.js +++ b/app/assets/javascripts/environments/graphql/resolvers.js @@ -3,12 +3,11 @@ import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils'; const mapNestedEnvironment = (env) => ({ ...convertObjectPropsToCamelCase(env, { deep: true }), - __typename: 'NestedEnvironment', + __typename: 'NestedLocalEnvironment', }); const mapEnvironment = (env) => ({ ...convertObjectPropsToCamelCase(env), - // eslint-disable-next-line @gitlab/require-i18n-strings - __typename: 'Environment', + __typename: 'LocalEnvironment', }); export const resolvers = (endpoint) => ({ @@ -22,7 +21,7 @@ export const resolvers = (endpoint) => ({ __typename: 'ReviewApp', }, stoppedCount: res.data.stopped_count, - __typename: 'EnvironmentApp', + __typename: 'LocalEnvironmentApp', })); }, folder(_, { environment: { folderPath } }) { @@ -30,7 +29,7 @@ export const resolvers = (endpoint) => ({ availableCount: res.data.available_count, environments: res.data.environments.map(mapEnvironment), stoppedCount: res.data.stopped_count, - __typename: 'EnvironmentFolder', + __typename: 'LocalEnvironmentFolder', })); }, }, diff --git a/app/assets/javascripts/environments/graphql/typedefs.graphql b/app/assets/javascripts/environments/graphql/typedefs.graphql index 44c985941d4..49ea719449e 100644 --- a/app/assets/javascripts/environments/graphql/typedefs.graphql +++ b/app/assets/javascripts/environments/graphql/typedefs.graphql @@ -1,4 +1,4 @@ -type Environment { +type LocalEnvironment { id: Int! globalId: ID! name: String! @@ -9,14 +9,14 @@ type Environment { autoStopPath: String } -type NestedEnvironment { +type NestedLocalEnvironment { name: String! size: Int! - latest: Environment! + latest: LocalEnvironment! } -type EnvironmentFolder { - environments: [Environment!]! +type LocalEnvironmentFolder { + environments: [LocalEnvironment!]! availableCount: Int! stoppedCount: Int! } @@ -27,9 +27,9 @@ type ReviewApp { reviewSnippet: String } -type EnvironmentApp { +type LocalEnvironmentApp { stoppedCount: Int! availableCount: Int! - environments: [NestedEnvironment!]! + environments: [NestedLocalEnvironment!]! reviewApp: ReviewApp! } diff --git a/app/assets/javascripts/lib/utils/text_markdown.js b/app/assets/javascripts/lib/utils/text_markdown.js index 0804d792631..40dd29bea76 100644 --- a/app/assets/javascripts/lib/utils/text_markdown.js +++ b/app/assets/javascripts/lib/utils/text_markdown.js @@ -233,7 +233,7 @@ export function insertMarkdownText({ } } else if (tag.indexOf(textPlaceholder) > -1) { textToInsert = tag.replace(textPlaceholder, () => - selected.replace(/\\n/g, '\n').replace('%br', '\\n'), + selected.replace(/\\n/g, '\n').replace(/%br/g, '\\n'), ); } else { textToInsert = String(startChar) + tag + selected + (wrap ? tag : ''); diff --git a/app/assets/javascripts/pipeline_editor/pipeline_editor_app.vue b/app/assets/javascripts/pipeline_editor/pipeline_editor_app.vue index 0a573cb3d58..68db5d8078f 100644 --- a/app/assets/javascripts/pipeline_editor/pipeline_editor_app.vue +++ b/app/assets/javascripts/pipeline_editor/pipeline_editor_app.vue @@ -52,6 +52,7 @@ export default { isFetchingCommitSha: false, isNewCiConfigFile: false, lastCommittedContent: '', + shouldSkipStartScreen: false, showFailure: false, showStartScreen: false, showSuccess: false, @@ -60,7 +61,6 @@ export default { successType: null, }; }, - apollo: { initialCiFileContent: { fetchPolicy: fetchPolicies.NETWORK_ONLY, @@ -103,7 +103,11 @@ export default { } if (!hasCIFile) { - this.showStartScreen = true; + if (this.shouldSkipStartScreen) { + this.setNewEmptyCiConfigFile(); + } else { + this.showStartScreen = true; + } } else if (fileContent.length) { // If the file content is > 0, then we make sure to reset the // start screen flag during a refetch @@ -229,6 +233,7 @@ export default { }, mounted() { this.loadTemplateFromURL(); + this.checkShouldSkipStartScreen(); }, methods: { hideFailure() { @@ -293,6 +298,10 @@ export default { this.setNewEmptyCiConfigFile(); } }, + checkShouldSkipStartScreen() { + const params = queryToObject(window.location.search); + this.shouldSkipStartScreen = Boolean(params?.add_new_config_file); + }, }, }; diff --git a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_suggest_pipeline.vue b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_suggest_pipeline.vue index f3673005c45..cd5b7c3110d 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_suggest_pipeline.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_suggest_pipeline.vue @@ -4,9 +4,7 @@ import Tracking from '~/tracking'; import DismissibleContainer from '~/vue_shared/components/dismissible_container.vue'; import { SP_TRACK_LABEL, - SP_LINK_TRACK_EVENT, SP_SHOW_TRACK_EVENT, - SP_LINK_TRACK_VALUE, SP_SHOW_TRACK_VALUE, SP_HELP_CONTENT, SP_HELP_URL, @@ -20,9 +18,7 @@ export default { name: 'MRWidgetSuggestPipeline', SP_ICON_NAME, SP_TRACK_LABEL, - SP_LINK_TRACK_EVENT, SP_SHOW_TRACK_EVENT, - SP_LINK_TRACK_VALUE, SP_SHOW_TRACK_VALUE, SP_HELP_CONTENT, SP_HELP_URL, @@ -81,29 +77,14 @@ export default {
- @@ -115,9 +96,6 @@ export default {
- - {{ s__('mrWidget|Are you adding technical debt or code vulnerabilities?') }} -