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

using repoOwner and configure block creates two organizations

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • job-dsl-plugin
    • None
    • Jenkins: 2.138.2
      job-dsl: 1.70
      github-branch-source: 2.4.0
      configuration-as-code: 1.3

      Background

      Using the CasC plugin to run the Job DSL setup. 

      This currently  is not fully supported yet and is pending
      https://issues.jenkins-ci.org/browse/JENKINS-45504 &
      https://github.com/jenkinsci/configuration-as-code-plugin/issues/280

      But this issue seems unrelated.

      Description

      When combining the organizations & configure blocks the result  creates two Organizations (see screenshot).

      Example script:

       

      organizationFolder("test org") {
        description("configured with JCasC");
        displayName("test org");
      
        organizations {
          github {
            repoOwner("owner");
            credentialsId("1234");
            configure { node ->
                def traits = node / navigators / "org.jenkinsci.plugins.github_branch_source.GitHubSCMNavigator" / traits;
                traits << "jenkins.scm.impl.trait.RegexSCMSourceFilterTrait" {
                    regex("ha*");
                };
                traits << "org.jenkinsci.plugins.github_branch_source.TagDiscoveryTrait" {};
                traits << "org.jenkinsci.plugins.github_branch_source.BranchDiscoveryTrait" {
                    strategyId("3");
                };
            }
          }
        }
      
        triggers {
          periodic 30;
        }
      }
      

       

      The repoOwner & credentialsId get added to their own organization.

      The documentation https://github.com/jenkinsci/job-dsl-plugin/wiki/The-Configure-Block has limited details, particularly on using organizationFolder so it's difficult to know if this is an actual bug or just a configuration error.

            daspilker Daniel Spilker
            jknurek J Knurek
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: