Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-59402

JobDsl should respect Job post-construction initialization

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • core, job-dsl-plugin
    • None
    • Jenkins 2.168/2.193
      JobDsl plugin 1.72/1.77-SNAPSHOT

      Hello!
       
      we currently faced the following issue.
       
      If we run the creation of job via jobDsl pipeline step (https://jenkins.io/doc/pipeline/steps/job-dsl/) with any parameters, we are getting a folder on our filesystem without "legacyIds" file in builds directory.
      examples are in the bottom of this post.
      The problem is that if there is no legacyIds file in builds directory, after restarting of jenkins server, we are facing long migrations for all jobs created after the previous reboot
       

      Pull request with fix: https://github.com/jenkinsci/job-dsl-plugin/pull/1204

       
      Examples:
      job created via jobDsl:

      [root@server]# ls -lah builds/jobDsl_job
      total 2.5K
      drwxr-xr-x 1 centos centos 808K Sep 12 07:23 .
      drwxr-xr-x 1 centos centos 3.1G Sep 12 07:21 ..
      drwxr-xr-x 1 centos centos 808K Sep 12 07:23 1
      lrwxrwxrwx 1 centos centos    2 Sep 12 07:19 lastFailedBuild -> -1
      lrwxrwxrwx 1 centos centos    1 Sep 12 07:23 lastStableBuild -> 1
      lrwxrwxrwx 1 centos centos    1 Sep 12 07:23 lastSuccessfulBuild -> 1
      lrwxrwxrwx 1 centos centos    2 Sep 12 07:19 lastUnstableBuild -> -1
      lrwxrwxrwx 1 centos centos    2 Sep 12 07:19 lastUnsuccessfulBuild -> -1
      

      job created via manual creation:

      [root@server]# ls -lah builds/manual_job
      total 0
      drwxr-xr-x 1 centos centos    0 Sep 12 07:21 .
      drwxr-xr-x 1 centos centos 3.1G Sep 12 07:21 ..
      -rw-r--r-- 1 centos centos    0 Sep 12 07:21 legacyIds
      

          [JENKINS-59402] JobDsl should respect Job post-construction initialization

          Konstantin Bulanov created issue -
          Konstantin Bulanov made changes -
          Description Original: Hello!
           
           we currently faced the following issue.
            
           If we run the creation of job via jobDsl pipeline step ([https://jenkins.io/doc/pipeline/steps/job-dsl/|https://www.google.com/url?q=https%3A%2F%2Fjenkins.io%2Fdoc%2Fpipeline%2Fsteps%2Fjob-dsl%2F&sa=D&sntz=1&usg=AFQjCNFphzzbQzcBk-KwGSGjshQxhQHIbw]) with any parameters, we are getting a folder on our filesystem without "*_legacyIds_*" file in builds directory.
           examples are in the bottom of this post.
           The problem is that if there is no *_legacyIds_* file in builds directory, after restarting of jenkins server, we are facing long migrations for all jobs created after the previous reboot
            
            
           *Examples*:
           job created via jobDsl:
          {code:java}
          [root@server]# ls -lah builds/jobDsl_job
          total 2.5K
          drwxr-xr-x 1 centos centos 808K Sep 12 07:23 .
          drwxr-xr-x 1 centos centos 3.1G Sep 12 07:21 ..
          drwxr-xr-x 1 centos centos 808K Sep 12 07:23 1
          lrwxrwxrwx 1 centos centos    2 Sep 12 07:19 lastFailedBuild -> -1
          lrwxrwxrwx 1 centos centos    1 Sep 12 07:23 lastStableBuild -> 1
          lrwxrwxrwx 1 centos centos    1 Sep 12 07:23 lastSuccessfulBuild -> 1
          lrwxrwxrwx 1 centos centos    2 Sep 12 07:19 lastUnstableBuild -> -1
          lrwxrwxrwx 1 centos centos    2 Sep 12 07:19 lastUnsuccessfulBuild -> -1
          {code}
          job created via manual creation:
          {code:java}
          [root@server]# ls -lah builds/manual_job
          total 0
          drwxr-xr-x 1 centos centos    0 Sep 12 07:21 .
          drwxr-xr-x 1 centos centos 3.1G Sep 12 07:21 ..
          -rw-r--r-- 1 centos centos    0 Sep 12 07:21 legacyIds
          {code}
          New: Hello!
            
           we currently faced the following issue.
            
           If we run the creation of job via jobDsl pipeline step ([https://jenkins.io/doc/pipeline/steps/job-dsl/|https://www.google.com/url?q=https%3A%2F%2Fjenkins.io%2Fdoc%2Fpipeline%2Fsteps%2Fjob-dsl%2F&sa=D&sntz=1&usg=AFQjCNFphzzbQzcBk-KwGSGjshQxhQHIbw]) with any parameters, we are getting a folder on our filesystem without "*_legacyIds_*" file in builds directory.
           examples are in the bottom of this post.
           The problem is that if there is no *_legacyIds_* file in builds directory, after restarting of jenkins server, we are facing long migrations for all jobs created after the previous reboot
            

          Pull request with fix: [https://github.com/jenkinsci/job-dsl-plugin/pull/1203]
            
           *Examples*:
           job created via jobDsl:
          {code:java}
          [root@server]# ls -lah builds/jobDsl_job
          total 2.5K
          drwxr-xr-x 1 centos centos 808K Sep 12 07:23 .
          drwxr-xr-x 1 centos centos 3.1G Sep 12 07:21 ..
          drwxr-xr-x 1 centos centos 808K Sep 12 07:23 1
          lrwxrwxrwx 1 centos centos    2 Sep 12 07:19 lastFailedBuild -> -1
          lrwxrwxrwx 1 centos centos    1 Sep 12 07:23 lastStableBuild -> 1
          lrwxrwxrwx 1 centos centos    1 Sep 12 07:23 lastSuccessfulBuild -> 1
          lrwxrwxrwx 1 centos centos    2 Sep 12 07:19 lastUnstableBuild -> -1
          lrwxrwxrwx 1 centos centos    2 Sep 12 07:19 lastUnsuccessfulBuild -> -1
          {code}
          job created via manual creation:
          {code:java}
          [root@server]# ls -lah builds/manual_job
          total 0
          drwxr-xr-x 1 centos centos    0 Sep 12 07:21 .
          drwxr-xr-x 1 centos centos 3.1G Sep 12 07:21 ..
          -rw-r--r-- 1 centos centos    0 Sep 12 07:21 legacyIds
          {code}
          Konstantin Bulanov made changes -
          Description Original: Hello!
            
           we currently faced the following issue.
            
           If we run the creation of job via jobDsl pipeline step ([https://jenkins.io/doc/pipeline/steps/job-dsl/|https://www.google.com/url?q=https%3A%2F%2Fjenkins.io%2Fdoc%2Fpipeline%2Fsteps%2Fjob-dsl%2F&sa=D&sntz=1&usg=AFQjCNFphzzbQzcBk-KwGSGjshQxhQHIbw]) with any parameters, we are getting a folder on our filesystem without "*_legacyIds_*" file in builds directory.
           examples are in the bottom of this post.
           The problem is that if there is no *_legacyIds_* file in builds directory, after restarting of jenkins server, we are facing long migrations for all jobs created after the previous reboot
            

          Pull request with fix: [https://github.com/jenkinsci/job-dsl-plugin/pull/1203]
            
           *Examples*:
           job created via jobDsl:
          {code:java}
          [root@server]# ls -lah builds/jobDsl_job
          total 2.5K
          drwxr-xr-x 1 centos centos 808K Sep 12 07:23 .
          drwxr-xr-x 1 centos centos 3.1G Sep 12 07:21 ..
          drwxr-xr-x 1 centos centos 808K Sep 12 07:23 1
          lrwxrwxrwx 1 centos centos    2 Sep 12 07:19 lastFailedBuild -> -1
          lrwxrwxrwx 1 centos centos    1 Sep 12 07:23 lastStableBuild -> 1
          lrwxrwxrwx 1 centos centos    1 Sep 12 07:23 lastSuccessfulBuild -> 1
          lrwxrwxrwx 1 centos centos    2 Sep 12 07:19 lastUnstableBuild -> -1
          lrwxrwxrwx 1 centos centos    2 Sep 12 07:19 lastUnsuccessfulBuild -> -1
          {code}
          job created via manual creation:
          {code:java}
          [root@server]# ls -lah builds/manual_job
          total 0
          drwxr-xr-x 1 centos centos    0 Sep 12 07:21 .
          drwxr-xr-x 1 centos centos 3.1G Sep 12 07:21 ..
          -rw-r--r-- 1 centos centos    0 Sep 12 07:21 legacyIds
          {code}
          New: Hello!
            
           we currently faced the following issue.
            
           If we run the creation of job via jobDsl pipeline step ([https://jenkins.io/doc/pipeline/steps/job-dsl/|https://www.google.com/url?q=https%3A%2F%2Fjenkins.io%2Fdoc%2Fpipeline%2Fsteps%2Fjob-dsl%2F&sa=D&sntz=1&usg=AFQjCNFphzzbQzcBk-KwGSGjshQxhQHIbw]) with any parameters, we are getting a folder on our filesystem without "*_legacyIds_*" file in builds directory.
           examples are in the bottom of this post.
           The problem is that if there is no *_legacyIds_* file in builds directory, after restarting of jenkins server, we are facing long migrations for all jobs created after the previous reboot
            

          Pull request with fix: [https://github.com/jenkinsci/job-dsl-plugin/pull/1204|https://github.com/jenkinsci/job-dsl-plugin/pull/1203]
            
           *Examples*:
           job created via jobDsl:
          {code:java}
          [root@server]# ls -lah builds/jobDsl_job
          total 2.5K
          drwxr-xr-x 1 centos centos 808K Sep 12 07:23 .
          drwxr-xr-x 1 centos centos 3.1G Sep 12 07:21 ..
          drwxr-xr-x 1 centos centos 808K Sep 12 07:23 1
          lrwxrwxrwx 1 centos centos    2 Sep 12 07:19 lastFailedBuild -> -1
          lrwxrwxrwx 1 centos centos    1 Sep 12 07:23 lastStableBuild -> 1
          lrwxrwxrwx 1 centos centos    1 Sep 12 07:23 lastSuccessfulBuild -> 1
          lrwxrwxrwx 1 centos centos    2 Sep 12 07:19 lastUnstableBuild -> -1
          lrwxrwxrwx 1 centos centos    2 Sep 12 07:19 lastUnsuccessfulBuild -> -1
          {code}
          job created via manual creation:
          {code:java}
          [root@server]# ls -lah builds/manual_job
          total 0
          drwxr-xr-x 1 centos centos    0 Sep 12 07:21 .
          drwxr-xr-x 1 centos centos 3.1G Sep 12 07:21 ..
          -rw-r--r-- 1 centos centos    0 Sep 12 07:21 legacyIds
          {code}
          Konstantin Bulanov made changes -
          Description Original: Hello!
            
           we currently faced the following issue.
            
           If we run the creation of job via jobDsl pipeline step ([https://jenkins.io/doc/pipeline/steps/job-dsl/|https://www.google.com/url?q=https%3A%2F%2Fjenkins.io%2Fdoc%2Fpipeline%2Fsteps%2Fjob-dsl%2F&sa=D&sntz=1&usg=AFQjCNFphzzbQzcBk-KwGSGjshQxhQHIbw]) with any parameters, we are getting a folder on our filesystem without "*_legacyIds_*" file in builds directory.
           examples are in the bottom of this post.
           The problem is that if there is no *_legacyIds_* file in builds directory, after restarting of jenkins server, we are facing long migrations for all jobs created after the previous reboot
            

          Pull request with fix: [https://github.com/jenkinsci/job-dsl-plugin/pull/1204|https://github.com/jenkinsci/job-dsl-plugin/pull/1203]
            
           *Examples*:
           job created via jobDsl:
          {code:java}
          [root@server]# ls -lah builds/jobDsl_job
          total 2.5K
          drwxr-xr-x 1 centos centos 808K Sep 12 07:23 .
          drwxr-xr-x 1 centos centos 3.1G Sep 12 07:21 ..
          drwxr-xr-x 1 centos centos 808K Sep 12 07:23 1
          lrwxrwxrwx 1 centos centos    2 Sep 12 07:19 lastFailedBuild -> -1
          lrwxrwxrwx 1 centos centos    1 Sep 12 07:23 lastStableBuild -> 1
          lrwxrwxrwx 1 centos centos    1 Sep 12 07:23 lastSuccessfulBuild -> 1
          lrwxrwxrwx 1 centos centos    2 Sep 12 07:19 lastUnstableBuild -> -1
          lrwxrwxrwx 1 centos centos    2 Sep 12 07:19 lastUnsuccessfulBuild -> -1
          {code}
          job created via manual creation:
          {code:java}
          [root@server]# ls -lah builds/manual_job
          total 0
          drwxr-xr-x 1 centos centos    0 Sep 12 07:21 .
          drwxr-xr-x 1 centos centos 3.1G Sep 12 07:21 ..
          -rw-r--r-- 1 centos centos    0 Sep 12 07:21 legacyIds
          {code}
          New: Hello!
            
           we currently faced the following issue.
            
           If we run the creation of job via jobDsl pipeline step ([https://jenkins.io/doc/pipeline/steps/job-dsl/|https://www.google.com/url?q=https%3A%2F%2Fjenkins.io%2Fdoc%2Fpipeline%2Fsteps%2Fjob-dsl%2F&sa=D&sntz=1&usg=AFQjCNFphzzbQzcBk-KwGSGjshQxhQHIbw]) with any parameters, we are getting a folder on our filesystem without "*_legacyIds_*" file in builds directory.
           examples are in the bottom of this post.
           The problem is that if there is no *_legacyIds_* file in builds directory, after restarting of jenkins server, we are facing long migrations for all jobs created after the previous reboot
            

          Pull request with fix: [https://github.com/jenkinsci/job-dsl-plugin/pull/1204]

           
           *Examples*:
           job created via jobDsl:
          {code:java}
          [root@server]# ls -lah builds/jobDsl_job
          total 2.5K
          drwxr-xr-x 1 centos centos 808K Sep 12 07:23 .
          drwxr-xr-x 1 centos centos 3.1G Sep 12 07:21 ..
          drwxr-xr-x 1 centos centos 808K Sep 12 07:23 1
          lrwxrwxrwx 1 centos centos    2 Sep 12 07:19 lastFailedBuild -> -1
          lrwxrwxrwx 1 centos centos    1 Sep 12 07:23 lastStableBuild -> 1
          lrwxrwxrwx 1 centos centos    1 Sep 12 07:23 lastSuccessfulBuild -> 1
          lrwxrwxrwx 1 centos centos    2 Sep 12 07:19 lastUnstableBuild -> -1
          lrwxrwxrwx 1 centos centos    2 Sep 12 07:19 lastUnsuccessfulBuild -> -1
          {code}
          job created via manual creation:
          {code:java}
          [root@server]# ls -lah builds/manual_job
          total 0
          drwxr-xr-x 1 centos centos    0 Sep 12 07:21 .
          drwxr-xr-x 1 centos centos 3.1G Sep 12 07:21 ..
          -rw-r--r-- 1 centos centos    0 Sep 12 07:21 legacyIds
          {code}
          Daniel Spilker made changes -
          Component/s New: core [ 15593 ]
          Daniel Spilker made changes -
          Assignee Original: Daniel Spilker [ daspilker ] New: Konstantin Bulanov [ bulanovk ]
          David C. Bradley made changes -
          Link New: This issue is caused by JENKINS-64356 [ JENKINS-64356 ]

            bulanovk Konstantin Bulanov
            bulanovk Konstantin Bulanov
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: