-
Notifications
You must be signed in to change notification settings - Fork 29
Feat: Django Command run on startup to add plans / tiers #1111
Feat: Django Command run on startup to add plans / tiers #1111
Conversation
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
📢 Thoughts on this report? Let us know! |
|
✅ All tests successful. No failed tests were found. 📣 Thoughts on this report? Let Codecov know! | Powered by Codecov |
❌ 1 Tests Failed:
View the top 1 failed tests by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
| @@ -0,0 +1,14 @@ | |||
| "id","created_at","updated_at","base_unit_price","benefits","billing_rate","is_active","marketing_name","max_seats","monthly_uploads_limit","paid_plan","name","tier_id","stripe_id" | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jan 25 corresponds to January 2025
| # Check the output | ||
| assert "Successfully inserted all data into plans from CSV" in out.getvalue() | ||
|
|
||
| print(Plan.objects.all()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🖨️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was debugging the failing test 😅, fixed!
| def ready(self): | ||
| import core.signals # noqa: F401 | ||
|
|
||
| if RUN_ENV == "DEV": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remind me, what's the plan to seed prod then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
already seeded via Django Admin, and will be kept up to date there as well
| 7,2025-01-16 04:38:12.544 -0800,2025-01-24 11:34:53.935 -0800,4,"{""Up to 10 users"",""Unlimited repositories"",""2500 private repo uploads"",""Patch coverage analysis""}",annually,true,Team,10,2500,true,users-teamy,2,price_1NrlXiGlVGuVgOrkgMTw5yno | ||
| 6,2025-01-16 04:37:08.918 -0800,2025-01-24 11:35:15.346 -0800,5,"{""Up to 10 users"",""Unlimited repositories"",""2500 private repo uploads"",""Patch coverage analysis""}",monthly,true,Team,10,2500,true,users-teamm,2,price_1NqPKdGlVGuVgOrkm9OFvtz8 | ||
| 5,2025-01-16 04:35:34.152 -0800,2025-01-24 11:35:42.724 -0800,10,"{""Includes 5 seats"",""$10 per additional seat"",""Unlimited public repositories"",""Unlimited private repositories"",""Priority Support""}",annually,true,Sentry Pro,5,,true,users-sentryy,5,price_1MlYAYGlVGuVgOrke9SdbBUn | ||
| 4,2025-01-16 04:34:33.867 -0800,2025-01-24 11:35:48.218 -0800,12,"{""Includes 5 seats"",""$10 per additional seat"",""Unlimited public repositories"",""Unlimited private repositories"",""Priority Support""}",monthly,true,Sentry Pro,5,,true,users-sentrym,5,price_1MlY9yGlVGuVgOrkHluurBtJ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sentryy unit price should be 10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be missing something, I believe that's the case already :O
But I think you're right about pro plan being off users-pr-inappy having the incorrect price
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
Purpose/Motivation
This PR aims to make it dead simple to integrate the new plans into the Codecov local development environment, and provide a bridge for self-hosted folks as well.
This is done through a new django command which can currently be run with a "tier" or "plan" flag in the form of
python manage.py insert_data_to_db_from_csv nameOfCSV --model plans (or tiers)
You can use the provided csvs that are in the same directory or your own CSV if you so choose. The CSVs that are in the codebase are the "current" plan and tier information for codecov. I was originally thinking we should obfuscate this stuff... but for now it doesn't really make sense to do that because it's all public information anyway lol
Anyway, on app start, both the tier and plan version of this command are run if you're on the dev environment. Assuming umbrella-hat is the default way for folks to run the app I figure this is probably going to provide an experience where no "breaking changes" are felt though they are present.
Links to relevant tickets
Epic: codecov/engineering-team#2778
Closes codecov/engineering-team#3286
What does this PR do?
Include a brief description of the changes in this PR. Bullet points are your friend.
Notes to Reviewer
Anything to note to the team? Any tips on how to review, or where to start?
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.