You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The .forceignore file is supposed to work like a .gitignore, so it should be possible to write an opt-in sort of file like we can in git.
For example, this file would only allow classes:
# First, ignore everything
*
# Now, allow anything that's a directory
!*/
# Then allow anything in the classes directory
!**/classes/**
However, if I use a file like this, retrieve does not work as expected. A new remote class is listed by retrieve preview but won't be retrieved during an actual retrieve.
Steps To Reproduce
No repo required. Just create an empty project and scratch org using the .forceignore file from above.
We can confirm that creating and deploying a class works:
sf apex generate class --name MyClass --output-dir force-app/main/default/classes
sf project deploy start
As expected, MyClass is created in the scratch org.
Now, open the scratch org and use Dev Console to create a class called RemoteClass. Going back to the CLI:
sf project retrieve preview
No conflicts found.
No files will be deleted.
Will Retrieve [1] files.
Type Fullname Path
───────── ─────────── ────
ApexClass RemoteClass
Ignored [1] files. These files won't retrieve because they're ignored by your .forceignore file.
Type Fullname Path
─────── ──────── ────
Profile Admin
This is still as expected, so do the retrieve:
sf project retrieve start
Expected result
I would expect RemoteClass to be retrieved, as reported in the preview.
Actual result
Nothing is retrieved:
Retrieving v58.0 metadata from test-3vnmdnapvkxv@example.com using the v58.0 SOAP API
Preparing retrieve request... Succeeded
› Warning: Nothing retrieved
Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.
@aidan-harding you mentioned in cli-friends this also happened in devops center, their PM is aware of this and they should update SDR to include the fix and bump CLI if they are using it (or maybe they already did, pinged them a few weeks ago 😄 )
Summary
The
.forceignore
file is supposed to work like a.gitignore
, so it should be possible to write an opt-in sort of file like we can in git.For example, this file would only allow classes:
However, if I use a file like this, retrieve does not work as expected. A new remote class is listed by retrieve preview but won't be retrieved during an actual retrieve.
Steps To Reproduce
No repo required. Just create an empty project and scratch org using the
.forceignore
file from above.We can confirm that creating and deploying a class works:
As expected, MyClass is created in the scratch org.
Now, open the scratch org and use Dev Console to create a class called RemoteClass. Going back to the CLI:
This is still as expected, so do the retrieve:
Expected result
I would expect RemoteClass to be retrieved, as reported in the preview.
Actual result
Nothing is retrieved:
System Information
Using zsh shell on mac.
Additional information
The text was updated successfully, but these errors were encountered: