797fe0a6e6
Originally from branch 'fix-authorized-keys-enabled-default-2738' via merge request https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2240 Removed background migrations which were intended to fix state after using Gitlab without a default having been set Squashed commits: Locally, if Spring was not restarted, `current_application_settings` was still cached, which prevented the migration from editing the file. This will also ensure that any app server somehow hitting old cache data will properly default this setting regardless. Retroactively fix migration This allows us to identify customers who ran the broken migration. Their `authorized_keys_enabled` column does not have a default at this point. We will fix the column after we fix the `authorized_keys` file. Fix authorized_keys file if needed Add default to authorized_keys_enabled setting Reminder: The original migration was fixed retroactively a few commits ago, so people who did not ever run GitLab 9.3.0 already have a column that defaults to true and disallows nulls. I have tested on PostgreSQL and MySQL that it is safe to run this migration regardless. Affected customers who did run 9.3.0 are the ones who need this migration to fix the authorized_keys_enabled column. The reason for the retroactive fix plus this migration is that it allows us to run a migration in between to fix the authorized_keys file only for those who ran 9.3.0. Tweaks to address feedback Extract work into background migration Move batch-add-logic to background migration Do the work synchronously to avoid multiple workers attempting to add batches of keys at the same time. Also, make the delete portion wait until after adding is done. Do read and delete work in background migration Fix Rubocop offenses Add changelog entry Inform the user of actions taken or not taken Prevent unnecessary `select`s and `remove_key`s Add logs for action taken Fix optimization Reuse `Gitlab::ShellAdapter` Guarantee the earliest key Fix migration spec for MySQL |
||
---|---|---|
.. | ||
auth | ||
background_migration | ||
badge | ||
bare_repository_import | ||
bitbucket_import | ||
cache | ||
checks | ||
ci | ||
conflict | ||
cycle_analytics | ||
data_builder | ||
database | ||
dependency_linker | ||
diff | ||
downtime_check | ||
etag_caching | ||
fogbugz_import | ||
gfm | ||
git | ||
gitaly_client | ||
github_import | ||
gitlab_import | ||
google_code_import | ||
gpg | ||
graphs | ||
health_checks | ||
hook_data | ||
i18n | ||
import_export | ||
kubernetes | ||
ldap | ||
legacy_github_import | ||
metrics | ||
middleware | ||
o_auth | ||
prometheus | ||
quick_actions | ||
redis | ||
saml | ||
sanitizers | ||
serializer | ||
sherlock | ||
sidekiq_middleware | ||
sidekiq_status | ||
sidekiq_versioning | ||
slash_commands | ||
sql | ||
storage_check | ||
template | ||
utils | ||
view/presenter | ||
action_rate_limiter_spec.rb | ||
allowable_spec.rb | ||
app_logger_spec.rb | ||
asciidoc_spec.rb | ||
auth_spec.rb | ||
background_migration_spec.rb | ||
blame_spec.rb | ||
changes_list_spec.rb | ||
chat_name_token_spec.rb | ||
ci_access_spec.rb | ||
closing_issue_extractor_spec.rb | ||
color_schemes_spec.rb | ||
contributions_calendar_spec.rb | ||
current_settings_spec.rb | ||
daemon_spec.rb | ||
database_spec.rb | ||
dependency_linker_spec.rb | ||
downtime_check_spec.rb | ||
encoding_helper_spec.rb | ||
exclusive_lease_spec.rb | ||
fake_application_settings_spec.rb | ||
file_detector_spec.rb | ||
file_finder_spec.rb | ||
git_access_spec.rb | ||
git_access_wiki_spec.rb | ||
git_ref_validator_spec.rb | ||
git_spec.rb | ||
gitaly_client_spec.rb | ||
github_import_spec.rb | ||
gl_repository_spec.rb | ||
gpg_spec.rb | ||
group_hierarchy_spec.rb | ||
highlight_spec.rb | ||
i18n_spec.rb | ||
identifier_spec.rb | ||
import_sources_spec.rb | ||
incoming_email_spec.rb | ||
insecure_key_fingerprint_spec.rb | ||
issuable_metadata_spec.rb | ||
issuable_sorter_spec.rb | ||
issuables_count_for_state_spec.rb | ||
job_waiter_spec.rb | ||
kubernetes_spec.rb | ||
lazy_spec.rb | ||
lfs_token_spec.rb | ||
markup_helper_spec.rb | ||
metrics_spec.rb | ||
multi_collection_paginator_spec.rb | ||
optimistic_locking_spec.rb | ||
other_markup_spec.rb | ||
otp_key_rotator_spec.rb | ||
path_regex_spec.rb | ||
performance_bar_spec.rb | ||
polling_interval_spec.rb | ||
popen_spec.rb | ||
project_authorizations_spec.rb | ||
project_search_results_spec.rb | ||
project_template_spec.rb | ||
project_transfer_spec.rb | ||
prometheus_client_spec.rb | ||
reference_counter_spec.rb | ||
reference_extractor_spec.rb | ||
regex_spec.rb | ||
repo_path_spec.rb | ||
request_context_spec.rb | ||
request_forgery_protection_spec.rb | ||
request_profiler_spec.rb | ||
route_map_spec.rb | ||
routing_spec.rb | ||
search_results_spec.rb | ||
sentry_spec.rb | ||
shell_spec.rb | ||
sidekiq_config_spec.rb | ||
sidekiq_status_spec.rb | ||
sidekiq_throttler_spec.rb | ||
sidekiq_versioning_spec.rb | ||
snippet_search_results_spec.rb | ||
ssh_public_key_spec.rb | ||
string_range_marker_spec.rb | ||
string_regex_marker_spec.rb | ||
tcp_checker_spec.rb | ||
themes_spec.rb | ||
untrusted_regexp_spec.rb | ||
upgrader_spec.rb | ||
uploads_transfer_spec.rb | ||
url_blocker_spec.rb | ||
url_builder_spec.rb | ||
url_sanitizer_spec.rb | ||
usage_data_spec.rb | ||
user_access_spec.rb | ||
user_activities_spec.rb | ||
utils_spec.rb | ||
version_info_spec.rb | ||
visibility_level_spec.rb | ||
workhorse_spec.rb |