Skip to content
代码片段 群组 项目
该项目从 https://gitlab.com/gitlab-org/gitlab.git 镜像。 拉取镜像更新于
  1. 3月 27, 2023
  2. 3月 21, 2023
  3. 2月 06, 2023
    • Dylan Griffith's avatar
      Add MainClusterwide::ApplicationRecord and new connection · 20c78598
      Dylan Griffith 创作于
      Adds a new `main_clusterwide` connection option that can be configured
      in `config/database.yml`. This connection is part of the
      [Pods](https://gitlab.com/groups/gitlab-org/-/epics/7582) initiative
      (soon to be renamed to "Silos").
      
      This connection won't be configured in production or even GDK any time
      soon and as such we've opted to have these code paths untested in CI.
      Trying to test this new connection in CI would mean having a separate
      `config/database.yml` that ran all RSpec tests again which is just too
      expensive for this early stage of the project.
      
      The `main_clusterwide` connection will eventually be used to have a
      shared Postgres database that is used by many separate GitLab pods
      (silos/instances). We need to share some data like settings, users,
      licenses across all these pods while separating pod-specific data like
      projects, notes, merge_requests . This allows us to horizontally scale
      most of the data but still users can login and access data in any pod.
      
      When this connection is not configured then the `main` connection will
      be used (as before) so this change should be a no-op for anyone that
      doesn't explicitly go in and add `main_clusterwide` to their
      `config/database.yml`.
      
      There is a lot more detail on the architecture at
      https://docs.gitlab.com/ee/architecture/blueprints/pods/ but the main
      point is that this connection is for "shared" stuff and we're starting
      with `application_settings` and `licenses` as these are the simplest
      tables to decouple.
      
      Changelog: other
      20c78598
  4. 1月 27, 2023
  5. 10月 27, 2022
  6. 10月 23, 2022
  7. 10月 20, 2022
    • Omar Qunsul's avatar
      Ensure schemas are up-to-date after migration tests complete · 673e6eca
      Omar Qunsul 创作于
      If a CI migration leaves the database behind the current database
      schema, we need to ensure that the schema is brought up-to-date after
      the migrations run to prevent other tests from starting from an
      inconsistent state.
      
      This commit consolidates the database cleanup for multiple databases
      by ensuring:
      
      1. After a migration context is complete, either recreate the
      databases (if the number of columns approaches the max) or migrate all
      the schemas back to the latest and drop all data from both databases.
      
      2. After a migration example runs, delete any leftover data for that
      specific database.  If a CI migration leaves the database behind the
      current database schema, we need to ensure that the schema is brought
      up-to-date after the migrations run to prevent putting other tests in
      an inconsistent state.
      
      Related MR:
      https://gitlab.com/gitlab-org/gitlab/-/merge_requests/100233
      
      Closes https://gitlab.com/gitlab-org/gitlab/-/issues/377796
      
      
      
      Changelog: fixed
      Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
      673e6eca
  8. 10月 19, 2022
  9. 10月 15, 2022
    • Omar Qunsul's avatar
      Ensure schemas are up-to-date after migration tests complete · a93da703
      Omar Qunsul 创作于
      If a CI migration leaves the database behind the current database
      schema, we need to ensure that the schema is brought up-to-date after
      the migrations run to prevent other tests from starting from an
      inconsistent state.
      
      This commit consolidates the database cleanup for multiple databases
      by ensuring:
      
      1. After a migration context is complete, either recreate the
      databases (if the number of columns approaches the max) or migrate all
      the schemas back to the latest and drop all data from both databases.
      
      2. After a migration example runs, delete any leftover data for that
      specific database.  If a CI migration leaves the database behind the
      current database schema, we need to ensure that the schema is brought
      up-to-date after the migrations run to prevent putting other tests in
      an inconsistent state.
      
      Related MR:
      https://gitlab.com/gitlab-org/gitlab/-/merge_requests/100233
      
      Closes https://gitlab.com/gitlab-org/gitlab/-/issues/377796
      
      Changelog: fixed
      a93da703
  10. 9月 29, 2022
    • Stan Hu's avatar
      Ensure PostgreSQL versions are memoized at start of tests · 3a83e8e2
      Stan Hu 创作于
      Some GitLab classes, such as `Gitlab::Database::AsWithMaterialized`,
      need to check the PostgreSQL version to determine whether certain
      keywords can be used. We have some specs that specify exact query
      types or check for N+1 queries that might be thrown off by an extra
      `SELECT VERSION()` call. To ensure this doesn't happen, retrieve the
      version at the beginning of the test.
      
      Note that the initializer `config/initializers/1_postgresql_only.rb`
      already attempts to check the PostgreSQL version, but the result isn't
      memoized properly for callers that use
      `ApplicationRecord.database.version`.
      
      This came up in
      https://gitlab.com/gitlab-org/gitlab/-/merge_requests/99097#note_1118427731.
      
      Changelog: changed
      3a83e8e2
  11. 7月 20, 2022
  12. 11月 22, 2021
  13. 11月 19, 2021
    • pbair's avatar
      Only mock ci connections in single db mode · 6eeb7b3e
      pbair 创作于
      Change `mock_ci_connection` to only setup a mocked
      `Ci::ApplicationRecord` connection when running in a single database
      mode. When running with multiple databases, we can use the actual
      `Ci::ApplicationRecord` connection.
      6eeb7b3e
  14. 11月 17, 2021
  15. 11月 10, 2021
  16. 9月 23, 2021
  17. 9月 15, 2021
加载中