[JIRA] (JENKINS-43693) multibranchPipelineJob overrides old branch indexing sources

15 views
Skip to first unread message

ddigtiar@cloudbees.com (JIRA)

unread,
May 14, 2018, 12:50:02 AM5/14/18
to jenkinsc...@googlegroups.com
Denys Digtiar reopened an issue
 

I have created a fresh environment from 2.121 and installing:

  • Pipeline: Multibranch 2.18
  • Github Branch Source Plugin 2.3.4
  • Job DSL 1.69

I was able to reproduce the issue using the steps in the description. I can still see

Takeover for job-dsl-plugin_multibranch » master by source #1 from source that no longer exists
Branch reopened: master (5045094d82daa475fe79e7f5e52eba58c6df9020)
Scheduled build for branch: master

after I re-run the Seed Job.

Jenkins / Bug JENKINS-43693
multibranchPipelineJob overrides old branch indexing sources
Change By: Denys Digtiar
Resolution: Fixed
Status: Closed Reopened
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

ddigtiar@cloudbees.com (JIRA)

unread,
May 17, 2018, 12:24:03 AM5/17/18
to jenkinsc...@googlegroups.com
Denys Digtiar commented on Bug JENKINS-43693
 
Re: multibranchPipelineJob overrides old branch indexing sources

Sorry, Daniel Spilker . It looks like I misunderstood the resolution. Is the resolution to manually add unique Ids to the source definitions?

ddigtiar@cloudbees.com (JIRA)

unread,
May 17, 2018, 12:27:02 AM5/17/18
to jenkinsc...@googlegroups.com
Denys Digtiar edited a comment on Bug JENKINS-43693
Sorry, [~daspilker] . It looks like I misunderstood the resolution. Is the resolution to manually add unique Ids to the source definitions? Like this:
{code:java}
multibranchPipelineJob('job-dsl-plugin_multibranch') {
  branchSources {
    def repo = 'https://github.com/jenkinsci/job-dsl-plugin.git'
    git {
      id = UUID.nameUUIDFromBytes(repo.getBytes())
      remote(repo)
    }
  }
}{code}

michal.dziedziela@gmail.com (JIRA)

unread,
May 17, 2018, 12:42:02 AM5/17/18
to jenkinsc...@googlegroups.com

Denys Digtiar yes, it worked for me and I use repository name for id.

ddigtiar@cloudbees.com (JIRA)

unread,
May 17, 2018, 12:55:02 AM5/17/18
to jenkinsc...@googlegroups.com
Denys Digtiar closed an issue as Fixed
 
Change By: Denys Digtiar
Status: Reopened Closed
Resolution: Fixed

namelessorama@gmail.com (JIRA)

unread,
Feb 21, 2019, 5:28:02 AM2/21/19
to jenkinsc...@googlegroups.com
Vyacheslav Spiridonov commented on Bug JENKINS-43693
 
Re: multibranchPipelineJob overrides old branch indexing sources

This is how to do it for bitbucket-branch-source:

  branchSources {
  def repo = "https://bitbucket.com/..."
    branchSource {
      source { 
        bitbucket {
          id(UUID.nameUUIDFromBytes(repo.getBytes()).toString())
          serverUrl("...")
          repository("...")
          repoOwner("...")
         ...
        }
      }
    }
  }
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

ray.kivisto@gmail.com (JIRA)

unread,
Mar 27, 2019, 7:24:06 PM3/27/19
to jenkinsc...@googlegroups.com

knurek.j@gmail.com (JIRA)

unread,
May 2, 2019, 4:43:02 AM5/2/19
to jenkinsc...@googlegroups.com
J Knurek commented on Bug JENKINS-43693

I'm with Ray Kivisto on this.

I don't think this issue should be "Closed/Fix" if the default functionality still doesn't work as expected. 

