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

[admin] allow trial extension for orgs currently on trial #438

Merged
merged 6 commits into from
Mar 11, 2024

Conversation

JerrySentry
Copy link
Contributor

Purpose/Motivation

What is the feature? Why is this being done?

Currently the admin app can extend a org trial, but only after they have expired and turned back to basic plan.
This change allows the orgs' trials to be extended while they're still trialing.

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-staging
Copy link

codecov-staging bot commented Mar 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

Copy link

codecov-public-qa bot commented Mar 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (main@99afe14). Click here to learn what that means.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #438   +/-   ##
=======================================
  Coverage        ?   96.06%           
=======================================
  Files           ?      643           
  Lines           ?    17096           
  Branches        ?        0           
=======================================
  Hits            ?    16423           
  Misses          ?      673           
  Partials        ?        0           
Flag Coverage Δ
unit 96.06% <100.00%> (?)
unit-latest-uploader 96.06% <100.00%> (?)

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

Files Coverage Δ
plan/service.py 96.18% <100.00%> (ø)

Impacted file tree graph

@codecov-qa
Copy link

codecov-qa bot commented Mar 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (main@99afe14). Click here to learn what that means.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #438   +/-   ##
=======================================
  Coverage        ?   96.06%           
=======================================
  Files           ?      643           
  Lines           ?    17096           
  Branches        ?        0           
=======================================
  Hits            ?    16423           
  Misses          ?      673           
  Partials        ?        0           
Flag Coverage Δ
unit 96.06% <100.00%> (?)
unit-latest-uploader 96.06% <100.00%> (?)

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.

Copy link

codecov bot commented Mar 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.75%. Comparing base (b1c7efe) to head (08f6907).

❗ Current head 08f6907 differs from pull request most recent head 632e6b2. Consider uploading reports for the commit 632e6b2 to get more accurate results

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #438   +/-   ##
=====================================
  Coverage   95.75   95.75           
=====================================
  Files        765     765           
  Lines      17643   17643           
=====================================
  Hits       16894   16894           
  Misses       749     749           
Flag Coverage Δ
unit 96.04% <100.00%> (ø)
unit-latest-uploader 96.04% <100.00%> (ø)

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.

@JerrySentry JerrySentry marked this pull request as ready for review March 6, 2024 22:54
org_to_be_trialed.save()

res = self.client.post(
reverse("admin:codecov_auth_owner_changelist"),
Copy link
Contributor

Choose a reason for hiding this comment

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

looked this up, honestly a pretty interesting django feature lol

plan/service.py Outdated
self, current_owner: Owner, end_date: datetime = None
self,
current_owner: Owner,
end_date: datetime = None,
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be datetime | None for the type 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.

Yes, updated to end_date: Optional[datetime] = None

Copy link
Contributor

@ajay-sentry ajay-sentry left a comment

Choose a reason for hiding this comment

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

makes sense, just 1 small nit

@JerrySentry JerrySentry merged commit 66ceb85 into main Mar 11, 2024
20 checks passed
@JerrySentry JerrySentry deleted the mar_06_01 branch March 11, 2024 19:08
RulaKhaled pushed a commit that referenced this pull request Mar 13, 2024
Currently the admin app can extend a org trial, but only after they have expired and turned back to basic plan.
This change allows the orgs' trials to be extended while they're still trialing.
RulaKhaled added a commit that referenced this pull request Mar 13, 2024
* Test with states

* second round

* Okta stuff

* quick fix for test

* fixing tests

* more tests

* test: fix query measurements after 30 days test (#442)

* test: fix query measurements after 30 days test

This test started failing ater 2024-03-10 because
the time at the query was not frozen to a specific
date so it was using the system's actual time and
the measurements were not a part of the last 30 days.

* fix: add comments to clarify test fix

Signed-off-by: joseph-sentry <joseph.sawaya@sentry.io>

* [admin] allow trial extension for orgs currently on trial (#438)

Currently the admin app can extend a org trial, but only after they have expired and turned back to basic plan.
This change allows the orgs' trials to be extended while they're still trialing.

* Bundle Analysis: delete old code (#444)

These fields are being deprecated by bundleData and bundleChange. The app is no longer calling these fields anymore, it is safe to remove now.

* fix: use get_or_create in CommitSerializer.create (#437)

* fix: use get_or_create in CommitSerializer.create

there is a possibility of creating commits concurrently
if that happens there is a possibility of getting an
IntegrityError when trying to create the Commit object

this commit solves this problem by using get_or_create to
create the Commit object in the serializer

* test: add test to make sure CommitSerializer create only creates one object in the db

---------

Signed-off-by: joseph-sentry <joseph.sawaya@sentry.io>

* Revert "Bundle Analysis: delete old code (#444)" (#445)

This reverts commit 7932e93.

* Remove state after login

---------

Signed-off-by: joseph-sentry <joseph.sawaya@sentry.io>
Co-authored-by: joseph-sentry <136376984+joseph-sentry@users.noreply.github.com>
Co-authored-by: JerrySentry <142266253+JerrySentry@users.noreply.github.com>
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.

None yet

2 participants