Make Gitlab database library compatible with Rails 6.1
Summary
- Rails 6.0 triggers the following deprecation warning:
DEPRECATION WARNING: Accessing hashes returned from config_for by non-symbol keys is deprecated and will be removed in Rails 6.1. Use symbols for access instead.
That means that accessing database configuration values by string key is no longer working in Rails 6.1.
- A database now has multiple configurations due to introduced support for horizontal sharding.
The changelog is here: https://github.com/rails/rails/blob/6-1-stable/activerecord/CHANGELOG.md
Current work
The Rails Upgrade MR introduces the changes that fixes some of the tests:
-
✅ !59107 (92ab2ed5) => !61095 (merged) -
✅ !59107 (454be26e) => !61323 (merged) -
❌ !59107 (0d464ba4). Can't make this work for Rails 6.0. Very tiny changes to spec/lib/gitlab/database/with_lock_retries_spec.rb:244 anyway.
Let's check whether these changes are compatible with Rails 6.0 and are reasonable to be merged
Confidence level 75%
Edited by Thong Kuah