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

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

    Details

    • Similar Issues:
    • Released As:
      2.0.0

      Description

      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.

        Attachments

          Issue Links

            Activity

            Hide
            psadikov Pavel Sadikov added a comment -

            Ran into this problem as well. The configure block is sufficient for resolving the issue at the job level, but there is no workaround I could find for the global library configuration as its configured via CasC directly.

            After loading up Jenkins, I have to go into the Manage Jenkins -> Configure System and hit save without making any changes, which fixes the underlying XML.

            Show
            psadikov Pavel Sadikov added a comment - Ran into this problem as well. The configure block is sufficient for resolving the issue at the job level, but there is no workaround I could find for the global library configuration as its configured via CasC directly. After loading up Jenkins, I have to go into the Manage Jenkins -> Configure System and hit save without making any changes, which fixes the underlying XML.
            Hide
            daspilker Daniel Spilker added a comment -

            Closing this as duplicate of JENKINS-60899 as it's the same underlying problem.

            Show
            daspilker Daniel Spilker added a comment - Closing this as duplicate of JENKINS-60899 as it's the same underlying problem.

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: