Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
4190ff47
Commit
4190ff47
authored
Sep 29, 2021
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab master
parents
55545ce9
aff5848f
Changes
89
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
89 changed files
with
749 additions
and
343 deletions
+749
-343
.gitlab/issue_templates/Geo Replicate a new Git repository type.md
...ssue_templates/Geo Replicate a new Git repository type.md
+1
-1
.gitlab/issue_templates/Geo Replicate a new blob type.md
.gitlab/issue_templates/Geo Replicate a new blob type.md
+1
-1
.rubocop.yml
.rubocop.yml
+0
-1
danger/database/Dangerfile
danger/database/Dangerfile
+2
-2
doc/ci/jobs/ci_job_token.md
doc/ci/jobs/ci_job_token.md
+2
-2
ee/db/geo/schema.rb
ee/db/geo/schema.rb
+4
-318
ee/db/geo/schema_migrations/20170206203234
ee/db/geo/schema_migrations/20170206203234
+1
-0
ee/db/geo/schema_migrations/20170223033541
ee/db/geo/schema_migrations/20170223033541
+1
-0
ee/db/geo/schema_migrations/20170302005747
ee/db/geo/schema_migrations/20170302005747
+1
-0
ee/db/geo/schema_migrations/20170526214010
ee/db/geo/schema_migrations/20170526214010
+1
-0
ee/db/geo/schema_migrations/20170605154253
ee/db/geo/schema_migrations/20170605154253
+1
-0
ee/db/geo/schema_migrations/20170606155045
ee/db/geo/schema_migrations/20170606155045
+1
-0
ee/db/geo/schema_migrations/20170614201943
ee/db/geo/schema_migrations/20170614201943
+1
-0
ee/db/geo/schema_migrations/20170627195211
ee/db/geo/schema_migrations/20170627195211
+1
-0
ee/db/geo/schema_migrations/20170906174622
ee/db/geo/schema_migrations/20170906174622
+1
-0
ee/db/geo/schema_migrations/20170906182752
ee/db/geo/schema_migrations/20170906182752
+1
-0
ee/db/geo/schema_migrations/20171005045404
ee/db/geo/schema_migrations/20171005045404
+1
-0
ee/db/geo/schema_migrations/20171009162208
ee/db/geo/schema_migrations/20171009162208
+1
-0
ee/db/geo/schema_migrations/20171009162209
ee/db/geo/schema_migrations/20171009162209
+1
-0
ee/db/geo/schema_migrations/20171101105200
ee/db/geo/schema_migrations/20171101105200
+1
-0
ee/db/geo/schema_migrations/20171115143841
ee/db/geo/schema_migrations/20171115143841
+1
-0
ee/db/geo/schema_migrations/20180201154345
ee/db/geo/schema_migrations/20180201154345
+1
-0
ee/db/geo/schema_migrations/20180314175612
ee/db/geo/schema_migrations/20180314175612
+1
-0
ee/db/geo/schema_migrations/20180315222132
ee/db/geo/schema_migrations/20180315222132
+1
-0
ee/db/geo/schema_migrations/20180320011914
ee/db/geo/schema_migrations/20180320011914
+1
-0
ee/db/geo/schema_migrations/20180320013929
ee/db/geo/schema_migrations/20180320013929
+1
-0
ee/db/geo/schema_migrations/20180321144947
ee/db/geo/schema_migrations/20180321144947
+1
-0
ee/db/geo/schema_migrations/20180322062741
ee/db/geo/schema_migrations/20180322062741
+1
-0
ee/db/geo/schema_migrations/20180323182105
ee/db/geo/schema_migrations/20180323182105
+1
-0
ee/db/geo/schema_migrations/20180326171626
ee/db/geo/schema_migrations/20180326171626
+1
-0
ee/db/geo/schema_migrations/20180327071612
ee/db/geo/schema_migrations/20180327071612
+1
-0
ee/db/geo/schema_migrations/20180331055706
ee/db/geo/schema_migrations/20180331055706
+1
-0
ee/db/geo/schema_migrations/20180402170913
ee/db/geo/schema_migrations/20180402170913
+1
-0
ee/db/geo/schema_migrations/20180405074130
ee/db/geo/schema_migrations/20180405074130
+1
-0
ee/db/geo/schema_migrations/20180412213305
ee/db/geo/schema_migrations/20180412213305
+1
-0
ee/db/geo/schema_migrations/20180419174834
ee/db/geo/schema_migrations/20180419174834
+1
-0
ee/db/geo/schema_migrations/20180419192603
ee/db/geo/schema_migrations/20180419192603
+1
-0
ee/db/geo/schema_migrations/20180427114641
ee/db/geo/schema_migrations/20180427114641
+1
-0
ee/db/geo/schema_migrations/20180510223634
ee/db/geo/schema_migrations/20180510223634
+1
-0
ee/db/geo/schema_migrations/20180613184349
ee/db/geo/schema_migrations/20180613184349
+1
-0
ee/db/geo/schema_migrations/20180727221937
ee/db/geo/schema_migrations/20180727221937
+1
-0
ee/db/geo/schema_migrations/20180802215313
ee/db/geo/schema_migrations/20180802215313
+1
-0
ee/db/geo/schema_migrations/20180803160048
ee/db/geo/schema_migrations/20180803160048
+1
-0
ee/db/geo/schema_migrations/20180806011909
ee/db/geo/schema_migrations/20180806011909
+1
-0
ee/db/geo/schema_migrations/20180806020615
ee/db/geo/schema_migrations/20180806020615
+1
-0
ee/db/geo/schema_migrations/20181213184140
ee/db/geo/schema_migrations/20181213184140
+1
-0
ee/db/geo/schema_migrations/20190314201959
ee/db/geo/schema_migrations/20190314201959
+1
-0
ee/db/geo/schema_migrations/20190612211021
ee/db/geo/schema_migrations/20190612211021
+1
-0
ee/db/geo/schema_migrations/20190802200655
ee/db/geo/schema_migrations/20190802200655
+1
-0
ee/db/geo/schema_migrations/20190923111102
ee/db/geo/schema_migrations/20190923111102
+1
-0
ee/db/geo/schema_migrations/20191007122326
ee/db/geo/schema_migrations/20191007122326
+1
-0
ee/db/geo/schema_migrations/20191010203257
ee/db/geo/schema_migrations/20191010203257
+1
-0
ee/db/geo/schema_migrations/20191010204941
ee/db/geo/schema_migrations/20191010204941
+1
-0
ee/db/geo/schema_migrations/20191025194337
ee/db/geo/schema_migrations/20191025194337
+1
-0
ee/db/geo/schema_migrations/20200121194300
ee/db/geo/schema_migrations/20200121194300
+1
-0
ee/db/geo/schema_migrations/20200407120740
ee/db/geo/schema_migrations/20200407120740
+1
-0
ee/db/geo/schema_migrations/20200707011052
ee/db/geo/schema_migrations/20200707011052
+1
-0
ee/db/geo/schema_migrations/20200707210300
ee/db/geo/schema_migrations/20200707210300
+1
-0
ee/db/geo/schema_migrations/20200710194046
ee/db/geo/schema_migrations/20200710194046
+1
-0
ee/db/geo/schema_migrations/20200730133800
ee/db/geo/schema_migrations/20200730133800
+1
-0
ee/db/geo/schema_migrations/20200811171011
ee/db/geo/schema_migrations/20200811171011
+1
-0
ee/db/geo/schema_migrations/20200827120552
ee/db/geo/schema_migrations/20200827120552
+1
-0
ee/db/geo/schema_migrations/20200915152620
ee/db/geo/schema_migrations/20200915152620
+1
-0
ee/db/geo/schema_migrations/20200924184638
ee/db/geo/schema_migrations/20200924184638
+1
-0
ee/db/geo/schema_migrations/20201208025254
ee/db/geo/schema_migrations/20201208025254
+1
-0
ee/db/geo/schema_migrations/20201208031224
ee/db/geo/schema_migrations/20201208031224
+1
-0
ee/db/geo/schema_migrations/20210120225014
ee/db/geo/schema_migrations/20210120225014
+1
-0
ee/db/geo/schema_migrations/20210125222907
ee/db/geo/schema_migrations/20210125222907
+1
-0
ee/db/geo/schema_migrations/20210208175408
ee/db/geo/schema_migrations/20210208175408
+1
-0
ee/db/geo/schema_migrations/20210217020154
ee/db/geo/schema_migrations/20210217020154
+1
-0
ee/db/geo/schema_migrations/20210217020156
ee/db/geo/schema_migrations/20210217020156
+1
-0
ee/db/geo/schema_migrations/20210223111722
ee/db/geo/schema_migrations/20210223111722
+1
-0
ee/db/geo/schema_migrations/20210225200858
ee/db/geo/schema_migrations/20210225200858
+1
-0
ee/db/geo/schema_migrations/20210313050709
ee/db/geo/schema_migrations/20210313050709
+1
-0
ee/db/geo/schema_migrations/20210313051642
ee/db/geo/schema_migrations/20210313051642
+1
-0
ee/db/geo/schema_migrations/20210325150435
ee/db/geo/schema_migrations/20210325150435
+1
-0
ee/db/geo/schema_migrations/20210407140527
ee/db/geo/schema_migrations/20210407140527
+1
-0
ee/db/geo/schema_migrations/20210420180119
ee/db/geo/schema_migrations/20210420180119
+1
-0
ee/db/geo/schema_migrations/20210504143244
ee/db/geo/schema_migrations/20210504143244
+1
-0
ee/db/geo/schema_migrations/20210505170208
ee/db/geo/schema_migrations/20210505170208
+1
-0
ee/db/geo/schema_migrations/20210624160455
ee/db/geo/schema_migrations/20210624160455
+1
-0
ee/db/geo/schema_migrations/20210706120644
ee/db/geo/schema_migrations/20210706120644
+1
-0
ee/db/geo/schema_migrations/20210818111211
ee/db/geo/schema_migrations/20210818111211
+1
-0
ee/db/geo/schema_migrations/20210820152707
ee/db/geo/schema_migrations/20210820152707
+1
-0
ee/db/geo/structure.sql
ee/db/geo/structure.sql
+621
-0
ee/lib/gitlab/geo/database_tasks.rb
ee/lib/gitlab/geo/database_tasks.rb
+17
-9
ee/lib/tasks/geo.rake
ee/lib/tasks/geo.rake
+11
-4
ee/spec/lib/gitlab/geo/database_tasks_spec.rb
ee/spec/lib/gitlab/geo/database_tasks_spec.rb
+3
-3
ee/spec/tasks/geo_rake_spec.rb
ee/spec/tasks/geo_rake_spec.rb
+9
-2
No files found.
.gitlab/issue_templates/Geo Replicate a new Git repository type.md
View file @
4190ff47
...
...
@@ -109,7 +109,7 @@ Geo secondary sites have a [Geo tracking database](https://gitlab.com/gitlab-org
bin/rake geo:db:migrate
```
-
[ ] Be sure to commit the relevant changes in
`ee/db/geo/s
chema.rb
`
-
[ ] Be sure to commit the relevant changes in
`ee/db/geo/s
tructure.sql
`
### Add verification state fields on the Geo primary site
...
...
.gitlab/issue_templates/Geo Replicate a new blob type.md
View file @
4190ff47
...
...
@@ -110,7 +110,7 @@ Geo secondary sites have a [Geo tracking database](https://gitlab.com/gitlab-org
bin/rake geo:db:migrate
```
-
[ ] Be sure to commit the relevant changes in
`ee/db/geo/s
chema.rb
`
-
[ ] Be sure to commit the relevant changes in
`ee/db/geo/s
tructure.sql
`
### Add verification state fields on the Geo primary site
...
...
.rubocop.yml
View file @
4190ff47
...
...
@@ -28,7 +28,6 @@ AllCops:
-
'
node_modules/**/*'
-
'
db/fixtures/**/*'
-
'
db/schema.rb'
-
'
ee/db/geo/schema.rb'
-
'
tmp/**/*'
-
'
bin/**/*'
-
'
generator_templates/**/*'
...
...
danger/database/Dangerfile
View file @
4190ff47
...
...
@@ -33,7 +33,7 @@ MSG
DATABASE_APPROVED_LABEL
=
'database::approved'
non_geo_db_schema_updated
=
!
git
.
modified_files
.
grep
(
%r{
\A
db/structure
\.
sql}
).
empty?
geo_db_schema_updated
=
!
git
.
modified_files
.
grep
(
%r{
\A
ee/db/geo/s
chema
\.
rb
}
).
empty?
geo_db_schema_updated
=
!
git
.
modified_files
.
grep
(
%r{
\A
ee/db/geo/s
tructure
\.
sql
}
).
empty?
non_geo_migration_created
=
!
git
.
added_files
.
grep
(
%r{
\A
(db/(post_)?migrate)/}
).
empty?
geo_migration_created
=
!
git
.
added_files
.
grep
(
%r{
\A
ee/db/geo/(post_)?migrate/}
).
empty?
...
...
@@ -45,7 +45,7 @@ if non_geo_migration_created && !non_geo_db_schema_updated
end
if
geo_migration_created
&&
!
geo_db_schema_updated
warn
format
(
format_str
,
migrations:
'Geo migrations'
,
schema:
helper
.
html_link
(
"ee/db/geo/s
chema.rb
"
))
warn
format
(
format_str
,
migrations:
'Geo migrations'
,
schema:
helper
.
html_link
(
"ee/db/geo/s
tructure.sql
"
))
end
return
unless
helper
.
ci?
...
...
doc/ci/jobs/ci_job_token.md
View file @
4190ff47
...
...
@@ -12,9 +12,9 @@ When a pipeline job is about to run, GitLab generates a unique token and injects
You can use a GitLab CI/CD job token to authenticate with specific API endpoints:
-
Packages:
-
[
Package Registry
](
../../user/packages/package_registry/index.md
)
. To push to the
-
[
Package Registry
](
../../user/packages/package_registry/index.md
#use-gitlab-cicd-to-build-packages
)
. To push to the
Package Registry, you can use
[
deploy tokens
](
../../user/project/deploy_tokens/index.md
)
.
-
[
Container Registry
](
../../user/packages/container_registry/index.md
)
-
[
Container Registry
](
../../user/packages/container_registry/index.md
#build-and-push-by-using-gitlab-cicd
)
(the
`$CI_REGISTRY_PASSWORD`
is
`$CI_JOB_TOKEN`
).
-
[
Container Registry API
](
../../api/container_registry.md
)
(scoped to the job's project, when the
`ci_job_token_scope`
feature flag is enabled).
...
...
ee/db/geo/schema.rb
View file @
4190ff47
This diff is collapsed.
Click to expand it.
ee/db/geo/schema_migrations/20170206203234
0 → 100644
View file @
4190ff47
fc56ad577659aeb35893c644f404cbe226ef5c4b64d46bd7a6979917170e8379
\ No newline at end of file
ee/db/geo/schema_migrations/20170223033541
0 → 100644
View file @
4190ff47
03f26e06b4a8ba1d7f4793ed59f2790bc782de059a377777adeaa05645d940bc
\ No newline at end of file
ee/db/geo/schema_migrations/20170302005747
0 → 100644
View file @
4190ff47
1ee3e2ecb36df2c136430b7a302121cb8b916b54966a1d9c53fb959058b1101c
\ No newline at end of file
ee/db/geo/schema_migrations/20170526214010
0 → 100644
View file @
4190ff47
ffdbcf4ba41532961d8245078c5c80997fc8a7494181e9aae22d8d8eb0d84fae
\ No newline at end of file
ee/db/geo/schema_migrations/20170605154253
0 → 100644
View file @
4190ff47
6ce74aada3515fe681d55c19f3b483d44dae6878bfdc8713377a0eece3591701
\ No newline at end of file
ee/db/geo/schema_migrations/20170606155045
0 → 100644
View file @
4190ff47
7585f2682dc0b35f3bc5e105bd338ce3602cec7e6301a1a59c3b8342e6dd10bd
\ No newline at end of file
ee/db/geo/schema_migrations/20170614201943
0 → 100644
View file @
4190ff47
3d715f80eeda6d29cb4bfb725dca4303160d6be515371015726d86d4cfc92b58
\ No newline at end of file
ee/db/geo/schema_migrations/20170627195211
0 → 100644
View file @
4190ff47
ddcfa3398a102a01eda15bb3fa0b6a796011186084b291efd3a0766d327cd22e
\ No newline at end of file
ee/db/geo/schema_migrations/20170906174622
0 → 100644
View file @
4190ff47
158f354fa311961e328951fc365c8d0a87e6c55fbc8bd477b623006abaf18dfe
\ No newline at end of file
ee/db/geo/schema_migrations/20170906182752
0 → 100644
View file @
4190ff47
44f717e6b7bd87909ea978cdd74991babd0dd3a8e44dbfa4a6b7ec0874dfeeff
\ No newline at end of file
ee/db/geo/schema_migrations/20171005045404
0 → 100644
View file @
4190ff47
89faad46515d44af495b75b7c6ebcdc2c282fbb965cf5f6b34c4df534378b4c5
\ No newline at end of file
ee/db/geo/schema_migrations/20171009162208
0 → 100644
View file @
4190ff47
cb9da5bc60b2d4699c9117e3e384575e393d0c98b6f669606d98781d22dbc3ac
\ No newline at end of file
ee/db/geo/schema_migrations/20171009162209
0 → 100644
View file @
4190ff47
a6cc590283c5160a325ddd66a8139ac9da973670a5e1ec6c13772535da973237
\ No newline at end of file
ee/db/geo/schema_migrations/20171101105200
0 → 100644
View file @
4190ff47
b44a91c540b476b9c63ba247ef9f0e3ee2b696737cc3a59f1b60436dd0d8107f
\ No newline at end of file
ee/db/geo/schema_migrations/20171115143841
0 → 100644
View file @
4190ff47
2fb6f33c9d2942d0c83f550963447e414616ded09718e59b9e657480aa8cdfd5
\ No newline at end of file
ee/db/geo/schema_migrations/20180201154345
0 → 100644
View file @
4190ff47
871f226decc06e96cfb5f8156c7e87accc9475e22cd97d6c41fa27c8eb5855b7
\ No newline at end of file
ee/db/geo/schema_migrations/20180314175612
0 → 100644
View file @
4190ff47
427f9c742870563003a6f7728b8523faed8ad061b00fc01d307d4f2df83867c1
\ No newline at end of file
ee/db/geo/schema_migrations/20180315222132
0 → 100644
View file @
4190ff47
86fd97eff85491d242c8d38acadd383be052175d9e0dcfcecb32aeb152183c34
\ No newline at end of file
ee/db/geo/schema_migrations/20180320011914
0 → 100644
View file @
4190ff47
842585c0203ead10143bba55cb34d2ab360831661db4519f9083306cde9041f0
\ No newline at end of file
ee/db/geo/schema_migrations/20180320013929
0 → 100644
View file @
4190ff47
df6168850c19c25ac7a177cf91bc5c8ee73fca93724f171d427bf9937e9a6a6c
\ No newline at end of file
ee/db/geo/schema_migrations/20180321144947
0 → 100644
View file @
4190ff47
c818e0fc91534f407567d6ee1f9e5cd858392c7afbd22c35463c617ec57296f0
\ No newline at end of file
ee/db/geo/schema_migrations/20180322062741
0 → 100644
View file @
4190ff47
dc1fbc3291af7c261d686747d0985fee6fdc65cce98f262eca496af087020a8c
\ No newline at end of file
ee/db/geo/schema_migrations/20180323182105
0 → 100644
View file @
4190ff47
701f46d9972f184c27e2e8bc3631296138b522035ff35624db9688de9ae3d34b
\ No newline at end of file
ee/db/geo/schema_migrations/20180326171626
0 → 100644
View file @
4190ff47
322e4466d309ccfd8f24064c7835d9b271268d290e8204af06587fa2f5313272
\ No newline at end of file
ee/db/geo/schema_migrations/20180327071612
0 → 100644
View file @
4190ff47
72c5a2f8a94566a34fcc3df16b72a4239a37a9b1098ce31284d42bd5fefa52c0
\ No newline at end of file
ee/db/geo/schema_migrations/20180331055706
0 → 100644
View file @
4190ff47
43b9134bcd2c244859497764ae902da51e69320827301be4033b358cd2be3cfe
\ No newline at end of file
ee/db/geo/schema_migrations/20180402170913
0 → 100644
View file @
4190ff47
646959b39da5bb35f03941af129444c4364218ecc72ba9ffcfb869fa1d83e030
\ No newline at end of file
ee/db/geo/schema_migrations/20180405074130
0 → 100644
View file @
4190ff47
497de32713debe7016d643f0d9a1eafd6d4dd982c6f56374e26fc91647a61c64
\ No newline at end of file
ee/db/geo/schema_migrations/20180412213305
0 → 100644
View file @
4190ff47
6616c486d58e39cc4452f4d28a9f47e5c376ee5e6e9450d9659412467569e9b3
\ No newline at end of file
ee/db/geo/schema_migrations/20180419174834
0 → 100644
View file @
4190ff47
07196b409c0c9e73e4707a8137716f025f09238869e1b319efa045a0a8a97f74
\ No newline at end of file
ee/db/geo/schema_migrations/20180419192603
0 → 100644
View file @
4190ff47
8c8454796921d35b59261c9d3a9a29d5c3b52dd85a0171a36b81c0316563d984
\ No newline at end of file
ee/db/geo/schema_migrations/20180427114641
0 → 100644
View file @
4190ff47
f555f44342f489f4633fde2961c98c857ba9d673b4bde78b278d8a112858fe3d
\ No newline at end of file
ee/db/geo/schema_migrations/20180510223634
0 → 100644
View file @
4190ff47
01b19219e46985ac5dc1df2e6afb45fb9d006f082fadf1565eb4ac9206afb01a
\ No newline at end of file
ee/db/geo/schema_migrations/20180613184349
0 → 100644
View file @
4190ff47
853357855ebdc76d39a991b402764bc8009f47473f6f03e74c6ec26602695442
\ No newline at end of file
ee/db/geo/schema_migrations/20180727221937
0 → 100644
View file @
4190ff47
b035dbc1bafa92ab1595cb416314f23052b09fac4aff7d8e0556cdae752300fa
\ No newline at end of file
ee/db/geo/schema_migrations/20180802215313
0 → 100644
View file @
4190ff47
dc5fe525d8ebb0088f4b704b01b4568e2d8cb487156b4bbc6c90c16d53c501fc
\ No newline at end of file
ee/db/geo/schema_migrations/20180803160048
0 → 100644
View file @
4190ff47
a4a38efe967d1bf4a9b29e1545e32b3ea59d3373920b0989f65ccd1e79b79543
\ No newline at end of file
ee/db/geo/schema_migrations/20180806011909
0 → 100644
View file @
4190ff47
79c814920903ea9b92a2540dc9078a2b119ed63cbe02756d16f2c482ca1889ec
\ No newline at end of file
ee/db/geo/schema_migrations/20180806020615
0 → 100644
View file @
4190ff47
309fceeed92c7454495742644158f9cd2c31d75fc489cffdf18992c69f9b10c7
\ No newline at end of file
ee/db/geo/schema_migrations/20181213184140
0 → 100644
View file @
4190ff47
9c00de916aaa87b205fede9ae8c4decc03a1987fd038cd888abc905556da6334
\ No newline at end of file
ee/db/geo/schema_migrations/20190314201959
0 → 100644
View file @
4190ff47
67b34fe78c0d2f25fde2d7a981bc2de1053d46dad9d911df16d238ea02749197
\ No newline at end of file
ee/db/geo/schema_migrations/20190612211021
0 → 100644
View file @
4190ff47
805651c9c9f4fcc7ee69be2a774334bd3dea59475f9234da01b8ddc2badb7fb3
\ No newline at end of file
ee/db/geo/schema_migrations/20190802200655
0 → 100644
View file @
4190ff47
5766c582effb731ce3346ccf335eba9350d671b41ab9697c0c81ce901065f33e
\ No newline at end of file
ee/db/geo/schema_migrations/20190923111102
0 → 100644
View file @
4190ff47
a6804d3592cfde2b9541a1cfa20fb67762fa82cf9ebc3f703a98668f742995b0
\ No newline at end of file
ee/db/geo/schema_migrations/20191007122326
0 → 100644
View file @
4190ff47
15e06328a76772499ce08936d7e11e272ca57c3a5e04246a9b2ddab5e651d0c4
\ No newline at end of file
ee/db/geo/schema_migrations/20191010203257
0 → 100644
View file @
4190ff47
e1a58a3bc183214d280b253d0171cb97fca3c065a67a746214cf5d096acf0834
\ No newline at end of file
ee/db/geo/schema_migrations/20191010204941
0 → 100644
View file @
4190ff47
d7c8a2d1a8a4f36781a56475f8d96e830a33a7e94cfe4f622f28c6c43b76323d
\ No newline at end of file
ee/db/geo/schema_migrations/20191025194337
0 → 100644
View file @
4190ff47
2a6439cf81ef55b063b277112847b436f7daf37f1fc1d3e76261dc49e8ddba9b
\ No newline at end of file
ee/db/geo/schema_migrations/20200121194300
0 → 100644
View file @
4190ff47
4fbed5a9d9fb34137db151b78efdc9cf7ffbeb445728a1dbf536f1f8d621f066
\ No newline at end of file
ee/db/geo/schema_migrations/20200407120740
0 → 100644
View file @
4190ff47
2447efe0b351ce5f18aca8c9193541bbd83cdc8a6d009306b57c4158d80525b8
\ No newline at end of file
ee/db/geo/schema_migrations/20200707011052
0 → 100644
View file @
4190ff47
91b9f4eece930583053a215792537f8288e8d7226d1cb619eff167999d2c63d9
\ No newline at end of file
ee/db/geo/schema_migrations/20200707210300
0 → 100644
View file @
4190ff47
73adf0b2df8b314fa4911087d54649e2b2d83310516dd1b7557f8195875744d6
\ No newline at end of file
ee/db/geo/schema_migrations/20200710194046
0 → 100644
View file @
4190ff47
7dc9e31a729e11dfc4888d681f21b4260d4345d63ec2142aa3e78889d4c60c87
\ No newline at end of file
ee/db/geo/schema_migrations/20200730133800
0 → 100644
View file @
4190ff47
b99486cc34650ba7f735f04813cfcb3af24f8cebe8b293d4ef8db7f08b99fb04
\ No newline at end of file
ee/db/geo/schema_migrations/20200811171011
0 → 100644
View file @
4190ff47
e0c194fd28eb186918b71e5d90517cab6bc63d6ae0bdce69ea3bf3e89596e124
\ No newline at end of file
ee/db/geo/schema_migrations/20200827120552
0 → 100644
View file @
4190ff47
7b11f57bd5e4e96676c78335096b2e12b83fdfbc7b7df04fa18fb5b64ce963d1
\ No newline at end of file
ee/db/geo/schema_migrations/20200915152620
0 → 100644
View file @
4190ff47
faf6f0c60a3a0151995bf0d7973820de649aad4e6d708575e9ae79317ad893eb
\ No newline at end of file
ee/db/geo/schema_migrations/20200924184638
0 → 100644
View file @
4190ff47
7123ecf2a4b6cd114173126eb9375f050a1bc9b17df4a434f03b42ff902fe407
\ No newline at end of file
ee/db/geo/schema_migrations/20201208025254
0 → 100644
View file @
4190ff47
f9e1bca1a7a0c6642359689fa3340313d1d3fdadf31c338c971cb9313cf2b983
\ No newline at end of file
ee/db/geo/schema_migrations/20201208031224
0 → 100644
View file @
4190ff47
84bd01454296401f86c1866a33c6b45091333c6b3d638f5384b9c474bd7ab290
\ No newline at end of file
ee/db/geo/schema_migrations/20210120225014
0 → 100644
View file @
4190ff47
27d0aa487d569f90cf5f408fca0040b4bd679394520f41c602c2179891ffbb3b
\ No newline at end of file
ee/db/geo/schema_migrations/20210125222907
0 → 100644
View file @
4190ff47
0f364cf251d7fcda281145d84dda51cd67d33e4dfe87a805b3b188227c0dddbd
\ No newline at end of file
ee/db/geo/schema_migrations/20210208175408
0 → 100644
View file @
4190ff47
2b4bb29e09a1cc599c7b6e2b455bd6ea3175f3b7470ff8cbfef8be686dfb2abc
\ No newline at end of file
ee/db/geo/schema_migrations/20210217020154
0 → 100644
View file @
4190ff47
11f9ae81865a4315d6b46d90c1636252333747c095de567a056ebb344bc0e702
\ No newline at end of file
ee/db/geo/schema_migrations/20210217020156
0 → 100644
View file @
4190ff47
392afdcfb817a88a3cd35afa4db87749bc70418913dd90dbca616c06cdb24b1d
\ No newline at end of file
ee/db/geo/schema_migrations/20210223111722
0 → 100644
View file @
4190ff47
d009ec5b2c7ec6b1f54969dc182c47400e0a6a14f77174852ea42bc5c7823a27
\ No newline at end of file
ee/db/geo/schema_migrations/20210225200858
0 → 100644
View file @
4190ff47
b63d6fbfdcf0caf5399cb0c7579831d9187a18de88c7e516a84d21625e5fc963
\ No newline at end of file
ee/db/geo/schema_migrations/20210313050709
0 → 100644
View file @
4190ff47
823dc59c6b24cfd1784d1dd45e26f8e365e2e812001aa94b9a59daa1e1999f16
\ No newline at end of file
ee/db/geo/schema_migrations/20210313051642
0 → 100644
View file @
4190ff47
10bbe723769c6bf30f11406eb7f336f55b5b7b0e805c2fdeb24b018895315fd6
\ No newline at end of file
ee/db/geo/schema_migrations/20210325150435
0 → 100644
View file @
4190ff47
88a3355eb13da8ebccffeef580371a9ed6913baa0755ec4fe84a477eb02de432
\ No newline at end of file
ee/db/geo/schema_migrations/20210407140527
0 → 100644
View file @
4190ff47
710ade13436e31c2d8170d85e8890475db8f07fd60c2b89a14ef8824be005bc2
\ No newline at end of file
ee/db/geo/schema_migrations/20210420180119
0 → 100644
View file @
4190ff47
4cb0e40afc41a81af078e1afc53773fcee508bd4c4d6447ec432d8a28f743177
\ No newline at end of file
ee/db/geo/schema_migrations/20210504143244
0 → 100644
View file @
4190ff47
2af1ff7554c41a412ee92bea810127c5f38485a49e93c7da021b2590544e5150
\ No newline at end of file
ee/db/geo/schema_migrations/20210505170208
0 → 100644
View file @
4190ff47
ce8b83b1233035e24a58a79755fc062bc699f1b5337dfc74de0666a968ac484d
\ No newline at end of file
ee/db/geo/schema_migrations/20210624160455
0 → 100644
View file @
4190ff47
7376c4a2de86ac8879209571757319c9dc1c1b08292f55b904b4e60041d91e56
\ No newline at end of file
ee/db/geo/schema_migrations/20210706120644
0 → 100644
View file @
4190ff47
6c974f3987f274ec7cd5ce2225a7cc4170c87a487c981c65b94df4c3a7bd25c9
\ No newline at end of file
ee/db/geo/schema_migrations/20210818111211
0 → 100644
View file @
4190ff47
08472c4eefc6f596e2e705c62ea3aedc3c2db40ad8c6e169f597da6504ddfaa1
\ No newline at end of file
ee/db/geo/schema_migrations/20210820152707
0 → 100644
View file @
4190ff47
c57c851e7a2c7f393ae93df48cda9021b49cfb4bc75093462fd49f6502d02175
\ No newline at end of file
ee/db/geo/structure.sql
0 → 100644
View file @
4190ff47
This diff is collapsed.
Click to expand it.
ee/lib/gitlab/geo/database_tasks.rb
View file @
4190ff47
...
...
@@ -64,10 +64,7 @@ module Gitlab
require
'active_record/schema_dumper'
Gitlab
::
Geo
::
DatabaseTasks
.
with_geo_db
do
filename
=
ENV
[
'SCHEMA'
]
||
File
.
join
(
ActiveRecord
::
Tasks
::
DatabaseTasks
.
db_dir
,
'schema.rb'
)
File
.
open
(
filename
,
"w:utf-8"
)
do
|
file
|
ActiveRecord
::
SchemaDumper
.
dump
(
ActiveRecord
::
Base
.
connection
,
file
)
end
ActiveRecord
::
Tasks
::
DatabaseTasks
.
dump_schema
(
Gitlab
::
Geo
::
DatabaseTasks
.
db_config
)
end
end
end
...
...
@@ -132,10 +129,10 @@ module Gitlab
Gitlab
::
Geo
::
DatabaseTasks
.
with_geo_db
do
should_reconnect
=
ActiveRecord
::
Base
.
connection_pool
.
active_connection?
ActiveRecord
::
Schema
.
verbose
=
false
ActiveRecord
::
Tasks
::
DatabaseTasks
.
load_schema
(
ActiveRecord
::
Base
.
configurations
.
configs_for
(
env_name:
'test'
).
first
,
:
ruby
,
ENV
[
'SCHEMA'
])
ActiveRecord
::
Tasks
::
DatabaseTasks
.
load_schema
(
ActiveRecord
::
Base
.
configurations
.
configs_for
(
env_name:
'test'
).
first
,
:
sql
,
ENV
[
'SCHEMA'
])
ensure
if
should_reconnect
ActiveRecord
::
Base
.
establish_connection
(
ActiveRecord
::
Base
.
configurations
.
configs_for
(
env_name:
ActiveRecord
::
Tasks
::
DatabaseTasks
.
env
).
first
)
ActiveRecord
::
Base
.
establish_connection
(
Gitlab
::
Geo
::
DatabaseTasks
.
db_config
)
end
end
end
...
...
@@ -152,6 +149,7 @@ module Gitlab
database_config:
YAML
.
load_file
(
GEO_DATABASE_CONFIG
),
db_dir:
GEO_DB_DIR
,
migrations_paths:
geo_migrations_paths
,
schema_migrations_path:
geo_schema_migrations_path
,
seed_loader:
SeedLoader
.
new
}
end
...
...
@@ -170,6 +168,10 @@ module Gitlab
Rails
.
root
.
join
(
GEO_DB_DIR
,
'post_migrate'
)
end
def
geo_schema_migrations_path
Rails
.
root
.
join
(
GEO_DB_DIR
,
'schema_migrations'
).
to_s
end
def
with_geo_db
abort_if_no_geo_config!
...
...
@@ -177,7 +179,8 @@ module Gitlab
database_config:
ActiveRecord
::
Tasks
::
DatabaseTasks
.
database_configuration
&
.
dup
||
YAML
.
load_file
(
DATABASE_CONFIG
),
db_dir:
ActiveRecord
::
Tasks
::
DatabaseTasks
.
db_dir
,
migrations_paths:
ActiveRecord
::
Tasks
::
DatabaseTasks
.
migrations_paths
,
seed_loader:
ActiveRecord
::
Tasks
::
DatabaseTasks
.
seed_loader
seed_loader:
ActiveRecord
::
Tasks
::
DatabaseTasks
.
seed_loader
,
schema_migrations_path:
Gitlab
::
Database
::
SchemaMigrations
::
Context
.
default_schema_migrations_path
}
set_db_env
(
geo_settings
)
...
...
@@ -187,16 +190,21 @@ module Gitlab
set_db_env
(
original_settings
)
end
def
db_config
ActiveRecord
::
Base
.
configurations
.
configs_for
(
env_name:
ActiveRecord
::
Tasks
::
DatabaseTasks
.
env
).
first
end
def
set_db_env
(
settings
)
ActiveRecord
::
Tasks
::
DatabaseTasks
.
database_configuration
=
settings
[
:database_config
]
ActiveRecord
::
Tasks
::
DatabaseTasks
.
db_dir
=
settings
[
:db_dir
]
ActiveRecord
::
Tasks
::
DatabaseTasks
.
migrations_paths
=
settings
[
:migrations_paths
]
ActiveRecord
::
Tasks
::
DatabaseTasks
.
seed_loader
=
settings
[
:seed_loader
]
ActiveRecord
::
Base
.
configurations
=
ActiveRecord
::
Tasks
::
DatabaseTasks
.
database_configuration
||
{}
ActiveRecord
::
Base
.
configurations
=
ActiveRecord
::
Tasks
::
DatabaseTasks
.
database_configuration
||
{}
ActiveRecord
::
Migrator
.
migrations_paths
=
ActiveRecord
::
Tasks
::
DatabaseTasks
.
migrations_paths
Gitlab
::
Database
::
SchemaMigrations
::
Context
.
default_schema_migrations_path
=
settings
[
:schema_migrations_path
]
ActiveRecord
::
Base
.
establish_connection
(
ActiveRecord
::
Base
.
configurations
.
configs_for
(
env_name:
ActiveRecord
::
Tasks
::
DatabaseTasks
.
env
).
first
)
ActiveRecord
::
Base
.
establish_connection
(
db_config
)
end
class
SeedLoader
...
...
ee/lib/tasks/geo.rake
View file @
4190ff47
...
...
@@ -38,7 +38,7 @@ namespace :geo do
puts
"Current version:
#{
Gitlab
::
Geo
::
DatabaseTasks
.
version
}
"
end
desc
'GitLab | Geo | DB | Drops and recreates the database from ee/db/geo/s
chema.rb
for the current environment and loads the seeds.'
desc
'GitLab | Geo | DB | Drops and recreates the database from ee/db/geo/s
tructure.sql
for the current environment and loads the seeds.'
task
reset:
[
:environment
]
do
ns
[
'drop'
].
invoke
ns
[
'create'
].
invoke
...
...
@@ -77,12 +77,12 @@ namespace :geo do
end
namespace
:schema
do
desc
'GitLab | Geo | DB | Schema | Load a s
chema.rb
file into the database'
desc
'GitLab | Geo | DB | Schema | Load a s
tructure.sql
file into the database'
task
load:
[
:environment
]
do
Gitlab
::
Geo
::
DatabaseTasks
.
load_schema_current
(
:ruby
,
ENV
[
'SCHEMA'
])
Gitlab
::
Geo
::
DatabaseTasks
.
load_schema_current
(
ActiveRecord
::
Base
.
schema_format
,
ENV
[
'SCHEMA'
])
end
desc
'GitLab | Geo | DB | Schema | Create a ee/db/geo/s
chema.rb
file that is portable against any DB supported by AR'
desc
'GitLab | Geo | DB | Schema | Create a ee/db/geo/s
tructure.sql
file that is portable against any DB supported by AR'
task
dump:
[
:environment
]
do
Gitlab
::
Geo
::
DatabaseTasks
::
Schema
.
dump
...
...
@@ -90,6 +90,13 @@ namespace :geo do
end
end
# Inform Rake that custom tasks should be run every time rake db:schema:dump is run
Rake
::
Task
[
'geo:db:schema:dump'
].
enhance
do
Gitlab
::
Geo
::
DatabaseTasks
.
with_geo_db
do
Rake
::
Task
[
'gitlab:db:clean_structure_sql'
].
invoke
end
end
namespace
:migrate
do
desc
'GitLab | Geo | DB | Migrate | Runs the "up" for a given migration VERSION.'
task
up:
[
:environment
]
do
...
...
ee/spec/lib/gitlab/geo/database_tasks_spec.rb
View file @
4190ff47
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
RSpec
.
describe
Gitlab
::
Geo
::
DatabaseTasks
,
:reestablished_active_record_base
do
let
(
:schema_file
)
{
Rails
.
root
.
join
(
'tmp'
,
'tests'
,
'geo_s
chema.rb
'
).
to_s
}
let
(
:schema_file
)
{
Rails
.
root
.
join
(
'tmp'
,
'tests'
,
'geo_s
tructure.sql
'
).
to_s
}
subject
{
described_class
}
...
...
@@ -59,8 +59,8 @@ RSpec.describe Gitlab::Geo::DatabaseTasks, :reestablished_active_record_base do
describe
described_class
::
Schema
do
describe
'.dump'
do
it
'calls ActiveRecord::
SchemaDumper.dump
'
do
expect
(
ActiveRecord
::
SchemaDumper
).
to
receive
(
:dump
)
it
'calls ActiveRecord::
Tasks::DatabaseTasks.dump_schema
'
do
expect
(
ActiveRecord
::
Tasks
::
DatabaseTasks
).
to
receive
(
:dump_schema
)
subject
.
dump
end
...
...
ee/spec/tasks/geo_rake_spec.rb
View file @
4190ff47
...
...
@@ -6,7 +6,13 @@ RSpec.describe 'geo rake tasks', :geo, :silence_stdout do
include
::
EE
::
GeoHelpers
before
do
Rake
.
application
.
rake_require
'active_record/railties/databases'
Rake
.
application
.
rake_require
'tasks/gitlab/db'
Rake
.
application
.
rake_require
'tasks/geo'
# empty task as env is already loaded
Rake
::
Task
.
define_task
:environment
stub_licensed_features
(
geo:
true
)
end
...
...
@@ -133,15 +139,16 @@ RSpec.describe 'geo rake tasks', :geo, :silence_stdout do
describe
'geo:db:schema_load'
do
it
'loads schema file into database'
do
allow
(
ENV
).
to
receive
(
:[]
).
with
(
'SCHEMA'
)
expect
(
Gitlab
::
Geo
::
DatabaseTasks
).
to
receive
(
:load_schema_current
).
with
(
:
ruby
,
ENV
[
'SCHEMA'
])
expect
(
Gitlab
::
Geo
::
DatabaseTasks
).
to
receive
(
:load_schema_current
).
with
(
:
sql
,
ENV
[
'SCHEMA'
])
run_rake_task
(
'geo:db:schema:load'
)
end
end
describe
'geo:db:schema_dump'
do
it
'creates
schema.rb file'
do
it
'creates
a clean structure.sql file'
,
:reestablished_active_record_base
do
expect
(
Gitlab
::
Geo
::
DatabaseTasks
::
Schema
).
to
receive
(
:dump
)
expect
(
Rake
::
Task
[
'gitlab:db:clean_structure_sql'
]).
to
receive
(
:invoke
)
run_rake_task
(
'geo:db:schema:dump'
)
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment