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
494 stars 78 forks source link

ComponentSet.fromSource() ignores component.isMarkedForDelete() in include filter #2826

Open jayree opened 6 months ago

jayree commented 6 months ago

Summary

ComponentSet.fromSource() ignores components which are markedForDelete in include filter.

Steps To Reproduce

Expected result

components which are markedForDelete are not listed in manifestComponents

Actual result

components which are markedForDelete are listed in manifestComponents

System Information

{
  "architecture": "darwin-arm64",
  "cliVersion": "@salesforce/cli/2.38.0",
  "nodeVersion": "node-v20.11.1",
  "osVersion": "Darwin 23.4.0",
  "rootPath": "/Users/user/.local/share/sf/client/2.38.0-1a95a96",
  "shell": "zsh",
  "pluginVersions": [
    "@jayree/sfdx-plugin-manifest 3.1.63 (user)",
    "@jayree/sfdx-plugin-org 1.2.42 (user)",
    "@jayree/sfdx-plugin-prettier 1.3.53 (user)",
    "@jayree/sfdx-plugin-source 1.3.50 (user)",
    "@oclif/plugin-autocomplete 3.0.13 (core)",
    "@oclif/plugin-commands 3.2.2 (core)",
    "@oclif/plugin-help 6.0.20 (core)",
    "@oclif/plugin-not-found 3.1.2 (core)",
    "@oclif/plugin-plugins 5.0.7 (core)",
    "@oclif/plugin-search 1.0.21 (core)",
    "@oclif/plugin-update 4.2.4 (core)",
    "@oclif/plugin-version 2.0.16 (core)",
    "@oclif/plugin-warn-if-update-available 3.0.15 (core)",
    "@oclif/plugin-which 3.1.7 (core)",
    "@salesforce/cli 2.38.0 (core)",
    "apex 3.1.4 (core)",
    "auth 3.6.0 (core)",
    "data 3.3.0 (core)",
    "deploy-retrieve 3.6.0 (core)",
    "dev 2.3.0 (user)",
    "info 3.2.0 (core)",
    "limits 3.3.0 (core)",
    "marketplace 1.2.0 (core)",
    "org 4.1.0 (core)",
    "packaging 2.3.0 (core)",
    "schema 3.3.0 (core)",
    "settings 2.1.2 (core)",
    "sobject 1.3.0 (core)",
    "source 3.2.3 (core)",
    "telemetry 3.2.0 (core)",
    "templates 56.1.1 (core)",
    "trust 3.6.1 (core)",
    "user 3.5.0 (core)",
    "oclif-plugin-update-notifier 1.5.68 (user)",
    "sfdx-autocmplt 2.9.46 (user)"
  ]
}
github-actions[bot] commented 6 months ago

Hello @jayree :wave: It looks like you didn't include the full Salesforce CLI version information in your issue. Please provide the output of version --verbose --json for the CLI you're using (sf or sfdx).

A few more things to check:

Thank you!

github-actions[bot] commented 6 months 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.

git2gus[bot] commented 5 months ago

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

jayree commented 5 months ago

Hi, @mshanemc would it also be possible to mark all MarkedForDelete components from the filter in the new component set as destructiveComponents? fsDeletePaths is limited to paths so we cannot use this for non-decomposed child components.

mshanemc commented 5 months ago

checking my understanding

  1. you pass a filter ComponentSet that has some components that are MarkedForDelete
  2. rather than NOT using those components to filter, you'd rather keep those matches, but call setMarkedForDelete on them (with the pre/post matching the original filter member?)
jayree commented 5 months ago

@mshanemc yes, this is how I'm currently doing it: https://github.com/jayree/sfdx-plugin-manifest/blob/988f7bfa2ae0e02f3084a535b2031433b7ce8167/src/SDR-extra/collections/componentSetExtra.ts#L97

mshanemc commented 3 months ago

@jayree I've tried a few solutions to this, but they all ended up causing some integration test failures.