We've been trying to patch with 2GP for a few months now but we're constantly hitting errors even when the only change is a comment in an apex class. Many errors were around reports so to try to get to a patchable state I've deprecated reports that were erroring but have hit a new error:
Opportunity.Custom Process: Picklist value: OpportunityStagePicklistValue not found
Our app has 5 custom picklist values in the Opportunity.Stage StandardValueSet which we use throughout the product via our custom SalesProcess mentioned in the error. According to the metadata coverage report StandardValueSets cannot be packaged as part of 2GP so my question is:
Why are these Opportunity.Stage values not an issue in a normal package but break for patches?
One theory I have is that packaging deploys the code to a scratch org which would also deploy the StandardValueSets (as they can be pushed to an org via the Metadata API) but patching doesn't (maybe it installs the ancestor instead of deploying?). Does anyone know if this is the case?
To answer some questions on what we've done:
- Patching is enabled in our namespace org
- The defined ancestor has been released
- The ancestor has been security reviewed
- The versionNumber has the same Major and Minor number as the ancestor with the patch version being increased by one
- Still have a case open with Salesforce over this but it hasn't yielded anything so far
"ancestorId": "App@1.172.0-1",
"versionNumber": "1.172.1.NEXT",
This question does relate to the following but the suggested duplicate answer there wasn't the fix.
2gp Patching is Failing Even When the Only Change is a Comment
As always, any and all help is appreciated.