Open AndrewStopchenko-SO opened 4 days ago
we probably just need to update the regex to exclude comments 💡
we probably just need to update the regex to exclude comments 💡
I believe this is the place where it checks the whole .forceignore
file's content for backslashes:
https://github.com/forcedotcom/source-deploy-retrieve/blob/main/src/resolve/forceIgnore.ts#L28
I am curious though why the warning "spams" multiple times in the terminal during the sf project retrieve start
CLI command (on some larger projects)...
you're correct. I actually have that open and was modifying it now!!
it seems like every time the forceignore
class is constructed, it scans the file for \
, and emits the warning, during the deploy we check the file in different steps, so multiple warnings
I'm changing it so it goes line by line, and checks if it's a commented line #
and includes \
Summary
When .forceignore file contains backslashes
\
in the comments (for whatever reason...), sf project retrieve start and sf project deploy start commands add multiple warning messages as below:Why backslashes occurred in your
.forceignore
file?When some files are failing to deploy, we happened to add ignore pattern and included problem with filepath in the comment to that ignored pattern, and the filepath in the deploy failure messages was shown with backslashes (on Windows). 🙂
Steps To Reproduce
.forceignore
file to include the following line at the end:sf project retrieve start
andsf project deploy start
CLI commands in the VSCode Terminal (PowerShell 7), see the warning(s) in the terminal output. In my case,sf project retrieve start
command produced 3 warning messages;sf project retrieve start
produced 1 warning message.\
with a slash/
character, and run thesf project retrieve start
CLI command again - no warnings produced.Expected result
Backslashes in comments should be ignored, the warning should only react to baskslashes used in the ignored path patterns.
Actual result
Warning is displayed (even multiple times in case of
retrieve
operation).This is especially annoying when running
sf project retrieve start
in the project where many components exist, then these messages are flooding the terminal buffer.System Information
Diagnostics
:white_check_mark: pass - salesforcedx plugin isn’t installed :white_check_mark: pass - you don't have any linked plugins :x: unknown - using latest or latest-rc CLI version :white_check_mark: pass - [@salesforce/plugin-deploy-retrieve] sourceApiVersion matches apiVersion :white_check_mark: pass - [@salesforce/plugin-deploy-retrieve] default target DevHub max apiVersion matches default target org max apiVersion :white_check_mark: pass - [@salesforce/plugin-deploy-retrieve] sourceApiVersion matches default target org max apiVersion :white_check_mark: pass - can access: https://test.salesforce.com :white_check_mark: pass - can access: https://appexchange.salesforce.com/services/data :white_check_mark: pass - can access: https://developer.salesforce.com/media/salesforce-cli/sf/channels/stable/sf-win32-x64-buildmanifest
> sf version --verbose --json
output: