Ensure all existing and net new free namespaces have a plan ID of 34
Problem
Currently, there is a case where namespaces do not have a plan/subscription until they are looked at - see https://gitlab.com/gitlab-org/gitlab/-/issues/349811#risks
In the free user cap project, we need to determine how we should handle those.
In sisense, the data models automatically apply a free plan value (34) if no value is found. When running a query upstream in Snowflake we find that there are over 6 million namespaces missing a plan_id. ~55% of individual namespaces are missing a plan_id and ~19% of group namespaces are missing a plan_id. (related data analysis issue with query can be found here)
Just looking at namespaces that are missing plan_id
, ~94% are individual and ~6% are group namespaces.
Why this is a problem
A lot of our code currently looks for a plan_Id value of 34
or null
due to the fact that an ID is not always found. This creates risks that we don't truly know what state a namespace should be in as we're treating a value of null
as equal to a value of 34
. For reference, this issue was uncovered and discussed here https://gitlab.com/gitlab-org/gitlab/-/issues/353100.
Solution
- We should add a process that when a net new parent namespace is created it's automatically assigned to a plan_id value of
34
i.e. the free tier. - We should write a job to look for all existing parent namespaces that have a
null
plan_id value and ensure they get a plan_id value of34
See refinement notes below in #353470 (comment 1560700473)