feat: Backfill default PAT prefix to glpat when not set
What does this MR do and why?
Previously with !73314 (merged) we set the default value of PATs to glpat-
, however this does not update any existing instances where the value is not set. With this MR we populate application_settings
with the default value explicitly
Relates to #342327 (closed)
Migration
❯ be rake db:migrate
== 20211112155416 PopulateDefaultValueForPersonalAccessTokensPrefix: migrating
-- execute(" UPDATE\n application_settings\n SET\n personal_access_token_prefix = default\n WHERE\n personal_access_token_prefix IS NULL\n")
-> 0.0042s
== 20211112155416 PopulateDefaultValueForPersonalAccessTokensPrefix: migrated (0.0043s)
How to set up and validate locally
Via console
- Check
ApplicationSetting.current.personal_access_token_prefix
bundle exec rake db:migrate
- Check
ApplicationSetting.current.personal_access_token_prefix
Via UI
- Open Gitlab.com admin panel
- Check
Personal Access Token prefix
bundle exec rake db:migrate
- Check
Personal Access Token prefix
is now set toglpat-
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Lucas Charles