flagsmith icon indicating copy to clipboard operation
flagsmith copied to clipboard

feat: restrict versioning by days

Open kyle-ssg opened this issue 1 year ago • 9 comments
trafficstars

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

image

Disabled versions in history

image

kyle-ssg avatar Aug 28 '24 11:08 kyle-ssg

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

vercel[bot] avatar Aug 28 '24 11:08 vercel[bot]

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:

github-actions[bot] avatar Aug 28 '24 11:08 github-actions[bot]

Uffizzi Preview deployment-56361 was deleted.

github-actions[bot] avatar Aug 28 '24 11:08 github-actions[bot]

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.

matthewelwell avatar Aug 28 '24 14:08 matthewelwell

Some issues I've found in testing:

  1. 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.
image image
  1. 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.
image

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 avatar Aug 30 '24 10:08 matthewelwell

@matthewelwell this has been resolved

kyle-ssg avatar Sep 10 '24 10:09 kyle-ssg

Note: due to recent PR merge this can now be found within the feature modal image

kyle-ssg avatar Sep 10 '24 14:09 kyle-ssg

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

kyle-ssg avatar Sep 11 '24 13:09 kyle-ssg

@rolodato resolved button colour in dark mode. I think we're good to go on this ?

kyle-ssg avatar Sep 24 '24 09:09 kyle-ssg

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.

matthewelwell avatar Oct 29 '24 16:10 matthewelwell