updating existing jobs does not work

1,217 views
Skip to first unread message

Nikolay Diakov

unread,
Mar 19, 2015, 10:10:41 AM3/19/15
to job-dsl...@googlegroups.com
Using plugin version 1.30, Jenkins LTS 1.596.1.

My seeder job creates 2 maven build jobs, A and B. I have left unchecked "Ignore existing" in the configuration area.
  1. I change the goal to the maven build in the seeder job.
  2. I delete B.
  3. I run the seeder again.
  4. A did not get the new goal.
  5. B got the new goal.

Any ideas why I get this behavior? How does the plugin find out that something changed - XML diff? Didn't have time to dig into the code so asking here if I miss something obvious.

Cheers,

  Nikolay

Daniel Spilker

unread,
Mar 20, 2015, 11:02:30 AM3/20/15
to job-dsl...@googlegroups.com
Can you provide a DSL script to reproduce this?

Daniel

--
You received this message because you are subscribed to the Google Groups "job-dsl-plugin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to job-dsl-plugi...@googlegroups.com.
To post to this group, send email to job-dsl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/job-dsl-plugin/2dbbea78-6e1e-47bc-9050-ea2b56d9a56d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nikolay Diakov

unread,
Mar 24, 2015, 8:30:00 AM3/24/15
to job-dsl...@googlegroups.com
I have a simpler case, the update of existing views does not work either:

Have a manually created view A with 1 job (whichever).

Have a seeder script generate that view changing its type to a nested view for example. 

I observed that the seeder generated, but the view stayed the old view. The seeder succeeded to make a new vew (having deleted it before hand).

Does this seem normal?

Cheers,
  Nick

P.S. I also noticed that when I generate a new job (never existed), the plugin logs in the console "Add job" or something like that. When I delete an existing one manually, it says that it found an existing job, but still adds as a new job. Does Jenkins have some kind of cache? Weird.

Nikolay Diakov

unread,
Mar 24, 2015, 9:49:41 AM3/24/15
to job-dsl...@googlegroups.com
Example: views.groovy file contains

nestedView(project) {
    views {
        view('Builds') {
            jobs {
                regex("BUILD-.*")
            }
            columns {
                status()
                weather()
                name()
                lastSuccess()
                lastFailure()
                lastDuration()
            }
        }

        view('Linting') {
            description('Views all linting jobs.')
           
            jobs {
                regex('LINT-.*')
            }
            columns {
                status()
                weather()
                name()
                lastSuccess()
                lastFailure()
                lastDuration()
            }
       }
    }
}

In the seeder job I run all groovy files and have "ignoreExisting" ticked off.
I see that "ignoreExisting" has a default value 'true'. Could it be that the plugin UI does not convey the context properly?


Matti Simperi

unread,
Jun 15, 2015, 8:31:19 AM6/15/15
to job-dsl...@googlegroups.com
Hello Nikolay!

Have you found any solutions for this error? I have just started to use job-dsl and seeing also some problem on updating existing jobs. The seeding job executes without a problem, and says that found existing jobs, but still nothing updated on job configuration.

It worked smoothly for a few weeks time, but not anymore.



Regards,
Masa

Matti Simperi

unread,
Jun 15, 2015, 9:01:57 AM6/15/15
to job-dsl...@googlegroups.com
Actually just found the reason for our case. Was able to see some classnotfoundexcepitions on tomcat log.

Nikolay Diakov

unread,
Jun 16, 2015, 4:36:56 AM6/16/15
to job-dsl...@googlegroups.com
Excuses for the delay - had some vacation time. Great you found the issue, I had not had a look at our Tomcat log, will request it and take a look. I still experience original issue of not updating existing jobs.

Cheers,
  Nikolay

Nikolay Diakov

unread,
Mar 8, 2016, 9:21:46 AM3/8/16
to job-dsl-plugin
After updating both Jenkins and the plugin to latest, jobs started to update.
I consider this issue closed.

Sven Ackermann

unread,
Jul 25, 2016, 8:35:44 AM7/25/16
to job-dsl-plugin
Hi,

I still have this problem with the latest version of jenkins (2.7.1) and job dsl plugin (1.48), but only for recreation of views.
It seems that views are not updated if their type changes (in my case from "listView" to "sectionedView"). There is no error in the tomcat log and the seed-job log looks like everything is fine (telling me, my view existed before).
I have a script that creates a view conditionally either as listView or as sectionedView like this:

if (SECTION) {
  sectionedView('TEST') {
    sections {
      listView {
        name('Section 1')
        jobs {
          regex(/section1_job.+/)
        }
      }
      listView {
        name('Section 2')
        jobs {
          regex(/section2_job.+/)
        }
      }
    }
  }
} else {
  listView('TEST') {
    jobs {
      regex(/section._job.+/)
    }
  }
}

The variable 'SECTION' could e.g. be a build job parameter. If I run this once with SECTION==true, a sectioned view is created. If I run it again with SECTION==false, the view is not changed. Updating just the jobs (regex) configuration or the description works fine, I really think the problem is the change of the view type.

Regards,
Sven

Daniel Spilker

unread,
Aug 9, 2016, 2:22:38 AM8/9/16
to job-dsl...@googlegroups.com
It's not possible to change a view's type. Job DSL already catches that case for jobs and reports a meaningful error, but I forgot to add that check for views as well. I will fix that for 1.49.

Daniel

--
You received this message because you are subscribed to the Google Groups "job-dsl-plugin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to job-dsl-plugin+unsubscribe@googlegroups.com.
To post to this group, send email to job-dsl-plugin@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/job-dsl-plugin/7850645e-c026-4205-afd9-883b51c52a6d%40googlegroups.com.

Sven Ackermann

unread,
Aug 10, 2016, 11:06:03 AM8/10/16
to job-dsl-plugin
Ok, I understand. And thanks for your response.
Wouldn't it be an option to delete the existing view in this case just before it is recreated? I think that is safe because a view has no history like a job. Maybe that could be configurable as an option for the DSL step, so that one either gets a warning message or the view is deleted.
Thanks,
Sven
Reply all
Reply to author
Forward
0 new messages