flagsmith
flagsmith copied to clipboard
fix: add migration file to generate stale flags tag for all existing projects
Thanks for submitting a PR! Please check the boxes below:
- [x] I have run
pre-committo check linting - [ ] I have added information to
docs/if required so people know about the feature! - [x] I have filled in the "Changes" section below?
- [x] I have filled in the "How did you test this code" section below?
- [x] I have used a Conventional Commit title for this Pull Request
Changes
Currently the stale flags task is failing because it is trying to create stale flags in projects that don't have the tag created in.
This PR adds a migration to add the default tag to all existing projects, note that all new projects already have the tag automatically created.
I also considered the option of having the task create the stale flags tag lazily, but we decided that we want to be able to show our customers that they can get the benefit of stale flags functionality if they upgrade their plan. They are also free to use the tag manually themselves if they want.
How did you test this code?
Ran the migration manually locally to confirm that the tag was created for projects that didn't already have the tag and was not created for those projects that do have it.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Updated (UTC) |
|---|---|---|---|
| docs | ✅ Ready (Inspect) | Visit Preview | Apr 11, 2024 2:00pm |
| flagsmith-frontend-preview | ✅ Ready (Inspect) | Visit Preview | Apr 11, 2024 2:00pm |
| flagsmith-frontend-staging | ✅ Ready (Inspect) | Visit Preview | Apr 11, 2024 2:00pm |
Uffizzi Ephemeral Environment deployment-49975
:cloud: https://app.uffizzi.com/github.com/Flagsmith/flagsmith/pull/3755
:page_facing_up: View Application Logs etc.
What is Uffizzi? Learn more!
Codecov Report
Attention: Patch coverage is 58.82353% with 7 lines in your changes are missing coverage. Please review.
Project coverage is 95.89%. Comparing base (
c950875) to head (1e00ac4). Report is 3 commits behind head on main.
| Files | Patch % | Lines |
|---|---|---|
| ...ns/0006_create_stale_flags_tag_for_all_projects.py | 58.82% | 7 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #3755 +/- ##
==========================================
- Coverage 95.90% 95.89% -0.02%
==========================================
Files 1102 1103 +1
Lines 34703 34723 +20
==========================================
+ Hits 33283 33296 +13
- Misses 1420 1427 +7
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I'd like to discuss this with @kyle-ssg because this will add the Stale tag to all existing projects in the Flagsmith platform, but I'm not sure that the experience is quite right since it seems to suggest that the Stale flag behaviour will work for all subscription plans, but that's not the case - it will only work for Enterprise.
Converted to draft until the above is resolved.