fix: installing a tarball after a registered plugin works properly @W-21915680@#1295
Open
jfeingold35 wants to merge 4 commits intomainfrom
Open
fix: installing a tarball after a registered plugin works properly @W-21915680@#1295jfeingold35 wants to merge 4 commits intomainfrom
jfeingold35 wants to merge 4 commits intomainfrom
Conversation
|
Git2Gus App is installed but the |
f255a38 to
0678888
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes @W-21915680@ and closes #1294 .
OKAY, this is a really weird one.
When you install a plugin via its hosted name (e.g.,
sf plugins install code-analyzer) and then install some other plugin via a local tarball (e.g.,sf plugins install "file:///Users/blahblah/salesforce-plugin-update-v2.1.3.tgz"), if the second plugin's name is alphabetically after the first plugin's name, then the install of the second plugin subtly fails.The install will seem to succeed, but if you look carefully you'll see
installing plugin file:///.....-vX.Y.Z.tgz... installed vA.B.C, where XYZ is the version of the tarball and ABC is the version of the first plugin. And if you look at~/.local/share/sf/package.json, then you'll see that the tarball location simply overrode the declared location of the first plugin. This doesn't appear to interfere with the first plugin's behavior in any noticeable way, but it does mean that the second plugin won't work at all.The cause was that the matching operation to compare the tarball's package information to the known dependencies wasn't taking typing into account, so it was just auto-matching to the alphabetically first dependency it checked. This is why the bug is only reproducible when you have multiple dependencies and the second plugin is alphabetically after the first.
I believe that my fix is safe, as it adds test coverage for the scenario in question, and those tests fail without my changes and succeed with them. But I'm not sure, as this code is somewhat mysterious.