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

Support copy to production and delete destination data in CI/CD environments #47

Open
j-fischer opened this issue Sep 11, 2020 · 13 comments

Comments

@j-fischer
Copy link
Contributor

Hi @eltoroit ,

I've been playing around with your plugin quite a bit and I can see the potential for it to be useful as a deployment tool for some data driven configuration. In order to use it as part of a CI/CD process, however, it would be great to provide a way to flag the plugin invocation as a production deployment without getting another prompt in the command line. In addition, there are cases where a complete removal of the configuration records prior to the load might be desired, so it would be good if the following condition could be "overruled" through a command line flag of some sort.

I understand why those guards are in place, given that this plugin was designed to load training/test data in lower environments. However, would you be open to consider the alternative use case?

I could also see that an explicit deletion on an object level could be useful (clear some object records but not others - see upsert PR), and I'd be happy to look into the PR for that.

Please let me know if you have any questions.

Thanks for considering those changes.

Cheers

// ETCopyData.ts, line 391, 
if (data.settings.deleteDestination) {
	const msg = "Destination Org can not be production because this app deletes data! (2)";
	Util.writeLog(msg, LogLevel.FATAL);
	Util.throwError(msg);
	reject(msg);
} else { //...
@eltoroit
Copy link
Owner

With great power comes great responsibility. How to prevent accidental using this to wipe out the data in your production, when you actually meant to do it on a sandbox or a scratch org?

@j-fischer
Copy link
Contributor Author

I understand that, but the use case for CI/CD is legit: the set up would not be accidental and the build server cannot respond to the prompt. My recommendation would be to use a command line flag like --no-prompt or --force like it is used with common destructive commands such as del or rm.

What are your thoughts?

@j-fischer
Copy link
Contributor Author

I missed to mention that the delete functionality would be guarded by a prompt to ask the user for confirmation under normal conditions unless the --no-prompt is set.

I am all for preventing simple mistakes by adding gates and choosing the proper default values, which you have certainly done here. Just completely deactivating a feature would be a pity, given the potential here. Hope that makes sense?

@j-fischer
Copy link
Contributor Author

Hi @eltoroit ,

Just wanted to see if you have any thoughts on what I proposed?

Thanks,
Johannes

@pbabalis1
Copy link

The potential to use this pluging to seed data is very useful. I installed and tried to export a simple object w/o success Attachments included,,,,,, for export command : sfdx ETCopyData:export -c ./data -s mrs --loglevel TRACE --json

Please let me know any glaring issue of my setup...I would like to have a live session if it is possible

2023-07-23_22-25-47
2023-07-23_22-25-29
2023-07-23_22-23-33
for it to be useful as a deployment tool for some data driven configuration. II've been playing around with your plugin quite a bit and
2023-07-23_22-48-24

@j-fischer
Copy link
Contributor Author

Hi @pbabalis1 ,

Remove the "Account." prefix when referencing the fields. The two pass reference fields in the root should also be empty as those should only be set per object.

Pleases note that while this project is a great tool and I have used a few times in projects already, there is also a more stable and actively maintained project that does the same work: https://github.com/forcedotcom/SFDX-Data-Move-Utility

I would recommend to give this a try since you are at the early stages of playing with these plugins.

Hope this helps,
Johannes

@pbabalis1
Copy link

pbabalis1 commented Aug 1, 2023 via email

@pbabalis1
Copy link

pbabalis1 commented Aug 5, 2023 via email

@j-fischer
Copy link
Contributor Author

I can't see the image, so won't be able to help. In the meanwhile, I came across this great talk by the LFDG. Hope you enjoy it.

https://www.youtube.com/watch?v=Z4ka2cRuUks

@pbabalis1
Copy link

pbabalis1 commented Aug 7, 2023 via email

@j-fischer
Copy link
Contributor Author

j-fischer commented Aug 7, 2023

@pbabalis1 Awesome, glad I could help! Cheers

@pbabalis1
Copy link

pbabalis1 commented Aug 12, 2023 via email

@j-fischer
Copy link
Contributor Author

JSON does not support comments. Please see this for help: https://www.freecodecamp.org/news/json-comment-example-how-to-comment-in-json-files/

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

3 participants