forcedotcom / cli

Salesforce CLI
https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/
BSD 3-Clause "New" or "Revised" License
488 stars 78 forks source link

Cannot exclude List Views with .forceignore after CustomObject retrieval #938

Closed jcarmignani closed 2 years ago

jcarmignani commented 3 years ago

Summary

Short summary of what is going on or to provide context.

I would like to exclude from metadata retrieve all the List Views that are fetched while using: sfdx force:source:retrieve -m "CustomObject:Account"

Steps To Reproduce:

Insert the following lines in the .forceignore file: # Exclude listViews **listViews **.listView-meta.xml **.listView

Then retrieve the Account object: sfdx force:source:retrieve -m "CustomObject:Account"

Then check that the listViews folder is still there and the metadata for listViews as well: image

Expected result

listViews folders should be empty or all listViews folder should be removed from the SFDX Project

Actual result

Describe what actually happened instead. listViews folders are still there and nothing is changed despite adding some listViews patterns as part of the .forceignore file

Additional information

Feel free to attach a screenshot.

SFDX CLI Version(to find the version of the CLI engine run sfdx --version): sfdx-cli/7.81.0-7b953c80d1 win32-x64 node-v12.18.3

SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core) @oclif/plugin-autocomplete 0.1.5 (core) @oclif/plugin-commands 1.3.0 (core) @oclif/plugin-help 3.2.0 (core) @oclif/plugin-not-found 1.2.4 (core) @oclif/plugin-plugins 1.9.1 (core) @oclif/plugin-update 1.3.10 (core) @oclif/plugin-warn-if-update-available 1.7.0 (core) @oclif/plugin-which 1.0.3 (core) @salesforce/sfdx-trust 3.4.3 (core) alias 1.1.3 (core) analytics 1.12.1 (core) auth 1.4.3 (1.4.3) config 1.2.1 (core) generator 1.1.3 (core) odaseva-dx 0.0.0 salesforcedx 51.3.0 (latest-rc) ├─ salesforce-alm 51.3.0 ├─ limits 1.0.4 ├─ user 1.1.2 ├─ schema 1.0.4 ├─ custom-metadata 1.0.11 ├─ apex 0.1.4 ├─ templates 51.3.0 └─ @salesforce/sfdx-plugin-lwc-test 0.1.7 sfdx-cli 7.81.0 (core) OS and version: image

github-actions[bot] commented 3 years ago

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.

mshanemc commented 3 years ago

@jcarmignani that's a very old version the cli. Can you verify it doesn't work with a newer version?

There's also an opt-in for using a newer version of the .forceignore

finally, try these changes: listViews => `/listViews **.listView-meta.xml =>**/listView-meta.xml`

ignore syntax in v2 follows git: https://git-scm.com/docs/gitignore

github-actions[bot] commented 3 years ago

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.

no-response[bot] commented 3 years ago

This issue has been automatically closed because there has been no response to our request for more information from the original author. Currently, there is not enough information provided for us to take action. Please reply and reopen this issue if you need additional assistance.

jcarmignani commented 3 years ago

@mshanemc I have updated my version of the CLI using following command: sfdx update

Then I have modified my .forceignore file as you suggest: image

Eventually I have retrieved Metadata using the following manifest: `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

Account Contact User * CustomObject 51.0 ` I am still facing the same issue with the List Views: ![image](https://user-images.githubusercontent.com/11173517/114048331-bf75a880-988a-11eb-947c-51c4c55db427.png) Any suggestion?
github-actions[bot] commented 3 years ago

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.

uip-robot-zz commented 2 years ago

This issue has been linked to a new work item: W-9959024

WillieRuemmele commented 2 years ago

hi @jcarmignani ​ I was able to add a listview to the .forceignore and see it be ignored. It is different than how they mention it though.

by adding

force-app/main/default/objects/*/listViews/*.*.*

I was able to ignore all listviews from all objects

and by adding

force-app/main/default/objects/Broker__c/listViews/*.*.*

I was able to ignore just the custom object Broker__c's list views

cristiand391 commented 2 years ago

This should be fixed in latest sfdx v7.130.1 🎉 Release notes: https://github.com/forcedotcom/cli/tree/main/releasenotes/sfdx#71301-dec-9-2021-stable

jcarmignani commented 2 years ago

Thanks for providing a permanent fix to this issue :)