The ability to set the `id` does solve the problem, but in my opinion this is a workaround. And if a workaround is required, this should be clearly documented. Or even better, the default functionality should be the expected functionality. 

ray.kivisto@gmail.com (JIRA)

unread,
May 16, 2019, 10:28:04 AM5/16/19
to jenkinsc...@googlegroups.com
Ray Kivisto reopened an issue
 

Re-opening so we can track the discussion about if this is truly fixed or not, or if we should just update the plugin documentation with the `id` setting.

Change By: Ray Kivisto
Resolution: Fixed
Status: Closed Reopened

mail@daniel-spilker.com (JIRA)

unread,
Jun 17, 2019, 8:11:03 AM6/17/19
to jenkinsc...@googlegroups.com
Daniel Spilker commented on Bug JENKINS-43693
 
Re: multibranchPipelineJob overrides old branch indexing sources

PR for improving the documentation and removing support for randomly generated identifiers:

https://github.com/jenkinsci/job-dsl-plugin/pull/1187

To sum things up, you need to set a constant and unique identifier for each branch source to make things work. That's a delicacy of the SCM API plugin. There must be unique identifier for each branch source, no two branch sources either in the same or different jobs may share the same ID. It's your responsibility to keep the ID unique when using Job DSL. The ID must not change over time, e.g. on the next run of the seed job.

mail@daniel-spilker.com (JIRA)

unread,
Jun 17, 2019, 8:12:02 AM6/17/19
to jenkinsc...@googlegroups.com
Daniel Spilker started work on Bug JENKINS-43693
 
Change By: Daniel Spilker
Status: Reopened In Progress

rene.scheibe@gmail.com (JIRA)

unread,
Jun 17, 2019, 5:06:05 PM6/17/19
to jenkinsc...@googlegroups.com

Daniel Spilker is there a way in Job DSL to resemble the automatic id creation as done when the job is created via the UI?

rene.scheibe@gmail.com (JIRA)

unread,
Jun 17, 2019, 5:09:02 PM6/17/19
to jenkinsc...@googlegroups.com
René Scheibe edited a comment on Bug JENKINS-43693
[~daspilker] is there a way in Job DSL to resemble the automatic {{id}} creation as done when the job is created via the UI? Or can the {{id}} automatically be set only on job creation but not changed when updating the job?

mail@daniel-spilker.com (JIRA)

unread,
Aug 26, 2019, 7:17:04 AM8/26/19
to jenkinsc...@googlegroups.com

René Scheibe Job DSL should not replicate any plugin logic. The behavior will change over time, will most likely fail silently and cause more problems.

I'll close this issue since there no more known problems.

mail@daniel-spilker.com (JIRA)

unread,
Aug 26, 2019, 7:18:06 AM8/26/19
to jenkinsc...@googlegroups.com
Daniel Spilker closed an issue as Fixed
 
Change By: Daniel Spilker
Status: In Progress Closed
Resolution: Fixed
Released As: job-dsl 1.75

rene.scheibe@gmail.com (JIRA)

unread,
Aug 26, 2019, 7:55:03 AM8/26/19
to jenkinsc...@googlegroups.com
René Scheibe commented on Bug JENKINS-43693
 
Re: multibranchPipelineJob overrides old branch indexing sources

Still an issue: Enforcing to manually set the id is only possible for branch sources explicitly implemented in Job DSL. For branch sources that are provided via "dynamic" DSL that's not enforced.

That's for example all the sources under branchSources - branchSource which are for example:

  • bitbucket
  • git
  • github
  • mercurialSCMSource
  • subversionSCMSource

Do you think these can also be covered somehow?

kivagant@gmail.com (JIRA)

unread,
Oct 1, 2019, 8:15:07 AM10/1/19
to jenkinsc...@googlegroups.com
Eugene G commented on Bug JENKINS-43693

I faced the same issue even though I don't use the Job DSL plugin to configure a GitHub Organization pipeline. It was created in UI. Any workarounds?

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages