Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jun 13, 2025. It is now read-only.
/codecov-apiPublic archive

Comments

feat: add plan tier service#150

Merged
adrian-codecov merged 10 commits intomainfrom
412-plan-permissions
Sep 25, 2023
Merged

feat: add plan tier service#150
adrian-codecov merged 10 commits intomainfrom
412-plan-permissions

Conversation

@adrian-codecov
Copy link
Contributor

Purpose/Motivation

We need a way to differentiate a tier based on it's plan. This is an evolving tier so this is the first pass at this.

What does this PR do?

  • Add tier service + test w/ barebones differentiation of plans based on their tiers
  • Add resolvers + test to expose that to the client

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.

@codecov
Copy link

codecovbot commentedSep 20, 2023
edited
Loading

Codecov Report

Merging#150 (0f511b6) intomain (fc9553f) willincrease coverage by0.01%.
The diff coverage is100.00%.

@@           Coverage Diff           @@##            main    #150     +/-   ##=======================================+ Coverage   95.44   95.45   +0.01=======================================  Files        709     709               Lines      15201   15223     +22     =======================================+ Hits       14508   14530     +22  Misses       693     693
FlagCoverage Δ
unit95.60% <100.00%> (+<0.01%)⬆️
unit-latest-uploader95.60% <100.00%> (+<0.01%)⬆️

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

FilesCoverage Δ
graphql_api/types/enums/enum_types.py100.00% <100.00%> (ø)
graphql_api/types/plan/plan.py98.11% <100.00%> (+0.15%)⬆️
...i/types/plan_representation/plan_representation.py97.14% <100.00%> (ø)
plan/constants.py100.00% <100.00%> (ø)
plan/service.py96.11% <100.00%> (+0.11%)⬆️
plan/test_plan.py100.00% <100.00%> (ø)

@codecov-public-qa
Copy link

codecov-public-qabot commentedSep 20, 2023
edited
Loading

Codecov Report

Merging#150 (0f511b6) intomain (fc9553f) willincrease coverage by0.00%.
The diff coverage is100.00%.

Impacted file tree graph

@@           Coverage Diff           @@##             main     #150   +/-   ##=======================================  Coverage   95.52%   95.53%           =======================================  Files         594      594             Lines       14801    14823   +22     =======================================+ Hits        14139    14161   +22  Misses        662      662
FlagCoverage Δ
unit95.53% <100.00%> (+<0.01%)⬆️
unit-latest-uploader95.53% <100.00%> (+<0.01%)⬆️

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

Files ChangedCoverage Δ
graphql_api/types/enums/enum_types.py100.00% <100.00%> (ø)
graphql_api/types/plan/plan.py98.11% <100.00%> (+0.15%)⬆️
...i/types/plan_representation/plan_representation.py97.14% <100.00%> (ø)
plan/constants.py100.00% <100.00%> (ø)
plan/service.py95.14% <100.00%> (+0.14%)⬆️
plan/test_plan.py100.00% <100.00%> (ø)

Impacted file tree graph

@codecov-staging
Copy link

codecov-stagingbot commentedSep 20, 2023
edited
Loading

Codecov Report

All modified lines are covered by tests ✅

📢 Thoughts on this report?Let us know!.

orgUploadToken: String
defaultOrgUsername: String
isCurrentUserActivated: Boolean!
tier: TierName
Copy link
Contributor

Choose a reason for hiding this comment

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

The return type of the resolver isTierName which indicates that it can't be null. Should this beTierName! to match? Or should the return type of the resolver beOptional[TierName]?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Good catch, I'll make this non-nullable

Choose a reason for hiding this comment

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

ENTERPRISE_TIER_PLAN_NAMES = [
PlanName.ENTERPRISE_CLOUD_MONTHLY.value,
PlanName.ENTERPRISE_CLOUD_YEARLY.value,
]
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to just include atier with each plan representation? Then we wouldn't need to keep these lists in sync and might simplify the implementation ofTierService

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

