Block model and dataset creation in LIT demo mode. - #2621
Merged
Merged
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
copybara-service
Bot
force-pushed
the
test_989864731
branch
2 times, most recently
from
September 28, 2026 22:34
b830363 to
53efaaa
Compare
While `LitApp` disables saving and loading datapoints when `demo_mode` is enabled and hides model and dataset creation controls in the frontend UI, the backend `/create_model` and `/create_dataset` endpoints previously did not check `self._demo_mode`. Direct HTTP requests to these endpoints on a demo server could still trigger model or dataset initialization and archive downloads via `file_cache.cached_path`. Additionally, if archive extraction in `file_cache._get_extacted_dir` failed part-way through an archive, the partially populated extraction directory remained on disk and would be returned on subsequent cache lookups. Reject `/create_dataset` and `/create_model` requests when `self._demo_mode` is enabled in `LitApp`. In `file_cache._get_extacted_dir`, open tar archives with a context manager and clean up the extraction directory if extraction raises an exception so partial extractions are never cached. PiperOrigin-RevId: 990350608
copybara-service
Bot
force-pushed
the
test_989864731
branch
from
September 29, 2026 16:21
53efaaa to
12e46be
Compare
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.
Block model and dataset creation in LIT demo mode.
While
LitAppdisables saving and loading datapoints whendemo_modeis enabled and hides model and dataset creation controls in the frontend UI, the backend/create_modeland/create_datasetendpoints previously did not checkself._demo_mode. Direct HTTP requests to these endpoints on a demo server could still trigger model or dataset initialization and archive downloads viafile_cache.cached_path. Additionally, if archive extraction infile_cache._get_extacted_dirfailed part-way through an archive, the partially populated extraction directory remained on disk and would be returned on subsequent cache lookups.Reject
/create_datasetand/create_modelrequests whenself._demo_modeis enabled inLitApp. Infile_cache._get_extacted_dir, open tar archives with a context manager and clean up the extraction directory if extraction raises an exception so partial extractions are never cached.