Re: [OpenStack-Infra] JJB 1.4.0 delete-all no longer deletes jobs

2016-02-03 Thread Thanh Ha
Sorry for taking so long to get back on this one. I finally found the cause
and submitted a solution via this patch [1]. It turns out the issue is with
the groovy script itself! The api it was using getProjects() doesn't
include all job types and only simple jobs such as Freestyle jobs while
ignoring job types like Maven, Matrix, folder jobs, etc... The api is also
deprecated so we probably shouldn't use it anyway.

I switched to using the getAllItems() as recommended in the getProjects()
api docs. This newer api pulls in all job types but also allows you to pass
a parameter to select a specific job type if desired. We don't need that
parameter for the delete-all command.

Regards,

Thanh

[1] https://review.openstack.org/275993

On 20 January 2016 at 10:16, Thanh Ha  wrote:

> Sure thing, I'll try to find some time this week to investigate. Thanks
> for the pointer.
>
> Regards,
>
> Thanh
>
>
> On 19 January 2016 at 15:32, Darragh Bailey 
> wrote:
>
>> Hi Thanh,
>>
>>
>> I suspect there's an issue with the groovy script that is used in
>> place of the REST api point executing, see:
>>
>> https://github.com/openstack-infra/jenkins-job-builder/blob/master/jenkins_jobs/builder.py#L168-L173
>>
>> Maybe you don't have sufficient privs to execute the script, but the
>> code isn't checking the result of calling run_script() on Jenkins.
>>
>> Any chance you could try and capture the return value from those lines?
>>
>>
>> On 19 January 2016 at 18:00, Wayne Warren  wrote:
>> > What command line flags did you pass?
>> >
>> > I don't generally use this or the 'delete' subcommand, preferring
>> > instead to use python-jenkins directly.
>> >
>> > On Sun, Jan 17, 2016 at 5:03 PM, Thanh Ha 
>> wrote:
>> >> Hi Everyone,
>> >>
>> >> It seems to me that JJB 1.4.0's delete-all function has regressed and
>> no
>> >> longer performs the delete function. Instead it simply provides the
>> >> following output and exits without performing any deletes.
>> >>
>> >> Sure you want to delete *ALL* jobs from Jenkins server?
>> >> (including those not managed by Jenkins Job Builder) (Y/N): y
>> >> INFO:root:Deleting all jobs
>> >> INFO:jenkins_jobs.builder:Number of jobs to delete:  50
>> >> INFO:jenkins_jobs.builder:Cache saved
>> >>
>> >>
>> >> Has anyone else noticed this issue as well?
>> >>
>> >> I'll try to find some time to investigate which patch introduced this
>> issue
>> >> unless someone else gets to it first but thought I'd inform the team.
>> >>
>> >> Regards,
>> >>
>> >> Thanh
>>
>
___
OpenStack-Infra mailing list
OpenStack-Infra@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-infra


Re: [OpenStack-Infra] JJB 1.4.0 delete-all no longer deletes jobs

2016-01-20 Thread Thanh Ha
Sure thing, I'll try to find some time this week to investigate. Thanks for
the pointer.

Regards,

Thanh

On 19 January 2016 at 15:32, Darragh Bailey  wrote:

> Hi Thanh,
>
>
> I suspect there's an issue with the groovy script that is used in
> place of the REST api point executing, see:
>
> https://github.com/openstack-infra/jenkins-job-builder/blob/master/jenkins_jobs/builder.py#L168-L173
>
> Maybe you don't have sufficient privs to execute the script, but the
> code isn't checking the result of calling run_script() on Jenkins.
>
> Any chance you could try and capture the return value from those lines?
>
>
> On 19 January 2016 at 18:00, Wayne Warren  wrote:
> > What command line flags did you pass?
> >
> > I don't generally use this or the 'delete' subcommand, preferring
> > instead to use python-jenkins directly.
> >
> > On Sun, Jan 17, 2016 at 5:03 PM, Thanh Ha 
> wrote:
> >> Hi Everyone,
> >>
> >> It seems to me that JJB 1.4.0's delete-all function has regressed and no
> >> longer performs the delete function. Instead it simply provides the
> >> following output and exits without performing any deletes.
> >>
> >> Sure you want to delete *ALL* jobs from Jenkins server?
> >> (including those not managed by Jenkins Job Builder) (Y/N): y
> >> INFO:root:Deleting all jobs
> >> INFO:jenkins_jobs.builder:Number of jobs to delete:  50
> >> INFO:jenkins_jobs.builder:Cache saved
> >>
> >>
> >> Has anyone else noticed this issue as well?
> >>
> >> I'll try to find some time to investigate which patch introduced this
> issue
> >> unless someone else gets to it first but thought I'd inform the team.
> >>
> >> Regards,
> >>
> >> Thanh
>
___
OpenStack-Infra mailing list
OpenStack-Infra@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-infra


Re: [OpenStack-Infra] JJB 1.4.0 delete-all no longer deletes jobs

2016-01-20 Thread Thanh Ha
No flags it's simply just a call to:

$ jenkins-jobs delete-all

Thanh

On 19 January 2016 at 13:00, Wayne Warren  wrote:

