Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add new users-developer plan #494

Merged
merged 8 commits into from
Feb 4, 2025
Merged

Conversation

RulaKhaled
Copy link
Contributor

@RulaKhaled RulaKhaled commented Jan 30, 2025

As part of milestone 4, we are introducing the new userrs-developer plan, which is basically a free version of a team plan.

  • replace basic plan occurrences with developer plan
  • add users-developer to owner's plan choices
  • default plan to developer
  • adjust plans.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Copy link

codecov bot commented Jan 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.97%. Comparing base (74c0888) to head (b7bb750).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #494      +/-   ##
==========================================
- Coverage   90.34%   89.97%   -0.37%     
==========================================
  Files         437      324     -113     
  Lines       12951     9045    -3906     
  Branches     2104     1599     -505     
==========================================
- Hits        11700     8138    -3562     
+ Misses       1133      846     -287     
+ Partials      118       61      -57     
Flag Coverage Δ
shared-docker-uploader ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -311,9 +316,25 @@ def convert_to_DTO(self) -> dict:
monthly_uploads_limit=None,
)

DEVELOPER_PLAN = PlanData(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't need these anymore right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortunately we do because API is still using FREE_PLAN_REPRESENTATIONS once we clean up API we can go back and remove all plans representations.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just double checked that reference and it's for a django command script that is "dead" :) I think we're good to not add it for that reason

FREE_PLAN_REPRESENTATIONS = {
PlanName.FREE_PLAN_NAME.value: FREE_PLAN,
PlanName.BASIC_PLAN_NAME.value: BASIC_PLAN,
DEFAULT_FREE_PLAN: DEVELOPER_PLAN,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't need this anymore right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same thing here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same response, we can double confirm with @adrian-codecov but that's what he told me originally

@@ -2,10 +2,13 @@
from dataclasses import dataclass
from typing import List, Optional

DEFAULT_FREE_PLAN = "users-developer"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we put this next to the plan names so it's easier to see?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thoughts on renaming this to DEFAULT_PLAN_NAME as well? Since there could be a world where this plan isn't free, and this is technically just the name of the plan and not the full object

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like the name "Free" makes more sense here. It'll be easier to look for "Free" references if someone wants to update it. "Default plan name" could potentially reference any other plan

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the concept of "name" vs. "plan"? Would you say it's still clear that this is just a reference to the plan name and not the plan object?

trial_start_date=trial_start_date,
trial_end_date=trial_end_date,
)
plan_service = PlanService(current_org=current_org)

basic_plan = FREE_PLAN_REPRESENTATIONS[PlanName.BASIC_PLAN_NAME.value]
developer_plan = FREE_PLAN_REPRESENTATIONS[DEFAULT_FREE_PLAN]
assert plan_service.current_org == current_org
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of these assertions probably aren't needed, we can probably just assert the plan name and call it a day

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yah we're doing that in a lot of places, good thing to consider refactoring in a separate PR

@RulaKhaled RulaKhaled added this pull request to the merge queue Feb 4, 2025
Merged via the queue into main with commit 7ba099f Feb 4, 2025
6 checks passed
@RulaKhaled RulaKhaled deleted the add-users-developer-plan branch February 4, 2025 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants