-
Notifications
You must be signed in to change notification settings - Fork 13.7k
fix(frontend): clean up @latest frontend downloads (CORE-285) #14398
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
Closed
+289
−23
Closed
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
dbf7fef
fix(frontend): clean up @latest frontend downloads (CORE-285)
Glary-Bot bb2c1db
harden: validate metadata shape and refuse out-of-dir cleanup paths
Glary-Bot 0a2b9f8
trim verbose comments and docstrings
Glary-Bot 273314a
trim remaining comments; keep only the security-relevant one
Glary-Bot 672b4a2
Simplify auto-managed frontend cleanup with on-disk markers
DrJKL File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Way too many long comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair — trimmed in 0a2b9f8. Net -76 lines of prose across the two files:
AUTO_MANAGED_VERSION_SPECIFIERSand the regex constant — kept tight one-liners.init_frontend_unsafe"promote/prune" comments into nothing — the method names already say it._read/_prune/_untrack_auto_managed_versionsto one line each.Kept just five short comments that aren't restating code:
AUTO_MANAGED_VERSION_SPECIFIERSconstant (says why this tuple exists vs explicit pins)_is_safe_version_dirnamere-check in_prune_auto_managed_versions(would otherwise look redundant and get "simplified" away)33/33 tests still pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cut further in 273314a — only one comment remains in the new code:
This one I'd push back on removing: the
_is_safe_version_dirnamere-check inside_prune_auto_managed_versionslooks redundant (the read path already filters), and without a comment a future maintainer will simplify it away. That would re-open the path-traversal vector Oracle flagged in the first review pass. The testtest_prune_refuses_to_delete_outside_provider_dirwould still pass without the re-check (because it relies on the resolve-and-check below it), so the comment is the only thing protecting the layered defense.Everything else — class-constant explanations, regex purpose, atomic-write idiom, all docstrings on the new private helpers — is gone. Happy to delete this last one too if you'd rather rename the helper or merge the check into
_is_safe_version_dirname's docstring instead.33/33 tests still pass.