tabeyti / jenkins-jack

Jack into your Jenkins to execute Pipeline scripts, provide Pipeline step autocompletions, pull Shared Library step documenation, run console groovy scripts across multiple nodes, and more! Honestly, not that much more.
Other
97 stars 32 forks source link

Opening URLs in browser do not work if Jenkins URL has a non-empty base path #35

Closed chickenkiller closed 3 years ago

chickenkiller commented 3 years ago

I have a Jenkins server hosted at https://my_host:my_port/jenkins/.

The implementation of openBrowserAt, seen below:

https://github.com/tabeyti/jenkins-jack/blob/f698ad58f9ccf3599e1f086f3f2102eb5022d23d/src/jenkinsService.ts#L494-L496

will let to an URL containing the /jenkins part two times. Here is an example of URL constructed: https://my_host:my_port/jenkins//jenkins/job/Folder/job/MyJob/job/master/2/. The base URL of the jenkins URL should be used instead (https://my_host:my_port) before appending the path.

I am no typescript (nor javascript) developer so I don't know the best way to fix this, but it makes the extension unusable for quite a lot of Jenkins installations.

Thanks for having a look!

sreeniHari commented 3 years ago

Hi @tabeyti when is 1.1.1 milestone planned? Right now not able to use this wonderful plug-in because of this issue. We are a team of 100+ people and would strongly recommend this plug-n for the group

tabeyti commented 3 years ago

Hey @chickenkiller,@sreenihari !

Sorry for the delay.

The openBrowserAt method is only for the extension to open the browser to things like logs, jobs, builds, agents, etc., but you mentioned it was making the extension unusable for you guys.

Is this the only feature you both are having this issue with or are you both unable to use other features like to execute pipeline scripts, download build logs, etc.?

I've also tested the extension against an instance with the same URI format you referenced, but everything is working fine for my instance. I may need some more details, like your connection config in settings.json or how your Jenkins server is set up (e.g. behind proxy).

This is the connection config block in settings.json that I used for my test:

"jenkins-jack.jenkins.connections": [
        {
            "name": "localhost",
            "uri": "http://127.0.0.1:8080/jenkins",
            "username": "tabeyti",
            "password": "BLAHBLAHBLAHBLAHBLAHBOBLOBLAWLOG",
            "active": true
        },
        ...
]
sreeniHari commented 3 years ago

@tabeyti Thanks for the update. I managed to get it working by using domain name instead of ip like https://company.jenkins.com/jenkins/ however i had to immediately stop jenkins jack as it was pulling all the jobs and pipelines. we have 1000+ jobs !

What i need is a filter a particular folder. I believe someone has already logged issue already.

https://github.com/tabeyti/jenkins-jack/issues/40

tabeyti commented 3 years ago

Duplicate of #40. Closing.