Commit 65adfc5b authored by Dallas Reedy's avatar Dallas Reedy

Be more obvious about hard-coded Zuora plan IDs

- Use variables with more descriptive names
- Add comment blocks about us being okay doing this for SaaS-only
  experiments
- Fix both instances of hard-coded plan IDs for experiments to point to
  the correct plans!
  - Previously, the TrialStatusWidgetHelper one was pointing at the
    production Gold (no longer a thing) plan ID
  - And the PaidFeatureCalloutHelper one was actually pointing at the
    sandbox (oops!) Premium plan ID
parent 237dc760
......@@ -47,7 +47,14 @@ module PaidFeatureCalloutHelper
end
def premium_subscription_path_for_group(group)
# Hard-coding the plan_id to the Premium plan on production & staging
new_subscriptions_path(namespace_id: group.id, plan_id: '2c92c0f876e0f4cc0176e176a08f1b70')
# NOTE: We are okay hard-coding the production value for the Premium 1-year
# SaaS plan ID while this is all part of an active experiment. If & when the
# experiment is deemed a success, part of the clean-up effort will be to
# pull the value directly from the CustomersDot API. Value taken from
# https://gitlab.com/gitlab-org/customers-gitlab-com/blob/7177f13c478ef623b779d6635c4a58ee650b7884/config/application.yml#L186
# Cleanup issue: https://gitlab.com/gitlab-org/gitlab/-/issues/330987
zuora_premium_plan_id = '2c92a00d76f0d5060176f2fb0a5029ff'
new_subscriptions_path(namespace_id: group.id, plan_id: zuora_premium_plan_id)
end
end
......@@ -47,7 +47,13 @@ module TrialStatusWidgetHelper
end
def ultimate_subscription_path_for_group(group)
# Hard-coding the plan_id to the Ultimate plan on production & staging
new_subscriptions_path(namespace_id: group.id, plan_id: '2c92a0fc5a83f01d015aa6db83c45aac')
# NOTE: We are okay hard-coding the production value for the Ulitmate 1-year
# SaaS plan ID while this is all part of an active experiment. If & when the
# experiment is deemed a success, part of the clean-up effort will be to
# pull the value directly from the CustomersDot API. Value taken from
# https://gitlab.com/gitlab-org/customers-gitlab-com/blob/7177f13c478ef623b779d6635c4a58ee650b7884/config/application.yml#L207
zuora_ultimate_plan_id = '2c92a0ff76f0d5250176f2f8c86f305a'
new_subscriptions_path(namespace_id: group.id, plan_id: zuora_ultimate_plan_id)
end
end
......@@ -81,7 +81,7 @@ RSpec.describe PaidFeatureCalloutHelper do
days_remaining: 12,
feature_name: 'first feature',
href_compare_plans: '/groups/test-group/-/billings',
href_upgrade_to_paid: '/-/subscriptions/new?namespace_id=123&plan_id=2c92c0f876e0f4cc0176e176a08f1b70',
href_upgrade_to_paid: '/-/subscriptions/new?namespace_id=123&plan_id=2c92a00d76f0d5060176f2fb0a5029ff',
plan_name_for_trial: 'Ultimate',
plan_name_for_upgrade: 'Premium',
target_id: 'first-feature-callout'
......
......@@ -37,7 +37,7 @@ RSpec.describe TrialStatusWidgetHelper do
expect(data_attrs).to match(
shared_expected_attrs.merge(
group_name: 'Pants Group',
purchase_href: '/-/subscriptions/new?namespace_id=123&plan_id=2c92a0fc5a83f01d015aa6db83c45aac',
purchase_href: '/-/subscriptions/new?namespace_id=123&plan_id=2c92a0ff76f0d5250176f2f8c86f305a',
target_id: shared_expected_attrs[:container_id],
trial_end_date: Date.parse('2021-01-30')
)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment