Distinguish Free plan from OpenSource program
## Problem We don't have a way to distinguish between projects on a Free plan vs projects on a plan related to our OpenSource program. This lack of distinction can cause our system not to behave according to the expectations. This will become a big problem when the work in [CI minutes limits](https://gitlab.com/groups/gitlab-org/-/epics/5653) is completed because public projects will have a cost factor of 1.0 including OSS program projects if they are not moved over. ### CI minutes discrepancy [Our OpenSource Program](https://about.gitlab.com/solutions/open-source/) offers 50,000 CI minutes for FOSS projects. But FOSS projects are by definition public. However, today any public project gets unlimited CI minutes. But this is changing with the work in [CI minutes limits](https://gitlab.com/groups/gitlab-org/-/epics/5653) after which Public Projects by default will receive 400 CI minutes per month. Projects accepted into the OSS program will receive a cost factor of .008 which in turns means 50,000 minutes of runner duration getting them back to where they were before. The duration of 50,000 minutes is not 50,000 minutes because of the 0.008 cost factor (https://docs.gitlab.com/ee/ci/pipelines/cicd_minutes.html#cost-factor). This means, that really OSS programs would get 6,250,000 minutes which when we add a cost factor of 1 to public projects it would then go down to 50,000. Given that we don't know how many minutes in duration OSS program member namespaces use in a month (they likely exceed 50,000 minutes in duration), we have assigned a very low-cost factor to minimize disruption to the contribution process. If we proceed with hardening limits on public projects without separation of OSS program members, we reduce the available CICD minute duration from 6,250,000 to 50,000. **NOTE**: This applies to contributors of OSS projects NOT GitLab Contributs. ### Application limits We use [job activity limit](https://docs.gitlab.com/ee/administration/instance_limits.html#number-of-jobs-in-active-pipelines) to limit projects on Free plan to create pipelines with too many jobs running at the same time. This limit, today, is set to 500 active jobs, which means that a user can't have more than 500 jobs in active pipelines at a given point in time. When this limit is exceeded, the new pipeline is immediately dropped. While this limit works great to stop abusers, it does have an impact to community contributors to open source projects. Having the ability to distinguish between Free and OpenSource plans, and having FOSS projects in that plan we could skip (or raise) the limit if the pipeline runs for a fork that contributes to an open source project. We also know that contributors to GitLab run into this issue because a GitLab pipeline normally contains ~140 jobs and takes over 1 hour to run, it limits the ability for users to contribute to GitLab. We will address that in another way outside the OSS program. ![image](/uploads/481f574851f2ff33d161b676231ad395/image.png) ## Proposal Create a new Plan Type for free OpenSource plans, and assign OSS customers to that new Plan Type. - [x] Come up with the new Plan Type name - - Title - `Open Source Program` - Name - `opensource` - [x] Finalize a list of Zuora Product Rate Plans that should be associated to the new Plan Type: * \[OSS Program\] SaaS - Ultimate (formerly Gold) - 1 Year - [x] Create a plan titled `Open Source Program`, name `opensource` within GitLab.com plans table https://gitlab.com/gitlab-org/gitlab/-/issues/343134 - [x] Modify [plans controller](https://gitlab.com/gitlab-org/customers-gitlab-com/-/blob/staging/app/controllers/plans_controller.rb) within CustomersDot to sync `OpenSourceProgram` to GL.com https://gitlab.com/gitlab-org/customers-gitlab-com/-/issues/3687 - [x] Add [plan limits](https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/api/plan_limits.md) for the `Open Source Program` plan within GitLab.com. https://gitlab.com/gitlab-org/gitlab/-/issues/343134 - [x] Assign the new Plan Type name to new subscriptions / plans - The new subscription created should have the new `product_rate_plan_id` of the OSS plans. The template from above step would sync `opensource` to GitLab.com. https://gitlab.com/gitlab-org/customers-gitlab-com/-/issues/3694 - [x] Assign the new Plan Type name to existing subscriptions / plans https://gitlab.com/gitlab-org/customers-gitlab-com/-/issues/3695 - Modify the orders within the CustomersDot to new OSS plan ids. - Modify the corresponding `gitlab_subscriptions` table within the GitLab.com to use the `opensource` plan. ( `hosted_plan_id` ) - [x] Modify [`gitlab_pipeline_minutes` within CustomersDot](https://gitlab.com/gitlab-org/customers-gitlab-com/-/blob/staging/app/models/plan.rb#L463) to sync new CI minutes for `opensource` plans. https://gitlab.com/gitlab-org/customers-gitlab-com/-/issues/3688
epic