Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: restrict versioning by days #4547

Merged
merged 14 commits into from
Nov 5, 2024
Merged

Conversation

kyle-ssg
Copy link
Member

Thanks for submitting a PR! Please check the boxes below:

  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • 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 kyle-ssg requested a review from a team as a code owner August 28, 2024 11:49
@kyle-ssg kyle-ssg requested review from novakzaballa and removed request for a team August 28, 2024 11:49
Copy link

vercel bot commented Aug 28, 2024

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

@github-actions github-actions bot added front-end Issue related to the React Front End Dashboard feature New feature or request labels Aug 28, 2024
Copy link
Contributor

github-actions bot commented Aug 28, 2024

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-4547 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-e2e:pr-4547 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith:pr-4547 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-4547 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api:pr-4547 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-4547 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-frontend:pr-4547 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-frontend:pr-4547 Finished ✅ Results

Copy link
Contributor

github-actions bot commented Aug 28, 2024

Uffizzi Preview deployment-56361 was deleted.

Copy link
Contributor

@novakzaballa novakzaballa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM from a code perspective

@matthewelwell
Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Contributor

@matthewelwell matthewelwell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See feedback in comment above.

@kyle-ssg
Copy link
Member Author

@matthewelwell this has been resolved

@kyle-ssg
Copy link
Member Author

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

@kyle-ssg kyle-ssg requested review from rolodato and novakzaballa and removed request for novakzaballa October 1, 2024 17:55
@matthewelwell
Copy link
Contributor

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.

Copy link
Contributor

@matthewelwell matthewelwell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me from a versioning perspective.

The only thing I would add is that we should include an upgrade banner on the Audit Log page stating how much Audit Log history the organisation has access to. This is also available in the audit_log_visibility_days attribute from the subscription metadata endpoint.

@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Nov 5, 2024
Copy link
Contributor

@matthewelwell matthewelwell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-tested manually. Looks good to me.

@kyle-ssg kyle-ssg added this pull request to the merge queue Nov 5, 2024
Merged via the queue into main with commit dad864a Nov 5, 2024
30 checks passed
@kyle-ssg kyle-ssg deleted the feat/restrict-versioning-by-days branch November 5, 2024 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request front-end Issue related to the React Front End Dashboard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants