-
Notifications
You must be signed in to change notification settings - Fork 78
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
LATEST resolves to deleted (deprecated) package versions for dependencies #1514
Comments
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. |
We have determined that the issue you reported exists in code owned by another team that uses only the official support channels. To ensure that your issue is addressed, open an official Salesforce customer support ticket with a link to this issue. We encourage anyone experiencing this issue to do the same to increase the priority. We will keep this issue open for the community to collaborate on. |
This issue has been linked to a new work item: W-11150069 |
Thanks @jonnypetraglia. We'll get it fixed. |
This was fixed in sfdx v7.154.0, see release notes: https://github.com/forcedotcom/cli/tree/main/releasenotes/sfdx#71540-june-9-2022 |
Summary
LATEST does not exclude deleted package versions when resolving dependencies.
If the most recently generated version of a package has been deleted, executing
sfdx force:package:version
for another package that refers to LATEST of the aforementioned package will resolve to the deleted version.Steps To Reproduce:
Repository to reproduce: [dreamhouse-lwc](https://github.com/jonnypetraglia/sfdx-error1)
Obviously if you run this your 04t IDs will be different.
Step 1: Create two packages
sfdx force:package:create -n Foo -r Foo -t Unlocked
sfdx force:package:create -n Bar -r Bar -t Unlocked
Step 2: Generate a Foo package version twice
sfdx force:package:version:create -p Foo -x --wait 9001
sfdx force:package:version:create -p Foo -x --wait 9001
Step 3: Delete the latest Foo
sfdx force:package:version:delete -p 04t3n000000ZnCwAAK --noprompt
Confirm it's really gone:
sfdx force:package:version:list -p Foo
Step 4: Attempt to create Bar package version
sfdx force:package:version:create -p Bar -x --wait 9001
Expected result
Depend on the latest non-deleted version, i.e. 1.0.0.1
Actual result
Depends on the latest version, even if it has been deleted, i.e. 1.0.0.2
System Information
Additional information
Passing --dev-debug shows that the following SOQL query is run via the Tooling API:
SELECT MAX(BuildNumber) FROM Package2Version WHERE Package2Id = '0Ho3n000000KyjzCAC' AND MajorVersion = 1 AND MinorVersion = 0 AND PatchVersion = 0 AND Branch = null
Unless there's a use case that this would break, simply appending
AND IsDeprecated = false
to the end would fix it.Here is the chunk of code it is on:
https://github.com/forcedotcom/salesforce-alm/blob/608ff7e2afb537392e160453dfd4721d901d1429/src/lib/package/packageVersionCreateCommand.ts#L229-L248
We are only using unlocked packages.
The text was updated successfully, but these errors were encountered: