flagsmith
flagsmith copied to clipboard
feat: restrict versioning by days
Thanks for submitting a PR! Please check the boxes below:
- [x] 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
Adjusts limiting of version history to date rather than number of versions
How did you test this code?
Manually set limitation in code against https://pr-4433-deployment-54847-flagsmith.app.uffizzi.com/
Disabled links in audit log
Disabled versions in history
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 | Nov 5, 2024 10:31am |
| flagsmith-frontend-preview | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Nov 5, 2024 10:31am |
| flagsmith-frontend-staging | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Nov 5, 2024 10:31am |
Docker builds report
| Image | Build Status | Security report |
|---|---|---|
ghcr.io/flagsmith/flagsmith-api-test:pr-4547 |
Finished :white_check_mark: | Skipped |
ghcr.io/flagsmith/flagsmith-e2e:pr-4547 |
Finished :white_check_mark: | Skipped |
ghcr.io/flagsmith/flagsmith:pr-4547 |
Finished :white_check_mark: | Results :white_check_mark: |
ghcr.io/flagsmith/flagsmith-private-cloud:pr-4547 |
Finished :white_check_mark: | Results :white_check_mark: |
ghcr.io/flagsmith/flagsmith-api:pr-4547 |
Finished :white_check_mark: | Results :white_check_mark: |
ghcr.io/flagsmith/flagsmith-private-cloud:pr-4547 |
Finished :white_check_mark: | Results :white_check_mark: |
ghcr.io/flagsmith/flagsmith-frontend:pr-4547 |
Finished :white_check_mark: | Results :white_check_mark: |
ghcr.io/flagsmith/flagsmith-frontend:pr-4547 |
Finished :white_check_mark: | Results :white_check_mark: |
Uffizzi Preview deployment-56361 was deleted.
I guess it's good to have the code there, but in theory we should never need the logic to blank out the link from the audit log, because the audit log visibility is also restricted for non-enterprise plans.
Some issues I've found in testing:
- Since I'm running this self hosted, I would have expected the plan next to 'Version History' to say 'Enterprise' here, like it does for Audit Logs.
- The only time that the API will return versions older than the limit is when the current live version is older than the limit. We shouldn't really blur this out.
If we want to blur things out, I could perhaps return a field that states that there are older versions, but I don't think this is necessary. I think we should just let the API handle the restrictions here.
@matthewelwell this has been resolved
Note: due to recent PR merge this can now be found within the feature modal
I briefly played around with this but wasn't able to set up a fully representative local environment to test looking at older audit log entries or version history - is there a quick way I could do that?
q for @matthewelwell
@rolodato resolved button colour in dark mode. I think we're good to go on this ?
I briefly played around with this but wasn't able to set up a fully representative local environment to test looking at older audit log entries or version history - is there a quick way I could do that?
q for @matthewelwell
Sorry @rolodato - I missed this one. The BE has now been merged if that's helpful. In order to manually change the limit though you'll need to directly edit the organisations_organisationsubscriptioninformationcache table in the database and set the relevant fields (which should be fairly self explanatory).
Note that if you're using an organisation on the scale up plan you will also need to set the VERSIONING_RELEASE_DATE environment variable in the API to a date in the past to work around the logic which grandfathers unlimited audit log history for existing scale up customers.