apm icon indicating copy to clipboard operation
apm copied to clipboard

Installing package from SSH Git URL doesn't work

Open fcurts opened this issue 7 years ago • 7 comments

Prerequisites

  • [X] Put an X between the brackets on this line if you have done all of the following:
    • Reproduced the problem in Safe Mode: http://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
    • Followed all applicable steps in the debugging guide: http://flight-manual.atom.io/hacking-atom/sections/debugging/
    • Checked the FAQs on the message board for common solutions: https://discuss.atom.io/c/faq
    • Checked that your issue isn't already filed: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aatom
    • Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages

Description

Despite of what https://github.com/atom/apm/pull/518 says, installing a package from an SSH URL (git@...) doesn't work.

(Sidenote: I couldn't find any documentation for the "Install package from Git URL" feature.)

Steps to Reproduce

  1. Develop a package on master branch of a GitHub Enterprise repo
  2. Run apm install --verbose [email protected]:myorg/mypackage.git

Expected behavior: [What you expect to happen]

Package is installed successfully.

Actual behavior: [What actually happens]

From what I can tell, apm misinterprets git@... as package@version and hence tries to resolve package git from atom.io:

Installing [email protected]:myorg/mypackage.git to /Users/xxx/.atom/packages
REQUEST { url: 'https://atom.io/api/packages/git', ... }
REQUEST make request https://atom.io/api/packages/git
REQUEST onRequestResponse https://atom.io/api/packages/git 404
...
Request for package information failed: Not Found

Reproduces how often: [What percentage of the time does it reproduce?]

always

Versions

apm 1.19.0 npm 3.10.10 node 6.9.5 x64 atom 1.27.2 python 2.7.10 git 2.17.1

macOS 10.13.5

Additional Information

I also tried with ssh:// and git+ssh:// URLs but the problem remains the same.

fcurts avatar Jun 05 '18 00:06 fcurts

Unfortunately, because we use hosted-git-info for a vital part of this functionality, installing packages using Git URLs only works for repositories hosted on GitHub, BitBucket, and GitLab.

See: https://www.npmjs.com/package/hosted-git-info#supported-hosts.

thomasjo avatar Jun 05 '18 08:06 thomasjo

@thomasjo You mean github/bitbucket/gitlab.com? (The package is hosted on GitHub Enterprise.) Ouch. In that case, can hosted-git-info be replaced/fixed/forked?

fcurts avatar Jun 05 '18 14:06 fcurts

Sounds like we are waiting for this PR to land: https://github.com/npm/hosted-git-info/pull/30

fcurts avatar Jun 05 '18 14:06 fcurts

@fcurts Yeah, that PR is quite old, and sadly there seems to be very little activity on the repo. Our recommendation for the time being is that you switch from using git@... to https:// URLs, which should work as expected.

Because this is currently blocked upstream, and there is a viable workaround, I'm going to close this. If using the proposed workaround will cause major problems for you, let us know and we can re-open the issue. If you, or someone else is willing to contribute a PR that resolves the problem, with zero regressions in existing functionality, we might be able get that merged and shipped.

Thanks for the report, and sorry about the inconvenience.

thomasjo avatar Jun 05 '18 16:06 thomasjo

@thomasjo HTTPS has the same problem - apm tries to resolve a package named https://github.mycompany.com/myorg/mypackage.git from atom.io. And even if it worked, many on-premises GitHub/GitLab instances (including ours) only support SSH Git URLs.

Please re-open.

fcurts avatar Jun 05 '18 16:06 fcurts

Any updates? Are there any plans to support/fix installing packages from Git URLs?

fcurts avatar Feb 13 '19 17:02 fcurts

For now manually cloning and then installing with apm is probably the easiest way.

lineargraph avatar Nov 12 '20 17:11 lineargraph