Skip to content
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

Add support for file:// protocol in plugin URI #365

Open
intelmatt opened this issue Aug 31, 2021 · 17 comments
Open

Add support for file:// protocol in plugin URI #365

intelmatt opened this issue Aug 31, 2021 · 17 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@intelmatt
Copy link

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 intelmatt added the bug Something isn't working label Aug 31, 2021
@timja
Copy link
Member

timja commented Sep 1, 2021

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

@oleg-nenashev oleg-nenashev added enhancement New feature or request good first issue Good for newcomers and removed bug Something isn't working labels Oct 18, 2021
@oleg-nenashev oleg-nenashev changed the title file:// protocol not supported for plugin URI Add support for file:// protocol in plugin URI Oct 18, 2021
@oleg-nenashev
Copy link
Member

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

@nijicompany
Copy link

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.

@shmarsy
Copy link

shmarsy commented Sep 5, 2022

hello,
I want to contribute in this issue.

@MarkEWaite
Copy link
Contributor

@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.

@prakrit55
Copy link

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?

@mukundsrinivasb
Copy link

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

@krisstern
Copy link
Member

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
Copy link
Member

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.

@jiakuanghe
Copy link
Contributor

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.

@krisstern
Copy link
Member

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!

@jiakuanghe
Copy link
Contributor

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 #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.

@krisstern
Copy link
Member

@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:

  • Task completed

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

@jiakuanghe
Copy link
Contributor

@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:

  • 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.

@krisstern
Copy link
Member

You are welcome @jiakuanghe!

@RAHULDAS6009
Copy link

can anyone give a resource to solve this issue

@itsAftabAlam
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.