cli icon indicating copy to clipboard operation
cli copied to clipboard

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

Open jayree opened this issue 1 year ago • 7 comments

Summary

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

Steps To Reproduce

  • create a componentSet with components and mark them for deletion.
  • use this componentSet as an include filter and create a ComponentSet.fromSource()

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)"
  ]
}

jayree avatar Apr 15 '24 16:04 jayree

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:

  • Make sure you've provided detailed steps to reproduce your issue.
    • A repository that clearly demonstrates the bug is ideal.
  • Make sure you've installed the latest version of Salesforce CLI. (docs)
    • Better yet, try the rc or nightly versions. (docs)
  • Try running the doctor command to diagnose common issues.
  • Search GitHub for existing related issues.

Thank you!

github-actions[bot] avatar Apr 15 '24 16:04 github-actions[bot]

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.

github-actions[bot] avatar Apr 15 '24 16:04 github-actions[bot]

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

git2gus[bot] avatar May 15 '24 16:05 git2gus[bot]

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.

jayree avatar May 29 '24 10:05 jayree

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?)

mshanemc avatar May 29 '24 12:05 mshanemc

@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

jayree avatar Jun 01 '24 13:06 jayree

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

mshanemc avatar Jul 29 '24 21:07 mshanemc