Sync SaaS trial submission to Platypus when namespace is known
Summary
The purpose of this issue is to update when we submit SaaS trial submissions to Nexus to ensure we always submit the setup for company (SFC) value.
Currently, trial information submits to Nexus when the user submits the trial form which we will call step 1. However, it's on the next step where the user assigns the trial to a namespace (step 2), we need to ensure we submit the SFC data after we have the value from step 2.
Problem we're solving for
Currently, SFC is stored at the user level. Therefore we always have it when the user submits the trial form. However, it makes it challenging when a user creates multiple namespaces to understand what if any is for company use.
In the short term, we still store SFC at the user level. However, for net new parent level groups being created, we start storing the value at the namespace level as well, and only if the value is unknown at the user level we write the group value to the user level.
In the longer term, all flows store the SFC value at the namespace level at which point the trial form will have to reference this namespace value to ensure we're properly passing the correct value associated with that group.
Solution
As discussed here, we keep the trial flow as is and the changes are made in the back-end. Ideally, we would store users' information from step 1 before submitting everything to Nexus when they complete step 2. As it appears to be the best balance between technical needs and UX.
How the logic should function:
- User submits trial form (step 1), we store this data.
- User selects the namespace that the trial will be applied to (step 2).
- When we know what namespace the trial will be applied to, we do the following:
- First we look to see if their is a SFC value stored in the
namespace_settings
table. If a value is found then we submit this value to Nexus, if no value is found then we move on the next bullet - We check if a SFC value is known for the user by checking the
user_preferences
tables. If a value is found then we submit this value to Nexus, if no value is found then we still submit the form submission data to Nexus but we don't pass a SFC value as one is not known
- First we look to see if their is a SFC value stored in the
Important things to note
- The Adoption team is working on logic (could be live by the time we pick up this issue) to not require step 2 if the user only has one namespace in which case the trial will automatically be applied to their existing namespace. We should ensure our solution logic checking for the namespace value first then the user value still works within this experience as well. https://gitlab.com/gitlab-org/gitlab/-/issues/339654
- In the documented solution above, we first look for the namespace SFC value then only the user value if the namespace value is null. There will be cases where both the namespace and the user will have a value, we want to treat the namespace value as the ultimate source of truth so we will always send the namespace value if it exists and only looks for a user value if we can't find one on the namespace.
- The Activation team added the SFC column to the
namespace_settings
table, their original work can be found here in case it's needed gitlab-org/growth/team-tasks#413 (closed)