Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- This will make it easy to identify the project even if admins change
the name of the project or move it.
|
|
Updates changed method names and fixes spec failures
|
|
Signed-off-by: Rémy Coutable <remy@rymai.me>
|
|
|
|
This way we can reuse the safe setting
|
|
Because `connect_to_db?` already detects if the table exists or not
|
|
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>
|
|
|
|
These are clear wins.
|
|
|
|
Signed-off-by: Rémy Coutable <remy@rymai.me>
|
|
|
|
settings early if they exist without issuing any DB query
Signed-off-by: Rémy Coutable <remy@rymai.me>
|
|
application settings
This was causing significant performance problems in production, and this commit
reverts to the original behavior.
|
|
Signed-off-by: Rémy Coutable <remy@rymai.me>
|
|
Closes #43355
|
|
including/extending it
|
|
And use .rubocop.yml to exclude paths we don't care,
rather than using the cop itself to exclude.
|
|
|
|
|
|
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.
|
|
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
|
|
|
|
# Conflicts:
# lib/gitlab/current_settings.rb
|
|
|
|
connect instead of a socket
This helps with compiling gitlab assets without a redis server (used
during omnibus build)
|
|
autoload happier
Closes #34047
|
|
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.
|
|
This reverts commit ad521bde1bb556709edd39d8a9aa67ee47605b91, reversing
changes made to 3a38e5f1ab914bc4eaeecda6e18caaa7ca9ea5a7.
|
|
See https://gitlab.com/gitlab-org/gitlab-ce/issues/33736#note_32561501
|
|
|
|
Various Rails initializers (metrics, sentry, etc) are run before migrations,
which can lead to a mismatch between app/models/application_settings.rb and
schema.
|
|
|
|
This will avoid autoloading issues in the long term.
Signed-off-by: Rémy Coutable <remy@rymai.me>
|
|
Signed-off-by: Rémy Coutable <remy@rymai.me>
|
|
This reverts commit c20934869f7dc8cfbdbafb6ecb7b1305452c9e8a, reversing
changes made to 4b7ec44b91e0571d209c790d54947ba1756dac0e.
|
|
'master'"
This reverts merge request !8573
|