-
Notifications
You must be signed in to change notification settings - Fork 27
Description
Problem
Currently, the deployer defaults to target_base = 'Shared' unless --target-folder is specified. This causes confusion and failed deployments when restoring content to user folders (or other top-level folders like Embed Users, Embed Groups, etc.), unless the user manually specifies --target-folder.
When deploying dashboards/looks/backups under Users/ or other top-level folders, the deployer incorrectly interprets the folder structure, resulting in errors or content being placed in the wrong location. This friction is avoidable and makes user folder restores error-prone.
Proposal
Update the deployer logic to automatically detect target_base by inspecting the file path of the content being deployed. For example, if the file path contains /Users/, /Embed Users/, or /Embed Groups/, target_base should be set accordingly.
Example logic
# Pseudocode for smarter target_base selection
def guess_target_base(content_path):
for candidate in ['Shared', 'Users', 'Embed Groups', 'Embed Users']:
if os.sep + candidate + os.sep in content_path:
return candidate
return 'Shared' # fallbackThis would make the tool much more intuitive and prevent accidental misplacement or failed imports for user folder content.
Impact
- Simplifies user experience: No need to specify
--target-folderin most cases. - Reduces restore/import errors for user folder content.
- Backward compatible: falls back to 'Shared' if nothing matches.
Additional context
This behavior was discovered in a restore scenario where content under Users/ failed to deploy without manually specifying --target-folder Users. The tool's current default led to empty folder names and incorrect parent IDs. See attached logs in the discussion for details.
Happy to submit a PR for this if maintainers are interested.