flagsmith icon indicating copy to clipboard operation
flagsmith copied to clipboard

feat(versioning): add version rollback

Open matthewelwell opened this issue 1 year ago • 5 comments

Changes

Adds a new endpoint to rollback to a previous version.

Note that there are some implementation decisions that I made here, which are:

  1. Rolling back to a given version just 're-instates' it to be the latest version. This does mean that we're essentially picking up the version and dropping it at the top of the list again. There's an argument to say that we should leave the version as it was and just create a new cloned version from the one that we're choosing to rollback to. I'm keen to get some feedback on this.
  2. Rolling back creates 2 audit log records. One for the version that we're rolling back to, and one for the version that we're rolling back from. Again, there's an argument to say that this should be a single record, but I wanted to err on the side of more records, particularly to make the related_object_uuid logic easier.

How did you test this code?

Added a new test to verify the logic end to end.

matthewelwell avatar Aug 08 '24 15:08 matthewelwell

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview Aug 9, 2024 1:44pm
flagsmith-frontend-preview ⬜️ Ignored (Inspect) Visit Preview Aug 9, 2024 1:44pm
flagsmith-frontend-staging ⬜️ Ignored (Inspect) Visit Preview Aug 9, 2024 1:44pm

vercel[bot] avatar Aug 08 '24 15:08 vercel[bot]

Docker builds report

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

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

Uffizzi Ephemeral Environment deployment-55082

:cloud: https://app.uffizzi.com/github.com/Flagsmith/flagsmith/pull/4466

:page_facing_up: View Application Logs etc.

What is Uffizzi? Learn more!

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

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 96.90%. Comparing base (2dfbf99) to head (71cee5f). Report is 314 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4466      +/-   ##
==========================================
+ Coverage   96.89%   96.90%   +0.01%     
==========================================
  Files        1172     1175       +3     
  Lines       39082    39247     +165     
==========================================
+ Hits        37868    38033     +165     
  Misses       1214     1214              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Aug 08 '24 15:08 codecov[bot]

Converting this to draft while I work out how to handle this better with regards to change requests in particular.

matthewelwell avatar Aug 12 '24 14:08 matthewelwell

Closing as PR will change signficantly

matthewelwell avatar Dec 06 '24 11:12 matthewelwell