Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-08-07Save instance administration project id in DBReuben Pereira
- This will make it easy to identify the project even if admins change the name of the project or move it.
2019-07-12Upgrade to Rails 5.2Heinrich Lee Yu
Updates changed method names and fixes spec failures
2019-03-27Use a Gitlab::FakeApplicationSettings when migrations are pendingRémy Coutable
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-12-19Method `create_from_defaults` will never give nilLin Jen-Shin
2018-12-19Move schema aware defaults to build_from_defaultsLin Jen-Shin
This way we can reuse the safe setting
2018-12-19Return fake if and only if there's no databaseLin Jen-Shin
Because `connect_to_db?` already detects if the table exists or not
2018-12-19Return an ApplicationSetting in CurrentSettingsRémy Coutable
This replaces the use of fake_application_settings with `::ApplicationSetting.build`_from_defaults. The reason is that `fake_application_settings` doesn't have the custom accessors that `ApplicationSetting` has, e.g. `#commit_email_hostname`, thus this can lead to unexpected `nil` values which comes from the database column instead of `.default_commit_email_hostname` returned by `ApplicationSetting#commit_email_hostname`. Using `::ApplicationSetting.build_from_defaults` should be safe as it doesn't try to `INSERT` a DB record, in contrary to `::ApplicationSetting.create_from_defaults` which we used to use, and which created issues that the introduction of `fake_application_settings` tried to resolve (575dced5). Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-10-22Enable frozen string for lib/gitlab/*.rbgfyoung
2018-09-24Simplify by using Gitlab::SafeRequestStoreMichael Kozono
These are clear wins.
2018-09-11Simplify setting of in_memory_application_settingsStan Hu
2018-09-10Ensure in-memory application settings are cleared before each testRémy Coutable
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-07-09Updates from `rubocop -a`Lin Jen-Shin
2018-06-07Make Gitlab::CurrentSettings.current_application_settings return cached ↵Rémy Coutable
settings early if they exist without issuing any DB query Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-06-07Avoid sequential scans loading schema_migrations table when loading ↵Stan Hu
application settings This was causing significant performance problems in production, and this commit reverts to the original behavior.
2018-05-23Simplify Gitlab::CurrentSettings now that the logic is in CacheableAttributesRémy Coutable
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-03-15Cache table_exists?('application_settings') to reduce repeated schema reloadsStan Hu
Closes #43355
2018-02-02use Gitlab::UserSettings directly as a singleton instead of ↵Mario de la Ossa
including/extending it
2017-11-22Move ModuleWithInstanceVariables to Gitlab namespaceLin Jen-Shin
And use .rubocop.yml to exclude paths we don't care, rather than using the cop itself to exclude.
2017-11-17Use StrongMemoize and enable/disable cops properlyLin Jen-Shin
2017-09-18Add cop to make sure we don't use ivar in a moduleLin Jen-Shin
2017-08-31`current_application_settings` belongs on `Gitlab::CurrentSettings`Sean McGivern
The initializers including this were doing so at the top level, so every object loaded after them had a `current_application_settings` method. However, if someone had rack-attack enabled (which was loaded before these initializers), it would try to load the API, and fail, because `Gitlab::CurrentSettings` didn't have that method. To fix this: 1. Don't include `Gitlab::CurrentSettings` at the top level. We do not need `Object.new.current_application_settings` to work. 2. Make `Gitlab::CurrentSettings` explicitly `extend self`, as we already use it like that in several places. 3. Change the initializers to use that new form.
2017-07-11Repair Regression caused by - !11573Paul Charlton
some changes introduced by 4daa6da5407d235cbe4f7a787eaa29304446a870, 26b6e299e1c97b956306572c5c9f6c02f428bfd7, 17898ce021fc365c620d4600df68c3e7d2151619 were regressed during today's merge conflict resolution of !11573. This commit serves to reapply those changes. /cc: @rspeicher @stanhu @mikegreiling
2017-07-11Support multiple Redis instances based on queue typePaul Charlton
2017-07-11Merge branch 'master' into 'catch-redis-address-error'DJ Mountney
# Conflicts: # lib/gitlab/current_settings.rb
2017-07-10Prevent bad data being added to application settings when Redis is unavailableNick Thomas
2017-06-28Add additional error caching for redis when using a tcp address toDJ Mountney
connect instead of a socket This helps with compiling gitlab assets without a redis server (used during omnibus build)
2017-06-21Change references from ApplicationSetting to ::ApplicationSetting to make ↵Stan Hu
autoload happier Closes #34047
2017-06-19If migrations are pending, make CurrentSettings use existing values and ↵Stan Hu
populate missing columns with defaults master was failing because `ApplicationSetting.create_from_defaults` attempted to write to a column that did not exist in the database. This occurred in a `rake db:migrate` task, which was unable to perform the migration that would have added the missing column in the first place. In 9.3 RC2, we also had a bug where password sign-ins were disabled because there were many pending migrations. The problem occurred because `fake_application_settings` was being returned with an OpenStruct that did not include the predicate method `signup_enabled?`. As a result, the value would erroneously return `nil` instead of `true`. This commit uses the values of the defaults to mimic this behavior. This commit also refactors some of the logic to be clearer.
2017-06-19Revert "Merge branch 'rs-revert-11842' into 'master'"Stan Hu
This reverts commit ad521bde1bb556709edd39d8a9aa67ee47605b91, reversing changes made to 3a38e5f1ab914bc4eaeecda6e18caaa7ca9ea5a7.
2017-06-16Partially revert 1e8dbd46Robert Speicher
See https://gitlab.com/gitlab-org/gitlab-ce/issues/33736#note_32561501
2017-06-06redesign caching of application settingsPaul Charlton
2017-06-02Skip loading application settings from the database when migrations are pendingNick Thomas
Various Rails initializers (metrics, sentry, etc) are run before migrations, which can lead to a mismatch between app/models/application_settings.rb and schema.
2017-02-23Enable Rails/DelegateDouwe Maan
2017-01-27Move ApplicationSetting DEFAULTS to `.defaults` insteadRémy Coutable
This will avoid autoloading issues in the long term. Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-23Rescue from ActiveRecord::UnknownAttributeError and fallback to fake settingsRémy Coutable
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-23Revert "Merge branch 'revert-9cac0317' into 'master' "Grzegorz Bizon
This reverts commit c20934869f7dc8cfbdbafb6ecb7b1305452c9e8a, reversing changes made to 4b7ec44b91e0571d209c790d54947ba1756dac0e.
2017-01-22Revert "Merge branch 'dont-persist-application-settings-in-test-env' into ↵Grzegorz Bizon
'master'" This reverts merge request !8573
2017-01-21Revert "Merge branch 'backport-fix-load-error' into 'master'"Stan Hu
This reverts merge request !8671
2017-01-20Don't define ApplicationSetting defaults in a constantRémy Coutable
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-15Don't persist ApplicationSetting in test envRémy Coutable
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-15Move default values to ApplicationSetting::DEFAULTS and use it in ↵Rémy Coutable
CurrentSettings Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-12Add support for PlantUML diagrams in Asciidoc.Horacio Sanson
This MR enables rendering of PlantUML diagrams in Asciidoc documents. To add a PlantUML diagram all we need is to include a plantuml block like: ``` [plantuml, id="myDiagram", width="100px", height="100px"] -- bob -> alice : ping alice -> bob : pong -- ``` The plantuml block is substituted by an HTML img element with *src* pointing to an external PlantUML server. This MR also add a PlantUML integration section to the Administrator -> Settings page to configure the PlantUML rendering service and to enable/disable it. Closes: #17603
2016-12-19Rename Gogs to Gitea, DRY the controller and improve viewsRémy Coutable
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-12-19Gogs ImporterKim "BKC" Carlbäcker
2016-11-13Only turn on Sidekiq throttling if application settings existsStan Hu
If the database has not been migrated properly, the initializer for Sidekiq will fail to start and cause the whole Rails server to crash. This change checks the existence for the column and allows Rails to start even if the setting has not been added as a database column. Closes #24452
2016-11-10Allow the Sidekiq queues to throttle and the factor by which to throttle ↵Patricio Cano
them to be configurable
2016-11-10Allow certain Sidekiq jobs to be throttledPatricio Cano
2016-09-23Remove use of `USE_DB` environment variable in codeGrzegorz Bizon
2016-09-22Update `CurrentSettings` class that uses ENVGrzegorz Bizon
2016-08-25Remove gitoriousZ.J. van de Weg