mrraj470 / Keypirinha-Jenkins

A plugin to search Jenkins jobs and nodes in Keypirinha.
MIT License
4 stars 0 forks source link

Doesn't work with Cloudbees folders #1

Open AbhishekTripathi opened 2 years ago

AbhishekTripathi commented 2 years ago

Cloudbees has the notion of folders in Jenkins. I don't think it is exclusive to cloudbees but I might be wrong. When traversing through the folder structure, this plugin fails to list the nested build pipelines. It shows the top-level folders under the provided URL correctly but can't navigate inside which contains more folders that contain the builds. I am trying to visualize the structure below: Team A ---- Project 1 ---------- Multibranch Pipeline 1 ----------Deployment Pipeline 1 -----Project 2 -----------Multibranch Pipeline2 -----------Some other pipeline2 Team B .....

Below is the error log from the console

22:39:59.168 ** ERROR: Error from Jenkins.Jenkins.on_suggest: <class 'urllib.error.HTTPError'>: HTTP Error 404: Not Found Traceback (most recent call last): File "C:\Dropbox\Tools\Keypirinha\portable\Profile\InstalledPackages\Jenkins.keypirinha-package\jenkins.py", line 117, in on_suggest File "C:\Dropbox\Tools\Keypirinha\portable\Profile\InstalledPackages\Jenkins.keypirinha-package\jenkins.py", line 323, in _get_sub_job_suggestions File "C:\Dropbox\Tools\Keypirinha\portable\Profile\InstalledPackages\Jenkins.keypirinha-package\jenkins.py", line 365, in http_get_json File "lib\urllib\request.py", line 222, in urlopen File "lib\urllib\request.py", line 531, in open File "lib\urllib\request.py", line 641, in http_response File "lib\urllib\request.py", line 569, in error File "lib\urllib\request.py", line 503, in _call_chain File "lib\urllib\request.py", line 649, in http_error_default

AbhishekTripathi commented 2 years ago

I found in the document about the nested search but I think it might be more intuitive if it allows to navigate within the folder structure by traversing instead of just flattening the entire tree. It still lists the folder name but on tabbing, it gives the error in console as provided before.

Note: You can also control the depth of search by suffixing folder with ":" and depth number, for example "2". search_starts_from = Administration:3 (with above setting, you can directly search any jobs between "Administration/" to "Administration/job/{}/job/{}/") By default all folders are suffixed with ":1" implicitly. ]

AbhishekTripathi commented 2 years ago

Also, it appears it doesn't work with multibranch pipelines at all. They are not listed.

mrraj470 commented 2 years ago

Hey @AbhishekTripathi, Right now the logging in the plugin is not so good and it doesn't help me find the exact issue. I improved the logging a bit and pre-released v2.4.1.

with this v2.4.1, please add the following in the configuration separately (along with others)

[main] debug_mode=True

and please attach the logs and your configuration, so that I can find the cause of the issue.