Skip to content
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

dataUtils.ts isDeleteDataWorkspace doesn't support objectSets #786

Open
readeral opened this issue Sep 20, 2024 · 0 comments
Open

dataUtils.ts isDeleteDataWorkspace doesn't support objectSets #786

readeral opened this issue Sep 20, 2024 · 0 comments

Comments

@readeral
Copy link
Contributor

readeral commented Sep 20, 2024

Hi Nicolas,

I tried to invoke the hardis:org:data:import command with an export.json containing objectSets but as isDeleteDataWorkspace() only iterates over a root objects key, it fails.

I realise merely updating this function to iterate over both objectSets and objects won't resolve the problem, as your commands make import and delete processes discrete with important checks.

I suggest a short-term solution is to throw an error from isDeleteDataWorkspace() if it finds exportFileJson.objectSets saying the feature isn't supported and redirecting users to use SFDMU directly (taking care to choose the right org).

In the medium/long term, perhaps a hardis:org:data:sets command could use your org-aware dataImportCommand without checking for deletion, but maybe only allow it to run as part of CICD with a -unsafe flag ("at your own risk") as it's quite temperamental. getDataWorkspaceDetail() could return isUsingObjectSets and error if hardis:org:data:sets isn't being used to maintain the safety you've baked in to the :import and :delete commands.

objectSets isn't a particularly well-designed feature as it runs completely discrete jobs with no contextual awareness for the whole config, so it doesn't reuse externalId from other objectSets etc. In my experience, it only works for those who have a data shape that doesn't rely on externalId and probably only have a basic hierarchy. However, its value lies in being able to do multiple operations on the same Object without having to do several manual runs, like being able to clean out data before doing a fresh import, so there's still a place for it to be implemented at some point, it just might become a support nightmare if users haven't grasped the nuances and limitations of the feature (like I learned the hard way...).

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

No branches or pull requests

1 participant