@@ -23,7 +23,6 @@ The first option is to simply [import the Project tarball file via the GitLab UI
...
@@ -23,7 +23,6 @@ The first option is to simply [import the Project tarball file via the GitLab UI
It should take up to 15 minutes for the project to fully import. You can head to the project's main page for the current status.
It should take up to 15 minutes for the project to fully import. You can head to the project's main page for the current status.
NOTE: **Note:**
This method ignores all the errors silently (including the ones related to `GITALY_DISABLE_REQUEST_LIMITS`) and is used by GitLab's users. For development and testing, check the other methods below.
This method ignores all the errors silently (including the ones related to `GITALY_DISABLE_REQUEST_LIMITS`) and is used by GitLab's users. For development and testing, check the other methods below.
The `with_lock_retries` method **cannot** be used within the `change` method, you must manually define the `up` and `down` methods to make the migration reversible.
`with_lock_retries` method **cannot** be used within the `change` method, you must manually define the `up` and `down` methods to make the migration reversible.
### How the helper method works
### How the helper method works
...
@@ -443,7 +442,6 @@ the `with_multiple_threads` block, instead of re-using the global connection
...
@@ -443,7 +442,6 @@ the `with_multiple_threads` block, instead of re-using the global connection
pool. This ensures each thread has its own connection object, and won't time
pool. This ensures each thread has its own connection object, and won't time
out when trying to obtain one.
out when trying to obtain one.
NOTE: **Note:**
PostgreSQL has a maximum amount of connections that it allows. This
PostgreSQL has a maximum amount of connections that it allows. This
limit can vary from installation to installation. As a result, it's recommended
limit can vary from installation to installation. As a result, it's recommended
you do not use more than 32 threads in a single migration. Usually, 4-8 threads
you do not use more than 32 threads in a single migration. Usually, 4-8 threads
...
@@ -618,7 +616,6 @@ Before PostgreSQL 11, adding a column with a default was problematic as it would
...
@@ -618,7 +616,6 @@ Before PostgreSQL 11, adding a column with a default was problematic as it would
have caused a full table rewrite. The corresponding helper `add_column_with_default`
have caused a full table rewrite. The corresponding helper `add_column_with_default`
has been deprecated and will be removed in a later release.
has been deprecated and will be removed in a later release.
NOTE: **Note:**
If a backport adding a column with a default value is needed for %12.9 or earlier versions,
If a backport adding a column with a default value is needed for %12.9 or earlier versions,
it should use `add_column_with_default` helper. If a [large table](https://gitlab.com/gitlab-org/gitlab/-/blob/master/rubocop/rubocop-migrations.yml#L3)
it should use `add_column_with_default` helper. If a [large table](https://gitlab.com/gitlab-org/gitlab/-/blob/master/rubocop/rubocop-migrations.yml#L3)
is involved, backporting to %12.9 is contraindicated.
is involved, backporting to %12.9 is contraindicated.
...
@@ -964,7 +961,6 @@ in a previous migration.
...
@@ -964,7 +961,6 @@ in a previous migration.
### Example: Add a column `my_column` to the users table
### Example: Add a column `my_column` to the users table
NOTE: **Note:**
It is important not to leave out the `User.reset_column_information` command, in order to ensure that the old schema is dropped from the cache and ActiveRecord loads the updated schema information.
It is important not to leave out the `User.reset_column_information` command, in order to ensure that the old schema is dropped from the cache and ActiveRecord loads the updated schema information.
@@ -22,7 +22,6 @@ The measuring module is a tool that allows to measure a service's execution, and
...
@@ -22,7 +22,6 @@ The measuring module is a tool that allows to measure a service's execution, and
The measuring module will log these measurements into a structured log called [`service_measurement.log`](../administration/logs.md#service_measurementlog),
The measuring module will log these measurements into a structured log called [`service_measurement.log`](../administration/logs.md#service_measurementlog),
as a single entry for each service execution.
as a single entry for each service execution.
NOTE: **Note:**
For GitLab.com, `service_measurement.log` is ingested in Elasticsearch and Kibana as part of our monitoring solution.
For GitLab.com, `service_measurement.log` is ingested in Elasticsearch and Kibana as part of our monitoring solution.
@@ -6,7 +6,6 @@ info: To determine the technical writer assigned to the Stage/Group associated w
...
@@ -6,7 +6,6 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# End-to-end testing Best Practices
# End-to-end testing Best Practices
NOTE: **Note:**
This is a tailored extension of the Best Practices [found in the testing guide](../best_practices.md).
This is a tailored extension of the Best Practices [found in the testing guide](../best_practices.md).
## Link a test to its test-case issue
## Link a test to its test-case issue
...
@@ -269,7 +268,7 @@ We don't run tests that require Administrator access against our Production envi
...
@@ -269,7 +268,7 @@ We don't run tests that require Administrator access against our Production envi
When you add a new test that requires Administrator access, apply the RSpec metadata `:requires_admin` so that the test will not be included in the test suites executed against Production and other environments on which we don't want to run those tests.
When you add a new test that requires Administrator access, apply the RSpec metadata `:requires_admin` so that the test will not be included in the test suites executed against Production and other environments on which we don't want to run those tests.
Note: When running tests locally or configuring a pipeline, the environment variable `QA_CAN_TEST_ADMIN_FEATURES` can be set to `false` to skip tests that have the `:requires_admin` tag.
When running tests locally or configuring a pipeline, the environment variable `QA_CAN_TEST_ADMIN_FEATURES` can be set to `false` to skip tests that have the `:requires_admin` tag.
## Prefer `Commit` resource over `ProjectPush`
## Prefer `Commit` resource over `ProjectPush`
...
@@ -294,7 +293,6 @@ Resource::Repository::ProjectPush.fabricate! do |push|
...
@@ -294,7 +293,6 @@ Resource::Repository::ProjectPush.fabricate! do |push|
end
end
```
```
NOTE: **Note:**
A few exceptions for using a `ProjectPush` would be when your test calls for testing SSH integration or
A few exceptions for using a `ProjectPush` would be when your test calls for testing SSH integration or
@@ -30,7 +30,6 @@ We have started to migrate frontend tests to the [Jest](https://jestjs.io) testi
...
@@ -30,7 +30,6 @@ We have started to migrate frontend tests to the [Jest](https://jestjs.io) testi
Jest tests can be found in `/spec/frontend` and `/ee/spec/frontend` in EE.
Jest tests can be found in `/spec/frontend` and `/ee/spec/frontend` in EE.
NOTE: **Note:**
Most examples have a Jest and Karma example. See the Karma examples only as explanation to what's going on in the code, should you stumble over some use cases during your discovery. The Jest examples are the one you should follow.
Most examples have a Jest and Karma example. See the Karma examples only as explanation to what's going on in the code, should you stumble over some use cases during your discovery. The Jest examples are the one you should follow.
@@ -220,7 +220,6 @@ In this setup, an extra Rails route must be implemented in order to handle autho
...
@@ -220,7 +220,6 @@ In this setup, an extra Rails route must be implemented in order to handle autho
and [its routes](https://gitlab.com/gitlab-org/gitlab/blob/cc723071ad337573e0360a879cbf99bc4fb7adb9/config/routes/git_http.rb#L31-32).
and [its routes](https://gitlab.com/gitlab-org/gitlab/blob/cc723071ad337573e0360a879cbf99bc4fb7adb9/config/routes/git_http.rb#L31-32).
-[API endpoints for uploading packages](packages.md#file-uploads).
-[API endpoints for uploading packages](packages.md#file-uploads).
Note: **Note:**
This will fallback to _disk buffered upload_ when `direct_upload` is disabled inside the [object storage setting](../administration/uploads.md#object-storage-settings).
This will fallback to _disk buffered upload_ when `direct_upload` is disabled inside the [object storage setting](../administration/uploads.md#object-storage-settings).
The answer to the `/authorize` call will only contain a file system path.
The answer to the `/authorize` call will only contain a file system path.
More complex expressions are also possible (for example, using `COALESCE`).
More complex expressions are also possible (e.g. using `COALESCE`). Look at the existing event classes for examples.
Review the existing event classes for examples.
In some cases, defining the `timestamp_projection` method is not enough. The calculation query should know which table contains the timestamp expression. Each `Event` class is responsible for making modifications to the calculation query to make the `timestamp_projection` work. This usually means joining an additional table.
In some cases, defining the `timestamp_projection` method is not enough. The calculation query should know which table contains the timestamp expression. Each `Event` class is responsible for making modifications to the calculation query to make the `timestamp_projection` work. This usually means joining an additional table.
@@ -106,13 +106,12 @@ class RenameUsersUpdatedAtToUpdatedAtTimestamp < ActiveRecord::Migration[4.2]
...
@@ -106,13 +106,12 @@ class RenameUsersUpdatedAtToUpdatedAtTimestamp < ActiveRecord::Migration[4.2]
end
end
```
```
This will take care of renaming the column, ensuring data stays in sync, copying
This will take care of renaming the column, ensuring data stays in sync, and
over indexes and foreign keys, etc.
copying over indexes and foreign keys.
NOTE: **Note:**
If a column contains one or more indexes that don't contain the name of the
If a column contains 1 or more indexes that do not contain the name of
original column, the previously described procedure will fail. In that case,
the original column, the above procedure will fail. In this case you will first
you'll first need to rename these indexes.
need to rename these indexes.
### Step 2: Add A Post-Deployment Migration
### Step 2: Add A Post-Deployment Migration
...
@@ -137,7 +136,6 @@ class CleanupUsersUpdatedAtRename < ActiveRecord::Migration[4.2]
...
@@ -137,7 +136,6 @@ class CleanupUsersUpdatedAtRename < ActiveRecord::Migration[4.2]
end
end
```
```
NOTE: **Note:**
If you're renaming a [large table](https://gitlab.com/gitlab-org/gitlab/-/blob/master/rubocop/rubocop-migrations.yml#L3), please carefully consider the state when the first migration has run but the second cleanup migration hasn't been run yet.
If you're renaming a [large table](https://gitlab.com/gitlab-org/gitlab/-/blob/master/rubocop/rubocop-migrations.yml#L3), please carefully consider the state when the first migration has run but the second cleanup migration hasn't been run yet.
With [Canary](https://gitlab.com/gitlab-com/gl-infra/readiness/-/tree/master/library/canary/) it is possible that the system runs in this state for a significant amount of time.
With [Canary](https://gitlab.com/gitlab-com/gl-infra/readiness/-/tree/master/library/canary/) it is possible that the system runs in this state for a significant amount of time.
...
@@ -148,7 +146,7 @@ done without requiring downtime. However, this does require that any application
...
@@ -148,7 +146,7 @@ done without requiring downtime. However, this does require that any application
changes are deployed _first_. Thus, changing the constraints of a column should
changes are deployed _first_. Thus, changing the constraints of a column should
happen in a post-deployment migration.
happen in a post-deployment migration.
NOTE: Avoid using `change_column` as it produces an inefficient query because it re-defines
Avoid using `change_column` as it produces an inefficient query because it re-defines
the whole column type.
the whole column type.
You can check the following guides for each specific use case:
You can check the following guides for each specific use case: