Closed Brian-Triplett closed 3 months ago
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.
Hello @Brian-Triplett :wave: It looks like you didn't include the full Salesforce CLI version information in your issue.
Please provide the output of version --verbose --json
for the CLI you're using (sf
or sfdx
).
A few more things to check:
rc
or nightly
versions. (docs)doctor
command to diagnose common issues.Thank you!
Hi @Brian-Triplett. That doc explains the behavior of sourceApiVersion
and apiVersion
when deploying and retrieving source. There are correlations with packaging though so here is my interpretation of what is happening:
An org connection is created using the target dev hub org. If the --api-version
flag is used then that API version will be used by the command. If that flag is not specified, then the highest API version supported by the target dev hub org is used. I believe adding releaseVersion: previous
to your definition file also affects this when your target dev hub org is ahead of the package. The sourceApiVersion
is not used for this. I.e., I think this URL in the result is correct based on how the command was run: /services/data/v61.0/tooling/sobjects/Package2Version/05iHu000000Cd0YIAS
The sourceApiVersion
should be used for the <version>
element in the manifests that are generated as part of the package version create
process. To verify this, you can add the --preserve
flag to your command and you can inspect the package.xml file generated in the temporary directory. If the version is wrong in the manifest then that is a bug and should be fixed. Let me know if that's the case.
However, I believe this is working as designed.
Hello @Brian-Triplett :wave: None of the versions of sf
you shared match the latest release.
Shared: 2.44.8
Latest: 2.45.6
Update to the latest version of Salesforce CLI (docs) and confirm that you're still seeing your issue.
You can also try the rc
and nightly
releases! (docs)
After updating, share the full output of sf version --verbose --json
Thanks for this @shetzel. So if I understand correctly we need BOTH sourceApiVersion
in the sfdx-project.json but also need to consider specifying the --api-version
in the CLI command as well?
The main thing we want to avoid is having a "dead period" where we have 2GP packages that can't be shipped due to our DevHub being updated but a customer org still on the prior release.
We also want to avoid having to update an --api-version
variable though as that's a recipe for forgetting and finding out we're still making packages from 3 API versions ago.
Sorry, I typed too much in my response and didn't make the solution clear. In this transition period where dev hub orgs are being updated with the new Salesforce major release you might need to set releaseVersion: previous
in your definition file (config/project-scratch-def.json) to build the package on the previous release. In this case, that's what you need to do.
Closing this since the design is to use releaseVersion: previous
during transition periods.
Summary
We are creating a package with the
sf package version create
command. According to this doc thesourceApiVersion
should take precedence; however, the resulting package version is being created with the latest API version (61.0).Steps To Reproduce
sourceApiVersion
set to not the latest. Here is the one we are usingsf package version create --json --skip-ancestor-check --version-number 3.37.0.NEXT --definition-file config/project-scratch-def.json --package Banking Advisor --installation-key-bypass --code-coverage --version-description https://github.com/ncino/force-banking-advisor/actions/runs/9483764570 --version-name ver 3.37.0
Expected result
A package created with the
sourceApiVersion
specified in thesfdx-project.json
Actual result
The following error results when installing into orgs not on the Summer '24 release
System Information
Running inside of a Github Action with default Ubuntu image