diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a1f2112a8db..b1ed0298f23 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -98,7 +98,9 @@ variables: FRONTEND_FIXTURES_MAPPING_PATH: crystalball/frontend_fixtures_mapping.json RSPEC_CHANGED_FILES_PATH: rspec/changed_files.txt RSPEC_MATCHING_TESTS_PATH: rspec/matching_tests.txt + RSPEC_MATCHING_TESTS_FOSS_PATH: rspec/matching_tests-foss.txt RSPEC_LAST_RUN_RESULTS_FILE: rspec/rspec_last_run_results.txt + RSPEC_FOSS_IMPACT_PIPELINE_YML: rspec-foss-impact-pipeline.yml JUNIT_RESULT_FILE: rspec/junit_rspec.xml JUNIT_RETRY_FILE: rspec/junit_rspec-retry.xml diff --git a/.gitlab/ci/rails.gitlab-ci.yml b/.gitlab/ci/rails.gitlab-ci.yml index be84cf904d7..672d2301c3f 100644 --- a/.gitlab/ci/rails.gitlab-ci.yml +++ b/.gitlab/ci/rails.gitlab-ci.yml @@ -1,160 +1,5 @@ -####################### -# rspec job base specs -.rails-job-base: - extends: - - .default-retry - - .default-before_script - - .rails-cache - -.base-script: - script: - - source ./scripts/rspec_helpers.sh - # Only install knapsack after bundle install! Otherwise oddly some native - # gems could not be found under some circumstance. No idea why, hours wasted. - - run_timed_command "gem install knapsack --no-document" - - echo -e "\e[0Ksection_start:`date +%s`:gitaly-test-spawn[collapsed=true]\r\e[0KStarting Gitaly" - - run_timed_command "scripts/gitaly-test-spawn" # Do not use 'bundle exec' here - - echo -e "\e[0Ksection_end:`date +%s`:gitaly-test-spawn\r\e[0K" - -.minimal-rspec-tests: - variables: - RSPEC_TESTS_MAPPING_ENABLED: "true" - -.single-db: - variables: - DECOMPOSED_DB: "false" - -.single-db-rspec: - extends: .single-db - -.praefect-with-db: - variables: - GITALY_PRAEFECT_WITH_DB: '1' - -.rspec-base: - extends: - - .rails-job-base - - .base-artifacts - stage: test - variables: - RUBY_GC_MALLOC_LIMIT: 67108864 - RUBY_GC_MALLOC_LIMIT_MAX: 134217728 - RECORD_DEPRECATIONS: "true" - GEO_SECONDARY_PROXY: 0 - needs: ["setup-test-env", "retrieve-tests-metadata", "compile-test-assets", "detect-tests"] - script: - - !reference [.base-script, script] - - rspec_paralellized_job "--tag ~quarantine --tag ~level:migration" - -.base-artifacts: - artifacts: - expire_in: 31d - when: always - paths: - - coverage/ - - crystalball/ - - deprecations/ - - knapsack/ - - rspec/ - - tmp/capybara/ - - log/*.log - reports: - junit: ${JUNIT_RESULT_FILE} - -.rspec-base-migration: - extends: - - .base-artifacts - - .rails:rules:ee-and-foss-migration - script: - - !reference [.base-script, script] - - rspec_paralellized_job "--tag ~quarantine --tag level:migration" - -.rspec-base-pg11: - extends: - - .rspec-base - - .use-pg11 - -.rspec-base-pg12: - extends: - - .rspec-base - - .use-pg12 - -.rspec-base-pg12-as-if-foss: - extends: - - .rspec-base - - .as-if-foss - - .use-pg12 - needs: ["setup-test-env", "retrieve-tests-metadata", "compile-test-assets as-if-foss", "detect-tests"] - -.rspec-base-pg13: - extends: - - .rspec-base - - .use-pg13 - -.rspec-ee-base-pg11: - extends: - - .rspec-base - - .use-pg11-ee - -.rspec-ee-base-pg12: - extends: - - .rspec-base - - .use-pg12-ee - -.rspec-ee-base-pg12-es8: - extends: - - .rspec-base - - .use-pg12-es8-ee - - .rails:rules:run-search-tests - -.rspec-ee-base-pg12-opensearch1: - extends: - - .rspec-base - - .use-pg12-opensearch1-ee - - .rails:rules:run-search-tests - -.rspec-ee-base-pg13: - extends: - - .rspec-base - - .use-pg13-ee - -.db-job-base: - extends: - - .rails-job-base - - .rails:rules:ee-and-foss-migration - - .use-pg12 - stage: test - needs: ["setup-test-env"] -# rspec job base specs -###################### - -############################ -# rspec job parallel configs -.rspec-migration-parallel: - parallel: 12 - -.rspec-ee-migration-parallel: - parallel: 4 - -.rspec-unit-parallel: - parallel: 28 - -.rspec-ee-unit-parallel: - parallel: 18 - -.rspec-integration-parallel: - parallel: 12 - -.rspec-ee-integration-parallel: - parallel: 6 - -.rspec-system-parallel: - parallel: 28 - -.rspec-ee-system-parallel: - parallel: 10 -# rspec job parallel configs -############################ +include: + - local: .gitlab/ci/rails/shared.gitlab-ci.yml ############################################################### # EE/FOSS: default refs (MRs, default branch, schedules) jobs # @@ -927,22 +772,41 @@ rspec fail-fast: paths: - tmp/capybara/ -rspec foss-impact: +rspec-foss-impact:pipeline-generate: extends: - - .rspec-base-pg12-as-if-foss - .rails:rules:rspec-foss-impact - needs: ["setup-test-env", "retrieve-tests-metadata", "compile-test-assets as-if-foss", "detect-tests"] + stage: prepare + needs: ["detect-tests"] script: - - !reference [.base-script, script] - - rspec_matched_foss_tests "${RSPEC_MATCHING_TESTS_PATH}" "--tag ~quarantine" + - scripts/generate-rspec-foss-impact-pipeline "${RSPEC_MATCHING_TESTS_FOSS_PATH}" "${RSPEC_FOSS_IMPACT_PIPELINE_YML}" artifacts: - expire_in: 7d + expire_in: 1 day paths: - - tmp/capybara/ - # Temporary allow failure because of the high rate of failure due to the job - # running a lot more tests since https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96152. - # This should be reverted once https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96797 is merged. - allow_failure: true + - $RSPEC_FOSS_IMPACT_PIPELINE_YML + +rspec-foss-impact:trigger: + extends: + - .rails:rules:rspec-foss-impact + stage: test + needs: + - job: "setup-test-env" + artifacts: false + - job: "retrieve-tests-metadata" + artifacts: false + - job: "compile-test-assets as-if-foss" + artifacts: false + - job: "rspec-foss-impact:pipeline-generate" + artifacts: true + variables: + PARENT_PIPELINE_ID: $CI_PIPELINE_ID + trigger: + strategy: depend + forward: + yaml_variables: true + pipeline_variables: true + include: + - artifact: $RSPEC_FOSS_IMPACT_PIPELINE_YML + job: rspec-foss-impact:pipeline-generate fail-pipeline-early: extends: diff --git a/.gitlab/ci/rails/rspec-foss-impact.gitlab-ci.yml.erb b/.gitlab/ci/rails/rspec-foss-impact.gitlab-ci.yml.erb new file mode 100644 index 00000000000..eae144634c6 --- /dev/null +++ b/.gitlab/ci/rails/rspec-foss-impact.gitlab-ci.yml.erb @@ -0,0 +1,50 @@ +# RSpec FOSS impact pipeline loaded dynamically by script: scripts/generate-rspec-foss-impact-pipeline + +include: + - local: .gitlab/ci/rails/shared.gitlab-ci.yml + +default: + image: $DEFAULT_CI_IMAGE + tags: + - gitlab-org + # Default job timeout set to 90m https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/10520 + timeout: 90m + interruptible: true + +stages: + - test + +dont-interrupt-me: + extends: .rules:dont-interrupt + stage: .pre + interruptible: false + script: + - echo "This jobs makes sure this pipeline won't be interrupted! See https://docs.gitlab.com/ee/ci/yaml/#interruptible." + +rspec foss-impact: + extends: .rspec-base-pg12-as-if-foss + needs: + - pipeline: $PARENT_PIPELINE_ID + job: detect-tests + - pipeline: $PARENT_PIPELINE_ID + job: setup-test-env + - pipeline: $PARENT_PIPELINE_ID + job: retrieve-tests-metadata + - pipeline: $PARENT_PIPELINE_ID + job: compile-test-assets as-if-foss + rules: + - when: always + variables: + RSPEC_TESTS_FILTER_FILE: "${RSPEC_MATCHING_TESTS_FOSS_PATH}" + RSPEC_TESTS_MAPPING_ENABLED: "true" +<% if Integer(parallel_value) > 1 %> + parallel: <%= parallel_value %> +<% end %> + script: + - !reference [.base-script, script] + - rspec_paralellized_job "--tag ~quarantine" + artifacts: + expire_in: 7d + paths: + - "${RSPEC_MATCHING_TESTS_FOSS_PATH}" + - tmp/capybara/ diff --git a/.gitlab/ci/rails/shared.gitlab-ci.yml b/.gitlab/ci/rails/shared.gitlab-ci.yml new file mode 100644 index 00000000000..60c9826abfe --- /dev/null +++ b/.gitlab/ci/rails/shared.gitlab-ci.yml @@ -0,0 +1,172 @@ +include: + - local: .gitlab/ci/global.gitlab-ci.yml + - local: .gitlab/ci/rules.gitlab-ci.yml + +.rules:dont-interrupt: + rules: + - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH + allow_failure: true + - if: $CI_MERGE_REQUEST_IID + when: manual + allow_failure: true + +####################### +# rspec job base specs +.rails-job-base: + extends: + - .default-retry + - .default-before_script + - .rails-cache + +.base-script: + script: + - source ./scripts/rspec_helpers.sh + # Only install knapsack after bundle install! Otherwise oddly some native + # gems could not be found under some circumstance. No idea why, hours wasted. + - run_timed_command "gem install knapsack --no-document" + - echo -e "\e[0Ksection_start:`date +%s`:gitaly-test-spawn[collapsed=true]\r\e[0KStarting Gitaly" + - run_timed_command "scripts/gitaly-test-spawn" # Do not use 'bundle exec' here + - echo -e "\e[0Ksection_end:`date +%s`:gitaly-test-spawn\r\e[0K" + +.minimal-rspec-tests: + variables: + RSPEC_TESTS_MAPPING_ENABLED: "true" + +.single-db: + variables: + DECOMPOSED_DB: "false" + +.single-db-rspec: + extends: .single-db + +.praefect-with-db: + variables: + GITALY_PRAEFECT_WITH_DB: '1' + +.rspec-base: + extends: + - .rails-job-base + - .base-artifacts + stage: test + variables: + RUBY_GC_MALLOC_LIMIT: 67108864 + RUBY_GC_MALLOC_LIMIT_MAX: 134217728 + RECORD_DEPRECATIONS: "true" + GEO_SECONDARY_PROXY: 0 + RSPEC_TESTS_FILTER_FILE: "${RSPEC_MATCHING_TESTS_PATH}" + needs: ["setup-test-env", "retrieve-tests-metadata", "compile-test-assets", "detect-tests"] + script: + - !reference [.base-script, script] + - rspec_paralellized_job "--tag ~quarantine --tag ~level:migration" + +.base-artifacts: + artifacts: + expire_in: 31d + when: always + paths: + - coverage/ + - crystalball/ + - deprecations/ + - knapsack/ + - rspec/ + - tmp/capybara/ + - log/*.log + reports: + junit: ${JUNIT_RESULT_FILE} + +.rspec-base-migration: + extends: + - .base-artifacts + - .rails:rules:ee-and-foss-migration + variables: + RSPEC_TESTS_FILTER_FILE: "${RSPEC_MATCHING_TESTS_PATH}" + script: + - !reference [.base-script, script] + - rspec_paralellized_job "--tag ~quarantine --tag level:migration" + +.rspec-base-pg11: + extends: + - .rspec-base + - .use-pg11 + +.rspec-base-pg12: + extends: + - .rspec-base + - .use-pg12 + +.rspec-base-pg12-as-if-foss: + extends: + - .rspec-base + - .as-if-foss + - .use-pg12 + needs: ["setup-test-env", "retrieve-tests-metadata", "compile-test-assets as-if-foss", "detect-tests"] + +.rspec-base-pg13: + extends: + - .rspec-base + - .use-pg13 + +.rspec-ee-base-pg11: + extends: + - .rspec-base + - .use-pg11-ee + +.rspec-ee-base-pg12: + extends: + - .rspec-base + - .use-pg12-ee + +.rspec-ee-base-pg12-es8: + extends: + - .rspec-base + - .use-pg12-es8-ee + - .rails:rules:run-search-tests + +.rspec-ee-base-pg12-opensearch1: + extends: + - .rspec-base + - .use-pg12-opensearch1-ee + - .rails:rules:run-search-tests + +.rspec-ee-base-pg13: + extends: + - .rspec-base + - .use-pg13-ee + +.db-job-base: + extends: + - .rails-job-base + - .rails:rules:ee-and-foss-migration + - .use-pg12 + stage: test + needs: ["setup-test-env"] +# rspec job base specs +###################### + +############################ +# rspec job parallel configs +.rspec-migration-parallel: + parallel: 12 + +.rspec-ee-migration-parallel: + parallel: 4 + +.rspec-unit-parallel: + parallel: 28 + +.rspec-ee-unit-parallel: + parallel: 18 + +.rspec-integration-parallel: + parallel: 12 + +.rspec-ee-integration-parallel: + parallel: 6 + +.rspec-system-parallel: + parallel: 28 + +.rspec-ee-system-parallel: + parallel: 10 +# rspec job parallel configs +############################ diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml index 47cf52b8816..a7c46bc181e 100644 --- a/.gitlab/ci/rules.gitlab-ci.yml +++ b/.gitlab/ci/rules.gitlab-ci.yml @@ -1692,7 +1692,7 @@ rules: - if: '$LICENSE_MANAGEMENT_DISABLED || $GITLAB_FEATURES !~ /\blicense_scanning\b/' when: never - - changes: *code-backstage-qa-patterns + - changes: *dependency-patterns ################ # Review rules # diff --git a/.gitlab/ci/setup.gitlab-ci.yml b/.gitlab/ci/setup.gitlab-ci.yml index 4f3111de2bf..7f9edd1650a 100644 --- a/.gitlab/ci/setup.gitlab-ci.yml +++ b/.gitlab/ci/setup.gitlab-ci.yml @@ -134,14 +134,17 @@ detect-tests: tooling/bin/find_changes ${RSPEC_CHANGED_FILES_PATH}; tooling/bin/find_tests ${RSPEC_CHANGED_FILES_PATH} ${RSPEC_MATCHING_TESTS_PATH}; tooling/bin/find_changes ${RSPEC_CHANGED_FILES_PATH} ${RSPEC_MATCHING_TESTS_PATH} ${FRONTEND_FIXTURES_MAPPING_PATH}; - echo "Changed files: $(cat $RSPEC_CHANGED_FILES_PATH)"; - echo "Related rspec tests: $(cat $RSPEC_MATCHING_TESTS_PATH)"; + filter_rspec_matched_foss_tests ${RSPEC_MATCHING_TESTS_PATH} ${RSPEC_MATCHING_TESTS_FOSS_PATH}; + echoinfo "Changed files: $(cat $RSPEC_CHANGED_FILES_PATH)"; + echoinfo "Related RSpec tests: $(cat $RSPEC_MATCHING_TESTS_PATH)"; + echoinfo "Related FOSS RSpec tests: $(cat $RSPEC_MATCHING_TESTS_FOSS_PATH)"; fi artifacts: expire_in: 7d paths: - ${RSPEC_CHANGED_FILES_PATH} - ${RSPEC_MATCHING_TESTS_PATH} + - ${RSPEC_MATCHING_TESTS_FOSS_PATH} - ${FRONTEND_FIXTURES_MAPPING_PATH} detect-previous-failed-tests: diff --git a/.rubocop_todo/layout/first_array_element_indentation.yml b/.rubocop_todo/layout/first_array_element_indentation.yml index 7b90488a5c4..cbe806fc16f 100644 --- a/.rubocop_todo/layout/first_array_element_indentation.yml +++ b/.rubocop_todo/layout/first_array_element_indentation.yml @@ -7,26 +7,6 @@ Layout/FirstArrayElementIndentation: - 'spec/lib/gitlab/search/found_blob_spec.rb' - 'spec/models/ci/runner_version_spec.rb' - 'spec/models/repository_spec.rb' - - 'spec/models/user_preference_spec.rb' - - 'spec/models/user_spec.rb' - - 'spec/models/wiki_directory_spec.rb' - - 'spec/policies/concerns/crud_policy_helpers_spec.rb' - - 'spec/presenters/ci/build_runner_presenter_spec.rb' - - 'spec/requests/api/ci/jobs_spec.rb' - - 'spec/requests/api/ci/runner/jobs_request_post_spec.rb' - - 'spec/requests/api/ci/runners_spec.rb' - - 'spec/requests/api/deploy_tokens_spec.rb' - - 'spec/requests/api/graphql/ci/config_spec.rb' - - 'spec/requests/api/graphql/ci/jobs_spec.rb' - - 'spec/requests/api/graphql/mutations/uploads/delete_spec.rb' - - 'spec/requests/api/graphql/project/cluster_agents_spec.rb' - - 'spec/requests/api/graphql/project/issue/designs/designs_spec.rb' - - 'spec/requests/api/graphql/project/milestones_spec.rb' - - 'spec/requests/api/graphql/usage_trends_measurements_spec.rb' - - 'spec/requests/api/graphql/work_item_spec.rb' - - 'spec/requests/api/issues/post_projects_issues_spec.rb' - - 'spec/requests/api/issues/put_projects_issues_spec.rb' - - 'spec/requests/api/merge_requests_spec.rb' - 'spec/requests/api/task_completion_status_spec.rb' - 'spec/services/security/merge_reports_service_spec.rb' - 'spec/simplecov_env.rb' diff --git a/Gemfile b/Gemfile index 4fd9a4f666d..b8388126048 100644 --- a/Gemfile +++ b/Gemfile @@ -220,7 +220,7 @@ gem 'acts-as-taggable-on', '~> 9.0' # Background jobs gem 'sidekiq', '~> 6.4.0' -gem 'sidekiq-cron', '~> 1.4.0' +gem 'sidekiq-cron', '~> 1.8.0' gem 'redis-namespace', '~> 1.9.0' gem 'gitlab-sidekiq-fetcher', '0.8.0', require: 'sidekiq-reliable-fetch' diff --git a/Gemfile.checksum b/Gemfile.checksum index 7e2020d6afe..623f88630e6 100644 --- a/Gemfile.checksum +++ b/Gemfile.checksum @@ -80,7 +80,7 @@ {"name":"colored2","version":"3.1.2","platform":"ruby","checksum":"b13c2bd7eeae2cf7356a62501d398e72fde78780bd26aec6a979578293c28b4a"}, {"name":"commonmarker","version":"0.23.6","platform":"ruby","checksum":"c8aeaaaff4ba497bf180f762db63a0069794fafb6eff221224c9c8199d337b38"}, {"name":"concurrent-ruby","version":"1.1.10","platform":"ruby","checksum":"244cb1ca0d91ec2c15ca2209507c39fb163336994428e16fbd3f465c87bd8e68"}, -{"name":"connection_pool","version":"2.2.5","platform":"ruby","checksum":"13a8fc3921ce4df8e04fb65f1037251decb08d74757b41163688bd1c1feccd39"}, +{"name":"connection_pool","version":"2.3.0","platform":"ruby","checksum":"677985be912f33c90f98f229aaa0c0ddb2ef8776f21929a36eeeb25251c944da"}, {"name":"contracts","version":"0.11.0","platform":"ruby","checksum":"df6e438efa89c31dd3095851c3f7a25dfdae36b35ff1d4547f1d92941b3c7286"}, {"name":"cork","version":"0.3.0","platform":"ruby","checksum":"a0a0ac50e262f8514d1abe0a14e95e71c98b24e3378690e5d044daf0013ad4bc"}, {"name":"cose","version":"1.0.0","platform":"ruby","checksum":"520ebaad97b56d2873de02ff4e2c973f5e77ce2f8edbda454af9ee3073643bc0"}, @@ -532,7 +532,7 @@ {"name":"shellany","version":"0.0.1","platform":"ruby","checksum":"0e127a9132698766d7e752e82cdac8250b6adbd09e6c0a7fbbb6f61964fedee7"}, {"name":"shoulda-matchers","version":"5.1.0","platform":"ruby","checksum":"a01d20589989e9653ab4a28c67d9db2b82bcf0a2496cf01d5e1a95a4aaaf5b07"}, {"name":"sidekiq","version":"6.4.2","platform":"ruby","checksum":"0d3c05fecb5fbace5ff5efc63da707e02a9c4673fb8e33ceca10b5ec0e9f062c"}, -{"name":"sidekiq-cron","version":"1.4.0","platform":"ruby","checksum":"21612ade25ea79b4eeb8eacd7fb559a85a1abf6bf1da1aca1aa0079cafd3376d"}, +{"name":"sidekiq-cron","version":"1.8.0","platform":"ruby","checksum":"47da72ca73ce5b71896aaf7e7c4391386ec517dd003f184c50c0b727d82eb0ca"}, {"name":"sigdump","version":"0.2.4","platform":"ruby","checksum":"0bf2176e55c1a262788623fe5ea57caddd6ba2abebe5e349d9d5e7c3a3010ed7"}, {"name":"signet","version":"0.17.0","platform":"ruby","checksum":"1d2831930dc28da32e34bec68cf7ded97ee2867b208f97c500ee293829cb0004"}, {"name":"simple_po_parser","version":"1.1.6","platform":"ruby","checksum":"122687d44d3de516a0e69e2f383a4180f5015e8c5ed5a7f2258f2b376f64cbf3"}, diff --git a/Gemfile.lock b/Gemfile.lock index e77619a2e27..77d1122e1eb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -288,7 +288,7 @@ GEM colored2 (3.1.2) commonmarker (0.23.6) concurrent-ruby (1.1.10) - connection_pool (2.2.5) + connection_pool (2.3.0) contracts (0.11.0) cork (0.3.0) colored2 (~> 3.1) @@ -1309,7 +1309,7 @@ GEM connection_pool (>= 2.2.2) rack (~> 2.0) redis (>= 4.2.0) - sidekiq-cron (1.4.0) + sidekiq-cron (1.8.0) fugit (~> 1) sidekiq (>= 4.2.1) sigdump (0.2.4) @@ -1779,7 +1779,7 @@ DEPENDENCIES settingslogic (~> 2.0.9) shoulda-matchers (~> 5.1.0) sidekiq (~> 6.4.0) - sidekiq-cron (~> 1.4.0) + sidekiq-cron (~> 1.8.0) sigdump (~> 0.2.4) simple_po_parser (~> 1.1.6) simplecov (~> 0.21) diff --git a/app/assets/javascripts/ci_variable_list/components/legacy_ci_variable_settings.vue b/app/assets/javascripts/ci_variable_list/components/legacy_ci_variable_settings.vue index 9acc9fbffb6..f1fe188348d 100644 --- a/app/assets/javascripts/ci_variable_list/components/legacy_ci_variable_settings.vue +++ b/app/assets/javascripts/ci_variable_list/components/legacy_ci_variable_settings.vue @@ -9,10 +9,10 @@ export default { LegacyCiVariableTable, }, computed: { - ...mapState(['isGroup']), + ...mapState(['isGroup', 'isProject']), }, mounted() { - if (!this.isGroup) { + if (this.isProject) { this.fetchEnvironments(); } }, diff --git a/app/assets/javascripts/ci_variable_list/index.js b/app/assets/javascripts/ci_variable_list/index.js index a55052b650a..1b69da9e086 100644 --- a/app/assets/javascripts/ci_variable_list/index.js +++ b/app/assets/javascripts/ci_variable_list/index.js @@ -81,6 +81,7 @@ const mountLegacyCiVariableListApp = (containerEl) => { endpoint, projectId, isGroup, + isProject, maskableRegex, protectedByDefault, awsLogoSvgPath, @@ -92,6 +93,8 @@ const mountLegacyCiVariableListApp = (containerEl) => { maskedEnvironmentVariablesLink, environmentScopeLink, } = containerEl.dataset; + + const parsedIsProject = parseBoolean(isProject); const parsedIsGroup = parseBoolean(isGroup); const isProtectedByDefault = parseBoolean(protectedByDefault); @@ -99,6 +102,7 @@ const mountLegacyCiVariableListApp = (containerEl) => { endpoint, projectId, isGroup: parsedIsGroup, + isProject: parsedIsProject, maskableRegex, isProtectedByDefault, awsLogoSvgPath, diff --git a/app/assets/javascripts/groups/components/transfer_group_form.vue b/app/assets/javascripts/groups/components/transfer_group_form.vue index 7e7282a27b0..e28459811d7 100644 --- a/app/assets/javascripts/groups/components/transfer_group_form.vue +++ b/app/assets/javascripts/groups/components/transfer_group_form.vue @@ -2,7 +2,7 @@ import { GlFormGroup } from '@gitlab/ui'; import { __, s__ } from '~/locale'; import ConfirmDanger from '~/vue_shared/components/confirm_danger/confirm_danger.vue'; -import NamespaceSelect from '~/vue_shared/components/namespace_select/namespace_select.vue'; +import NamespaceSelect from '~/vue_shared/components/namespace_select/namespace_select_deprecated.vue'; export const i18n = { confirmationMessage: __( diff --git a/app/assets/javascripts/import_entities/import_projects/components/advanced_settings.vue b/app/assets/javascripts/import_entities/import_projects/components/advanced_settings.vue new file mode 100644 index 00000000000..a8fdf9b9ec5 --- /dev/null +++ b/app/assets/javascripts/import_entities/import_projects/components/advanced_settings.vue @@ -0,0 +1,51 @@ + + diff --git a/app/assets/javascripts/import_entities/import_projects/components/import_projects_table.vue b/app/assets/javascripts/import_entities/import_projects/components/import_projects_table.vue index 848c7361601..97a7ed4bf55 100644 --- a/app/assets/javascripts/import_entities/import_projects/components/import_projects_table.vue +++ b/app/assets/javascripts/import_entities/import_projects/components/import_projects_table.vue @@ -9,10 +9,12 @@ import { import { mapActions, mapState, mapGetters } from 'vuex'; import { n__, __, sprintf } from '~/locale'; import ProviderRepoTableRow from './provider_repo_table_row.vue'; +import AdvancedSettings from './advanced_settings.vue'; export default { name: 'ImportProjectsTable', components: { + AdvancedSettings, ProviderRepoTableRow, GlLoadingIcon, GlButton, @@ -35,6 +37,24 @@ export default { required: false, default: false, }, + optionalStages: { + type: Array, + required: false, + default: () => [], + }, + isAdvancedSettingsPanelInitiallyExpanded: { + type: Boolean, + required: false, + default: true, + }, + }, + + data() { + return { + optionalStagesSelection: Object.fromEntries( + this.optionalStages.map(({ name }) => [name, false]), + ), + }; }, computed: { @@ -127,7 +147,7 @@ export default { modal-id="import-all-modal" :title="s__('ImportProjects|Import repositories')" :ok-title="__('Import')" - @ok="importAll" + @ok="importAll({ optionalStages: optionalStagesSelection })" > {{ n__( @@ -150,6 +170,13 @@ export default { /> +
@@ -171,6 +198,7 @@ export default { :repo="repo" :available-namespaces="namespaces" :user-namespace="defaultTargetNamespace" + :optional-stages="optionalStagesSelection" /> diff --git a/app/assets/javascripts/import_entities/import_projects/components/provider_repo_table_row.vue b/app/assets/javascripts/import_entities/import_projects/components/provider_repo_table_row.vue index e4090a378e1..458e0fb1cb1 100644 --- a/app/assets/javascripts/import_entities/import_projects/components/provider_repo_table_row.vue +++ b/app/assets/javascripts/import_entities/import_projects/components/provider_repo_table_row.vue @@ -43,6 +43,10 @@ export default { type: Array, required: true, }, + optionalStages: { + type: Object, + required: true, + }, }, computed: { @@ -177,7 +181,7 @@ export default { v-if="isImportNotStarted" type="button" data-qa-selector="import_button" - @click="fetchImport(repo.importSource.id)" + @click="fetchImport({ repoId: repo.importSource.id, optionalStages })" > {{ importButtonText }} diff --git a/app/assets/javascripts/import_entities/import_projects/index.js b/app/assets/javascripts/import_entities/import_projects/index.js index 5146a0eb461..4daa9e8a1b8 100644 --- a/app/assets/javascripts/import_entities/import_projects/index.js +++ b/app/assets/javascripts/import_entities/import_projects/index.js @@ -42,6 +42,7 @@ export function initPropsFromElement(element) { providerTitle: element.dataset.provider, filterable: parseBoolean(element.dataset.filterable), paginatable: parseBoolean(element.dataset.paginatable), + optionalStages: JSON.parse(element.dataset.optionalStages), }; } diff --git a/app/assets/javascripts/import_entities/import_projects/store/actions.js b/app/assets/javascripts/import_entities/import_projects/store/actions.js index cbdce96ab40..a30c14f9d28 100644 --- a/app/assets/javascripts/import_entities/import_projects/store/actions.js +++ b/app/assets/javascripts/import_entities/import_projects/store/actions.js @@ -43,11 +43,14 @@ const restartJobsPolling = () => { const setImportTarget = ({ commit }, { repoId, importTarget }) => commit(types.SET_IMPORT_TARGET, { repoId, importTarget }); -const importAll = ({ state, dispatch }) => { +const importAll = ({ state, dispatch }, config = {}) => { return Promise.all( - state.repositories - .filter(isProjectImportable) - .map((r) => dispatch('fetchImport', r.importSource.id)), + state.repositories.filter(isProjectImportable).map((r) => + dispatch('fetchImport', { + repoId: r.importSource.id, + optionalStages: config?.optionalStages, + }), + ), ); }; @@ -92,7 +95,10 @@ const fetchReposFactory = ({ reposPath = isRequired() }) => ({ state, commit }) }); }; -const fetchImportFactory = (importPath = isRequired()) => ({ state, commit, getters }, repoId) => { +const fetchImportFactory = (importPath = isRequired()) => ( + { state, commit, getters }, + { repoId, optionalStages }, +) => { const { ciCdOnly } = state; const importTarget = getters.getImportTarget(repoId); @@ -105,6 +111,7 @@ const fetchImportFactory = (importPath = isRequired()) => ({ state, commit, gett ci_cd_only: ciCdOnly, new_name: newName, target_namespace: targetNamespace, + ...(Object.keys(optionalStages).length ? { optional_stages: optionalStages } : {}), }) .then(({ data }) => { commit(types.RECEIVE_IMPORT_SUCCESS, { diff --git a/app/assets/javascripts/pipeline_schedules/components/pipeline_schedules.vue b/app/assets/javascripts/pipeline_schedules/components/pipeline_schedules.vue index d3e8e80054c..3e49aeb808e 100644 --- a/app/assets/javascripts/pipeline_schedules/components/pipeline_schedules.vue +++ b/app/assets/javascripts/pipeline_schedules/components/pipeline_schedules.vue @@ -1,9 +1,16 @@ diff --git a/app/assets/javascripts/projects/settings/components/transfer_project_form.vue b/app/assets/javascripts/projects/settings/components/transfer_project_form.vue index 8299efed0a4..55420c9c732 100644 --- a/app/assets/javascripts/projects/settings/components/transfer_project_form.vue +++ b/app/assets/javascripts/projects/settings/components/transfer_project_form.vue @@ -2,7 +2,7 @@ import { GlFormGroup, GlAlert } from '@gitlab/ui'; import { debounce } from 'lodash'; import ConfirmDanger from '~/vue_shared/components/confirm_danger/confirm_danger.vue'; -import NamespaceSelect from '~/vue_shared/components/namespace_select/namespace_select.vue'; +import NamespaceSelect from '~/vue_shared/components/namespace_select/namespace_select_deprecated.vue'; import { getIdFromGraphQLId } from '~/graphql_shared/utils'; import { getTransferLocations } from '~/api/projects_api'; import { parseIntPagination, normalizeHeaders } from '~/lib/utils/common_utils'; diff --git a/app/assets/javascripts/runner/admin_runners/admin_runners_app.vue b/app/assets/javascripts/runner/admin_runners/admin_runners_app.vue index 74656a4fcd8..34c44321a9b 100644 --- a/app/assets/javascripts/runner/admin_runners/admin_runners_app.vue +++ b/app/assets/javascripts/runner/admin_runners/admin_runners_app.vue @@ -119,11 +119,6 @@ export default { upgradeStatusTokenConfig, ]; }, - isBulkDeleteEnabled() { - // Feature flag: admin_runners_bulk_delete - // Rollout issue: https://gitlab.com/gitlab-org/gitlab/-/issues/353981 - return this.glFeatures.adminRunnersBulkDelete; - }, isSearchFiltered() { return isSearchFiltered(this.search); }, @@ -216,18 +211,14 @@ export default { :filtered-svg-path="emptyStateFilteredSvgPath" />