-
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
Branch for dependency (base package) provided in sfdx-project.json is ignored when creating package version. #2183
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. |
Hey @avesolovksyy , sorry for the late reply! good catch, this was fixed last week and was included in the RC today: release notes for
|
@cristiand391 |
@avesolovksyy thanks for taking a look at this; and I'm glad I wasn't the only person affected! I've added two new unit tests to describe the intended behaviour more accurately and can verify they fail as per your expectation: I'm opening a pull request to address this on the packaging project. Can you help verify it works before it gets merged? |
@David-Polehonski |
@avesolovksyy thanks for posting this |
So looks like this was fixed in https://github.com/forcedotcom/cli/tree/main/releasenotes/sfdx#72056-june-15-2023 |
yep, thanks again @avesolovksyy and David for fixing this 🏆 |
Summary
Getting an error NoReleaseVersionFoundForBranchError when creating package version with 'sfdx package version create' command for my extension package. Error points to version of base package specified as dependency for extension package in sfdx-project.json. It seems like 'branch' attribute specified for dependency is completely ignored, that's why it's looking for base package version with with sort of empty branch and cannot find it.
Please note, we've already debugged the issue at code level and provided exact place in js code where we made a tweak that works for us - just check additional notes section, issue is very obvious at code base level, since code behaviour doesn't match code description in comments right in provided file.
Steps To Reproduce:
Expected result
Package version should be created successfully.
Actual result
Error has been thrown with a stack trace:
Pay attention, here it's referring to MyBasePackage id and version in error message (again, that's because it is looking for version in empty/undefined branch, i.e. version without branch, and we don't have such version of MyBasePackage). According to official sfdx guide it should respect branch specified for dependency, thus MyBasePackage version 1.0.8.x should be found.
System Information
It's problem in logic at code base level, not windows/linux specific issue, but still:
Additional information
We've investigated the issue and found that branch is evaluated in a wrong way for dependency at code level.
Affected file:
C:\Users\myuser\AppData\Local\sfdx\client\7.203.6-1da7df1\node_modules@salesforce\packaging\lib\package\packageVersionCreate.js
lines 104-105:
^^^ As you can see, here it picks up branch from dependency only when it is empty, which contradicts even the comment above that line. So we've updated the line 105 to the following to match the behaviour described in comment:
And we created extension version successfully after this.
Please take a look with priority, since dependency management is a crucial thing for us ISV.
This one seems to be a low-hanging fruit.
Thanks in advance.
The text was updated successfully, but these errors were encountered: