When attempting to deploy my changes via Gearset / Metadata API I get the following error on the Admin profile: "You may not modify the permission Promote a package version to released while editing a Standard Profile"
I am not sure which user permission label goes to this 'Promote a package version to released' permission.
I have tried removing the 'Packaging2' (Create and Update Second-Generation Packages) but that wasn't it.
I have found the permission on the profile in the org under System Admin Profile > System Permissions
Seems to be related to Managed Package development: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_dev2gp_create_pkg_ver_promote.htm
The 'Promote a package version to released' permission is already enabled in the target org. I found that the related profile permission Name/Label was 'Packaging2PromoteVersion'. This permission was NOT included in the metadata file. This is confusing, in the Profile Metadata documentation it reads:
- We designed Profile metadata deployment to overlay the existing Profile settings in a target org. For example, if you disable permissions for a profile, the newly disabled permission information isn't exported. To force all Profile changes to deploy through metadata, including permission disablement, add code that explicitly indicates disabled permissions. For example, add this code to the Profile metadata .xml file before deploying into a target org: <value>false</value>.
- Source: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_profile.htm
I was able to get the deploy to go through by ADDING the missing permission declaration to TRUE. Which matches what was already in the org. So I have a feeling by excluding it the deployment was attempting to set the value to false even though it was not included in the profile metadata file I was deploying. Which would be against how this is supposed to work.