gitlab_subscriptions trial column being nil and false
GitlabSubscription
contains a trial
column, which defaults to false. Our model scope searches for false
, indicating paid subscriptions. It was first introduced in !7885 (merged).
However a large number of records have the value nil
. Currently on production:
- 388206 records have
nil
- 3323787 records have
false
false
seems to be the correct value as it is the default value in database, and our Rails scope checks against false
too.
We need to find
- why
nil
was generated (done: answer in !23037 (closed)) - Whether those
nil
s should have beenfalse
. (done: see the update below)
Update
After some code review in !23037 (comment 272226873), here is a second round of summary:
When the feature was first deployed, there were those two cases:
- Those namespaces in trial created subscription with
trial:nil
- Those paid namespaces created subscription with
trial:nil
I think we need to do an audit to see how nil
is treated in code.
For case one, we might have accidentally made some trial namespaces as paid namespaces.
For case two, paid namespaces might not be treated as paid (e.g. UpdateMaxSeatsUsedForGitlabComSubscriptionsWorker
certainly skipped those)