feat(daemon,sdk): add depth-aware recursive file listing#5030
Open
MDzaja wants to merge 1 commit into
Open
Conversation
|
View your CI Pipeline Execution ↗ for commit 2ce4ac6
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
28e461e to
85e81ac
Compare
There was a problem hiding this comment.
5 issues found and verified against the latest diff
Tip: instead of fixing issues one by one fix them all with cubic
Re-trigger cubic
Signed-off-by: MDzaja <mirkodzaja0@gmail.com>
85e81ac to
2ce4ac6
Compare
2c15a7f to
b40f732
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.
Summary
Adds an optional
depthparameter toGET /files(and all SDKlistFiles/list_fileswrappers) for recursive directory listing. When omitted, behavior is identical to the current shallow listing.Changes
Daemon (
apps/daemon/pkg/toolbox/fs/)depthquery parameter onGET /files(integer, default 1, must be ≥ 1)depth=1preserves the originalos.ReadDircode path (no behavioral change for default case)depth > 1usesfilepath.WalkDirwith depth-bounded descent, returning a flat listpathfield onFileInfo(full entry path,omitemptyfor backward compat)ClientRejectsUnknownResponseFieldsto omit the newpathfield for older Go SDK clients that reject unknown JSON fieldsSDKs (all 5 languages)
listFiles(path, depth?)/list_files(path, depth=None)with client-side validation (depth must be at least 1)listFiles(path, { depth?: number })list_files(path, depth: int | None = None)(sync + async)ListFiles(ctx, path, options.WithDepth(n))list_files(path, depth: nil)listFiles(path)+listFiles(path, Integer depth)overloadFileInfo.Pathfield added to types + mapped from generated clientGenerated clients — all 6 toolbox API clients regenerated with the new
depthparam andpathmodel field.Behavior
GET /files?path=/tmp/xGET /files?path=/tmp/x&depth=1GET /files?path=/tmp/x&depth=3GET /files?path=/tmp/x&depth=0Backward Compatibility
depthis optional, defaults to 1pathfield usesomitempty— absent when empty, old clients ignore itClientRejectsUnknownResponseFieldsto strippathfor Go SDK clients below v0.188.0 (whose generated client rejects unknown JSON fields)Summary by cubic
Adds depth-aware recursive file listing to
GET /filesand all SDKlistFilesmethods. Default stays shallow; responses now include apathfield with the full entry path.depthquery (default 1, must be ≥1).depth=1uses the original shallow path;>1returns a flat list up to N levels. Symlinks are listed but not followed; unreadable subtrees are skipped; invaliddepthreturns 400. Recursive listing handles a symlinked root by resolving it for walking while reportingpathunder the requested root.FileInfo.pathadded (full path). Older Go SDKs have this field stripped automatically for compatibility.listFiles(path, { depth?: number })with client-side validation.list_files(path, depth: int | None = None)(sync/async) with validation.ListFiles(ctx, path, options.WithDepth(n)).list_files(path, depth: nil)with validation.listFiles(path)andlistFiles(path, Integer depth)with validation.Written for commit 2ce4ac6. Summary will update on new commits.