ensure immutable databses when starting in configuration directory mode with#1229
Merged
simonw merged 4 commits intosimonw:mainfrom Mar 29, 2021
Merged
ensure immutable databses when starting in configuration directory mode with#1229simonw merged 4 commits intosimonw:mainfrom
simonw merged 4 commits intosimonw:mainfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1229 +/- ##
=======================================
Coverage 91.51% 91.51%
=======================================
Files 34 34
Lines 4255 4255
=======================================
Hits 3894 3894
Misses 361 361
Continue to review full report at Codecov.
|
Contributor
Author
|
I believe this pr and #1031 are related and fix the same issue. |
Owner
|
Thanks for figuring this out! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #1224
This PR ensures all databases found in a configuration directory that match the files in
inspect-data.jsonwill be set toimmutableas outlined in https://docs.datasette.io/en/latest/settings.html#configuration-directory-modespecifically on building the
datasetteinstance it checks:immutablesis an empty tuple - as passed by the cli codeimmutablesis the default function valueNone- when it's not explicitly setAnd correctly builds the immutable database list from the
inspect-data[file]keys.Note for this to work the
inspect-data.jsonfile must containfilepaths which are relative to the configuration directory otherwise the file paths won't match and the dbs won't be set to immutable.I couldn't find an easy way to test this due to the way
make_app_clientworks, happy to take directions on adding a test for this.I've updated the relevant docs as well, i.e. use the
inspectcli cmd from the config directory path to create the relevant filehttps://docs.datasette.io/en/latest/performance.html#using-datasette-inspect