Closed mmindenhall closed 8 months ago
Hi @mmindenhall!
Thanks for raising this very well detailed issue and thanks for contributing in making this project better!
What is the content of the .forceignore
file used to ignore __tests__
folders please?
Do you reproduce it with any LWC component ? Or some of them have particularities?
Hi @scolladon!
Here's the .forceignore
for the package where we encountered this problem.
# List files or directories below to ignore them when running force:source:push, force:source:pull, and force:source:status
# More information: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_exclude_source.htm
#
package.xml
# LWC configuration files
**/jsconfig.json
**/.eslintrc.json
# LWC Jest
**/__tests__/**
# Profiles
**/force-app/main/default/profiles/**
# Fields
**/Contact/fields/CleanStatus.field-meta.xml
# Custom Index
**/force-app/main/default/customindex/**
**/AppSwitcher.appMenu-meta.xml
**/LightningService_UtilityBar.flexipage-meta.xml
**/profiles/**
I'm pretty sure the behavior will happen with any LWC component when using --generate-delta
. The one I used to reproduce the problem in my fork of sfdx-git-delta-reproduction-playground
was a simple Hello World LWC, using the .forceignore
already in sfdx-git-delta-reproduction-playground
.
BTW I took a quick peek at the source code, and I think this is what's happening. The --ignore
file is being used to filter files to process out of the git
output, but no filtering is being applied in the copy operation to the output
folder. I think the --ignore
file patterns need to be applied in both places.
Thank you for spiking a bit @mmindenhall. I see now what is happening here, I'll propose a fix next week hopefully.
Stay tuned!
Shipped in release v5.32.0
.
You can install the new version using the version number or the latest-rc
channel
$ sfdx plugins:install sfdx-git-delta@latest-rc
$ sfdx plugins:install sfdx-git-delta@v5.32.0
Happy incremental deployment!
Issue verification check:
What is the problem?
My employer has been gradually building jest tests for LWCs.
When there are changes in the source of an LWC with jest tests,
sgd --generate-delta
copies the__tests__
folder (contains the jest test sources) to the output folder, despite the.forceignore
passed tosgd
specifying that this folder should be ignored.What is the parameter and the value you used with it?
See reproduction steps below.
What is the expected result?
The expected result is that the output folder would not contain the
__tests__
folder for any LWC with jest tests.What is the actual result?
The output folder contains the
__tests__
folder and its contents, which causes the subsequentsf force source deploy -p /tmp/output/folder
command to fail due to the jest.js
file(s) not being deployable.Steps to reproduce
issue/744
branchRun this command:
__tests__
folder was copied into the tree in theoutput
folderExecution context
Operating System: … Darwin Kernel Version 23.0.0: Fri Sep 15 14:41:43 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T6000 yarn version: … 1.22.19 node version: … v18.16.0 git version: … git version 2.43.0 sfdx version: … @salesforce/cli/2.21.8 darwin-arm64 node-v18.16.0 sgd plugin version: … sfdx-git-delta 5.31.1
More information (optional)