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

Missing Git remote and browser URLs when executing Job DSL via CasC

XMLWordPrintable

    • 2.0.0

      When creating a Bitbucket Server SCM pipeline seed job using Job DSL in CasC, the generated XML is missing the Git remote and browser URLs, causing the job to fail. Opening the job configuration and immediately saving it without making any changes populates the URLs in the XML.

      Steps to reproduce, with log entries and example CasC YAML: casc_dsl_badxml.txt

      The key log entry appears to be:

      c.a.b.j.i.scm.BitbucketSCM#<init>: No Bitbucket Server configuration for serverId Bitbucket

      This message seems to indicate that CasC may be executing the Job DSL script before applying the CasC YAML that defines the Bitbucket server.

      When executing the exact same Job DSL script via a freestyle job after CasC completes, the generated XML correctly contains the Git remote and browser URLs. Steps to verify: direct_dsl_goodxml.txt

      Using the Job DSL Configure block to inject the Git remote and browser URLs provides a workaround. Steps to verify: casc_dsl_workaround.txt

      This issue may affect other SCM provider plugins and may be related to JENKINS-60899 and possibly others, though I am not certain.

            Unassigned Unassigned
            bryanburke Bryan Burke
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: