diff --git a/.gitlab/ci/gitlab-gems.gitlab-ci.yml b/.gitlab/ci/gitlab-gems.gitlab-ci.yml index 0c2fc96b02b..f188e1f97f8 100644 --- a/.gitlab/ci/gitlab-gems.gitlab-ci.yml +++ b/.gitlab/ci/gitlab-gems.gitlab-ci.yml @@ -14,3 +14,6 @@ include: - local: .gitlab/ci/templates/gem.gitlab-ci.yml inputs: gem_name: "gitlab-schema-validation" + - local: .gitlab/ci/templates/gem.gitlab-ci.yml + inputs: + gem_name: "gitlab-ipynbdiff" diff --git a/.gitlab/ci/release-environments/main.gitlab-ci.yml b/.gitlab/ci/release-environments/main.gitlab-ci.yml index 6c28ba3e2dd..7eb67509301 100644 --- a/.gitlab/ci/release-environments/main.gitlab-ci.yml +++ b/.gitlab/ci/release-environments/main.gitlab-ci.yml @@ -14,7 +14,7 @@ review-build-cng: review-deploy-env: allow_failure: true stage: deploy - needs: ["release-environments-build-cng"] + needs: ["review-build-cng"] variables: DEPLOY_ENV: deploy.env script: diff --git a/.gitlab/ci/review-apps/main.gitlab-ci.yml b/.gitlab/ci/review-apps/main.gitlab-ci.yml index 54dc4b4cb75..065a654eab2 100644 --- a/.gitlab/ci/review-apps/main.gitlab-ci.yml +++ b/.gitlab/ci/review-apps/main.gitlab-ci.yml @@ -44,6 +44,12 @@ review-build-cng: variables: HOST_SUFFIX: "${CI_ENVIRONMENT_SLUG}" DOMAIN: "-${CI_ENVIRONMENT_SLUG}.${REVIEW_APPS_DOMAIN}" + GITLAB_HELM_CHART_PROJECT_URL: "https://gitlab.com/gitlab-org/charts/gitlab" + GITLAB_HELM_REPO_URL: "https://charts.gitlab.io" + GITLAB_REPO_URL: ${CI_PROJECT_URL} + GITLAB_IMAGE_REPOSITORY: "registry.gitlab.com/gitlab-org/build/cng-mirror" + GITLAB_IMAGE_SUFFIX: "ee" + GITLAB_VERIFY_DEPLOY_TIMEOUT_MINUTES: 5 GITLAB_HELM_CHART_REF: "75b1486a9aec212d0f49ef1251526d8e51004bbc" # 7.0.1: https://gitlab.com/gitlab-org/charts/gitlab/-/commit/75b1486a9aec212d0f49ef1251526d8e51004bbc environment: name: review/${CI_COMMIT_REF_SLUG}${SCHEDULE_TYPE} # No separator for SCHEDULE_TYPE so it's compatible as before and looks nice without it diff --git a/.gitlab/ci/vendored-gems.gitlab-ci.yml b/.gitlab/ci/vendored-gems.gitlab-ci.yml index 3c9dadb8332..a06481197e5 100644 --- a/.gitlab/ci/vendored-gems.gitlab-ci.yml +++ b/.gitlab/ci/vendored-gems.gitlab-ci.yml @@ -11,10 +11,6 @@ include: inputs: gem_name: "microsoft_graph_mailer" gem_path_prefix: "vendor/gems/" - - local: .gitlab/ci/templates/gem.gitlab-ci.yml - inputs: - gem_name: "ipynbdiff" - gem_path_prefix: "vendor/gems/" - local: .gitlab/ci/templates/gem.gitlab-ci.yml inputs: gem_name: "omniauth-azure-oauth2" diff --git a/.gitlab/issue_templates/Geo Replicate a new Git repository type.md b/.gitlab/issue_templates/Geo Replicate a new Git repository type.md index ae5c6a054c0..24ccd4afd6d 100644 --- a/.gitlab/issue_templates/Geo Replicate a new Git repository type.md +++ b/.gitlab/issue_templates/Geo Replicate a new Git repository type.md @@ -146,11 +146,14 @@ The Geo primary site needs to checksum every replicable so secondaries can verif enable_lock_retries! def up - create_table :cool_widget_states, id: false do |t| + create_table :cool_widget_states do |t| t.datetime_with_timezone :verification_started_at t.datetime_with_timezone :verification_retry_at t.datetime_with_timezone :verified_at - t.references :cool_widget, primary_key: true, default: nil, index: false, foreign_key: { on_delete: :cascade } + t.references :cool_widget, + null: false, + index: { unique: true }, + foreign_key: { on_delete: :cascade } t.integer :verification_state, default: 0, limit: 2, null: false t.integer :verification_retry_count, default: 0, limit: 2, null: false t.binary :verification_checksum, using: 'verification_checksum::bytea' @@ -292,6 +295,11 @@ That's all of the required database changes. # Search the codebase for examples, and consult a Geo expert if needed. end + override :verification_state_model_key + def verification_state_model_key + :cool_widget_id + end + override :verification_state_table_class def verification_state_table_class CoolWidgetState diff --git a/.gitlab/issue_templates/Geo Replicate a new blob type.md b/.gitlab/issue_templates/Geo Replicate a new blob type.md index 91a86a96ac9..94c93bd27e4 100644 --- a/.gitlab/issue_templates/Geo Replicate a new blob type.md +++ b/.gitlab/issue_templates/Geo Replicate a new blob type.md @@ -148,14 +148,13 @@ The Geo primary site needs to checksum every replicable so secondaries can verif enable_lock_retries! def up - create_table :cool_widget_states, id: false do |t| + create_table :cool_widget_states do |t| t.datetime_with_timezone :verification_started_at t.datetime_with_timezone :verification_retry_at t.datetime_with_timezone :verified_at t.references :cool_widget, - primary_key: true, - default: nil, - index: false, + null: false, + index: { unique: true }, foreign_key: { on_delete: :cascade } t.integer :verification_state, default: 0, limit: 2, null: false t.integer :verification_retry_count, default: 0, limit: 2, null: false @@ -298,6 +297,11 @@ That's all of the required database changes. # Search the codebase for examples, and consult a Geo expert if needed. end + override :verification_state_model_key + def verification_state_model_key + :cool_widget_id + end + override :verification_state_table_class def verification_state_table_class CoolWidgetState diff --git a/.rubocop_todo/naming/inclusive_language.yml b/.rubocop_todo/naming/inclusive_language.yml index 350df577e09..9d1e98f87d3 100644 --- a/.rubocop_todo/naming/inclusive_language.yml +++ b/.rubocop_todo/naming/inclusive_language.yml @@ -28,7 +28,6 @@ Naming/InclusiveLanguage: - 'ee/app/controllers/projects/push_rules_controller.rb' - 'ee/lib/arkose/verify_response.rb' - 'ee/lib/system_check/geo/http_connection_check.rb' - - 'ee/spec/lib/gitlab/checks/diff_check_spec.rb' - 'ee/spec/models/dora/lead_time_for_changes_metric_spec.rb' - 'lib/api/entities/application_setting.rb' - 'lib/api/settings.rb' @@ -45,31 +44,18 @@ Naming/InclusiveLanguage: - 'lib/gitlab/sanitizers/svg.rb' - 'lib/gitlab/sanitizers/svg/whitelist.rb' - 'lib/system_check/app/git_user_default_ssh_config_check.rb' - - 'rubocop/cop/active_record_association_reload.rb' - - 'rubocop/cop/avoid_becomes.rb' - - 'rubocop/cop/avoid_keyword_arguments_in_sidekiq_workers.rb' - 'rubocop/cop/avoid_return_from_blocks.rb' - - 'rubocop/cop/default_scope.rb' - - 'rubocop/cop/destroy_all.rb' - 'rubocop/cop/graphql/id_type.rb' - - 'rubocop/cop/group_public_or_visible_to_user.rb' - - 'rubocop/cop/inject_enterprise_edition_module.rb' - - 'rubocop/cop/migration/add_columns_to_wide_tables.rb' - 'spec/controllers/concerns/issuable_collections_spec.rb' - 'spec/controllers/health_check_controller_spec.rb' - 'spec/controllers/metrics_controller_spec.rb' - - 'spec/features/projects/import_export/export_file_spec.rb' - 'spec/helpers/markup_helper_spec.rb' - 'spec/lib/banzai/filter/asset_proxy_filter_spec.rb' - 'spec/lib/gitlab/asset_proxy_spec.rb' - 'spec/lib/gitlab/auth/ip_rate_limiter_spec.rb' - 'spec/lib/gitlab/git/hook_env_spec.rb' - 'spec/lib/gitlab/github_import/markdown/attachment_spec.rb' - - 'spec/lib/gitlab/import_export/attribute_configuration_spec.rb' - - 'spec/lib/gitlab/import_export/references_configuration_spec.rb' - - 'spec/lib/gitlab/markdown_cache/active_record/extension_spec.rb' - 'spec/lib/gitlab/middleware/basic_health_check_spec.rb' - - 'spec/lib/gitlab/middleware/go_spec.rb' - 'spec/lib/gitlab/sanitizers/exif_spec.rb' - 'spec/lib/system_check/app/git_user_default_ssh_config_check_spec.rb' - 'spec/models/application_setting_spec.rb' diff --git a/Gemfile b/Gemfile index 6aeaa32425e..3a6ce1553f7 100644 --- a/Gemfile +++ b/Gemfile @@ -593,7 +593,7 @@ gem 'ipaddress', '~> 0.8.3' gem 'parslet', '~> 1.8' -gem 'ipynbdiff', path: 'vendor/gems/ipynbdiff' +gem 'ipynbdiff', path: 'gems/ipynbdiff', require: 'ipynb_diff' gem 'ed25519', '~> 1.3.0' diff --git a/Gemfile.lock b/Gemfile.lock index a2a7a3f26ae..adbca941778 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -34,6 +34,13 @@ PATH nokogiri (~> 1.15.2) rake (~> 13.0) +PATH + remote: gems/ipynbdiff + specs: + ipynbdiff (0.4.7) + diffy (~> 3.4) + oj (~> 3.13.16) + PATH remote: vendor/gems/attr_encrypted specs: @@ -68,13 +75,6 @@ PATH error_tracking_open_api (1.0.0) typhoeus (~> 1.0, >= 1.0.1) -PATH - remote: vendor/gems/ipynbdiff - specs: - ipynbdiff (0.4.7) - diffy (~> 3.4) - oj (~> 3.13.16) - PATH remote: vendor/gems/mail-smtp_pool specs: diff --git a/app/assets/javascripts/alerts_settings/components/alerts_settings_form.vue b/app/assets/javascripts/alerts_settings/components/alerts_settings_form.vue index e88e0a3a344..033f48827f1 100644 --- a/app/assets/javascripts/alerts_settings/components/alerts_settings_form.vue +++ b/app/assets/javascripts/alerts_settings/components/alerts_settings_form.vue @@ -122,14 +122,12 @@ export default { name: '', token: '', url: '', - apiUrl: '', }, activeTabIndex: this.tabIndex, currentIntegration: null, parsedPayload: [], validationState: { name: true, - apiUrl: true, }, pricingLink: `${PROMO_URL}/pricing`, }; @@ -188,20 +186,14 @@ export default { ); }, isFormDirty() { - const { type, active, name, apiUrl, payloadAlertFields = [], payloadAttributeMappings = [] } = + const { type, active, name, payloadAlertFields = [], payloadAttributeMappings = [] } = this.currentIntegration || {}; - const { - name: formName, - apiUrl: formApiUrl, - active: formActive, - type: formType, - } = this.integrationForm; + const { name: formName, active: formActive, type: formType } = this.integrationForm; const isDirty = type !== formType || active !== formActive || name !== formName || - apiUrl !== formApiUrl || !isEqual(this.parsedPayload, payloadAlertFields) || !isEqual(this.mapping, this.getCleanMapping(payloadAttributeMappings)); @@ -211,25 +203,19 @@ export default { return this.isFormValid && this.isFormDirty; }, dataForSave() { - const { name, apiUrl, active } = this.integrationForm; + const { name, active } = this.integrationForm; const customMappingVariables = { payloadAttributeMappings: this.mapping, payloadExample: this.samplePayload.json || '{}', }; - const variables = this.isHttp - ? { name, active, ...customMappingVariables } - : { apiUrl, active }; + const variables = this.isHttp ? { name, active, ...customMappingVariables } : { active }; return { type: this.integrationForm.type, variables }; }, testAlertModal() { return this.isFormDirty ? testAlertModalId : null; }, - prometheusUrlInvalidFeedback() { - const { blankUrlError, invalidUrlError } = i18n.integrationFormSteps.prometheusFormUrl; - return this.integrationForm.apiUrl?.length ? invalidUrlError : blankUrlError; - }, }, watch: { tabIndex(val) { @@ -247,13 +233,12 @@ export default { type, active, url, - apiUrl, token, payloadExample, payloadAlertFields, payloadAttributeMappings, } = val; - this.integrationForm = { type, name, active, url, apiUrl, token }; + this.integrationForm = { type, name, active, url, token }; if (this.showMappingBuilder) { this.resetPayloadAndMappingConfirmed = false; @@ -271,14 +256,6 @@ export default { validateName() { this.validationState.name = Boolean(this.integrationForm.name?.length); }, - validateApiUrl() { - try { - const parsedUrl = new URL(this.integrationForm.apiUrl); - this.validationState.apiUrl = ['http:', 'https:'].includes(parsedUrl.protocol); - } catch (e) { - this.validationState.apiUrl = false; - } - }, isValidNonEmptyJSON(JSONString) { if (JSONString) { let parsed; @@ -298,14 +275,12 @@ export default { }, triggerValidation() { if (this.isHttp) { - this.validationState.apiUrl = true; this.validateName(); if (!this.validationState.name) { this.$refs.integrationName.$el.scrollIntoView({ behavior: 'smooth', block: 'center' }); } } else if (this.isPrometheus) { this.validationState.name = true; - this.validateApiUrl(); } }, sendTestAlert() { @@ -332,7 +307,6 @@ export default { this.integrationForm.type = integrationTypes.none.value; this.integrationForm.name = ''; this.integrationForm.active = false; - this.integrationForm.apiUrl = ''; this.samplePayload = { json: null, error: null, @@ -490,28 +464,6 @@ export default { class="gl-mt-4 gl-font-weight-normal" /> - - - - - {{ $options.i18n.integrationFormSteps.prometheusFormUrl.help }} - - -