Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add workflow flow actions to decomposed workflow preset and allow isAddressable #1467

Merged
merged 2 commits into from
Jan 6, 2025

Conversation

mcarvin8
Copy link
Contributor

@mcarvin8 mcarvin8 commented Dec 13, 2024

What does this PR do?

Updates the decomposed workflow preset to add the child type: Workflow Flow Actions

The overall metadata registry is also missing this child type so I'm adding it to that JSON as well.

In the current decomposed preset, Workflow Flow Actions are added to the *.workflow-meta.xml file instead of decomposed into their own directory and smaller files.

This is causing issues deploying decomposed workflow children, as Salesforce CLI appears to check the *.workflow-meta.xml file even when deploying just 1 decomposed workflow child like an email alert. Since the *.workflow-meta.xml isn't "empty", I'm unable to deploy just a decomposed WorkflowAlert for example.

Also, the "isAddressable: false" key in each supported decomposed workflow child is preventing each decomposed workflow child from being retrieved or deployed without the parent.

After working with @shetzel via CLI Issue 2563, updating the preset to remove all isAddressable: false lines and manually add workflow flow actions to the preset fixes my issue retrieving and deploying decomposed workflow children. I've tested this out in my work's repo, which has tons of workflows with workflow flow actions.

Let me know if your team wants to make this a beta2 instead of modfying an existing beta. Since I'm not changing the overall decomposed workflow structure, just adding a missing child and fixing the addressable feature, I think it makes sense to me to just update the beta preset.

What issues does this PR fix or reference?

forcedotcom/cli#2563

Functionality Before

Decomposed workflow children besides Flow Actions are decomposed into their own sub-directories and files.

Flow actions are added directly to the *.workflow-meta.xml files.

Retrieves can work but deployments fail because it's seeing the Flow Action in the *.workflow-meta.xml file and isAddressable is false, so I can't deploy the child without the parent file.

Functionality After

All decomposed workflow children including Flow Actions are decomposed into their own sub-directories and files.

The *.workflow-meta.xml file just contains the workflow header/footer.

Retrieving and deploying individual workflow children including Flow Actions works with Salesforce CLI.

[skip-validate-pr]

@BluecanvasReen
Copy link

By coincidence I have been debugging this problem for the last couple of days. The same problem happens for SharingRules.

The normal registry, does not correctly detect the fullname of the components, because it does not contain the correct strategy, and the beta version does not work because of isAddressable === false.

Added this comment to get notifications, but happy to support this issue if need be.

@mcarvin8
Copy link
Contributor Author

mcarvin8 commented Dec 16, 2024

You can work around the isAddressable issue @BluecanvasReen if you copy the existing preset into your sfdx-project.json file in a key named registryCustomizations and remove all "isAddressable": false, lines. Then you would need to temporarily remove the existing preset in sourceBehaviorOptions.

I have my sfdx-project.json with the updated workflow preset in forcedotcom/cli#2563 you can reference.

Obviously the long-term fix is for Salesforce to fix the beta preset with a new CLI build, but doing this with workflows was able to get me un-blocked in my work's repo.

I'd like to get a Salesforce engineer to respond to this PR first, but I can update this PR to fix the sharing rules preset if they concur with this fix.

@mcarvin8
Copy link
Contributor Author

mcarvin8 commented Jan 6, 2025

@shetzel - Can this request be reviewed soon please by you or someone else on the CLI team?

@shetzel
Copy link
Contributor

shetzel commented Jan 6, 2025

@shetzel - Can this request be reviewed soon please by you or someone else on the CLI team?

Hi Matt - sorry for the delay. Thanks for making the PR. I'll get someone to look. We've been in a release moratorium.

@WillieRuemmele WillieRuemmele mentioned this pull request Jan 6, 2025
@WillieRuemmele
Copy link
Member

Hi @mcarvin8 - I've started running our tests on your fork over here - I had to update our snapshots because your changes affected those, you can run those yarn test:snapshot to see what they're now producing with you registry+preset changes, let's make sure those look correct

@mcarvin8
Copy link
Contributor Author

mcarvin8 commented Jan 6, 2025

Thank you @shetzel and @WillieRuemmele ! Yea I just realized today that I should update the overall registry JSON as well for the workflow flow actions since it's missing there as well.

When I run yarn test:snapshot on my branch, the changes look good to me.

@WillieRuemmele WillieRuemmele merged commit 7558f5a into forcedotcom:main Jan 6, 2025
54 of 55 checks passed
@mcarvin8 mcarvin8 deleted the fix/workflow-preset branch January 6, 2025 23:52
@mcarvin8
Copy link
Contributor Author

mcarvin8 commented Jan 9, 2025

@BluecanvasReen - Sorry your issue with SharingRules got pushed to the side in all of this.

I'm assuming Salesforce would probably advocate for an issue in their issues repo to update the preset

Is this update just removing the isAddressable lines in the decompose preset for sharing rules? Or is there updates needed to the overall metadata registry?

I could push the change for you in my forked SDR repo, but the Salesforce CLI team might just want a new issues created in https://github.com/forcedotcom/cli/issues

peternhale pushed a commit that referenced this pull request Jan 9, 2025
…w isAddressable (#1467)

* fix: add workflow flow actions and allow isAddressable

* fix: add workflow flow actions
@shetzel
Copy link
Contributor

shetzel commented Jan 9, 2025

@BluecanvasReen @mcarvin8 - please review when you have a sec. #1482

Thanks Matt for bringing this up. I completely missed it! Although we'd prefer a new issue, this will work too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants