feat(versioning): limit returned number of versions by plan
Changes
This PR primarily sets out to implement a limit on the number of versions returned for a given subscription plan. As part of the discussions related to this functionality, however, I have implemented (in this same PR) a similar limit on the audit log records.
Some things we'll need to do outside of the deployment of this:
- Add the limit information to the metadata for the relevant plans
How did you test this code?
Added / updated unit tests.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| docs | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Oct 28, 2024 0:23am |
| flagsmith-frontend-preview | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Oct 28, 2024 0:23am |
| flagsmith-frontend-staging | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Oct 28, 2024 0:23am |
Docker builds report
| Image | Build Status | Security report |
|---|---|---|
ghcr.io/flagsmith/flagsmith-api-test:pr-4433 |
Finished :white_check_mark: | Skipped |
ghcr.io/flagsmith/flagsmith-e2e:pr-4433 |
Finished :white_check_mark: | Skipped |
ghcr.io/flagsmith/flagsmith-frontend:pr-4433 |
Finished :white_check_mark: | Results :white_check_mark: |
ghcr.io/flagsmith/flagsmith-api:pr-4433 |
Finished :white_check_mark: | Results :white_check_mark: |
ghcr.io/flagsmith/flagsmith:pr-4433 |
Finished :white_check_mark: | Results :white_check_mark: |
ghcr.io/flagsmith/flagsmith-private-cloud:pr-4433 |
Finished :white_check_mark: | Results :white_check_mark: |
Uffizzi Preview deployment-54847 was deleted.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 97.29%. Comparing base (
7a6b2e0) to head (422e5df). Report is 11 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #4433 +/- ##
==========================================
+ Coverage 97.22% 97.29% +0.07%
==========================================
Files 1172 1173 +1
Lines 40537 40799 +262
==========================================
+ Hits 39411 39697 +286
+ Misses 1126 1102 -24
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This may need to change based on a discussion here. Moving this PR to draft for now.
@kyle-ssg you can use the uffizzi environment to develop against here but you won't be able to alter the value of the feature_history_visibility_days attribute that is now returned on the /organisations/:id/get-subscription-metadata endpoint.
The default for all organisations though is 7 days so hopefully that at least gives you something to work with. Really, I don't think there's anything for you to do though as the API only returns the correct data. Maybe you just want to add a UI hint somewhere based on this value (bear in mind that null means no limit, 0 means no data).
It's possibly worth mentioning that this PR also applies the same logic to the Audit Log (audit_log_visibility_days also added to the same endpoint as above).
If you want to be able to manipulate these values, it's probably best if you run the API via docker (using the ghcr.io/flagsmith/flagsmith-api:pr-4433 image) and let me know and I can help update those values.
This is ready for review, right?
This is ready for review, right?
Yep.
@gagantrivedi I've responded to your questions and implemented a change for one of them. I also had to make a change that I thought about in my own head after you reviewed as well so could you take another quick look at those changes?