diff options
49 files changed, 364 insertions, 165 deletions
diff --git a/.rubocop.yml b/.rubocop.yml index 8416653d677..6db777dbc58 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -604,6 +604,8 @@ Rails/TimeZone: - 'ee/spec/workers/**/*' - 'ee/lib/**/*' - 'ee/spec/lib/**/*' + - 'spec/features/**/*' + - 'ee/spec/features/**/*' # WIP: See https://gitlab.com/gitlab-org/gitlab/-/issues/220040 Rails/SaveBang: diff --git a/Gemfile.lock b/Gemfile.lock index 81bf21f2176..2dcfa78394b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -238,6 +238,7 @@ GEM danger gitlab (~> 4.2, >= 4.2.0) database_cleaner (1.7.0) + dead_end (3.1.1) deckar01-task_list (2.3.1) html-pipeline declarative (0.0.20) @@ -247,13 +248,15 @@ GEM activerecord (>= 3.2.0, < 7.0) deprecation_toolkit (1.5.1) activesupport (>= 4.2) - derailed_benchmarks (1.8.1) + derailed_benchmarks (2.1.1) benchmark-ips (~> 2) + dead_end get_process_mem (~> 0) heapy (~> 0) - memory_profiler (~> 0) - mini_histogram (>= 0.2.1) + memory_profiler (>= 0, < 2) + mini_histogram (>= 0.3.0) rack (>= 1) + rack-test rake (> 10, < 14) ruby-statistics (>= 2.1) thor (>= 0.19, < 2) @@ -372,7 +375,7 @@ GEM fast_blank (1.0.0) fast_gettext (2.1.0) ffaker (2.10.0) - ffi (1.15.3) + ffi (1.15.5) ffi-compiler (1.0.1) ffi (>= 1.0.0) rake @@ -435,7 +438,7 @@ GEM ruby-progressbar (~> 1.4) fuzzyurl (0.9.0) gemoji (3.0.1) - get_process_mem (0.2.5) + get_process_mem (0.2.7) ffi (~> 1.0) gettext (3.3.6) locale (>= 2.0.5) @@ -1125,7 +1128,7 @@ GEM ruby-saml (1.13.0) nokogiri (>= 1.10.5) rexml - ruby-statistics (2.1.2) + ruby-statistics (3.0.0) ruby2_keywords (0.0.4) ruby_parser (3.15.0) sexp_processor (~> 4.9) @@ -1263,7 +1266,7 @@ GEM daemons (~> 1.0, >= 1.0.9) eventmachine (~> 1.0, >= 1.0.4) rack (>= 1, < 3) - thor (1.1.0) + thor (1.2.1) thrift (0.14.0) tilt (2.0.10) timecop (0.9.1) diff --git a/app/assets/javascripts/editor/extensions/source_editor_ci_schema_ext.js b/app/assets/javascripts/editor/extensions/source_editor_ci_schema_ext.js index 0290bb84b5f..b41eae88c54 100644 --- a/app/assets/javascripts/editor/extensions/source_editor_ci_schema_ext.js +++ b/app/assets/javascripts/editor/extensions/source_editor_ci_schema_ext.js @@ -14,7 +14,7 @@ export class CiSchemaExtension { // to fetch schema files, hence the `gon.gitlab_url` // reference. This prevents error: // "Failed to execute 'fetch' on 'WorkerGlobalScope'" - const absoluteSchemaUrl = gon.gitlab_url + ciSchemaPath; + const absoluteSchemaUrl = new URL(ciSchemaPath, gon.gitlab_url).href; const modelFileName = instance.getModel().uri.path.split('/').pop(); registerSchema({ diff --git a/app/assets/javascripts/google_tag_manager/index.js b/app/assets/javascripts/google_tag_manager/index.js index 55987ce64e6..aca0f93a4d1 100644 --- a/app/assets/javascripts/google_tag_manager/index.js +++ b/app/assets/javascripts/google_tag_manager/index.js @@ -231,3 +231,32 @@ export const trackTransaction = (transactionDetails) => { pushEnhancedEcommerceEvent('EECtransactionSuccess', eventData); }; + +export const trackAddToCartUsageTab = () => { + if (!isSupported()) { + return; + } + + const getStartedButton = document.querySelector('.js-buy-additional-minutes'); + getStartedButton.addEventListener('click', () => { + window.dataLayer.push({ + event: 'EECproductAddToCart', + ecommerce: { + currencyCode: 'USD', + add: { + products: [ + { + name: 'CI/CD Minutes', + id: '0003', + price: '10', + brand: 'GitLab', + category: 'DevOps', + variant: 'add-on', + quantity: 1, + }, + ], + }, + }, + }); + }); +}; diff --git a/app/assets/javascripts/pipeline_editor/index.js b/app/assets/javascripts/pipeline_editor/index.js index 04f91cb3d1e..732fc665c9e 100644 --- a/app/assets/javascripts/pipeline_editor/index.js +++ b/app/assets/javascripts/pipeline_editor/index.js @@ -2,7 +2,6 @@ import Vue from 'vue'; import VueApollo from 'vue-apollo'; import createDefaultClient from '~/lib/graphql'; -import { resetServiceWorkersPublicPath } from '../lib/utils/webpack'; import { EDITOR_APP_STATUS_LOADING } from './constants'; import { CODE_SNIPPET_SOURCE_SETTINGS } from './components/code_snippet_alert/constants'; import getCurrentBranch from './graphql/queries/client/current_branch.query.graphql'; @@ -14,11 +13,6 @@ import typeDefs from './graphql/typedefs.graphql'; import PipelineEditorApp from './pipeline_editor_app.vue'; export const initPipelineEditor = (selector = '#js-pipeline-editor') => { - // Prevent issues loading syntax validation workers - // Fixes https://gitlab.com/gitlab-org/gitlab/-/issues/297252 - // TODO Remove when https://gitlab.com/gitlab-org/gitlab/-/issues/321656 is resolved - resetServiceWorkersPublicPath(); - const el = document.querySelector(selector); if (!el) { diff --git a/app/services/ci/create_downstream_pipeline_service.rb b/app/services/ci/create_downstream_pipeline_service.rb index a2e53cbf9b8..034bab93108 100644 --- a/app/services/ci/create_downstream_pipeline_service.rb +++ b/app/services/ci/create_downstream_pipeline_service.rb @@ -120,15 +120,13 @@ module Ci def has_cyclic_dependency? return false if @bridge.triggers_child_pipeline? - if Feature.enabled?(:ci_drop_cyclical_triggered_pipelines, @bridge.project, default_enabled: :yaml) - pipeline_checksums = @bridge.pipeline.self_and_upstreams.filter_map do |pipeline| - config_checksum(pipeline) unless pipeline.child? - end - - # To avoid false positives we allow 1 cycle in the ancestry and - # fail when 2 cycles are detected: A -> B -> A -> B -> A - pipeline_checksums.tally.any? { |_checksum, occurrences| occurrences > 2 } + pipeline_checksums = @bridge.pipeline.self_and_upstreams.filter_map do |pipeline| + config_checksum(pipeline) unless pipeline.child? end + + # To avoid false positives we allow 1 cycle in the ancestry and + # fail when 2 cycles are detected: A -> B -> A -> B -> A + pipeline_checksums.tally.any? { |_checksum, occurrences| occurrences > 2 } end def has_max_descendants_depth? diff --git a/config/feature_flags/development/cache_shared_runners_enabled.yml b/config/feature_flags/development/cache_shared_runners_enabled.yml deleted file mode 100644 index 4dde6c852a6..00000000000 --- a/config/feature_flags/development/cache_shared_runners_enabled.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: cache_shared_runners_enabled -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68002 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/338267 -milestone: '14.2' -type: development -group: group::optimize -default_enabled: true diff --git a/config/feature_flags/development/ci_drop_cyclical_triggered_pipelines.yml b/config/feature_flags/development/ci_drop_cyclical_triggered_pipelines.yml deleted file mode 100644 index 3c7204f444b..00000000000 --- a/config/feature_flags/development/ci_drop_cyclical_triggered_pipelines.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: ci_drop_cyclical_triggered_pipelines -introduced_by_url: https://gitlab.com/gitlab-org/security/gitlab/-/merge_requests/1195 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/329390 -milestone: '13.12' -type: development -group: group::pipeline execution -default_enabled: false diff --git a/data/whats_new/202202210001_14_08.yml b/data/whats_new/202202210001_14_08.yml new file mode 100644 index 00000000000..116eb889bbe --- /dev/null +++ b/data/whats_new/202202210001_14_08.yml @@ -0,0 +1,92 @@ +- title: "Support for ecdsa-sk and ed25519-sk SSH keys" + body: | + [OpenSSH 8.2](https://www.openssh.com/releasenotes.html#8.2) added support for FIDO/U2F hardware authenticators with new + ecdsa-sk and ed25519-sk key types. + + GitLab now supports these key types, allowing users to take advantage of hardware-backed SSH authentication. + stage: manage + self-managed: true + gitlab-com: true + packages: [Free, Premium, Ultimate] + url: 'https://docs.gitlab.com/ee/ssh/#generate-an-ssh-key-pair-for-a-fidou2f-hardware-security-key' + image_url: 'https://about.gitlab.com/images/14_8/ssh_key.png' + published_at: 2022-02-22 + release: 14.8 +- title: "Auto-completion of keywords in the Pipeline Editor" + body: | + Writing a valid GitLab CI/CD pipeline can be difficult regardless of whether you're a novice or more advanced user. Syntax structure should be accurate and even a small typo or misconfiguration could cause your pipeline to be invalid, introducing more work to find the source of the problem. In this release, we've added auto-completion of CI/CD keywords to the pipeline editor, which will greatly increase your efficiency when writing and debugging pipelines. You'll be more confident that your pipeline will run the way you want it the very first time it runs. + stage: verify + self-managed: true + gitlab-com: true + packages: [Free, Premium, Ultimate] + url: 'https://docs.gitlab.com/ee/ci/pipeline_editor/index.html#validate-ci-configuration' + image_url: 'https://about.gitlab.com/images/growth/verify.png' + published_at: 2022-02-22 + release: 14.8 +- title: "Security approval policies" + body: | + GitLab now supports flexible security approvals as the replacement for the deprecated Vulnerability-Check feature. Security approvals are similar to Vulnerability-Check in that both can require approvals for MRs that contain security vulnerabilities. However, security approvals improve the previous experience in several ways: + + - Users can choose who is allowed to edit security approval rules. An independent security or compliance team can therefore manage rules in a way that prevents development project maintainers from modifying the rules. + - Multiple rules can be created and chained together to allow for filtering on different severity thresholds for each scanner type. + - A two-step approval process can be enforced for any desired changes to security approval rules. + - A single set of security policies can be applied to multiple development projects to allow for ease in maintaining a single, centralized ruleset. + + Security approval policies can be used alongside the existing Vulnerability-Check feature, as the two policies are additive and don't conflict. However, we encourage users to migrate their Vulnerability-Check rules over to security approval policies. Vulnerability-Check rules are now [deprecated](https://docs.gitlab.com/ee/update/deprecations.html#vulnerability-check), and are scheduled for removal in GitLab 15.0. Self managed users will need to enable the `scan_result_policy` feature flag prior to using this feature. To get started, navigate to **Security & Compliance > Policies** and create a new Scan Result type policy. + stage: protect + self-managed: true + gitlab-com: true + packages: [Ultimate] + url: 'https://docs.gitlab.com/ee/user/application_security/policies/scan-result-policies' + image_url: 'https://about.gitlab.com/images/14_8/protect-security-approval-policies.png' + published_at: 2022-02-22 + release: 14.8 +- title: "On-demand security scan index view" + body: | + Find all your on-demand DAST and DAST API scans on a single page. We have introduced a new index page for on-demand scans that shows your in-progress scans, previously run scans, saved scans, and scheduled scans. From this index page, you can find specific scans easily or re-run scans that have already finished. In previous versions of GitLab, to see on-demand scans that were in-progress or had finished, you needed to search through the pipelines page to find the right pipeline. Saved on-demand scans were located in the Security & Compliance configuration section. To find scheduled scans, you needed to look at each saved scan individually to see their schedule. All of those activities are now rolled into one page to make it easier to run on-demand security testing outside of CI/CD builds, MRs, or pipelines. + stage: secure + self-managed: true + gitlab-com: true + packages: [Ultimate] + url: 'https://docs.gitlab.com/ee/user/application_security/dast/#view-on-demand-dast-scans' + image_url: 'https://about.gitlab.com/images/14_8/dast-on-demand-index-page.png' + published_at: 2022-02-22 + release: 14.8 +- title: "User impersonation audit events for groups" + body: | + GitLab now provides audit events on the group audit events page for + [user impersonation](https://docs.gitlab.com/ee/user/admin_area/#user-impersonation) starting and stopping. This was previously + only available on a page unavailable to GitLab SaaS customers. We are excited to bring + it to the group page which allows both self-managed and SaaS users to view these events! + + These events are helpful to understand if an administrator impersonated a user in your group and any actions that the + administrator took as the impersonated user. You can correlate: + + - Any actions a user took. + - When impersonation was happening. + + This can help you understand if it was actually the user performing certain actions or an administrator impersonating them. The + absence of impersonation events in the audit log is also a way to be confident that a given user actually performed given + actions, rather than someone impersonating them. + stage: manage + self-managed: true + gitlab-com: true + packages: [Premium, Ultimate] + url: 'https://docs.gitlab.com/ee/administration/audit_events.html#group-events' + image_url: 'https://about.gitlab.com/images/14_8/impersonation_audit_event.png' + published_at: 2022-02-22 + release: 14.8 +- title: "Additional display options for roadmaps" + body: | + In this release, we have introduced additional progress tracking capabilities to roadmaps. You can now view the percentage of completed epics based on issue count instead of issue weight. This functionality is useful for organizations that are using Kanban or other methodologies that don't require their teams to set a weight on issues. + + You can now also customize the level of milestones to include in your roadmap, allowing you to tailor your view to meet the needs of your audience. + stage: plan + self-managed: true + gitlab-com: true + packages: [Premium, Ultimate] + url: 'https://docs.gitlab.com/ee/user/group/roadmap/index.html#roadmap-settings' + image_url: 'https://about.gitlab.com/images/14_8/rp_roadmap_settings.png' + published_at: 2022-02-22 + release: 14.8 +
\ No newline at end of file diff --git a/db/fixtures/development/33_triage_ops.rb b/db/fixtures/development/33_triage_ops.rb index 38e0d4a6371..f4d74af15ca 100644 --- a/db/fixtures/development/33_triage_ops.rb +++ b/db/fixtures/development/33_triage_ops.rb @@ -4,7 +4,7 @@ require './spec/support/sidekiq_middleware' require './spec/support/helpers/test_env' class Gitlab::Seeder::TriageOps - WEBHOOK_URL = 'http://0.0.0.0:8080' + WEBHOOK_URL = 'http://0.0.0.0:$PORT$' WEBHOOK_TOKEN = "triage-ops-webhook-token" def seed! @@ -23,7 +23,7 @@ class Gitlab::Seeder::TriageOps ensure_project('gitlab-org/security/gitlab') puts "Ensuring required bot user" ensure_bot_user - puts "Setting up webhooks for #{WEBHOOK_URL}" + puts "Setting up webhooks" ensure_webhook_for('gitlab-com') ensure_webhook_for('gitlab-org') end @@ -65,7 +65,7 @@ class Gitlab::Seeder::TriageOps hook_params = { enable_ssl_verification: false, token: WEBHOOK_TOKEN, - url: WEBHOOK_URL + url: WEBHOOK_URL.gsub("$PORT$", ENV.fetch('TRIAGE_OPS_WEBHOOK_PORT', '8091')) } # Subscribe the hook to all possible events. all_group_hook_events = GroupHook.triggers.values @@ -76,7 +76,7 @@ class Gitlab::Seeder::TriageOps hook = group.hooks.new(hook_params) hook.save! - puts "Hook token '#{hook.token}' for '#{group_path}' group is present now." + puts "Hook with url '#{hook.url}' and token '#{hook.token}' for '#{group_path}' is present now." end def ensure_group(full_path) diff --git a/doc/administration/reference_architectures/index.md b/doc/administration/reference_architectures/index.md index 815155866e8..3fcd6d7ae4e 100644 --- a/doc/administration/reference_architectures/index.md +++ b/doc/administration/reference_architectures/index.md @@ -103,12 +103,14 @@ The following table details the testing done against the reference architectures <style> table.test-coverage td { + border-top: 1px solid #dbdbdb; border-left: 1px solid #dbdbdb; border-right: 1px solid #dbdbdb; border-bottom: 1px solid #dbdbdb; } table.test-coverage th { + border-top: 1px solid #dbdbdb; border-left: 1px solid #dbdbdb; border-right: 1px solid #dbdbdb; border-bottom: 1px solid #dbdbdb; @@ -131,7 +133,6 @@ table.test-coverage th { <th scope="col">Omnibus</th> <th scope="col">Cloud Native Hybrid</th> <th scope="col">Omnibus</th> - <th scope="col">Cloud Native Hybrid</th> </tr> <tr> <th scope="row">1k</th> @@ -140,7 +141,6 @@ table.test-coverage th { <td></td> <td></td> <td></td> - <td></td> </tr> <tr> <th scope="row">2k</th> @@ -149,7 +149,6 @@ table.test-coverage th { <td></td> <td></td> <td></td> - <td></td> </tr> <tr> <th scope="row">3k</th> @@ -158,7 +157,6 @@ table.test-coverage th { <td></td> <td></td> <td></td> - <td></td> </tr> <tr> <th scope="row">5k</th> @@ -167,7 +165,6 @@ table.test-coverage th { <td></td> <td></td> <td></td> - <td></td> </tr> <tr> <th scope="row">10k</th> @@ -176,7 +173,6 @@ table.test-coverage th { <td><a href="https://gitlab.com/gitlab-org/quality/performance/-/wikis/Past-Results/10k">Ad-Hoc (inc Cloud Services)</a></td> <td><a href="https://gitlab.com/gitlab-org/quality/performance/-/wikis/Past-Results/10k-Cloud-Native-Hybrid">Ad-Hoc</a></td> <td><a href="https://gitlab.com/gitlab-org/quality/performance/-/wikis/Past-Results/10k">Ad-Hoc</a></td> - <td></td> </tr> <tr> <th scope="row">25k</th> @@ -185,7 +181,6 @@ table.test-coverage th { <td></td> <td></td> <td><a href="https://gitlab.com/gitlab-org/quality/performance/-/wikis/Past-Results/25k">Ad-Hoc</a></td> - <td></td> </tr> <tr> <th scope="row">50k</th> @@ -194,7 +189,6 @@ table.test-coverage th { <td><a href="https://gitlab.com/gitlab-org/quality/performance/-/wikis/Past-Results/50k">Ad-Hoc (inc Cloud Services)</a></td> <td></td> <td></td> - <td></td> </tr> </table> @@ -218,7 +212,6 @@ The Standard Reference Architectures are designed to be platform agnostic, with <th scope="col">Omnibus</th> <th scope="col">Cloud Native Hybrid</th> <th scope="col">Omnibus</th> - <th scope="col">Cloud Native Hybrid</th> </tr> <tr> <th scope="row">1k</th> @@ -227,7 +220,6 @@ The Standard Reference Architectures are designed to be platform agnostic, with <td></td> <td></td> <td></td> - <td></td> </tr> <tr> <th scope="row">2k</th> @@ -236,7 +228,6 @@ The Standard Reference Architectures are designed to be platform agnostic, with <td></td> <td></td> <td></td> - <td></td> </tr> <tr> <th scope="row">3k</th> @@ -245,7 +236,6 @@ The Standard Reference Architectures are designed to be platform agnostic, with <td></td> <td></td> <td></td> - <td></td> </tr> <tr> <th scope="row">5k</th> @@ -254,7 +244,6 @@ The Standard Reference Architectures are designed to be platform agnostic, with <td></td> <td></td> <td></td> - <td></td> </tr> <tr> <th scope="row">10k</th> @@ -263,7 +252,6 @@ The Standard Reference Architectures are designed to be platform agnostic, with <td></td> <td></td> <td></td> - <td></td> </tr> <tr> <th scope="row">25k</th> @@ -272,7 +260,6 @@ The Standard Reference Architectures are designed to be platform agnostic, with <td></td> <td></td> <td></td> - <td></td> </tr> <tr> <th scope="row">50k</th> @@ -281,10 +268,92 @@ The Standard Reference Architectures are designed to be platform agnostic, with <td></td> <td></td> <td></td> + </tr> +</table> + +### Recommended cloud providers and services + +NOTE: +The following lists are non exhaustive. Generally, other cloud providers not listed +here will likely work with the same specs, but this hasn't been validated. +Additionally, when it comes to other cloud provider services not listed here, +it's advised to be cautious as each implementation can be notably different +and should be tested thoroughly before production use. + +Through testing and real life usage, the Reference Architectures are validated and supported on the following cloud providers: + +<table> +<thead> + <tr> + <th>Reference Architecture</th> + <th>GCP</th> + <th>AWS</th> + <th>Azure</th> + <th>Bare Metal</th> + </tr> +</thead> +<tbody> + <tr> + <td>Omnibus</td> + <td>✅</td> + <td>✅</td> + <td>✅</td> + <td>✅</td> + </tr> + <tr> + <td>Cloud Native Hybrid</td> + <td>✅</td> + <td>✅</td> + <td></td> + <td></td> + </tr> +</tbody> +</table> + +Additionally, the following cloud provider services are validated and supported for use as part of the Reference Architectures: + +<table> +<thead> + <tr> + <th>Cloud Service</th> + <th>GCP</th> + <th>AWS</th> + <th>Bare Metal</th> + </tr> +</thead> +<tbody> + <tr> + <td>Object Storage</td> + <td>✅ <a href="https://cloud.google.com/storage" target="_blank">Cloud Storage</a></td> + <td>✅ <a href="https://aws.amazon.com/s3/" target="_blank">S3</a></td> + <td>✅ <a href="https://min.io/" target="_blank">MinIO</a></td> + </tr> + <tr> + <td>Database</td> + <td>✅ <a href="https://cloud.google.com/sql" target="_blank" rel="noopener noreferrer">Cloud SQL</a></td> + <td>✅ <a href="https://aws.amazon.com/rds/" target="_blank" rel="noopener noreferrer">RDS</a></td> + <td></td> + </tr> + <tr> + <td>Redis</td> + <td></td> + <td>✅ <a href="https://aws.amazon.com/elasticache/" target="_blank" rel="noopener noreferrer">Elasticache</a></td> <td></td> </tr> +</tbody> </table> +The following specific cloud provider services have been found to have issues in terms of either functionality or performance. As such, they either have caveats that should be considered or are not recommended: + +- [Azure Blob Storage](https://azure.microsoft.com/en-gb/services/storage/blobs/) has been found to have performance limits that can impact production use at certain times. For larger Reference Architectures the service may not be sufficient for production use and an alternative is recommended for use instead. +- [Azure Database for PostgreSQL Server](https://azure.microsoft.com/en-gb/services/postgresql/#overview) (Single / Flexible) is not recommended for use due to notable performance issues or missing functionality. +- [AWS Aurora Database](https://aws.amazon.com/rds/aurora) is not recommended due to compatibility issues. + +NOTE: +As a general rule we unfortunately don't recommend Azure Services at this time. +If required, we advise thorough testing is done at your intended scale +over a sustained period to validate if the service is suitable. + ## Availability Components GitLab comes with the following components for your use, listed from least to diff --git a/doc/development/internal_api/index.md b/doc/development/internal_api/index.md index f7eb4cb60c1..ef58d6c2c44 100644 --- a/doc/development/internal_api/index.md +++ b/doc/development/internal_api/index.md @@ -413,9 +413,6 @@ These endpoints are all authenticated using JWT. The JWT secret is stored in a f specified in `config/gitlab.yml`. By default, the location is in the root of the GitLab Rails app in a file called `.gitlab_kas_secret`. -WARNING: -The GitLab agent is under development and is not recommended for production use. - ### GitLab agent information Called from GitLab agent server (`kas`) to retrieve agent diff --git a/doc/update/index.md b/doc/update/index.md index 45b5f36bc5a..b5004be4ffd 100644 --- a/doc/update/index.md +++ b/doc/update/index.md @@ -230,14 +230,12 @@ Backward-incompatible changes and migrations are reserved for major versions. Follow the directions carefully as we cannot guarantee that upgrading between major versions is seamless. -It is required to follow the following upgrade steps to ensure a successful *major* version upgrade: +A *major* upgrade requires the following steps: +1. Start by identifying a [supported upgrade path](#upgrade-paths). This is essential for a successful *major* version upgrade. 1. Upgrade to the latest minor version of the preceding major version. -1. Upgrade to the next major version (`X.0.Z`). -1. Upgrade to its first minor version (`X.1.Z`). -1. Proceed with upgrading to a newer releases of that major version. - -Identify a [supported upgrade path](#upgrade-paths). +1. Upgrade to the "dot zero" release of the next major version (`X.0.Z`). +1. Optional. Follow the [upgrade path](#upgrade-paths), and proceed with upgrading to newer releases of that major version. It's also important to ensure that any [background migrations have been fully completed](#checking-for-background-migrations-before-upgrading) before upgrading to a new major version. @@ -261,7 +259,7 @@ Find where your version sits in the upgrade path below, and upgrade GitLab accordingly, while also consulting the [version-specific upgrade instructions](#version-specific-upgrading-instructions): -`8.11.Z` -> `8.12.0` -> `8.17.7` -> `9.5.10` -> `10.8.7` -> [`11.11.8`](#1200) -> `12.0.12` -> [`12.1.17`](#1210) -> `12.10.14` -> `13.0.14` -> [`13.1.11`](#1310) -> [`13.8.8`](#1388) -> [latest `13.12.Z`](https://about.gitlab.com/releases/categories/releases/) -> [latest `14.0.Z`](#1400) -> [latest `14.1.Z`](#1410) -> [latest `14.Y.Z`](https://about.gitlab.com/releases/categories/releases/) +`8.11.Z` -> `8.12.0` -> `8.17.7` -> `9.5.10` -> `10.8.7` -> [`11.11.8`](#1200) -> `12.0.12` -> [`12.1.17`](#1210) -> `12.10.14` -> `13.0.14` -> [`13.1.11`](#1310) -> [`13.8.8`](#1388) -> [`13.12.15`](#13120) -> [`14.0.12`](#1400) -> [latest `14.Y.Z`](https://gitlab.com/gitlab-org/gitlab/-/releases) The following table, while not exhaustive, shows some examples of the supported upgrade paths. @@ -269,8 +267,8 @@ Additional steps between the mentioned versions are possible. We list the minima | Target version | Your version | Supported upgrade path | Note | | -------------- | ------------ | ---------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | -| `14.2.6` | `13.10.2` | `13.10.2` -> `13.12.15` -> `14.0.11` -> `14.1.8` -> `14.2.6` | Three intermediate versions are required: `13.12`, `14.0`, and `14.1`, then `14.2.6`. | -| `14.1.8` | `13.9.2` | `13.9.2` -> `13.12.15` -> `14.0.11` -> `14.1.8` | Two intermediate versions are required: `13.12` and `14.0`, then `14.1.8`. | +| `14.6.2` | `13.10.2` | `13.10.2` -> `13.12.15` -> `14.0.12` -> `14.6.2` | Two intermediate versions are required: `13.12` and `14.0`, then `14.6.2`. | +| `14.1.8` | `13.9.2` | `13.9.2` -> `13.12.15` -> `14.0.12` -> `14.1.8` | Two intermediate versions are required: `13.12` and `14.0`, then `14.1.8`. | | `13.12.15` | `12.9.2` | `12.9.2` -> `12.10.14` -> `13.0.14` -> `13.1.11` -> `13.8.8` -> `13.12.15` | Four intermediate versions are required: `12.10`, `13.0`, `13.1` and `13.8.8`, then `13.12.15`. | | `13.2.10` | `11.5.0` | `11.5.0` -> `11.11.8` -> `12.0.12` -> `12.1.17` -> `12.10.14` -> `13.0.14` -> `13.1.11` -> `13.2.10` | Six intermediate versions are required: `11.11`, `12.0`, `12.1`, `12.10`, `13.0` and `13.1`, then `13.2.10`. | | `12.10.14` | `11.3.4` | `11.3.4` -> `11.11.8` -> `12.0.12` -> `12.1.17` -> `12.10.14` | Three intermediate versions are required: `11.11`, `12.0` and `12.1`, then `12.10.14`. | @@ -364,6 +362,15 @@ or [init scripts](upgrading_from_source.md#configure-sysv-init-script) by [follo For more information, refer to [this issue](https://gitlab.com/gitlab-org/gitlab/-/issues/331823). +### 14.4.4 + +- For [zero-downtime upgrades](zero_downtime.md) on a GitLab cluster with separate Web and API nodes, you need to enable the `paginated_tree_graphql_query` [feature flag](../api/feature_flags.md) _before_ upgrading GitLab Web nodes to 14.4. + This is because we [enabled `paginated_tree_graphql_query by default in 14.4](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70913/diffs), so if GitLab UI is on 14.4 and its API is on 14.3, the frontend will have this feature enabled but the backend will have it disabled. This will result in the following error: + + ```shell + bundle.esm.js:63 Uncaught (in promise) Error: GraphQL error: Field 'paginatedTree' doesn't exist on type 'Repository' + ``` + ### 14.4.0 - Git 2.33.x and later is required. We recommend you use the diff --git a/doc/update/zero_downtime.md b/doc/update/zero_downtime.md index 050c5909934..d4d569463fa 100644 --- a/doc/update/zero_downtime.md +++ b/doc/update/zero_downtime.md @@ -39,7 +39,9 @@ release if the patch release is not the latest. For example, upgrading from 14.1.1 to 14.2.0 should be safe even if 14.1.2 has been released. We do recommend you check the release posts of any releases between your current and target version just in case they include any migrations that may require you to upgrade -one release at a time. +one release at a time. + +We also recommend you verify the [version specific upgrading instructions](index.md#version-specific-upgrading-instructions) relevant to your [upgrade path](index.md#upgrade-paths). Some releases may also include so called "background migrations". These migrations are performed in the background by Sidekiq and are often used for diff --git a/doc/user/discussions/index.md b/doc/user/discussions/index.md index 37047e9f8d0..e6c21d6653a 100644 --- a/doc/user/discussions/index.md +++ b/doc/user/discussions/index.md @@ -47,6 +47,8 @@ in a different color. Avoid mentioning `@all` in issues and merge requests, because it sends an email notification to all the members of that project's group. This might be interpreted as spam. +Notifications and mentions can be disabled in +[a group's settings](../group/index.md#disable-email-notifications). ## Add a comment to a merge request diff diff --git a/doc/user/group/index.md b/doc/user/group/index.md index 86704f81c82..3e9196d39b3 100644 --- a/doc/user/group/index.md +++ b/doc/user/group/index.md @@ -717,7 +717,8 @@ To disable email notifications: > [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/21301) in GitLab 12.6. You can prevent users from being added to a conversation and getting notified when -anyone mentions a group in which those users are members. +anyone [mentions a group](../discussions/index.md#mentions) +in which those users are members. Groups with disabled mentions are visualized accordingly in the autocompletion dropdown list. diff --git a/doc/user/group/value_stream_analytics/index.md b/doc/user/group/value_stream_analytics/index.md index ccf77f79fd9..3b2369db504 100644 --- a/doc/user/group/value_stream_analytics/index.md +++ b/doc/user/group/value_stream_analytics/index.md @@ -280,7 +280,7 @@ Shown metrics and charts includes: - [Lead time](#how-metrics-are-measured) - [Cycle time](#how-metrics-are-measured) -- [Days to completion chart](#days-to-completion-chart) +- [Total time chart](#total-time-chart) - [Tasks by type chart](#type-of-work---tasks-by-type-chart) ### Stage table @@ -413,7 +413,7 @@ To delete a custom value stream: ![Delete value stream](img/delete_value_stream_v13_12.png "Deleting a custom value stream") -## Days to completion chart +## Total time chart > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/21631) in GitLab 12.6. > - Chart median line [removed](https://gitlab.com/gitlab-org/gitlab/-/issues/235455) in GitLab 13.4. @@ -422,8 +422,9 @@ To delete a custom value stream: This chart visually depicts the average number of days it takes for cycles to be completed. This chart uses the global page filters for displaying data based on the selected -group, projects, and time frame. In addition, specific stages can be selected -from the chart itself. +group, projects, and time frame. + +When a stage is selected the chart only displays data relevant to the selected stage. On the overview the chart displays a sum of the times for all stages in the value stream. The chart data is limited to the last 500 items. diff --git a/doc/user/packages/container_registry/index.md b/doc/user/packages/container_registry/index.md index b28f0cbfb35..4655982a03b 100644 --- a/doc/user/packages/container_registry/index.md +++ b/doc/user/packages/container_registry/index.md @@ -553,13 +553,6 @@ this setting. However, disabling the Container Registry disables all Container R | Private project with Container Registry visibility <br/> set to **Only Project Members** (UI) or `private` (API) | View Container Registry <br/> and pull images | No | No | Yes | | Any project with Container Registry `disabled` | All operations on Container Registry | No | No | No | -## Manifest lists and garbage collection - -Manifest lists are commonly used for creating multi-architecture images. If you rely on manifest -lists, you should tag all the individual manifests referenced by a list in their respective -repositories, and not just the manifest list itself. This ensures that those manifests aren't -garbage collected, as long as they have at least one tag pointing to them. - ## Troubleshooting the GitLab Container Registry ### Docker connection error diff --git a/doc/user/permissions.md b/doc/user/permissions.md index 90d76d609ab..ccb45cfbb8d 100644 --- a/doc/user/permissions.md +++ b/doc/user/permissions.md @@ -383,6 +383,7 @@ The following table lists group permissions available for each role: | View Group DevOps Adoption **(ULTIMATE)** | | ✓ | ✓ | ✓ | ✓ | | View metrics dashboard annotations | | ✓ | ✓ | ✓ | ✓ | | View Productivity analytics **(PREMIUM)** | | ✓ | ✓ | ✓ | ✓ | +| View Usage quota data | | ✓ | ✓ | ✓ | ✓ | | Create and edit group wiki pages **(PREMIUM)** | | | ✓ | ✓ | ✓ | | Create project in group | | | ✓ (3)(5) | ✓ (3) | ✓ (3) | | Create/edit/delete group milestones | | | ✓ | ✓ | ✓ | @@ -412,7 +413,7 @@ The following table lists group permissions available for each role: | Share (invite) groups with groups | | | | | ✓ | | View 2FA status of members | | | | | ✓ | | View Billing **(FREE SAAS)** | | | | | ✓ (4) | -| View Usage Quotas **(FREE SAAS)** | | | | | ✓ (4) | +| View Usage Quotas Page **(FREE SAAS)** | | | | ✓ | ✓ (4) | | Manage runners | | | | | ✓ | <!-- markdownlint-disable MD029 --> diff --git a/doc/user/project/wiki/group.md b/doc/user/project/wiki/group.md index 2c499af123c..37f2ef8fc6a 100644 --- a/doc/user/project/wiki/group.md +++ b/doc/user/project/wiki/group.md @@ -7,7 +7,7 @@ type: reference, how-to # Group wikis **(PREMIUM)** -> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/13195) in [GitLab Premium](https://about.gitlab.com/pricing/) 13.5. +> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/13195) in GitLab 13.5. If you use GitLab groups to manage multiple projects, some of your documentation might span multiple groups. You can create group wikis, instead of [project wikis](index.md), @@ -17,7 +17,7 @@ Group wikis are similar to [project wikis](index.md), with a few limitations: - [Git LFS](../../../topics/git/lfs/index.md) is not supported. - Group wikis are not included in [global search](../../search/advanced_search.md). - Changes to group wikis don't show up in the [group's activity feed](../../group/index.md#group-activity-analytics). -- Group wikis are enabled by default for **(PREMIUM)** and higher tiers. +- Group wikis are enabled by default for GitLab Premium and higher tiers. You [can't turn them off from the GitLab user interface](https://gitlab.com/gitlab-org/gitlab/-/issues/208413). For updates, follow [the epic that tracks feature parity with project wikis](https://gitlab.com/groups/gitlab-org/-/epics/2782). @@ -38,7 +38,7 @@ To access a group wiki: ## Export a group wiki -> Introduced in [GitLab 13.9](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/53247). +> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/53247) in GitLab 13.9. Users with the Owner role in a group can [import and export group wikis](../../group/settings/import_export.md) when importing diff --git a/doc/user/search/index.md b/doc/user/search/index.md index 0a799843d3c..f96ca746474 100644 --- a/doc/user/search/index.md +++ b/doc/user/search/index.md @@ -40,8 +40,8 @@ in the search field in the upper right corner: Follow these steps to filter the **Issues** and **Merge requests** list pages in projects and groups: -1. Click in the field **Search or filter results...**. -1. In the dropdown menu that appears, select the attribute you wish to filter by: +1. Select **Search or filter results...**. +1. In the dropdown list that appears, select the attribute you wish to filter by: - Assignee - Author - Confidential @@ -113,7 +113,7 @@ You can filter the **Issues** list to individual instances by their ID. For exam > Moved to GitLab Premium in 13.9. To filter merge requests by an individual approver, you can type (or select from -the dropdown) **Approver** and select the user. +the dropdown list) **Approver** and select the user. ![Filter MRs by an approver](img/filter_approver_merge_requests_v14_6.png) @@ -123,7 +123,7 @@ the dropdown) **Approver** and select the user. > - Moved to GitLab Premium in 13.9. To filter merge requests already approved by a specific individual, you can type (or select from -the dropdown) **Approved-By** and select the user. +the dropdown list) **Approved-By** and select the user. ![Filter MRs by approved by](img/filter_approved_by_merge_requests_v14_6.png) @@ -132,20 +132,20 @@ the dropdown) **Approved-By** and select the user. > [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/47605) in GitLab 13.7. To filter review requested merge requests for a specific individual, you can type (or select from -the dropdown) **Reviewer** and select the user. +the dropdown list) **Reviewer** and select the user. ### Filtering merge requests by environment or deployment date **(FREE)** > [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/44041) in GitLab 13.6. To filter merge requests by deployment data, such as the environment or a date, -you can type (or select from the dropdown) the following: +you can type (or select from the dropdown list) the following: - Environment - Deployed-before - Deployed-after -When filtering by an environment, a dropdown presents all environments that +When filtering by an environment, a dropdown list presents all environments that you can choose from: ![Filter MRs by their environment](img/filtering_merge_requests_by_environment_v14_6.png) @@ -174,7 +174,7 @@ you must type at least `Sim` before autocomplete displays results. Search history is available for issues and merge requests, and is stored locally in your browser. To run a search from history: -1. In the top menu, click **Issues** or **Merge requests**. +1. In the top menu, select **Issues** or **Merge requests**. 1. To the left of the search bar, click **Recent searches**, and select a search from the list. ## Removing search filters @@ -227,7 +227,7 @@ and sort them by **Last created**, **Oldest created**, **Last updated**, or **Ol From an [issue board](../../user/project/issue_board.md), you can filter issues by **Author**, **Assignee**, **Milestone**, and **Labels**. You can also filter them by name (issue title), from the field **Filter by name**, which is loaded as you type. -To search for issues to add to lists present in your issue board, click +To search for issues to add to lists present in your issue board, select the button **Add issues** on the top-right of your screen, opening a modal window from which you can, besides filtering them by **Name**, **Author**, **Assignee**, **Milestone**, and **Labels**, select multiple issues to add to a list of your choice: diff --git a/doc/user/shortcuts.md b/doc/user/shortcuts.md index a4eee41514d..5259938f8af 100644 --- a/doc/user/shortcuts.md +++ b/doc/user/shortcuts.md @@ -166,7 +166,7 @@ These shortcuts are available when editing a file with the |----------------|------------------------|-------------| | <kbd>Command</kbd> + <kbd>b</kbd> | <kbd>Control</kbd> + <kbd>b</kbd> | Bold | | <kbd>Command</kbd> + <kbd>i</kbd> | <kbd>Control</kbd> + <kbd>i</kbd> | Italic | -| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>s</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>s</kbd> | Strikethrough | +| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>x</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>x</kbd> | Strikethrough | | <kbd>Command</kbd> + <kbd>e</kbd> | <kbd>Control</kbd> + <kbd>e</kbd> | Code | | <kbd>Command</kbd> + <kbd>Alt</kbd> + <kbd>0</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>0</kbd> | Apply normal text style | | <kbd>Command</kbd> + <kbd>Alt</kbd> + <kbd>1</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>1</kbd> | Apply heading style 1 | diff --git a/doc/user/snippets.md b/doc/user/snippets.md index dc3ab35067e..fc6ae11c724 100644 --- a/doc/user/snippets.md +++ b/doc/user/snippets.md @@ -33,20 +33,19 @@ You can create snippets in multiple ways, depending on whether you want to creat 1. Select the kind of snippet you want to create: - **To create a personal snippet**: On the - [Snippets dashboard](https://gitlab.com/dashboard/snippets), click + [Snippets dashboard](https://gitlab.com/dashboard/snippets), select **New snippet**, or: - *If you're on a project's page,* select the plus icon (**{plus-square-o}**) in the top navigation bar, and then select **New snippet** from the **GitLab** (GitLab SaaS) or **Your Instance** (self-managed) section - of the same dropdown menu. + of the same dropdown list. - *For all other pages,* select the plus icon (**{plus-square-o}**) - in the top navigation bar, then select **New snippet** from the dropdown - menu. + in the top navigation bar, then select **New snippet** from the dropdown list. - If you installed the [GitLab Workflow VS Code extension](project/repository/vscode.md), use the [`Gitlab: Create snippet` command](https://marketplace.visualstudio.com/items?itemName=GitLab.gitlab-workflow#create-snippet). - **To create a project snippet**: Go to your project's page. Select the plus icon (**{plus-square-o}**), and then select **New snippet** from the - **This project** section of the dropdown menu. + **This project** section of the dropdown list. 1. Add a **Title** and **Description**. 1. Name your **File** with an appropriate extension, such as `example.rb` or `index.html`. Filenames with appropriate extensions display [syntax highlighting](#filenames). @@ -162,7 +161,7 @@ you wish to delete. Instead of copying a snippet to a local file, you may want to clone a snippet to preserve its relationship with the repository, so you can receive or make updates -as needed. Select the **Clone** button on a snippet to display the URLs to clone with SSH or HTTPS: +as needed. Select **Clone** on a snippet to display the URLs to clone with SSH or HTTPS: ![Clone snippet](img/snippet_clone_button_v13_0.png) @@ -202,7 +201,7 @@ For example: ## Download snippets You can download the raw content of a snippet. By default, they download with Linux-style line endings (`LF`). If -you want to preserve the original line endings you need to add a parameter `line_ending=raw` +you want to preserve the original line endings you must add a parameter `line_ending=raw` (For example: `https://gitlab.com/snippets/SNIPPET_ID/raw?line_ending=raw`). In case a snippet was created using the GitLab web interface the original line ending is Windows-like (`CRLF`). diff --git a/doc/user/usage_quotas.md b/doc/user/usage_quotas.md index 67f7f7f3db5..5e310be4c9c 100644 --- a/doc/user/usage_quotas.md +++ b/doc/user/usage_quotas.md @@ -42,7 +42,7 @@ namespace to recalculate the storage. > - Enabled on self-managed in GitLab 14.5. > - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/71270) in GitLab 14.5. -The following storage usage statistics are available to an owner: +The following storage usage statistics are available to a maintainer: - Total namespace storage used: Total amount of storage used across projects in this namespace. - Total excess storage used: Total amount of storage used that exceeds their allocated storage. diff --git a/docker/README.md b/docker/README.md deleted file mode 100644 index cb6f99a6482..00000000000 --- a/docker/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# GitLab Docker images - -This content has been moved to [our documentation site](https://docs.gitlab.com/ee/install/docker.html). diff --git a/lib/tasks/gitlab/db.rake b/lib/tasks/gitlab/db.rake index 6d4af9d166f..e4561e88570 100644 --- a/lib/tasks/gitlab/db.rake +++ b/lib/tasks/gitlab/db.rake @@ -170,6 +170,13 @@ namespace :gitlab do Rake::Task['gitlab:db:create_dynamic_partitions'].invoke end + desc "Clear all connections" + task :clear_all_connections do + ActiveRecord::Base.clear_all_connections! + end + + Rake::Task['db:test:purge'].enhance(['gitlab:db:clear_all_connections']) + # During testing, db:test:load restores the database schema from scratch # which does not include dynamic partitions. We cannot rely on application # initializers here as the application can continue to run while diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 11e87e307a5..b843d7aca31 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -10868,12 +10868,6 @@ msgstr "" msgid "CycleAnalytics|%{selectedLabelsCount} selected (%{maxLabels} max)" msgstr "" -msgid "CycleAnalytics|%{stageCount} stages selected" -msgstr "" - -msgid "CycleAnalytics|All stages" -msgstr "" - msgid "CycleAnalytics|Average time to completion" msgstr "" @@ -10886,9 +10880,6 @@ msgstr "" msgid "CycleAnalytics|Lead Time for Changes" msgstr "" -msgid "CycleAnalytics|No stages selected" -msgstr "" - msgid "CycleAnalytics|Number of tasks" msgstr "" @@ -10920,9 +10911,6 @@ msgstr "" msgid "CycleAnalytics|Stage time: %{title}" msgstr "" -msgid "CycleAnalytics|Stages" -msgstr "" - msgid "CycleAnalytics|Tasks by type" msgstr "" @@ -10956,9 +10944,6 @@ msgstr "" msgid "CycleAnalytics|project dropdown filter" msgstr "" -msgid "CycleAnalytics|stage dropdown" -msgstr "" - msgid "DAG visualization requires at least 3 dependent jobs." msgstr "" diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/push_mirroring_lfs_over_http_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/push_mirroring_lfs_over_http_spec.rb index b8e425ae3b8..873fa8e1fae 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/push_mirroring_lfs_over_http_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/push_mirroring_lfs_over_http_spec.rb @@ -3,7 +3,7 @@ module QA RSpec.describe 'Create' do describe 'Push mirror a repository over HTTP' do - it 'configures and syncs LFS objects for a (push) mirrored repository', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347847' do + it 'configures and syncs LFS objects for a (push) mirrored repository', :aggregate_failures, testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347847' do Runtime::Browser.visit(:gitlab, Page::Main::Login) Page::Main::Login.perform(&:sign_in_using_credentials) @@ -30,14 +30,15 @@ module QA mirror_settings.authentication_method = 'Password' mirror_settings.password = Runtime::User.password mirror_settings.mirror_repository - mirror_settings.update target_project_uri # rubocop:disable Rails/SaveBang + mirror_settings.update(target_project_uri) # rubocop:disable Rails/SaveBang + mirror_settings.verify_update(target_project_uri) end end # Check that the target project has the commit from the source target_project.visit! Page::Project::Show.perform do |project_page| - expect(project_page).to have_file('README.md') + expect { project_page.has_file?('README.md') }.to eventually_be_truthy.within(max_duration: 60), "Expected a file named README.md but it did not appear." expect(project_page).to have_readme_content('The rendered file could not be displayed because it is stored in LFS') end end diff --git a/spec/features/admin/admin_runners_spec.rb b/spec/features/admin/admin_runners_spec.rb index 2155d157186..3f0c7e64a1f 100644 --- a/spec/features/admin/admin_runners_spec.rb +++ b/spec/features/admin/admin_runners_spec.rb @@ -23,7 +23,7 @@ RSpec.describe "Admin Runners" do context "when there are runners" do it 'has all necessary texts' do - create(:ci_runner, :instance, created_at: 1.year.ago, contacted_at: Time.now) + create(:ci_runner, :instance, created_at: 1.year.ago, contacted_at: Time.zone.now) create(:ci_runner, :instance, created_at: 1.year.ago, contacted_at: 1.week.ago) create(:ci_runner, :instance, created_at: 1.year.ago, contacted_at: 1.year.ago) @@ -158,9 +158,9 @@ RSpec.describe "Admin Runners" do let!(:never_contacted) { create(:ci_runner, :instance, description: 'runner-never-contacted', contacted_at: nil) } before do - create(:ci_runner, :instance, description: 'runner-1', contacted_at: Time.now) - create(:ci_runner, :instance, description: 'runner-2', contacted_at: Time.now) - create(:ci_runner, :instance, description: 'runner-paused', active: false, contacted_at: Time.now) + create(:ci_runner, :instance, description: 'runner-1', contacted_at: Time.zone.now) + create(:ci_runner, :instance, description: 'runner-2', contacted_at: Time.zone.now) + create(:ci_runner, :instance, description: 'runner-paused', active: false, contacted_at: Time.zone.now) visit admin_runners_path end diff --git a/spec/features/admin/admin_users_spec.rb b/spec/features/admin/admin_users_spec.rb index 95e3f5c70e5..f4b7fa45e4f 100644 --- a/spec/features/admin/admin_users_spec.rb +++ b/spec/features/admin/admin_users_spec.rb @@ -54,7 +54,7 @@ RSpec.describe "Admin::Users" do visit admin_users_path(tab: 'cohorts') - expect(page).to have_content("#{Time.now.strftime('%b %Y')} 3 0") + expect(page).to have_content("#{Time.zone.now.strftime('%b %Y')} 3 0") end end diff --git a/spec/features/admin/admin_uses_repository_checks_spec.rb b/spec/features/admin/admin_uses_repository_checks_spec.rb index c13313609b5..4e6aae7c46f 100644 --- a/spec/features/admin/admin_uses_repository_checks_spec.rb +++ b/spec/features/admin/admin_uses_repository_checks_spec.rb @@ -43,7 +43,7 @@ RSpec.describe 'Admin uses repository checks', :request_store do project = create(:project) project.update_columns( last_repository_check_failed: true, - last_repository_check_at: Time.now + last_repository_check_at: Time.zone.now ) visit_admin_project_page(project) diff --git a/spec/features/admin/users/user_spec.rb b/spec/features/admin/users/user_spec.rb index 0d053329627..a897f5e24b6 100644 --- a/spec/features/admin/users/user_spec.rb +++ b/spec/features/admin/users/user_spec.rb @@ -220,7 +220,7 @@ RSpec.describe 'Admin::Users::User' do context 'a user with an expired password' do before do - another_user.update!(password_expires_at: Time.now - 5.minutes) + another_user.update!(password_expires_at: Time.zone.now - 5.minutes) end it 'does not redirect to password change page' do @@ -255,7 +255,7 @@ RSpec.describe 'Admin::Users::User' do context 'a user with an expired password' do before do - another_user.update!(password_expires_at: Time.now - 5.minutes) + another_user.update!(password_expires_at: Time.zone.now - 5.minutes) end it 'is redirected back to the impersonated users page in the admin after stopping' do diff --git a/spec/features/admin/users/users_spec.rb b/spec/features/admin/users/users_spec.rb index 5b0b6e085c9..619090a179d 100644 --- a/spec/features/admin/users/users_spec.rb +++ b/spec/features/admin/users/users_spec.rb @@ -574,7 +574,7 @@ RSpec.describe 'Admin::Users' do user.reload expect(user.name).to eq('Big Bang') expect(user.admin?).to be_truthy - expect(user.password_expires_at).to be <= Time.now + expect(user.password_expires_at).to be <= Time.zone.now end end diff --git a/spec/features/dashboard/projects_spec.rb b/spec/features/dashboard/projects_spec.rb index 82288a6c1a6..97712b405ad 100644 --- a/spec/features/dashboard/projects_spec.rb +++ b/spec/features/dashboard/projects_spec.rb @@ -48,7 +48,7 @@ RSpec.describe 'Dashboard Projects' do context 'when last_repository_updated_at, last_activity_at and update_at are present' do it 'shows the last_repository_updated_at attribute as the update date' do - project.update!(last_repository_updated_at: Time.now, last_activity_at: 1.hour.ago) + project.update!(last_repository_updated_at: Time.zone.now, last_activity_at: 1.hour.ago) visit dashboard_projects_path @@ -56,7 +56,7 @@ RSpec.describe 'Dashboard Projects' do end it 'shows the last_activity_at attribute as the update date' do - project.update!(last_repository_updated_at: 1.hour.ago, last_activity_at: Time.now) + project.update!(last_repository_updated_at: 1.hour.ago, last_activity_at: Time.zone.now) visit dashboard_projects_path diff --git a/spec/features/issues/user_sorts_issues_spec.rb b/spec/features/issues/user_sorts_issues_spec.rb index f3eaff379a1..86bdaf5d706 100644 --- a/spec/features/issues/user_sorts_issues_spec.rb +++ b/spec/features/issues/user_sorts_issues_spec.rb @@ -9,9 +9,9 @@ RSpec.describe "User sorts issues" do let_it_be(:user) { create(:user) } let_it_be(:group) { create(:group) } let_it_be(:project) { create(:project_empty_repo, :public, group: group) } - let_it_be(:issue1, reload: true) { create(:issue, title: 'foo', created_at: Time.now, project: project) } - let_it_be(:issue2, reload: true) { create(:issue, title: 'bar', created_at: Time.now - 60, project: project) } - let_it_be(:issue3, reload: true) { create(:issue, title: 'baz', created_at: Time.now - 120, project: project) } + let_it_be(:issue1, reload: true) { create(:issue, title: 'foo', created_at: Time.zone.now, project: project) } + let_it_be(:issue2, reload: true) { create(:issue, title: 'bar', created_at: Time.zone.now - 60, project: project) } + let_it_be(:issue3, reload: true) { create(:issue, title: 'baz', created_at: Time.zone.now - 120, project: project) } let_it_be(:newer_due_milestone) { create(:milestone, project: project, due_date: '2013-12-11') } let_it_be(:later_due_milestone) { create(:milestone, project: project, due_date: '2013-12-12') } @@ -75,7 +75,7 @@ RSpec.describe "User sorts issues" do end it 'sorts by most recently updated', :js do - issue3.updated_at = Time.now + 100 + issue3.updated_at = Time.zone.now + 100 issue3.save! visit project_issues_path(project, sort: sort_value_recently_updated) diff --git a/spec/features/projects/blobs/edit_spec.rb b/spec/features/projects/blobs/edit_spec.rb index 3f1c10b3688..54176378de8 100644 --- a/spec/features/projects/blobs/edit_spec.rb +++ b/spec/features/projects/blobs/edit_spec.rb @@ -183,7 +183,7 @@ RSpec.describe 'Editing file blob', :js do freeze_time do visit project_edit_blob_path(project, tree_join(protected_branch, file_path)) - epoch = Time.now.strftime('%s%L').last(5) + epoch = Time.zone.now.strftime('%s%L').last(5) expect(find('.js-branch-name').value).to eq "#{user.username}-protected-branch-patch-#{epoch}" end diff --git a/spec/features/projects/files/project_owner_creates_license_file_spec.rb b/spec/features/projects/files/project_owner_creates_license_file_spec.rb index 4a0b1f4c548..138e426e909 100644 --- a/spec/features/projects/files/project_owner_creates_license_file_spec.rb +++ b/spec/features/projects/files/project_owner_creates_license_file_spec.rb @@ -26,7 +26,7 @@ RSpec.describe 'Projects > Files > Project owner creates a license file', :js do file_content = first('.file-editor') expect(file_content).to have_content('MIT License') - expect(file_content).to have_content("Copyright (c) #{Time.now.year} #{project.namespace.human_name}") + expect(file_content).to have_content("Copyright (c) #{Time.zone.now.year} #{project.namespace.human_name}") fill_in :commit_message, with: 'Add a LICENSE file', visible: true click_button 'Commit changes' @@ -34,7 +34,7 @@ RSpec.describe 'Projects > Files > Project owner creates a license file', :js do expect(current_path).to eq( project_blob_path(project, 'master/LICENSE')) expect(page).to have_content('MIT License') - expect(page).to have_content("Copyright (c) #{Time.now.year} #{project.namespace.human_name}") + expect(page).to have_content("Copyright (c) #{Time.zone.now.year} #{project.namespace.human_name}") end it 'project maintainer creates a license file from the "Add license" link' do @@ -50,7 +50,7 @@ RSpec.describe 'Projects > Files > Project owner creates a license file', :js do file_content = first('.file-editor') expect(file_content).to have_content('MIT License') - expect(file_content).to have_content("Copyright (c) #{Time.now.year} #{project.namespace.human_name}") + expect(file_content).to have_content("Copyright (c) #{Time.zone.now.year} #{project.namespace.human_name}") fill_in :commit_message, with: 'Add a LICENSE file', visible: true click_button 'Commit changes' @@ -58,7 +58,7 @@ RSpec.describe 'Projects > Files > Project owner creates a license file', :js do expect(current_path).to eq( project_blob_path(project, 'master/LICENSE')) expect(page).to have_content('MIT License') - expect(page).to have_content("Copyright (c) #{Time.now.year} #{project.namespace.human_name}") + expect(page).to have_content("Copyright (c) #{Time.zone.now.year} #{project.namespace.human_name}") end def select_template(template) diff --git a/spec/features/projects/files/project_owner_sees_link_to_create_license_file_in_empty_project_spec.rb b/spec/features/projects/files/project_owner_sees_link_to_create_license_file_in_empty_project_spec.rb index ca384291c12..2b44eb59d71 100644 --- a/spec/features/projects/files/project_owner_sees_link_to_create_license_file_in_empty_project_spec.rb +++ b/spec/features/projects/files/project_owner_sees_link_to_create_license_file_in_empty_project_spec.rb @@ -23,7 +23,7 @@ RSpec.describe 'Projects > Files > Project owner sees a link to create a license select_template('MIT License') expect(ide_editor_value).to have_content('MIT License') - expect(ide_editor_value).to have_content("Copyright (c) #{Time.now.year} #{project.namespace.human_name}") + expect(ide_editor_value).to have_content("Copyright (c) #{Time.zone.now.year} #{project.namespace.human_name}") ide_commit @@ -33,7 +33,7 @@ RSpec.describe 'Projects > Files > Project owner sees a link to create a license license_file = project.repository.blob_at('master', 'LICENSE').data expect(license_file).to have_content('MIT License') - expect(license_file).to have_content("Copyright (c) #{Time.now.year} #{project.namespace.human_name}") + expect(license_file).to have_content("Copyright (c) #{Time.zone.now.year} #{project.namespace.human_name}") end def select_template(template) diff --git a/spec/features/projects/jobs_spec.rb b/spec/features/projects/jobs_spec.rb index a65d2d15c12..fbdba373843 100644 --- a/spec/features/projects/jobs_spec.rb +++ b/spec/features/projects/jobs_spec.rb @@ -384,7 +384,7 @@ RSpec.describe 'Jobs', :clean_gitlab_redis_shared_state do end context 'when expire date is defined' do - let(:expire_at) { Time.now + 7.days } + let(:expire_at) { Time.zone.now + 7.days } context 'when user has ability to update job' do context 'when artifacts are unlocked' do @@ -423,7 +423,7 @@ RSpec.describe 'Jobs', :clean_gitlab_redis_shared_state do end context 'when artifacts expired' do - let(:expire_at) { Time.now - 7.days } + let(:expire_at) { Time.zone.now - 7.days } context 'when artifacts are unlocked' do before do diff --git a/spec/features/projects/pipelines/pipelines_spec.rb b/spec/features/projects/pipelines/pipelines_spec.rb index 37ac5a9d5a2..e5138677eb2 100644 --- a/spec/features/projects/pipelines/pipelines_spec.rb +++ b/spec/features/projects/pipelines/pipelines_spec.rb @@ -414,7 +414,7 @@ RSpec.describe 'Pipelines', :js do it "has link to the delayed job's action" do find('[data-testid="pipelines-manual-actions-dropdown"]').click - time_diff = [0, delayed_job.scheduled_at - Time.now].max + time_diff = [0, delayed_job.scheduled_at - Time.zone.now].max expect(page).to have_button('delayed job 1') expect(page).to have_content(Time.at(time_diff).utc.strftime("%H:%M:%S")) end diff --git a/spec/features/projects/remote_mirror_spec.rb b/spec/features/projects/remote_mirror_spec.rb index 7bbffe627f6..2c8e895d43d 100644 --- a/spec/features/projects/remote_mirror_spec.rb +++ b/spec/features/projects/remote_mirror_spec.rb @@ -25,7 +25,7 @@ RSpec.describe 'Project remote mirror', :feature do context 'when last_error and last_update_at are present' do it 'renders error message with timestamp' do - remote_mirror.update!(last_error: 'Some new error', last_update_at: Time.now - 5.minutes) + remote_mirror.update!(last_error: 'Some new error', last_update_at: Time.zone.now - 5.minutes) visit project_mirror_path(project) diff --git a/spec/features/users/login_spec.rb b/spec/features/users/login_spec.rb index 2780549eea1..98191c7d4db 100644 --- a/spec/features/users/login_spec.rb +++ b/spec/features/users/login_spec.rb @@ -437,7 +437,7 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do context 'when the users password is expired' do before do - user.update!(password_expires_at: Time.parse('2018-05-08 11:29:46 UTC')) + user.update!(password_expires_at: Time.zone.parse('2018-05-08 11:29:46 UTC')) end it 'asks for a new password' do @@ -860,7 +860,7 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions do context 'when the users password is expired' do before do - user.update!(password_expires_at: Time.parse('2018-05-08 11:29:46 UTC')) + user.update!(password_expires_at: Time.zone.parse('2018-05-08 11:29:46 UTC')) end it 'asks the user to accept the terms before setting a new password' do diff --git a/spec/features/users/show_spec.rb b/spec/features/users/show_spec.rb index 8edbf639c81..cb395846b96 100644 --- a/spec/features/users/show_spec.rb +++ b/spec/features/users/show_spec.rb @@ -426,7 +426,7 @@ RSpec.describe 'User page' do end context 'structured markup' do - let_it_be(:user) { create(:user, website_url: 'https://gitlab.com', organization: 'GitLab', job_title: 'Frontend Engineer', email: 'public@example.com', public_email: 'public@example.com', location: 'Country', created_at: Time.now, updated_at: Time.now) } + let_it_be(:user) { create(:user, website_url: 'https://gitlab.com', organization: 'GitLab', job_title: 'Frontend Engineer', email: 'public@example.com', public_email: 'public@example.com', location: 'Country', created_at: Time.zone.now, updated_at: Time.zone.now) } it 'shows Person structured markup' do subject diff --git a/spec/frontend/editor/source_editor_ci_schema_ext_spec.js b/spec/frontend/editor/source_editor_ci_schema_ext_spec.js index 5eaac9e9ef9..2f6d277ca75 100644 --- a/spec/frontend/editor/source_editor_ci_schema_ext_spec.js +++ b/spec/frontend/editor/source_editor_ci_schema_ext_spec.js @@ -4,10 +4,14 @@ import { CiSchemaExtension } from '~/editor/extensions/source_editor_ci_schema_e import ciSchemaPath from '~/editor/schema/ci.json'; import SourceEditor from '~/editor/source_editor'; +// Webpack is configured to use file-loader for the CI schema; mimic that here +jest.mock('~/editor/schema/ci.json', () => '/assets/ci.json'); + const mockRef = 'AABBCCDD'; describe('~/editor/editor_ci_config_ext', () => { const defaultBlobPath = '.gitlab-ci.yml'; + const expectedSchemaUri = `${TEST_HOST}${ciSchemaPath}`; let editor; let instance; @@ -84,14 +88,13 @@ describe('~/editor/editor_ci_config_ext', () => { }); expect(getConfiguredYmlSchema()).toEqual({ - uri: `${TEST_HOST}${ciSchemaPath}`, + uri: expectedSchemaUri, fileMatch: [defaultBlobPath], }); }); it('with an alternative file name match', () => { createMockEditor({ blobPath: 'dir1/dir2/another-ci-filename.yml' }); - instance.registerCiSchema({ projectNamespace: mockProjectNamespace, projectPath: mockProjectPath, @@ -99,7 +102,7 @@ describe('~/editor/editor_ci_config_ext', () => { }); expect(getConfiguredYmlSchema()).toEqual({ - uri: `${TEST_HOST}${ciSchemaPath}`, + uri: expectedSchemaUri, fileMatch: ['another-ci-filename.yml'], }); }); diff --git a/spec/frontend/google_tag_manager/index_spec.js b/spec/frontend/google_tag_manager/index_spec.js index 9112b0e17e7..498e60778c6 100644 --- a/spec/frontend/google_tag_manager/index_spec.js +++ b/spec/frontend/google_tag_manager/index_spec.js @@ -11,6 +11,7 @@ import { trackSaasTrialGetStarted, trackCheckout, trackTransaction, + trackAddToCartUsageTab, } from '~/google_tag_manager'; import { setHTMLFixture } from 'helpers/fixtures'; import { logError } from '~/lib/logger'; @@ -173,6 +174,32 @@ describe('~/google_tag_manager/index', () => { }, ], }), + createTestCase(trackAddToCartUsageTab, { + links: [ + { + cls: 'js-buy-additional-minutes', + expectation: { + event: 'EECproductAddToCart', + ecommerce: { + currencyCode: 'USD', + add: { + products: [ + { + name: 'CI/CD Minutes', + id: '0003', + price: '10', + brand: 'GitLab', + category: 'DevOps', + variant: 'add-on', + quantity: 1, + }, + ], + }, + }, + }, + }, + ], + }), ])('%p', (subject, { links = [], forms = [], expectedEvents }) => { beforeEach(() => { setHTMLFixture(createHTML({ links, forms })); diff --git a/spec/services/ci/create_downstream_pipeline_service_spec.rb b/spec/services/ci/create_downstream_pipeline_service_spec.rb index 43eb57df66c..6142704b00e 100644 --- a/spec/services/ci/create_downstream_pipeline_service_spec.rb +++ b/spec/services/ci/create_downstream_pipeline_service_spec.rb @@ -485,14 +485,6 @@ RSpec.describe Ci::CreateDownstreamPipelineService, '#execute' do end it_behaves_like 'detects cyclical pipelines' - - context 'when ci_drop_cyclical_triggered_pipelines is not enabled' do - before do - stub_feature_flags(ci_drop_cyclical_triggered_pipelines: false) - end - - it_behaves_like 'passes cyclical pipeline precondition' - end end context 'when source in the ancestry differ' do diff --git a/spec/tasks/gitlab/db_rake_spec.rb b/spec/tasks/gitlab/db_rake_spec.rb index c3fd8135ae0..4296f626ce5 100644 --- a/spec/tasks/gitlab/db_rake_spec.rb +++ b/spec/tasks/gitlab/db_rake_spec.rb @@ -20,6 +20,14 @@ RSpec.describe 'gitlab:db namespace rake task', :silence_stdout do allow(Rake::Task['db:seed_fu']).to receive(:invoke).and_return(true) end + describe 'clear_all_connections' do + it 'calls clear_all_connections!' do + expect(ActiveRecord::Base).to receive(:clear_all_connections!) + + run_rake_task('gitlab:db:clear_all_connections') + end + end + describe 'mark_migration_complete' do context 'with a single database' do let(:main_model) { ActiveRecord::Base } diff --git a/spec/tooling/danger/project_helper_spec.rb b/spec/tooling/danger/project_helper_spec.rb index 1b416286f8e..eaafb13b61a 100644 --- a/spec/tooling/danger/project_helper_spec.rb +++ b/spec/tooling/danger/project_helper_spec.rb @@ -166,6 +166,8 @@ RSpec.describe Tooling::Danger::ProjectHelper do 'lib/gitlab/usage_data_counters/aggregated_metrics/common.yml' | [:product_intelligence] 'lib/gitlab/usage_data_counters/hll_redis_counter.rb' | [:backend, :product_intelligence] 'lib/gitlab/tracking.rb' | [:backend, :product_intelligence] + 'lib/gitlab/usage/service_ping_report.rb' | [:backend, :product_intelligence] + 'lib/gitlab/usage/metrics/key_path_processor.rb' | [:backend, :product_intelligence] 'spec/lib/gitlab/tracking_spec.rb' | [:backend, :product_intelligence] 'app/helpers/tracking_helper.rb' | [:backend, :product_intelligence] 'spec/helpers/tracking_helper_spec.rb' | [:backend, :product_intelligence] @@ -181,6 +183,8 @@ RSpec.describe Tooling::Danger::ProjectHelper do 'config/metrics/schema.json' | [:product_intelligence] 'doc/api/usage_data.md' | [:product_intelligence] 'spec/lib/gitlab/usage_data_spec.rb' | [:product_intelligence] + 'spec/lib/gitlab/usage/service_ping_report.rb' | [:backend, :product_intelligence] + 'spec/lib/gitlab/usage/metrics/key_path_processor.rb' | [:backend, :product_intelligence] 'app/models/integration.rb' | [:integrations_be, :backend] 'ee/app/models/integrations/github.rb' | [:integrations_be, :backend] diff --git a/tooling/danger/project_helper.rb b/tooling/danger/project_helper.rb index eaf33608b83..a597ef2b047 100644 --- a/tooling/danger/project_helper.rb +++ b/tooling/danger/project_helper.rb @@ -133,6 +133,7 @@ module Tooling %r{\A((ee|jh)/)?lib/gitlab/usage_data_counters/.*\.yml\z} => [:product_intelligence], %r{\A((ee|jh)/)?config/(events|metrics)/((.*\.yml)|(schema\.json))\z} => [:product_intelligence], %r{\A((ee|jh)/)?lib/gitlab/usage_data(_counters)?(/|\.rb)} => [:backend, :product_intelligence], + %r{\A((ee|jh)/)?(spec/)?lib/gitlab/usage(/|\.rb)} => [:backend, :product_intelligence], %r{\A( lib/gitlab/tracking\.rb | spec/lib/gitlab/tracking_spec\.rb | |