diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-02 12:14:26 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-02 12:14:26 +0000 |
commit | ce459835cb32ed396fb7524fb615a5d07f8c51ef (patch) | |
tree | bc56e024828f25d53f8b713b4d8f6393b8755112 | |
parent | 374f3dee7dc0fae10a34daf503b8bf3078008f4b (diff) | |
download | gitlab-ce-ce459835cb32ed396fb7524fb615a5d07f8c51ef.tar.gz |
Add latest changes from gitlab-org/gitlab@master
33 files changed, 134 insertions, 119 deletions
diff --git a/.gitlab/ci/frontend.gitlab-ci.yml b/.gitlab/ci/frontend.gitlab-ci.yml index 2e0d83187cf..ec7c87a6203 100644 --- a/.gitlab/ci/frontend.gitlab-ci.yml +++ b/.gitlab/ci/frontend.gitlab-ci.yml @@ -141,6 +141,19 @@ rspec-all frontend_fixture as-if-foss: - !reference [.frontend-fixtures-base, needs] - "compile-test-assets as-if-foss" +upload-frontend-fixtures: + extends: + - .frontend-fixtures-base + - .frontend:rules:upload-frontend-fixtures + stage: fixtures + needs: ["rspec-all frontend_fixture"] + script: + - source scripts/gitlab_component_helpers.sh + - 'fixtures_archive_doesnt_exist || { echoinfo "INFO: Exiting early as package exists."; exit 0; }' + - run_timed_command "create_fixtures_package" + - run_timed_command "upload_fixtures_package" + artifacts: {} + graphql-schema-dump: variables: SETUP_DB: "false" diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml index 69e846440c3..6a05bd84830 100644 --- a/.gitlab/ci/rules.gitlab-ci.yml +++ b/.gitlab/ci/rules.gitlab-ci.yml @@ -989,6 +989,20 @@ - <<: *if-merge-request changes: *frontend-patterns-for-as-if-foss +.frontend:rules:upload-frontend-fixtures: + rules: + # The new strategy to upload fixtures as generic packages is experimental and can be disabled by removing the `REUSE_FRONTEND_FIXTURES_ENABLED` variable + - if: '$REUSE_FRONTEND_FIXTURES_ENABLED != "true"' + when: never + - <<: *if-dot-com-gitlab-org-default-branch + changes: *code-backstage-patterns + - <<: *if-dot-com-gitlab-org-merge-request + changes: + - ".gitlab/ci/frontend.gitlab-ci.yml" + - "scripts/gitlab_component_helpers.sh" + when: manual + allow_failure: true + .frontend:rules:jest: rules: - <<: *if-fork-merge-request diff --git a/.rubocop_todo/rake/require.yml b/.rubocop_todo/rake/require.yml index 339a2018d19..04a474b5fe7 100644 --- a/.rubocop_todo/rake/require.yml +++ b/.rubocop_todo/rake/require.yml @@ -8,8 +8,6 @@ Rake/Require: - 'lib/tasks/gitlab/metrics_exporter.rake' - 'lib/tasks/gitlab/openapi.rake' - 'lib/tasks/gitlab/packages/events.rake' - - 'lib/tasks/gitlab/packages/migrate.rake' - - 'lib/tasks/gitlab/pages.rake' - 'lib/tasks/gitlab/refresh_project_statistics_build_artifacts_size.rake' - 'lib/tasks/tokens.rake' - 'qa/tasks/webdrivers.rake' diff --git a/app/assets/javascripts/invite_members/components/invite_members_modal.vue b/app/assets/javascripts/invite_members/components/invite_members_modal.vue index 607c888b85a..812e39e6392 100644 --- a/app/assets/javascripts/invite_members/components/invite_members_modal.vue +++ b/app/assets/javascripts/invite_members/components/invite_members_modal.vue @@ -51,6 +51,8 @@ export default { MembersTokenSelect, ModalConfetti, UserLimitNotification, + ActiveTrialNotification: () => + import('ee_component/invite_members/components/active_trial_notification.vue'), }, mixins: [Tracking.mixin({ category: INVITE_MEMBER_MODAL_TRACKING_CATEGORY })], inject: ['newProjectPath'], @@ -421,7 +423,6 @@ export default { :new-users-to-invite="newUsersToInvite" :root-group-id="rootId" :users-limit-dataset="usersLimitDataset" - :active-trial-dataset="activeTrialDataset" :full-path="fullPath" @close="onClose" @cancel="onCancel" @@ -504,6 +505,10 @@ export default { </div> </template> + <template #active-trial-alert> + <active-trial-notification v-if="!isCelebration" :active-trial-dataset="activeTrialDataset" /> + </template> + <template #select="{ exceptionState, inputId }"> <members-token-select v-model="newUsersToInvite" diff --git a/app/services/ci/job_artifacts/destroy_all_expired_service.rb b/app/services/ci/job_artifacts/destroy_all_expired_service.rb index b5dd5b843c6..30683475ad2 100644 --- a/app/services/ci/job_artifacts/destroy_all_expired_service.rb +++ b/app/services/ci/job_artifacts/destroy_all_expired_service.rb @@ -25,11 +25,7 @@ module Ci # which is scheduled every 7 minutes. def execute in_lock(EXCLUSIVE_LOCK_KEY, ttl: LOCK_TIMEOUT, retries: 1) do - if ::Feature.enabled?(:ci_destroy_unlocked_job_artifacts) - destroy_unlocked_job_artifacts - else - destroy_job_artifacts_with_slow_iteration - end + destroy_unlocked_job_artifacts end @removed_artifacts_count @@ -45,20 +41,6 @@ module Ci end end - def destroy_job_artifacts_with_slow_iteration - Ci::JobArtifact.expired_before(@start_at).each_batch(of: BATCH_SIZE, column: :expire_at, order: :desc) do |relation, index| - # For performance reasons, join with ci_pipelines after the batch is queried. - # See: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/47496 - artifacts = relation.unlocked - - service_response = destroy_batch(artifacts) - @removed_artifacts_count += service_response[:destroyed_artifacts_count] - - break if loop_timeout? - break if index >= LOOP_LIMIT - end - end - def destroy_batch(artifacts) Ci::JobArtifacts::DestroyBatchService.new(artifacts, skip_projects_on_refresh: true).execute end diff --git a/config/feature_flags/development/ci_destroy_unlocked_job_artifacts.yml b/config/feature_flags/development/ci_destroy_unlocked_job_artifacts.yml deleted file mode 100644 index eba1c4ead3b..00000000000 --- a/config/feature_flags/development/ci_destroy_unlocked_job_artifacts.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: ci_destroy_unlocked_job_artifacts -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/72406 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/338165 -milestone: '14.5' -type: development -group: group::pipeline insights -default_enabled: true diff --git a/config/feature_flags/development/enable_environments_search_within_folder.yml b/config/feature_flags/development/enable_environments_search_within_folder.yml index a03b31ffbfc..18edc467293 100644 --- a/config/feature_flags/development/enable_environments_search_within_folder.yml +++ b/config/feature_flags/development/enable_environments_search_within_folder.yml @@ -4,5 +4,5 @@ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/102227/ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/382108 milestone: '15.7' type: development -group: group::release +group: group::configure default_enabled: true diff --git a/config/feature_flags/development/environment_details_vue.yml b/config/feature_flags/development/environment_details_vue.yml index 5a647f65a7a..c757329c271 100644 --- a/config/feature_flags/development/environment_details_vue.yml +++ b/config/feature_flags/development/environment_details_vue.yml @@ -4,5 +4,5 @@ introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/105527 rollout_issue_url: "https://gitlab.com/gitlab-org/gitlab/-/issues/384914" milestone: '15.7' type: development -group: group::release +group: group::configure default_enabled: false diff --git a/config/feature_flags/development/environment_search_api_min_chars.yml b/config/feature_flags/development/environment_search_api_min_chars.yml index 2d719a41cd0..4df65792218 100644 --- a/config/feature_flags/development/environment_search_api_min_chars.yml +++ b/config/feature_flags/development/environment_search_api_min_chars.yml @@ -4,5 +4,5 @@ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/108277 rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/387244 milestone: '15.8' type: development -group: group::release +group: group::configure default_enabled: false diff --git a/config/feature_flags/development/environments_search_logging.yml b/config/feature_flags/development/environments_search_logging.yml index 76f6c78154b..c4cb6036d3a 100644 --- a/config/feature_flags/development/environments_search_logging.yml +++ b/config/feature_flags/development/environments_search_logging.yml @@ -4,5 +4,5 @@ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/107866 rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/386778 milestone: '15.8' type: development -group: group::release +group: group::configure default_enabled: false diff --git a/config/feature_flags/development/multiple_environment_approval_rules_fe.yml b/config/feature_flags/development/multiple_environment_approval_rules_fe.yml index c282313f409..d97c6114a67 100644 --- a/config/feature_flags/development/multiple_environment_approval_rules_fe.yml +++ b/config/feature_flags/development/multiple_environment_approval_rules_fe.yml @@ -4,5 +4,5 @@ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/105719 rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/384334 milestone: '15.7' type: development -group: group::release +group: group::configure default_enabled: false diff --git a/config/feature_flags/development/validate_environment_tier_presence.yml b/config/feature_flags/development/validate_environment_tier_presence.yml index 78593e338a4..5cc16b36f19 100644 --- a/config/feature_flags/development/validate_environment_tier_presence.yml +++ b/config/feature_flags/development/validate_environment_tier_presence.yml @@ -3,5 +3,5 @@ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/111011 rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/391293 milestone: '15.9' type: development -group: group::release +group: group::configure default_enabled: true diff --git a/config/routes.rb b/config/routes.rb index c951934c933..589d44c3de6 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -88,6 +88,7 @@ InitializerConnections.raise_if_new_database_connection do # JSON Web Token get 'jwt/auth' => 'jwt#auth' + post 'jwt/auth', to: proc { [404, {}, ['']] } # Health check get 'health_check(/:checks)' => 'health_check#index', as: :health_check diff --git a/data/removals/16_0/16-0-remove-embed-grafana-panels-in-markdown.yml b/data/removals/16_0/16-0-remove-embed-grafana-panels-in-markdown.yml deleted file mode 100644 index 6b6c1ec4c75..00000000000 --- a/data/removals/16_0/16-0-remove-embed-grafana-panels-in-markdown.yml +++ /dev/null @@ -1,15 +0,0 @@ -- title: "Embedding Grafana panels in Markdown is removed" - announcement_milestone: "15.9" - announcement_date: "2023-02-22" - removal_milestone: "16.0" - removal_date: "2023-05-22" - breaking_change: true - reporter: abellucci - stage: monitor - issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/389477 - body: | - The ability to add Grafana panels in GitLab Flavored Markdown is removed. - We intend to replace this feature with the ability to [embed charts](https://gitlab.com/groups/gitlab-org/opstrace/-/epics/33) - with the [GitLab Observability UI](https://gitlab.com/gitlab-org/opstrace/opstrace-ui). - tiers: [Free, Silver, Gold, Core, Premium, Ultimate] - documentation_url: https://docs.gitlab.com/ee/operations/metrics/embed_grafana.html#embed-grafana-panels-in-markdown-deprecated diff --git a/db/post_migrate/20221102231130_finalize_backfill_user_details_fields.rb b/db/post_migrate/20221102231130_finalize_backfill_user_details_fields.rb index 0ce8f260d06..a6b5bdd307e 100644 --- a/db/post_migrate/20221102231130_finalize_backfill_user_details_fields.rb +++ b/db/post_migrate/20221102231130_finalize_backfill_user_details_fields.rb @@ -8,6 +8,10 @@ class FinalizeBackfillUserDetailsFields < Gitlab::Database::Migration[2.0] restrict_gitlab_migration gitlab_schema: :gitlab_main def up + # If the 20230116160904_remove_user_details_fields_from_user.rb migration already ran, + # finalizing this background migration will fail. + return unless column_exists?(:users, :linkedin) + ensure_batched_background_migration_is_finished( job_class_name: BACKFILL_MIGRATION, table_name: :users, diff --git a/doc/integration/jira/connect-app.md b/doc/integration/jira/connect-app.md index 402efc409cb..a4c164defe7 100644 --- a/doc/integration/jira/connect-app.md +++ b/doc/integration/jira/connect-app.md @@ -117,7 +117,7 @@ Jira apps can only link to one URL per marketplace listing. The official listing If your instance doesn't meet the prerequisites or you don't want to use the official marketplace listing, you can [install the app manually](#install-the-gitlab-for-jira-cloud-app-manually). -It's not possible to create branches from Jira for self-managed instances. +It's not possible to create branches from Jira for self-managed instances. For more information, see [issue 391432](https://gitlab.com/gitlab-org/gitlab/-/issues/391432). ### Set up your instance diff --git a/doc/subscriptions/gitlab_com/index.md b/doc/subscriptions/gitlab_com/index.md index ef1b6ae7f6f..cd36e426852 100644 --- a/doc/subscriptions/gitlab_com/index.md +++ b/doc/subscriptions/gitlab_com/index.md @@ -171,13 +171,13 @@ The user must not be assigned any other role, anywhere in the instance. - If your project is public, all users, including those with the Guest role can access your project. -### Add users to your subscription +### Add seats to your subscription Your subscription cost is based on the maximum number of seats you use during the billing period. Even if you reach the number of seats in your subscription, you can continue to add users. GitLab [bills you for the overage](../quarterly_reconciliation.md). -To add users to a subscription: +To add seats to a subscription: 1. Log in to the [Customers Portal](https://customers.gitlab.com/). 1. Navigate to the **Manage Purchases** page. diff --git a/doc/update/removals.md b/doc/update/removals.md index a83b10142a9..110a3ee29e8 100644 --- a/doc/update/removals.md +++ b/doc/update/removals.md @@ -34,18 +34,6 @@ For removal reviewers (Technical Writers only): https://about.gitlab.com/handbook/marketing/blog/release-posts/#update-the-removals-doc --> -## Removed in 16.0 - -### Embedding Grafana panels in Markdown is removed - -WARNING: -This is a [breaking change](https://docs.gitlab.com/ee/development/deprecation_guidelines/). -Review the details carefully before upgrading. - -The ability to add Grafana panels in GitLab Flavored Markdown is removed. -We intend to replace this feature with the ability to [embed charts](https://gitlab.com/groups/gitlab-org/opstrace/-/epics/33) -with the [GitLab Observability UI](https://gitlab.com/gitlab-org/opstrace/opstrace-ui). - ## Removed in 15.9 ### Live Preview no longer available in the Web IDE diff --git a/lib/gitlab/regex.rb b/lib/gitlab/regex.rb index 4d15ac99277..84f7338a9ce 100644 --- a/lib/gitlab/regex.rb +++ b/lib/gitlab/regex.rb @@ -265,7 +265,7 @@ module Gitlab # eg 'source/full/path' or 'destination_namespace' not 'https://example.com/destination/namespace/path' # the regex also allows for an empty string ('') to be accepted as this is allowed in # a bulk_import POST request - @bulk_import_destination_namespace_path_regex ||= %r/((\A\z)|\A([.]?)[^\W](\/?[.]?[0-9a-z][-_]*)+\z)/i + @bulk_import_destination_namespace_path_regex ||= %r/((\A\z)|\A([.]?)\w*([0-9a-z][-_]*)(\/?[.]?[0-9a-z][-_]*)+\z)/i end def bulk_import_source_full_path_regex diff --git a/lib/support/nginx/gitlab-pages-ssl b/lib/support/nginx/gitlab-pages-ssl index 900d91e0575..a883d151a96 100644 --- a/lib/support/nginx/gitlab-pages-ssl +++ b/lib/support/nginx/gitlab-pages-ssl @@ -38,8 +38,10 @@ server { ssl_session_cache shared:SSL:10m; ssl_session_tickets off; - ssl_protocols TLSv1.2 TLSv1.3; - ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384; + # These settings are in line with the modern settings from https://ssl-config.mozilla.org/ + # and are supported by all still-supported browsers since 2019. If you have specific needs + # for older settings, please consult the intermediate settings there. + ssl_protocols TLSv1.3; ssl_prefer_server_ciphers off; ## See app/controllers/application_controller.rb for headers set @@ -53,11 +55,6 @@ server { # ssl_stapling_verify on; # ssl_trusted_certificate /etc/nginx/ssl/stapling.trusted.crt; - ## [Optional] Generate a stronger DHE parameter: - ## sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 4096 - ## - # ssl_dhparam /etc/ssl/certs/dhparam.pem; - ## [Optional] Enable HTTP Strict Transport Security # add_header Strict-Transport-Security "max-age=63072000; includeSubDomains"; diff --git a/lib/support/nginx/gitlab-ssl b/lib/support/nginx/gitlab-ssl index 435b9055929..23d504736e6 100644 --- a/lib/support/nginx/gitlab-ssl +++ b/lib/support/nginx/gitlab-ssl @@ -97,8 +97,10 @@ server { ssl_session_cache shared:SSL:10m; ssl_session_tickets off; - ssl_protocols TLSv1.2 TLSv1.3; - ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384; + # These settings are in line with the modern settings from https://ssl-config.mozilla.org/ + # and are supported by all still-supported browsers since 2019. If you have specific needs + # for older settings, please consult the intermediate settings there. + ssl_protocols TLSv1.3; ssl_prefer_server_ciphers off; ## See app/controllers/application_controller.rb for headers set @@ -114,11 +116,6 @@ server { # resolver 208.67.222.222 208.67.222.220 valid=300s; # Can change to your DNS resolver if desired # resolver_timeout 5s; - ## [Optional] Generate a stronger DHE parameter: - ## sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 4096 - ## - # ssl_dhparam /etc/ssl/certs/dhparam.pem; - ## [Optional] Enable HTTP Strict Transport Security # add_header Strict-Transport-Security "max-age=63072000; includeSubDomains"; diff --git a/lib/support/nginx/registry-ssl b/lib/support/nginx/registry-ssl index be16037629b..50ecb855e24 100644 --- a/lib/support/nginx/registry-ssl +++ b/lib/support/nginx/registry-ssl @@ -34,15 +34,12 @@ server { ssl_session_cache shared:SSL:10m; ssl_session_tickets off; - ssl_protocols TLSv1.2 TLSv1.3; - ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384; + # These settings are in line with the modern settings from https://ssl-config.mozilla.org/ + # and are supported by all still-supported browsers since 2019. If you have specific needs + # for older settings, please consult the intermediate settings there. + ssl_protocols TLSv1.3; ssl_prefer_server_ciphers off; - ## [Optional] Generate a stronger DHE parameter: - ## sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 4096 - ## - # ssl_dhparam /etc/ssl/certs/dhparam.pem; - ## [Optional] Enable HTTP Strict Transport Security # add_header Strict-Transport-Security "max-age=63072000; includeSubDomains"; diff --git a/lib/tasks/gitlab/packages/migrate.rake b/lib/tasks/gitlab/packages/migrate.rake index 1c28f4308a2..737788583ae 100644 --- a/lib/tasks/gitlab/packages/migrate.rake +++ b/lib/tasks/gitlab/packages/migrate.rake @@ -1,11 +1,11 @@ # frozen_string_literal: true -require 'logger' - desc "GitLab | Packages | Migrate packages files to remote storage" namespace :gitlab do namespace :packages do task migrate: :environment do + require 'logger' + logger = Logger.new($stdout) logger.info('Starting transfer of package files to object storage') diff --git a/lib/tasks/gitlab/pages.rake b/lib/tasks/gitlab/pages.rake index e6fde28e38f..ecfb163f284 100644 --- a/lib/tasks/gitlab/pages.rake +++ b/lib/tasks/gitlab/pages.rake @@ -1,11 +1,11 @@ # frozen_string_literal: true -require 'logger' - namespace :gitlab do namespace :pages do namespace :deployments do task migrate_to_object_storage: :gitlab_environment do + require 'logger' + logger = Logger.new($stdout) helper = Gitlab::LocalAndRemoteStorageMigration::PagesDeploymentMigrater.new(logger) diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/maven/maven_group_level_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/maven/maven_group_level_spec.rb index 363ed7eb508..92b0466919c 100644 --- a/qa/qa/specs/features/browser_ui/5_package/package_registry/maven/maven_group_level_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/maven/maven_group_level_spec.rb @@ -282,7 +282,11 @@ module QA it( 'uses GitLab as a mirror of the central proxy', :skip_live_env, - testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/375988' + testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/375988', + quarantine: { + type: :investigating, + issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/378221' + } ) do Support::Retrier.retry_on_exception(max_attempts: 3, sleep_interval: 2) do Resource::Repository::Commit.fabricate_via_api! do |commit| diff --git a/scripts/api/base.rb b/scripts/api/base.rb index 4872ede253d..972b461a09a 100644 --- a/scripts/api/base.rb +++ b/scripts/api/base.rb @@ -8,7 +8,7 @@ class Base @project = options.fetch(:project) # If api_token is nil, it's set to '' to allow unauthenticated requests (for forks). - api_token = options.fetch(:api_token, '') + api_token = options[:api_token] || '' warn "No API token given." if api_token.empty? diff --git a/scripts/gitlab_component_helpers.sh b/scripts/gitlab_component_helpers.sh index c46dbb57a58..309e339de01 100644 --- a/scripts/gitlab_component_helpers.sh +++ b/scripts/gitlab_component_helpers.sh @@ -51,6 +51,24 @@ export GITLAB_ASSETS_HASH="${GITLAB_ASSETS_HASH:-"NO_HASH"}" export GITLAB_ASSETS_PACKAGE="assets-${NODE_ENV}-${GITLAB_EDITION}-${GITLAB_ASSETS_HASH}-${GITLAB_ASSETS_PACKAGE_VERSION}.tar.gz" export GITLAB_ASSETS_PACKAGE_URL="${API_PACKAGES_BASE_URL}/assets/${NODE_ENV}-${GITLAB_EDITION}-${GITLAB_ASSETS_HASH}/${GITLAB_ASSETS_PACKAGE}" +# Fixtures constants + +# Export the SHA variable for updating/downloading fixture packages, using the following order of precedence: +# 1. If MERGE_BASE_SHA is defined, use its value. +# 2. If CI_MERGE_REQUEST_SOURCE_BRANCH_SHA is defined, use its value for merge request pipelines. +# 3. Otherwise, use the value of CI_COMMIT_SHA for default branch pipelines or merge requests with detached pipelines. +if [ -n "${MERGE_BASE_SHA:-}" ]; then + export FIXTURES_SHA="${MERGE_BASE_SHA}" +elif [ -n "${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA:-}" ]; then + export FIXTURES_SHA="${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA}" +else + export FIXTURES_SHA="${CI_COMMIT_SHA}" +fi + +export FIXTURES_PATH="tmp/tests/frontend/**/*" +export FIXTURES_PACKAGE="fixtures-${FIXTURES_SHA}.tar.gz" +export FIXTURES_PACKAGE_URL="${API_PACKAGES_BASE_URL}/fixtures/${FIXTURES_SHA}/${FIXTURES_PACKAGE}" + # Generic helper functions function archive_doesnt_exist() { local package_url="${1}" @@ -147,3 +165,16 @@ function create_gitlab_assets_package() { function upload_gitlab_assets_package() { upload_package "${GITLAB_ASSETS_PACKAGE}" "${GITLAB_ASSETS_PACKAGE_URL}" } + +# Fixtures functions +function fixtures_archive_doesnt_exist() { + archive_doesnt_exist "${FIXTURES_PACKAGE_URL}" +} + +function create_fixtures_package() { + create_package "${FIXTURES_PACKAGE}" "${FIXTURES_PATH}" +} + +function upload_fixtures_package() { + upload_package "${FIXTURES_PACKAGE}" "${FIXTURES_PACKAGE_URL}" +} diff --git a/spec/features/projects/jobs_spec.rb b/spec/features/projects/jobs_spec.rb index a57476f8b88..07b8f8339eb 100644 --- a/spec/features/projects/jobs_spec.rb +++ b/spec/features/projects/jobs_spec.rb @@ -1071,7 +1071,7 @@ RSpec.describe 'Jobs', :clean_gitlab_redis_shared_state, feature_category: :proj create(:ci_job_artifact, :archive, file: artifacts_file, job: job2) end - it do + it 'receive 404 from download request', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/391632' do requests = inspect_requests { visit other_job_download_path } request = requests.find { |request| request.url == other_job_download_path } diff --git a/spec/frontend/invite_members/components/invite_members_modal_spec.js b/spec/frontend/invite_members/components/invite_members_modal_spec.js index 41ffe9b92c9..c1677f8366c 100644 --- a/spec/frontend/invite_members/components/invite_members_modal_spec.js +++ b/spec/frontend/invite_members/components/invite_members_modal_spec.js @@ -73,6 +73,7 @@ describe('InviteMembersModal', () => { wrapper = shallowMountExtended(InviteMembersModal, { provide: { newProjectPath, + name: propsData.name, }, propsData: { usersLimitDataset: {}, diff --git a/spec/lib/gitlab/regex_spec.rb b/spec/lib/gitlab/regex_spec.rb index caca33704dd..19a6735e439 100644 --- a/spec/lib/gitlab/regex_spec.rb +++ b/spec/lib/gitlab/regex_spec.rb @@ -110,6 +110,8 @@ RSpec.describe Gitlab::Regex, feature_category: :tooling do it { is_expected.to match('.source/.full/.path') } it { is_expected.to match('domain_namespace') } it { is_expected.to match('gitlab-migration-test') } + it { is_expected.to match('1-project-path') } + it { is_expected.to match('e-project-path') } it { is_expected.to match('') } # it is possible to pass an empty string for destination_namespace in bulk_import POST request end diff --git a/spec/migrations/20221102231130_finalize_backfill_user_details_fields_spec.rb b/spec/migrations/20221102231130_finalize_backfill_user_details_fields_spec.rb index 7ad9f4ed156..37bff128edd 100644 --- a/spec/migrations/20221102231130_finalize_backfill_user_details_fields_spec.rb +++ b/spec/migrations/20221102231130_finalize_backfill_user_details_fields_spec.rb @@ -58,6 +58,22 @@ RSpec.describe FinalizeBackfillUserDetailsFields, :migration, feature_category: end end + context 'when users.linkedin column has already been dropped' do + before do + table(:users).create!(id: 1, email: 'author@example.com', username: 'author', projects_limit: 10) + ActiveRecord::Base.connection.execute("ALTER TABLE users DROP COLUMN linkedin") + migration_record.update_column(:status, 1) + end + + after do + ActiveRecord::Base.connection.execute("ALTER TABLE users ADD COLUMN linkedin text DEFAULT '' NOT NULL") + end + + it 'does not raise exception' do + expect { migrate! }.not_to raise_error + end + end + context 'with different migration statuses', :redis do using RSpec::Parameterized::TableSyntax diff --git a/spec/requests/jwt_controller_spec.rb b/spec/requests/jwt_controller_spec.rb index 1b91c04b5d9..69127a7526e 100644 --- a/spec/requests/jwt_controller_spec.rb +++ b/spec/requests/jwt_controller_spec.rb @@ -53,6 +53,14 @@ RSpec.describe JwtController, feature_category: :system_access do end end + context 'POST /jwt/auth' do + it 'returns 404' do + post '/jwt/auth' + + expect(response).to have_gitlab_http_status(:not_found) + end + end + context 'authenticating against container registry' do context 'existing service' do subject! { get '/jwt/auth', params: parameters } diff --git a/spec/services/ci/job_artifacts/destroy_all_expired_service_spec.rb b/spec/services/ci/job_artifacts/destroy_all_expired_service_spec.rb index 457be67c1ea..07e76f65232 100644 --- a/spec/services/ci/job_artifacts/destroy_all_expired_service_spec.rb +++ b/spec/services/ci/job_artifacts/destroy_all_expired_service_spec.rb @@ -39,32 +39,12 @@ feature_category: :build_artifacts do second_artifact end - context 'with ci_destroy_unlocked_job_artifacts feature flag disabled' do - before do - stub_feature_flags(ci_destroy_unlocked_job_artifacts: false) - end - - it 'performs a consistent number of queries' do - control = ActiveRecord::QueryRecorder.new { service.execute } - - more_artifacts - - expect { subject }.not_to exceed_query_limit(control.count) - end - end - - context 'with ci_destroy_unlocked_job_artifacts feature flag enabled' do - before do - stub_feature_flags(ci_destroy_unlocked_job_artifacts: true) - end - - it 'performs a consistent number of queries' do - control = ActiveRecord::QueryRecorder.new { service.execute } + it 'performs a consistent number of queries' do + control = ActiveRecord::QueryRecorder.new { service.execute } - more_artifacts + more_artifacts - expect { subject }.not_to exceed_query_limit(control.count) - end + expect { subject }.not_to exceed_query_limit(control.count) end end |