That's a good idea, my only hesitance is anticipating if a tier could ever not be strictly tied to your plan. If so, it almost feels like there's no need for a tier service altogether, and just a property of the plan service, so like

<some>_PLAN_REPRESENTATIONS= {PlanName.<some>_PLAN_NAME.value:PlanData(        ...tier=<sometier>,        ...    ),  }}classPlanService():...deftier(self)->TierName:returnself.plan_data.tier

CODECOV_BASIC = 0
CODECOV_TRIAL = 0
LITE_MONTHLY = 6
LITE_YEARLY = 8
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

These values are not defined yet and subject to change

"Unlimited private repositories",
"Priority Support",
],
tier_name=TierName.PRO.value,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the types are slightly off here.TierName.PRO has typeTierName butTierName.PRO.value has typestr

@plan_bindable.field("tierName")
@convert_kwargs_to_snake_case
def resolve_tier_name(plan_service: PlanService, info) -> TierName:
return plan_service.tier_name
Copy link
Contributor

Choose a reason for hiding this comment

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

This is where you could call.value on the enum. The return type would bestr.

pretrialUsersCount: Int
marketingName: String!
planName: String!
tierName: String!
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we use the GraphQL enum anywhere? Should this betierName: TierName! instead?

@adrian-codecovadrian-codecov merged commit309c6ce intomainSep 25, 2023
@adrian-codecovadrian-codecov deleted the 412-plan-permissions branchSeptember 25, 2023 19:50
@Morton22
Copy link

Merging#150 (0f511b6) intomain (fc9553f) willincrease coverage by0.01%.
The diff coverage is100.00%.

@@           Coverage Diff           @@##            main    #150     +/-   ##=======================================+ Coverage   95.44   95.45   +0.01=======================================  Files        709     709               Lines      15201   15223     +22     =======================================+ Hits       14508   14530     +22  Misses       693     693
FlagCoverage Δ
unit95.60% <100.00%> (+<0.01%)⬆️
unit-latest-uploader95.60% <100.00%> (+<0.01%)⬆️

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

FilesCoverage Δ
graphql_api/types/enums/enum_types.py100.00% <100.00%> (ø)
graphql_api/types/plan/plan.py98.11% <100.00%> (+0.15%)⬆️
...i/types/plan_representation/plan_representation.py97.14% <100.00%> (ø)
plan/constants.py100.00% <100.00%> (ø)
plan/service.py96.11% <100.00%> (+0.11%)⬆️
plan/test_plan.py100.00% <100.00%> (ø)

@Morton22
Copy link

#> ##Codecov Report

The diff coverage is100.00%.

@@           Coverage Diff           @@##            main    #150     +/-   ##=======================================+ Coverage   95.44   95.45   +0.01=======================================  Files        709     709               Lines      15201   15223     +22     =======================================+ Hits       14508   14530     +22  Misses       693     693
FlagCoverage Δ
unit95.60% <100.00%> (+<0.01%)⬆️
unit-latest-uploader95.60% <100.00%> (+<0.01%)⬆️

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

FilesCoverage Δ
graphql_api/types/enums/enum_types.py100.00% <100.00%> (ø)
graphql_api/types/plan/plan.py98.11% <100.00%> (+0.15%)⬆️
...i/types/plan_representation/plan_representation.py97.14% <100.00%> (ø)
plan/constants.py100.00% <100.00%> (ø)
plan/service.py96.11% <100.00%> (+0.11%)⬆️
plan/test_plan.py100.00% <100.00%> (ø)

Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

3 more reviewers

@scott-codecovscott-codecovscott-codecov approved these changes

@Bilal786BilalBilal786BilalBilal786Bilal left review comments

@stormz310stormz310stormz310 approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@adrian-codecov@Morton22@stormz310@scott-codecov@Bilal786Bilal

[8]ページ先頭

©2009-2026 Movatter.jp