Skip notebooks with unmapped language in extension-aware ReadDir#5516
Open
simonfaltum wants to merge 2 commits into
Open
Skip notebooks with unmapped language in extension-aware ReadDir#5516simonfaltum wants to merge 2 commits into
simonfaltum wants to merge 2 commits into
Conversation
ReadDir in the workspace files extensions client appended an empty extension for notebooks whose language has no extension mapping, listing a name that the same filer's Stat and Read deliberately report as not found. Omit such entries from the listing and log a warning instead. Co-authored-by: Isaac
Contributor
Waiting for approvalBased on git history, these people are best suited to review:
Eligible reviewers: Suggestions based on git history. See OWNERS for ownership rules. |
Collaborator
|
Commit: 8ee3935
25 interesting tests: 15 SKIP, 7 RECOVERED, 3 flaky
Top 30 slowest tests (at least 2 minutes):
|
Co-authored-by: Isaac
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.
Why
Found during a full-repo review of the CLI. The extension-aware workspace filer maps a notebook's language to a file extension when listing a directory. For a notebook whose language has no extension mapping (empty or one the CLI does not know yet), it appended an empty extension, so
ReadDirlisted the notebook under its raw, extension-less name. The same filer'sStatandReaddeliberately report extension-less notebook names as not found, so callers got entries they could not access, and recursive operations failed with confusing "file does not exist" errors on names the listing just returned.Changes
Before,
ReadDirlisted notebooks with an unmapped language under a broken, extension-less name; now it omits them from the listing and logs a warning naming the notebook and its language.In
libs/filer/workspace_files_extensions_client.go,getNotebookStatByNameWithoutExtreturns a nil stat when no extension is associated with the notebook's language (after the Jupyter export format override, so.ipynbnotebooks are unaffected regardless of language), andReadDirskips entries with a nil stat. Skipping was chosen over erroring because failing the whole directory listing would break bundle and template operations on trees containing one such notebook, including notebooks that sync filters would have excluded anyway. A fallback extension cannot work because no extension round-trips through the filer's language checks.Test plan
.ipynbextensiongo test ./libs/filer/passes, including the existing duplicate-name tests./task fmt-q,./task lint-q, and./task checkspassThis pull request and its description were written by Isaac.