Skip to content

Change default value for :inbound_job_token_scope_enabled

What does this MR do and why?

Issue
This MR is changing the default value for inbound_job_token_scope_enabled on database level. We have introduced the FF to set the default for inbound_job_token_scope_enabled, once that flag is enabled for all users, we want to remove it and we want to have the db support (default also to true on db level) at that point. The detailed plan is described in the issue

Table: project_ci_cd_settings
Column: inbound_job_token_scope_enabled
Change: default value from false to true

Screenshots or screen recordings

Migration:

➜  gitlab git:(340822/Change_inbound_job_token_scope_enabled_default_value_for_new_projects_2) ✗ rails db:migrate
main: == 20230126110439 ChangeDefaultValueForInboundJobTokenScopeEnabled: migrating =
main: -- change_column_default(:project_ci_cd_settings, :inbound_job_token_scope_enabled, {:from=>false, :to=>true})
main:    -> 0.0851s
main: == 20230126110439 ChangeDefaultValueForInboundJobTokenScopeEnabled: migrated (0.0861s) 

ci: == 20230126110439 ChangeDefaultValueForInboundJobTokenScopeEnabled: migrating =
ci: -- change_column_default(:project_ci_cd_settings, :inbound_job_token_scope_enabled, {:from=>false, :to=>true})
ci:    -> 0.0082s
ci: == 20230126110439 ChangeDefaultValueForInboundJobTokenScopeEnabled: migrated (0.0152s) 

Rollback:

➜  gitlab git:(340822/Change_inbound_job_token_scope_enabled_default_value_for_new_projects_2) rake db:rollback:main STEP=1
Type application/netcdf is already registered as a variant of application/netcdf.
main: == 20230126110439 ChangeDefaultValueForInboundJobTokenScopeEnabled: reverting =
main: -- change_column_default(:project_ci_cd_settings, :inbound_job_token_scope_enabled, {:from=>true, :to=>false})
main:    -> 0.0904s
main: == 20230126110439 ChangeDefaultValueForInboundJobTokenScopeEnabled: reverted (0.0915s) 

➜  gitlab git:(340822/Change_inbound_job_token_scope_enabled_default_value_for_new_projects_2) ✗ rake db:rollback:ci STEP=1  
ci: == 20230126110439 ChangeDefaultValueForInboundJobTokenScopeEnabled: reverting =
ci: -- change_column_default(:project_ci_cd_settings, :inbound_job_token_scope_enabled, {:from=>true, :to=>false})
ci:    -> 0.1196s
ci: == 20230126110439 ChangeDefaultValueForInboundJobTokenScopeEnabled: reverted (0.1276s) 

How to set up and validate locally

  1. Checkout this branch and migrate
  2. Create a new project and verify the value in the table project_ci_cd_settings for inbound_job_token_scope_enabled, it should be true

If you rollback and repeat the steps above, the value stored in the db should be false.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Kasia Misirli

Merge request reports

Loading