Age | Commit message (Collapse) | Author |
|
Add frozen_string_literal to spec/lib (part 1)
See merge request gitlab-org/gitlab-ce!31130
|
|
Remove code related to object hierarchy and MySQL
Closes #65056 and #65055
See merge request gitlab-org/gitlab-ce!31095
|
|
Using the sed script from
https://gitlab.com/gitlab-org/gitlab-ce/issues/59758
|
|
These are not required because MySQL is not
supported anymore
|
|
Changes all calls to data_source_exists? to table_exists?
since that is the intent of these calls
|
|
- Background migration for changing null values to false
- Set false as default value for private_profile DB column
|
|
Add cleanup migration for MR's multiple assignees
See merge request gitlab-org/gitlab-ce!30269
|
|
This fixes the `Namespace#name` and `Route#name` for all user
namespaces and their personal projects in case they don't match the
user name anymore.
More info info in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/23272
|
|
The migration steals the remaining background jobs
of populating MRs with assignees, executes them
synchronously and then makes sure that all the
assignees are migrated
|
|
This removes old migrations that violate the
FactoriesinMigrationSpecs cop
|
|
On the assumption that a background migration whose specs need a schema
older than 2018 is obsoleted by this migration squash, we can remove
both specs and code for those that fail to run in CI as a result of the
schema at that date no longer existing.
This is true for all but the MigrateStageStatus background migration,
which is also used from the MigrateBuildStage background migration.
|
|
This backports all EE schema changes to CE, including EE migrations,
ensuring both use the same schema.
== Updated tests
A spec related to ghost and support bot users had to be modified to make
it pass. The spec in question assumes that the "support_bot" column
exists when defining the spec. In the single codebase setup this is not
the case, as the column is backported in a later migration. Any attempt
to use a different schema version or use of "around" blocks to
conditionally disable specs won't help, as reverting the backport
migration would also drop the "support_bot" column. Removing the
"support_bot" tests entirely appears to be the only solution.
We also need to update some foreign key tests now that we have
backported the EE columns. Fortunately, these changes are very minor.
== Backporting migrations
This commit moves EE specific migrations (except those for the Geo
tracking database) and related files to CE, and also removes any traces
of the ee/db directory.
Some migrations had to be modified or removed, as they no longer work
with the schema being backported. These migrations were all quite old,
so we opted for removing them where modifying them would take too much
time and effort.
Some old migrations were modified in EE, while also existing in CE. In
these cases we took the EE code, and in one case removed them entirely.
It's not worth spending time trying to merge these changes somehow as we
plan to remove old migrations around the release of 12.0, see
https://gitlab.com/gitlab-org/gitlab-ce/issues/59177 for more details.
|
|
This reverts commit fd19f887dfeeeedb483c4a4fb32f9f768e89389c, reversing
changes made to abb2d4c601d796339c8d7cb0c00946696730f198.
|
|
We need to stub default_git_depth and default_git_depth= because some
old migrations specs try to create a record using schema before that
column was introduced.
The `let!` calls were executed before the `before` hook which still
caused some factories to fail, so they're created in the `before` hook
now as well.
|
|
Add project level git depth setting
Closes #59688
See merge request gitlab-org/gitlab-ce!28919
|
|
Uploads coming from AttachmentUploader
need to be moved to the currently supported location
(FileUploader)
|
|
We need to stub default_git_depth and default_git_depth= because some
old migrations specs try to create a record using schema before that
column was introduced.
|
|
Introduce default_git_depth in project's CI/CD settings and set it to
50. Use it if there is no GIT_DEPTH variable specified. Apply this
default only to newly created projects and keep it nil for old ones
in order to not break pipelines that rely on non-shallow clones.
default_git_depth can be updated from CI/CD Settings in the UI, must be
either nil or integer between 0 and 1000 (incl).
Inherit default_git_depth from the origin project when forking projects.
MR pipelines are run on a MR ref (refs/merge-requests/:iid/merge) and it
contains unique commit (i.e. merge commit) which doesn't exist in the
other branch/tags refs. We need to add it cause otherwise it may break
pipelines for old projects that have already enabled Pipelines for merge
results and have git depth 0.
Document new default_git_depth project CI/CD setting
|
|
Adds migrations to reset the merge_status of opened,
mergeable MRs. That's required by
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/28513
so we're able to sync the status update along merge-ref,
without leaving MRs with a stale merge-ref.
|
|
|
|
Model.new.attributes now also returns encrypted attributes.
|
|
Signed-off-by: Rémy Coutable <remy@rymai.me>
|
|
Fix stage index migration failing in PostgreSQL 10
Closes #59985
See merge request gitlab-org/gitlab-ce!26972
|
|
- rewords examples starting with 'should'
- rewords examples starting with 'it'
Note: I had to manually fixup "onlies" to "only"
|
|
As discussed in
https://www.postgresql.org/message-id/9922.1353433645%40sss.pgh.pa.us,
the PostgreSQL window function last_value may not consider the
right rows:
Note that first_value, last_value, and nth_value consider only the rows
within the "window frame", which by default contains the rows from the
start of the partition through the last peer of the current row. This is
likely to give unhelpful results for last_value and sometimes also
nth_value. You can redefine the frame by adding a suitable frame
specification (RANGE or ROWS) to the OVER clause. See Section 4.2.8 for
more information about frame specifications.
This query could be fixed by adding `RANGE BETWEEN UNBOUNDED PRECEDING
AND UNBOUNDED FOLLOWING`, but that's quite verbose. It's simpler just to
use the first_value function.
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/59985
|
|
This will be further required for supporting multi-assignees MRs
|
|
|
|
Token column are no longer used as token values are stored digested in
token_digest.
|
|
Signed-off-by: Rémy Coutable <remy@rymai.me>
|
|
'Populate cluster kubernetes namespace' was using factories for their
specs. According to our documentation (see spec/migrations/readme.md),
we should use table helper to create a temproary ActiveRecord::Base
derived model for a table.
|
|
|
|
|
|
On GitLab.com, we saw numerous duplicate disk entry inserts because
the migration was not taking the routes table into account. We now
implement this in the migration to be consistent.
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/56061
|
|
We've found some problems with the backgroung migration:
BackfillLegacyProjectRepositories
See https://gitlab.com/gitlab-org/gitlab-ce/issues/56061
The migration was disabled to run on production:
https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/5906
So to overcome it's not being run anywhere, just remove it.
Whenever all problems in BackfillLegacyProjectRepositories are fixed
we'll create a new migration (with a different timestamp) to have it
run.
|
|
These are data columns that store runtime configuration
of build needed to execute it on runner and within pipeline.
The definition of this data is that once used, and when no longer
needed (due to retry capability) they can be freely removed.
They use `jsonb` on PostgreSQL, and `text` on MySQL (due to lacking
support for json datatype on old enough version).
|
|
|
|
Adds a background migration that will ensure all projects that
are on legacy storage have a row in `project_repositories`.
|
|
spec/lib/gitlab/background_migration/migrate_stage_status_spec.rb:9: warning: already initialized constant STATUSES
spec/lib/gitlab/background_migration/migrate_build_stage_spec.rb:9: warning: previous definition of STATUSES was here
|
|
Populate MR metrics with events table information (migration)
Closes #41587
See merge request gitlab-org/gitlab-ce!23564
|
|
|
|
|
|
This adds a background migration that will ensure all projects that
are on hashed storage have a row in `project_repositories`.
Related issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/48527
|
|
|
|
* master: (243 commits)
Conflicts:
db/schema.rb
lib/gitlab/import_export/import_export.yml
|
|
Or otherwise do not try to write repo config.
|
|
|
|
|
|
If the EncryptColumns background migration runs in a sidekiq with a
stale view of the database schema, or when the purported destination
columns don't actually exist, data loss can result. Attempt to work
around these issues by reloading schema information before running
the migration, and raising errors if the model reports that any of its
source or destination columns are missing.
|
|
|
|
|