Closed darlaam closed 4 years ago
Hi @mockersf, thanks for the great work on this package! I am looking forward to using it on one of my group's Jenkins installations.
Could you talk about any progress that has been made to add support for jobs nested within folders? Our existing Jenkins installation makes heavy use of jobs within folders (nested one or two levels deep).
Without this support, this library is unusable for our existing installation.
you can now get a folder and its jobs:
let folder: jenkins_api::job::Folder = jenkins
.get_job("test_folder")
.unwrap()
.as_variant::<jenkins_api::job::Folder>()
.unwrap();
let job = folder.jobs[0].get_full_job(&jenkins);
Let's we have a job in a folder (something like
http://jenkins:8080/job/folder/job/myjob
)First attempt
-> Result::unwrap() on an
Errvalue: Error(Status(404), "http://jenkins:8080/job/folder%2Fjob%2Fmyjob/api/json?depth=1")
Ok.There is some URL encoding done there (namely in
JobName
andName::Name()
). Doesn't seems the way to go then...No need to say that the simple
get_job("myjob")
is also a 404.Attempt two Can I get the job from the folder ?
-> Result::unwrap() on an Err value: Error(Json(Error("missing field
buildable", line: 1, column: 14901)))
Yes... right... Indeed, folders don't have a buildable field...Attempt three From home ? Same problem than 2 : I can get the Home folder, list jobs (somes are actually folders) and panic trying to get a full job (which it's not... so quite logical).
Attempt four With get_object_as
Better : I cant get the job, but I can't get the full fledge job :
Result::unwrap() on an Err value: ParseIntError { kind: InvalidDigit }
Seems we are paddling inPath.url_to_path method
: the url is detected as a build one...To conclude So question is : is it possible to access a job in a folder ? It seems that the code exect the job to be at the root of jenkins.