Add experience level to user preferences
What does this MR do?
This MR supports the overall functionality needed for the “Choose Your Experience Level” page, which is part of the onboarding issues board experiment.
The page itself has been started in !31415 (merged) and is behind an experiment-based feature flag, which is currently completely disabled.
This MR is meant to be inline with our value of iteration and with a development paradigm of separating structural changes from behavioral changes.
Supports gitlab-org/growth/engineering#5363 (closed)
Migrating Up
> bundle exec rails db:migrate:up VERSION=20200521022725
== 20200521022725 AddExperienceLevelToUserPreferences: migrating ==============
-- add_column(:user_preferences, :experience_level, :integer, {:limit=>2})
-> 0.0009s
== 20200521022725 AddExperienceLevelToUserPreferences: migrated (0.0010s) =====
Migrating Down
> bundle exec rails db:migrate:down VERSION=20200521022725
== 20200521022725 AddExperienceLevelToUserPreferences: reverting ==============
-- remove_column(:user_preferences, :experience_level, :integer, {:limit=>2})
-> 0.0064s
== 20200521022725 AddExperienceLevelToUserPreferences: reverted (0.0097s) =====
Redoing the Migration
> bundle exec rails db:migrate:redo VERSION=20200521022725
== 20200521022725 AddExperienceLevelToUserPreferences: reverting ==============
-- remove_column(:user_preferences, :experience_level, :integer, {:limit=>2})
-> 0.0009s
== 20200521022725 AddExperienceLevelToUserPreferences: reverted (0.0027s) =====
== 20200521022725 AddExperienceLevelToUserPreferences: migrating ==============
-- add_column(:user_preferences, :experience_level, :integer, {:limit=>2})
-> 0.0008s
== 20200521022725 AddExperienceLevelToUserPreferences: migrated (0.0009s) =====
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry - [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides - [-] Separation of EE specific content
Availability and Testing
This MR adds a new column to an existing table in Postgres. I am not fully aware of the implications of doing so (i.e. how large that table is in production, for example, or if the chosen column type (smallint
) & attribute type (enum
) is appropriate for the desired behavior).
- [-] Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team