> What command line flags did you pass?
>
> I don't generally use this or the 'delete' subcommand, preferring
> instead to use python-jenkins directly.
>
> On Sun, Jan 17, 2016 at 5:03 PM, Thanh Ha 
> wrote:
> > Hi Everyone,
> >
> > It seems to me that JJB 1.4.0's delete-all function has regressed and no
> > longer performs the delete function. Instead it simply provides the
> > following output and exits without performing any deletes.
> >
> > Sure you want to delete *ALL* jobs from Jenkins server?
> > (including those not managed by Jenkins Job Builder) (Y/N): y
> > INFO:root:Deleting all jobs
> > INFO:jenkins_jobs.builder:Number of jobs to delete:  50
> > INFO:jenkins_jobs.builder:Cache saved
> >
> >
> > Has anyone else noticed this issue as well?
> >
> > I'll try to find some time to investigate which patch introduced this
> issue
> > unless someone else gets to it first but thought I'd inform the team.
> >
> > Regards,
> >
> > Thanh
>
___
OpenStack-Infra mailing list
OpenStack-Infra@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-infra


Re: [OpenStack-Infra] JJB 1.4.0 delete-all no longer deletes jobs

2016-01-19 Thread Darragh Bailey
Hi Thanh,


I suspect there's an issue with the groovy script that is used in
place of the REST api point executing, see:
https://github.com/openstack-infra/jenkins-job-builder/blob/master/jenkins_jobs/builder.py#L168-L173

Maybe you don't have sufficient privs to execute the script, but the
code isn't checking the result of calling run_script() on Jenkins.

Any chance you could try and capture the return value from those lines?


On 19 January 2016 at 18:00, Wayne Warren  wrote:
> What command line flags did you pass?
>
> I don't generally use this or the 'delete' subcommand, preferring
> instead to use python-jenkins directly.
>
> On Sun, Jan 17, 2016 at 5:03 PM, Thanh Ha  
> wrote:
>> Hi Everyone,
>>
>> It seems to me that JJB 1.4.0's delete-all function has regressed and no
>> longer performs the delete function. Instead it simply provides the
>> following output and exits without performing any deletes.
>>
>> Sure you want to delete *ALL* jobs from Jenkins server?
>> (including those not managed by Jenkins Job Builder) (Y/N): y
>> INFO:root:Deleting all jobs
>> INFO:jenkins_jobs.builder:Number of jobs to delete:  50
>> INFO:jenkins_jobs.builder:Cache saved
>>
>>
>> Has anyone else noticed this issue as well?
>>
>> I'll try to find some time to investigate which patch introduced this issue
>> unless someone else gets to it first but thought I'd inform the team.
>>
>> Regards,
>>
>> Thanh
>>
>>
>> ___
>> OpenStack-Infra mailing list
>> OpenStack-Infra@lists.openstack.org
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-infra
>>
>
> ___
> OpenStack-Infra mailing list
> OpenStack-Infra@lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-infra



-- 
Darragh Bailey
"Nothing is foolproof to a sufficiently talented fool"

___
OpenStack-Infra mailing list
OpenStack-Infra@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-infra


Re: [OpenStack-Infra] JJB 1.4.0 delete-all no longer deletes jobs

2016-01-19 Thread Wayne Warren
What command line flags did you pass?

I don't generally use this or the 'delete' subcommand, preferring
instead to use python-jenkins directly.

On Sun, Jan 17, 2016 at 5:03 PM, Thanh Ha  wrote:
> Hi Everyone,
>
> It seems to me that JJB 1.4.0's delete-all function has regressed and no
> longer performs the delete function. Instead it simply provides the
> following output and exits without performing any deletes.
>
> Sure you want to delete *ALL* jobs from Jenkins server?
> (including those not managed by Jenkins Job Builder) (Y/N): y
> INFO:root:Deleting all jobs
> INFO:jenkins_jobs.builder:Number of jobs to delete:  50
> INFO:jenkins_jobs.builder:Cache saved
>
>
> Has anyone else noticed this issue as well?
>
> I'll try to find some time to investigate which patch introduced this issue
> unless someone else gets to it first but thought I'd inform the team.
>
> Regards,
>
> Thanh
>
>
> ___
> OpenStack-Infra mailing list
> OpenStack-Infra@lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-infra
>

___
OpenStack-Infra mailing list
OpenStack-Infra@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-infra


[OpenStack-Infra] JJB 1.4.0 delete-all no longer deletes jobs

2016-01-17 Thread Thanh Ha
Hi Everyone,

It seems to me that JJB 1.4.0's delete-all function has regressed and no
longer performs the delete function. Instead it simply provides the
following output and exits without performing any deletes.

Sure you want to delete *ALL* jobs from Jenkins server?
(including those not managed by Jenkins Job Builder) (Y/N): y
INFO:root:Deleting all jobs
INFO:jenkins_jobs.builder:Number of jobs to delete:  50
INFO:jenkins_jobs.builder:Cache saved


Has anyone else noticed this issue as well?

I'll try to find some time to investigate which patch introduced this issue
unless someone else gets to it first but thought I'd inform the team.

Regards,

Thanh
___
OpenStack-Infra mailing list
OpenStack-Infra@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-infra