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

Non SFDX File in Package Directory Breaks Clean #4

Closed
ralphcallaway opened this issue Sep 27, 2019 · 5 comments
Closed

Non SFDX File in Package Directory Breaks Clean #4

ralphcallaway opened this issue Sep 27, 2019 · 5 comments

Comments

@ralphcallaway
Copy link
Collaborator

➜  project git:(XXX.1/master) sfdx force:source:clean -x manifest/package.xml 
(node:22917) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added. Use emitter.setMaxListeners() to increase limit
WARNING: This command can be dangerous! It is intended to be used along side source control.  IT WILL REMOVE ALL FILES FROM 'packageDirectories' WHICH ARE NOT FOUND IN THE TARGET ORG.  They will not be recoverable unless tracked in source control!
Do you wish to continue? (y): y
WARNING: Failed to retrieve! All files are "marked" and will need to be manually reset!
ERROR running force:source:retrieve:  Unexpected file found in package directory: /Users/ralphcallaway/Development/project/src/classes/SomeClass.cls.orig

In this case, a git merge conflict artifact broke down the process and left everything deleted (will post some thoughts on that in another ticket)

Not totally sure this is really an issue with this command, more an issue with the sfdx command not being smart enough to tell the difference between sfdx and non-sfdx files in package directories.

@ralphcallaway
Copy link
Collaborator Author

added a .forceignore with the following and the method runs, but the file gets deleted (fine in this case)

a lot of this boils down to is there a good reason to have non-sfdx files in package folders (kind of feel like now, let's be opinionated and say if it doesn't exist in the org it's deleted, regardless of whether it's an sfdx file our not. package folders are just for sfdx files

@ralphcallaway
Copy link
Collaborator Author

it also deletes the old src/package.xml manifest, which should go anyway ...

perhaps we make that the description, cleans folder so that it only contains sfdx metadata that are in the current default org

@ChuckJonas
Copy link
Collaborator

ChuckJonas commented Sep 27, 2019

Ya, looks like the error.

I think we could exclude . files and .forceIgnore. EVERYTHING else will be removed. As you saw before, nothing else should be in the source folders as it will break the standards sfdx force:source commands... So by deleting everything else it really is "cleaning up"

@ChuckJonas
Copy link
Collaborator

I think the only TODO from this issue is just to make this behavior more apparent in the command help and readme.md

@ralphcallaway
Copy link
Collaborator Author

mostly, i'd say #6 is a todo that comes out of this, but yeah it seems like you'd expect clean to delete these files and to mirror the current constraints of the sfdx command

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

2 participants