cli icon indicating copy to clipboard operation
cli copied to clipboard

"sf project convert source" creates invalid SharingRule xml when decomposeSharingRulesBeta & decomposeWorkflowBeta is enabled

Open soileaud opened this issue 8 months ago • 3 comments

Summary

Enabling both decomposeWorkflowBeta & decomposeSharingRulesBeta causes project convert source to generate bad metadata format files for SharingRules&Workflow which cause deployment errors when both metadata types are in the conversion/deployment.

Steps To Reproduce

  1. Have project with sharing rules and workflow rules with alerts/fieldupdates (for example on Account)
  2. sf project convert source-behavior --behavior decomposeSharingRulesBeta
  3. sf project convert source-behavior --behavior decomposeWorkflowBeta
  4. sf project generate manifest --source-dir force-app/main/default/workflows/Account --source-dir force-app/main/default/sharingRules/Account --output-dir test
  5. sf project convert source --manifest test/package.xml --output-dir test2

side note for step 4, I first tried sf project convert source --source-dir force-app/main/default/workflows/Account --source-dir force-app/main/default/sharingRules/Account/ --output-dir test but that generated an incorrect directory, with a correct manifest - but that may be a second issue..

Expected result

Separate, valid, Sharing Rule and Workflow rule files ready for metadata api deployment

Actual result

A single, invalid, sharing rule file with Workflow alert/fieldUpdate elements above the sharing elements. No workflow file.

Additional information

Image

Image

System Information

"versionDetail": {
    "architecture": "darwin-arm64",
    "cliVersion": "@salesforce/cli/2.82.6",
    "nodeVersion": "node-v22.14.0",
    "osVersion": "Darwin 24.3.0",
    "rootPath": "/Users/soileaud/.local/share/sf/client/2.82.6-151255f",
    "shell": "zsh",
    "pluginVersions": [
      "@oclif/plugin-autocomplete 3.2.26 (core)",
      "@oclif/plugin-commands 4.1.22 (core)",
      "@oclif/plugin-help 6.2.27 (core)",
      "@oclif/plugin-not-found 3.2.48 (core)",
      "@oclif/plugin-plugins 5.4.36 (core)",
      "@oclif/plugin-search 1.2.23 (core)",
      "@oclif/plugin-update 4.6.35 (core)",
      "@oclif/plugin-version 2.2.27 (core)",
      "@oclif/plugin-warn-if-update-available 3.1.38 (core)",
      "@oclif/plugin-which 3.2.34 (core)",
      "@salesforce/cli 2.82.6 (core)",
      "apex 3.6.11 (core)",
      "api 1.3.3 (core)",
      "auth 3.6.107 (core)",
      "data 4.0.23 (core)",
      "deploy-retrieve 3.21.1 (core)",
      "info 3.4.50 (core)",
      "limits 3.3.51 (core)",
      "marketplace 1.3.7 (core)",
      "org 5.5.5 (core)",
      "packaging 2.12.3 (user)",
      "schema 3.3.57 (core)",
      "settings 2.4.21 (core)",
      "sobject 1.4.53 (core)",
      "telemetry 3.6.36 (core)",
      "templates 56.3.43 (core)",
      "trust 3.7.75 (core)",
      "user 3.6.15 (core)",
      "sfdmu 4.38.0 (user)",
      "sfdx-git-delta 6.5.1 (user)",
      "sfdx-hardis 5.25.0 (user)",
      "texei-sfdx-plugin 2.8.3 (user)"
    ]
  }

soileaud avatar Apr 08 '25 01:04 soileaud

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 08 '25 01:04 github-actions[bot]

I was able to reproduce this, after converting to the test2 directory, there was only a sharingRules dir, but should include a workflows dir. The manifest was the same

steps to repro:

setup > sharing settings > Manage sharing settings for: Account > new Sharing Rule setup > workflow rules > new WF Rule > Account > Field Updates sf project retrieve start follow steps above

WillieRuemmele avatar Apr 09 '25 16:04 WillieRuemmele

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

git2gus[bot] avatar Apr 09 '25 16:04 git2gus[bot]