plugin-installation-manager-tool icon indicating copy to clipboard operation
plugin-installation-manager-tool copied to clipboard

Add support for file:// protocol in plugin URI

Open intelmatt opened this issue 4 years ago • 17 comments
trafficstars

Version report

Jenkins and plugins versions report:

Jenkins 2.303.1; no plugins installed

Reproduction steps

  1. Run Jenkins docker LTS image
  2. Open a shell in the image
  3. Try to install a local hpi file by running this command: jenkins-plugin-cli -p git:4.8.2_CMT:file:///usr/share/jenkins/ref/plugins/git-4.8.2_CMT.hpi

Results

Expected result:

I expected to see the plugin and all of its dependencies get installed.

Actual result:

I got an error:

Unable to resolve plugin URL file:///usr/share/jenkins/ref/plugins/git-4.8.2_CMT.hpi, or download plugin git to file: URI does not specify a valid host name: file:///usr/share/jenkins/ref/plugins/git-4.8.2_CMT.hpi

I believe the problem is that jenkins-plugin-cli does not support the file:// protocol. If there is some other known way to install a local hpi file using jenkins-plugin-cli dependency resolver, let me know.

intelmatt avatar Aug 31 '21 22:08 intelmatt

There’s not currently, it needs to be hosted on a web server for now

timja avatar Sep 01 '21 06:09 timja

I think it is rather RFE than bug, but indeed it would be awesome to have it implemented

oleg-nenashev avatar Oct 18 '21 05:10 oleg-nenashev

Hello, I want to contribute to open source and I found this project beginner friendly. Can anyone guide me to make my first contribution? Help and resources are much appreciated. Thanks in advance.

nijicompany avatar Aug 27 '22 13:08 nijicompany

hello, I want to contribute in this issue.

shmarsy avatar Sep 05 '22 15:09 shmarsy

@nijicompany and @shmarsy you'll need Apache Maven and Java 11. You'll probably want an integrated development environment (IDE) like Visual Studio Code, IntelliJ, Apache Netbeans, or Eclipse.

See https://www.jenkins.io/participate/code/ for good guidelines on ways that you can contribute with code.

If you prefer more of a step-wise tutorial, see the five part video series on modernizing a plugin.

If you prefer written rather than video, consider the "Contributing to Open Source" document.

MarkEWaite avatar Sep 05 '22 15:09 MarkEWaite

Hello there ,I want to know if the bug is still there or not, if its then what is the plugin about? Is it a git plugin to be used?

prakrit55 avatar Dec 15 '22 06:12 prakrit55

What I have so far

  1. Managed to set up the project and build in docker container
  2. Made some minor changes just to check if everything works like adding my name to the end of a command description
  3. Have understood that the changes have to made at the lines
 @Option(name = "--plugins", aliases = {"-p"}, usage = "List of plugins to install, separated by a space",
            handler = StringArrayOptionHandler.class)
    private String[] plugins = new String[0];

I need help with understanding

  1. What methods talk about parsing plugins to be downloaded

mukundsrinivasb avatar Jan 22 '23 02:01 mukundsrinivasb

Have you tried running the command jenkins-plugin-cli -p git:4.8.2_CMT:file:///usr/share/jenkins/ref/plugins/git-4.8.2_CMT.hpi with a local hpi file called something like git-4.8.2_CMT.hpi for the example @mukundsrinivasb?

krisstern avatar Jan 22 '23 06:01 krisstern

What @prakrit55 said:

Hello there ,I want to know if the bug is still there or not, if its then what is the plugin about? Is it a git plugin to be used?

Hi @prakrit55 I believe this is still an active issue to be resovled. This plugin is used to manage plugin installations. According to the README.md:

The plugin manager downloads plugins and their dependencies into a folder so that they can be easily imported into an instance of Jenkins.

krisstern avatar Jan 22 '23 06:01 krisstern

Hi, I am interested in this issue. @krisstern @MarkEWaite I would like to fix it. Does anyone already fix it? Or it still waiting for someone to fix it? Thanks.

jiakuanghe avatar Feb 01 '23 02:02 jiakuanghe

Hi @jiakuanghe I don't think a PR has been submitted for this issue yet, so you may go ahead and try to come up with a patch. Enjoy!

krisstern avatar Feb 01 '23 02:02 krisstern

Hi @jiakuanghe I don't think a PR has been submitted for this issue yet, so you may go ahead and try to come up with a patch. Enjoy!

@krisstern I just opened a PR in https://github.com/jenkinsci/plugin-installation-manager-tool/pull/522 Would you like to help me see if it is the correct way to submit a PR? But the PR is for another issue. I will finish this issue as well. Thanks.

jiakuanghe avatar Feb 01 '23 03:02 jiakuanghe

@jiakuanghe Sure!

It is better to put Fixes #258 up top where you have a checklist. For the checklist checkbox, try removing the extra spaces in - [x] so you will see something like the following:

  • [x] Task completed

Other than that the PR looks okay to be on the surface at least.

krisstern avatar Feb 01 '23 03:02 krisstern

@jiakuanghe Sure!

It is better to put Fixes #258 up top where you have a checklist. For the checklist checkbox, try removing the extra spaces in - [x] so you will see something like the following:

  • [x] Task completed

Other than that the PR looks okay to be on the surface at least.

Done. I've edited it. Thanks for letting me know.

jiakuanghe avatar Feb 01 '23 03:02 jiakuanghe

You are welcome @jiakuanghe!

krisstern avatar Feb 01 '23 15:02 krisstern

can anyone give a resource to solve this issue

RAHULDAS6009 avatar Mar 28 '23 08:03 RAHULDAS6009

Hi, I am not able to reproduce the issue. The tool works fine. Is this issue still unresolved?

itsAftabAlam avatar Dec 08 '23 09:12 itsAftabAlam