-
Notifications
You must be signed in to change notification settings - Fork 240
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
list matching jobs using dsl #225
base: master
Are you sure you want to change the base?
Conversation
mostly fixes to mock usage of client object
Hi @sahal ! I fixed the tests and added a new one to ensure we don't get false positives from folder names. |
lib/jenkins_api_client/job.rb
Outdated
@@ -702,17 +702,18 @@ def builder = new groovy.json.JsonBuilder(allInfo) | |||
job_list_json() | |||
EOS | |||
|
|||
response_json = { "jobs" => JSON.parse(groovy_script_output) } | |||
response_json = response_json | |||
response_json = groovy_script_output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This now returns a String instead of a Hash because JSON.parse was removed
lib/jenkins_api_client/job.rb
Outdated
@@ -702,17 +702,18 @@ def builder = new groovy.json.JsonBuilder(allInfo) | |||
job_list_json() | |||
EOS | |||
|
|||
response_json = { "jobs" => JSON.parse(groovy_script_output) } | |||
response_json = response_json | |||
response_json = groovy_script_output | |||
|
|||
jobs = Array.new | |||
response_json["jobs"].each do |job| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Above the jobs hash key was removed so this no longer works.
lib/jenkins_api_client/job.rb
Outdated
if job.is_a?(Hash) | ||
if job.key? :_class and job[:_class] !~ /com.cloudbees.hudson.plugins.folder.Folder/ | ||
if ignorecase | ||
jobs << job[:name] if job[:name] =~ /#{filter}/i |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is using symbols instead of strings now. When I used JSON.parse it returned strings so this did not work for me.
@tmiller it looks like we need more tests if this is breaking something! I'll take another look soon |
@tmiller, I'm sorry, but I can't tell by your comments if this is breaking something for you or needs to be fixed. Can you be more specific about what functionality is broken? |
@sahal @dayer4b - take a look at the change I made to the I was testing this locally with an instance of Jenkins running, the With a search for a job named
Hope that helps! |
#256 <-- my changes are in this PR. I'm still getting used to Github over Stash/Bitbucket |
Hi, what is the status of this pr? Is anyone working it? We're looking at using this gem, but it's completely useless to us without this PR. Not a single job is outside of a folder for us. |
Hi @snowe2010, According to @katelovescode's comment above, this needs more work and I don't believe anybody is actively working on it. Feel free to take a stab at it if you're interested. |
I'll pass it along to the team to let them know. Not sure if one of us will have time to take it though. |
Incorporates jhoblitt's groovy script to get a full list of folders. See #210