Skip to content

KC-1267: Fix: consistent folder JSON response across get, ls, and nsf-get commands#2092

Open
sshrushanth-ks wants to merge 1 commit into
get-folder-response-fixfrom
get-folder-response-fix-int
Open

KC-1267: Fix: consistent folder JSON response across get, ls, and nsf-get commands#2092
sshrushanth-ks wants to merge 1 commit into
get-folder-response-fixfrom
get-folder-response-fix-int

Conversation

@sshrushanth-ks
Copy link
Copy Markdown
Contributor

Summary

Folder JSON responses were inconsistent across get, ls, and nsf-get commands — using different field names for the same data, missing parent_uid, and inconsistent type/source values. This fix standardises the response format across all three commands and adds --include-dag support to nsf-get.

Changes

  • get (shared folder) — renamed shared_folder_uid → folder_uid, added "type": "shared_folder" and parent_uid
  • get (folder cache) — renamed parent_folder_uid → parent_uid for consistency across all folder types
  • get (shared_folder_folder) — retains shared_folder_uid alongside folder_uid since it identifies the owning shared folder, which is distinct from the immediate parent
  • ls --format json — folder source now uses actual folder type values (user_folder, shared_folder, nested_share_folder) instead of "Legacy" / "Nested Share Folder"; record source standardised to "legacy" / "nested_share_folder"
  • nsf-get --format json — renamed nested_share_folder_uid → folder_uid, added "type": "nested_share_folder" and parent_uid
  • nsf-get — added --include-dag flag to include DAG/GraphSync data for PAM resource record types (pamMachine, pamDatabase, pamUser, pamDirectory, pamRemoteBrowser)

@sshrushanth-ks sshrushanth-ks self-assigned this May 27, 2026
@sshrushanth-ks sshrushanth-ks marked this pull request as ready for review May 27, 2026 12:28
is_nested_share = hasattr(params, 'nested_share_folders') and f.uid in params.nested_share_folders
source = 'Nested Share Folder' if is_nested_share else 'Legacy'
row = ['folder', f.uid, f.name, f'Flags: {folder_flags(f)}, Parent: {f.parent_uid or "/"}', source]
folder_type = 'nested_share_folder' if is_nested_share else f.type
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comparing with raw strings is not a good idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants