Get Job Info by Pattern should use fullname

Bug #1685575 reported by Bernardo Vale
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Python Jenkins
Fix Released
Undecided
Unassigned

Bug Description

get_job_info_regex should use fullname instead of name otherwise it will fail if the matched job is inside a folder.

For example, given the above structure:

job1
frontend/
  front-build
  front-deploy
job2

If we execute this code:

jobs = server.get_job_info_regex(pattern='front', folder_depth=None)
We will get the following error:

jenkins.NotFoundException: Requested item could not be found
Because we're not sending the folder name to _get_job_folder.

Revision history for this message
Bernardo Vale (bvale) wrote :
Changed in python-jenkins:
assignee: nobody → Bernardo Vale (bvale)
Changed in python-jenkins:
assignee: Bernardo Vale (bvale) → Khai Do (zaro0508)
status: New → In Progress
Changed in python-jenkins:
assignee: Khai Do (zaro0508) → Sorin Sbârnea (sorin-sbarnea)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on python-jenkins (master)

Change abandoned by Sorin Sbarnea (<email address hidden>) on branch: master
Review: https://review.opendev.org/459087

Sorin Sbarnea (ssbarnea)
Changed in python-jenkins:
assignee: Sorin Sbarnea (ssbarnea) → nobody
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-jenkins (master)

Reviewed: https://review.opendev.org/c/jjb/python-jenkins/+/821781
Committed: https://opendev.org/jjb/python-jenkins/commit/dc2b9447de6fefa716dab5c64a197b55ca461fc5
Submitter: "Zuul (22348)"
Branch: master

commit dc2b9447de6fefa716dab5c64a197b55ca461fc5
Author: Jim Wisniewski <email address hidden>
Date: Tue Dec 14 18:17:53 2021 -0500

    Use fullname in get_job_info_regex

    Use full job name in `get_job_info_regex` instead of just the name, so
    that matches will work in folders as well.

    Closes-Bug: 1685575
    Change-Id: I97ba8ca004387b376a511ba52fc9fdd2aeb98a63

Changed in python-jenkins:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.