Missing DSL orphanedItemStrategy

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      While trying the implement DSL configuration using Bitbucket Branch, I'm not able to implement orphanedItemStrategy. It defaults to a DefaultOrphanedItemStrategyContext, that do not exist on DSL API.

      Error:

      ERROR: (script, line 12) No signature of method: javaposse.jobdsl.dsl.helpers.workflow.DefaultOrphanedItemStrategyContext.daysToKeep() is applicable for argument types: (java.lang.String) values: [10]
      Possible solutions: daysToKeep(int), getDaysToKeep(), setDaysToKeep(int), numToKeep(int)
      

      Looking into a manually configured Bitbucket Branch based build config.xml file, it shows that orphanedItemStrategy is implemented by cloudbees-folder.

      <orphanedItemStrategy class="com.cloudbees.hudson.plugins.folder.computed.DefaultOrphanedItemStrategy" plugin="cloudbees-folder@6.2.1">
          <pruneDeadBranches>false</pruneDeadBranches>
          <daysToKeep>-1</daysToKeep>
          <numToKeep>-1</numToKeep>
        </orphanedItemStrategy>
      

      Bitbucket Branch implements OrganizationFolder and expanding orphanedItemStrategy, does not show the same configurations as in the xml file.

      Test DSL script:

      organizationFolder('My DSL Folder test'){
          displayName('my_display_name')
          description('my_description')
          orphanedItemStrategy {
              discardOldItems {
                  daysToKeep('10')
                  numToKeep('10')
              }
          }
          organizations {
              bitbucket {
                  repoOwner('my_repo_code')
                  credentialsId('my_cred_id')
                  serverUrl('my_server_url')
              }
          }
      }
      

      To me, this seems a case of missing DSL configuration but not sure by which component.

            Assignee:
            Daniel Spilker
            Reporter:
            Nuno Costa
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: