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: Force readonly #1973

Merged
merged 2 commits into from
Aug 9, 2023
Merged

feat: Force readonly #1973

merged 2 commits into from
Aug 9, 2023

Conversation

markphelps
Copy link
Collaborator

Gives us (and operators) to force the UI into read-only mode by setting the following:

experimental:
  filesystem_storage:
    enabled: true

storage:
  readOnly: true

In this next release we will be 'graduating' filesystem storage, so the experimental bit will not be required.

The goal of this feature is two fold:

  1. To enable devs to be able to more easily test the UI in readonly mode (without requiring us to configure a readonly storage mode)
  2. To allow operators to put Flipt in readonly mode even if backed by a database

For 2., more work will need to be done either at the API or ideally storage layer to reject all write requests, as currently this change only affects the UI so users could still make API requests or modify data via import/export even if storage: readonly: true

This also modifies the badge in the UI to show an icon based on what storage mode is in use:

  • database
  • local
  • git
  • object

(images in order)

CleanShot 2023-08-09 at 09 33 04
CleanShot 2023-08-09 at 09 29 42
CleanShot 2023-08-09 at 09 29 26
CleanShot 2023-08-09 at 09 29 09

@markphelps markphelps requested a review from a team as a code owner August 9, 2023 13:44
Copy link
Contributor

@GeorgeMac GeorgeMac left a comment

Choose a reason for hiding this comment

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

Super neat

@codecov
Copy link

codecov bot commented Aug 9, 2023

Codecov Report

Merging #1973 (e4b1736) into main (fddcf20) will increase coverage by 0.02%.
The diff coverage is 90.00%.

@@            Coverage Diff             @@
##             main    #1973      +/-   ##
==========================================
+ Coverage   71.13%   71.16%   +0.02%     
==========================================
  Files          67       67              
  Lines        6572     6578       +6     
==========================================
+ Hits         4675     4681       +6     
  Misses       1634     1634              
  Partials      263      263              
Files Changed Coverage Δ
internal/cmd/auth.go 0.00% <0.00%> (ø)
internal/config/storage.go 81.42% <100.00%> (+1.74%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@markphelps markphelps merged commit abaa595 into main Aug 9, 2023
25 checks passed
@markphelps markphelps deleted the force-readonly branch August 9, 2023 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants