diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-11-04 11:37:49 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-11-04 18:41:27 +0100 |
commit | 9c66b78cdcdd85c9d9023dbfa8914d5748279e19 (patch) | |
tree | f2f95d6323a1a0737a890d9d3e01ec8e940bf320 /lib | |
parent | aca7d01ddde166f955265a311590fa20c6f35d1c (diff) | |
download | gitlab-ce-9c66b78cdcdd85c9d9023dbfa8914d5748279e19.tar.gz |
Merge branch '24059-round-robin-repository-storage' into 'master'
Resolve "Introduce round-robin project creation to spread load over multiple shards"
Allow multiple shards to be enabled in the admin settings page, balancing project creation across all enabled shards.
* `f.select ..., multiple: true` isn't the most beautiful UI in the world, but switching to `collection_check_boxes` (or a facsimile thereof) isn't trivial
* Should `pick_repository_storage` be a method of `ApplicationSetting`, or `Project`? It's going to accrete logic over time so perhaps it should be its own class already?
* This is written to avoid the need for a database migration, so it is`serialize :repository_storage` without `, Array`. This is tested, but alternatives include:
* Add a database migration
* Write a custom Coder that will accept a String or Array in `load` and always `dump an Array.
Closes #24059
See merge request !7273
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/entities.rb | 1 | ||||
-rw-r--r-- | lib/api/settings.rb | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index ab9d2d54f4b..81ce5e807ed 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -510,6 +510,7 @@ module API expose :after_sign_out_path expose :container_registry_token_expire_delay expose :repository_storage + expose :repository_storages expose :koding_enabled expose :koding_url end diff --git a/lib/api/settings.rb b/lib/api/settings.rb index c885fcd7ea3..c4cb1c7924a 100644 --- a/lib/api/settings.rb +++ b/lib/api/settings.rb @@ -17,12 +17,12 @@ module API present current_settings, with: Entities::ApplicationSetting end - # Modify applicaiton settings + # Modify application settings # # Example Request: # PUT /application/settings put "application/settings" do - attributes = current_settings.attributes.keys - ["id"] + attributes = ["repository_storage"] + current_settings.attributes.keys - ["id"] attrs = attributes_for_keys(attributes) if current_settings.update_attributes(attrs) |