[JIRA] (JENKINS-60899) Job DSL runs brefore Gitea servers are loaded

14 views
Skip to first unread message

connor24nolan@live.com (JIRA)

unread,
Jan 28, 2020, 6:42:03 PM1/28/20
to jenkinsc...@googlegroups.com
Connor Nolan created an issue
 
Jenkins / Bug JENKINS-60899
Job DSL runs brefore Gitea servers are loaded
Issue Type: Bug Bug
Assignee: Unassigned
Components: configuration-as-code-plugin, gitea-plugin, job-dsl-plugin
Created: 2020-01-28 23:41
Priority: Minor Minor
Reporter: Connor Nolan

When using Configuration as Code to setup Jenkins with a Gitea server and a mult-branch pipeline, the Job DSL will be run before the Gitea servers are added and it will error that it cannot find the Gitea server when running the first scan, this requires you to manually scan on startup.

Relevant jenkins.yaml:

unclassified:
  giteaServers:
    servers:
      - serverUrl: "SERVER_URL"
        displayName: "Gitea Server"
        credentialsId: "gitea_login"

jobs:
  - script: >
      multibranchPipelineJob('JOB') {
        branchSources {
          branchSource {
            source {
              giteaSCMSource {
                id('12312313')
                credentialsId('gitea_login')
                repoOwner('USER')
                repository('REPO')
                serverUrl("SERVER_URL")
                traits {
                  cloneOptionTrait {
                    extension {
                      noTags(false)
                      shallow(false)
                      reference("")
                      timeout(10)
                    }
                  }
                  wipeWorkspaceTrait()
                }
              }
            }
          }
        }
        configure { node ->
          def traits = node / sources / data / 'jenkins.branch.BranchSource' / source / traits
          traits << 'org.jenkinsci.plugin.gitea.BranchDiscoveryTrait' {
            strategyId('3')
          }
        }
      }

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

connor24nolan@live.com (JIRA)

unread,
Jan 28, 2020, 9:38:03 PM1/28/20
to jenkinsc...@googlegroups.com
Connor Nolan updated an issue
Change By: Connor Nolan
When using Configuration as Code to setup Jenkins with a Gitea server and a mult-branch pipeline, the Job DSL will be run before the Gitea servers are added and it will error that it cannot find the Gitea server when running the first scan, this requires you to manually scan on startup.

Relevant jenkins.yaml:
{code :java }
      }{code}
 
Log:
{code}
[Wed Jan 29 02:33:55 GMT 2020] Starting branch indexing...
ERROR: [Wed Jan 29 02:33:55 GMT 2020] Could not update folder level actions from source 12312313
hudson.AbortException: Unknown server: SERVER_URL
at org.jenkinsci.plugin.gitea.GiteaSCMSource.gitea(GiteaSCMSource.java:570)
at org.jenkinsci.plugin.gitea.GiteaSCMSource.retrieveActions(GiteaSCMSource.java:395)
at jenkins.scm.api.SCMSource.fetchActions(SCMSource.java:848)
at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:598)
at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:277)
at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:164)
at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1032)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:427)
[Wed Jan 29 02:33:55 GMT 2020] Finished branch indexing. Indexing took 8 ms
FATAL: Unknown server: SERVER_URL
Finished: FAILURE
{code}

mail@daniel-spilker.com (JIRA)

unread,
Mar 16, 2020, 5:18:02 PM3/16/20
to jenkinsc...@googlegroups.com
Daniel Spilker assigned an issue to Joseph Petersen
 

Joseph Petersen are you still maintaining the CasC plugin? How can we fix this? This there an order between the RootElementConfigurators? Can I just decrease the oridnal of the SeedJobConfigurator extension?

Change By: Daniel Spilker
Assignee: Joseph Petersen
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

josephp90@gmail.com (JIRA)

unread,
Mar 16, 2020, 6:26:03 PM3/16/20
to jenkinsc...@googlegroups.com
Joseph Petersen commented on Bug JENKINS-60899
 
Re: Job DSL runs brefore Gitea servers are loaded

I would say it's a bug in the Gitea plugin, it should not run validation until someone tries to run the job.

josephp90@gmail.com (JIRA)

unread,
Mar 16, 2020, 6:33:03 PM3/16/20
to jenkinsc...@googlegroups.com

However I would like to add perhaps the configurator api could benefit from the new milestone.

Perhaps we could introduce a way delay SeedJobConfigurator to run after These: https://github.com/jenkinsci/configuration-as-code-plugin/pull/1262/files#diff-a366d4f8874702b6d3c2e23825acc7eeR34

Or otherwise add an even higher load order for those that truely wants to run last.

Imo SeedJobConfigurator should really and truely RUN LAST

 

cc Tim Jacomb Oleg Nenashev

bryan.burke@cgifederal.com (JIRA)

unread,
Mar 20, 2020, 1:59:03 PM3/20/20
to jenkinsc...@googlegroups.com

This problem seems to affect other SCM providers as well, the Atlassian Bitbucket Server Integration plugin in my case. I documented a dirty workaround to inject the clone and browser URLs into the XML via the DSL configure block. See: JENKINS-61210

bryan.burke@cgifederal.com (JIRA)

unread,
Mar 20, 2020, 2:00:03 PM3/20/20
to jenkinsc...@googlegroups.com
Bryan Burke edited a comment on Bug JENKINS-60899
This problem seems to affect other SCM providers as well, the Atlassian Bitbucket Server Integration plugin in my case. I documented a dirty workaround to inject the clone and browser URLs into the XML via the DSL configure block. See: JENKINS-61210


*Edit*: I'm not certain if the same workaround would work for multibranch pipelines.
Reply all
Reply to author
Forward
0 new messages