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

Improvement/Feature request: Ability to override hardcoded config file via command line option. #3

Open
avesolovksyy opened this issue Dec 30, 2023 · 2 comments

Comments

@avesolovksyy
Copy link

First of all, it is really greate idea to split profiles like that - not sure why SF hasn't introduced this as a part of source format.

But, currently configuration is hardcoded inside shared/config.json file.
It would be really great to have an option to pass config file via command line, so that we can override the default one.

Since SF is constantly improving on security, new items/tags appear regularly in profiles and permission sets, e.g. flowAccesses. Thus having ability to adjust configs without updating source code and releasing new plugin version, would be really great.

Thanks a lot for the plugin, anyway

@lodossDev
Copy link
Owner

Hi, i think you can just update the default config file to extend it?

@avesolovksyy
Copy link
Author

Yes, that's what we are doing currently - in CI job after installing sf plugin, bash command copies our updated file with configs into location where plugin is installed to override default embedded config.

We could have avoid doing such hack if default config file is updated with latest SF changes and new version of plugin is released. I've attached config file that we are currently using (just added customMetadataTypeAccesses, customSettingAccesses, categoryGroupVisibilities and flowAccesses).
config.json

Alternative approach would be just to introduce command line flag for split and merge to pass external config file - that's what I'm suggesting here to avoid hacks and re-releases of plugin version in future.

Also, we've noticed some trouble with layoutAssignments mapping in default config. Currently it is using layout as nameTag, but same layout can be mapped to different record types in scope of one profile. Below is a snippet that we have in one of our profiles:

<layoutAssignments>
    <layout>Service_Metrics__c-Service Metrics Layout</layout>
</layoutAssignments>
<layoutAssignments>
    <layout>Service_Metrics__c-Service Metrics Layout</layout>
    <recordType>Service_Metrics__c.Service_Metrics_MainRT</recordType>
</layoutAssignments>
<layoutAssignments>
    <layout>Service_Metrics__c-Service Metrics Layout</layout>
    <recordType>Service_Metrics__c.Service_Metrics_SecondaryRT</recordType>
</layoutAssignments>

When splitting such profile, only the latest layout assignment is present in generated folder.

We have already tried to use tagName=recordType, but it throws an error when parsing assignments without Recored Types (like the first one in snippet above).

Seems like this may require changes in code base.
Any advice how to handle this would be appreciated.

Thanks in advance.
And Happy New Year!

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

No branches or pull requests

2 participants