[JIRA] (JENKINS-61601) Unable to trigger job on deletion of branch when configured with job DSL.

24 views
Skip to first unread message

neha.mhf@gmail.com (JIRA)

unread,
Mar 20, 2020, 8:17:03 AM3/20/20
to jenkinsc...@googlegroups.com
Neha Singh created an issue
 
Jenkins / Bug JENKINS-61601
Unable to trigger job on deletion of branch when configured with job DSL.
Issue Type: Bug Bug
Assignee: Aytunc BEKEN
Components: multibranch-action-triggers-plugin
Created: 2020-03-20 12:16
Environment: multibranch-action-triggers@1.8
Priority: Minor Minor
Reporter: Neha Singh

MultiBranch pipeline configured with job dsl , fails to trigger job on branch deletion with the multibranch-action-trigger-plugin, however with manual configuration it seems to be working fine intermittently. 

Job dsl

def job_path = "${new File(__FILE__).parent}"
def jenkinsfile = job_path + "/Jenkinsfile" 

configFiles { 
 customConfig 
{ 
  id('feat_deploy') 
  name('feat_deploy') 
  comment('Used in the Deploy-Feature multibranch job.')  
  content(readFileFromWorkspace(jenkinsfile)) 
 } 
} 
multibranchPipelineJob('Deploy-Feature') {
 branchSources {
  git {
   id('123454321') 
   remote('g...@github.com:xyz/abc.git') 
   credentialsId('git-ssh-key') 
   includes('feat/*') 
 } 
} 
orphanedItemStrategy { 
 discardOldItems { 
 daysToKeep(0) 
 numToKeep(0) 
} 
} 
factory { 
pipelineBranchDefaultsProjectFactory { 
 scriptId('feat_deploy') 
 useSandbox(true) 
 } 
} 
properties{
 pipelineTriggerProperty { 
  createActionJobsToTrigger('')
  deleteActionJobsToTrigger('Remove-Feature')
 } 
} 
triggers{
 periodicFolderTrigger { 
 interval('5m') }
 }
}

 

Failed to send event to listener warning in logs sometime.

2020-03-20 10:59:33.205+0000 [id=82129] WARNING h.model.listeners.ItemListener#forAll: failed to send event to listener of class org.jenkinsci.plugins.workflow.multibranch.ExtendedWorkflowMultiBranchProject$ItemListenerImpl java.lang.NullPointerException at org.jenkinsci.plugins.workflow.multibranch.PipelineTriggerProperty.convertToPattern(PipelineTriggerProperty.java:527) at org.jenkinsci.plugins.workflow.multibranch.PipelineTriggerProperty.checkExcludeFilter(PipelineTriggerProperty.java:522) at org.jenkinsci.plugins.workflow.multibranch.PipelineTriggerProperty.triggerActionJobs(PipelineTriggerProperty.java:466) at org.jenkinsci.plugins.workflow.multibranch.PipelineTriggerProperty.triggerCreateActionJobs(PipelineTriggerProperty.java:486) at org.jenkinsci.plugins.workflow.multibranch.ExtendedWorkflowMultiBranchProject$ItemListenerImpl.onCreated(ExtendedWorkflowMultiBranchProject.java:29) at hudson.model.listeners.ItemListener$2.apply(ItemListener.java:218) at hudson.model.listeners.ItemListener$2.apply(ItemListener.java:216) at hudson.model.listeners.ItemListener.forAll(ItemListener.java:178) at hudson.model.listeners.ItemListener.fireOnCreated(ItemListener.java:216) at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:936) at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observeNew(MultiBranchProject.java:2083) at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1991) at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:357) at jenkins.plugins.git.AbstractGitSCMSource$8.discoverBranches(AbstractGitSCMSource.java:677) at jenkins.plugins.git.AbstractGitSCMSource$8.run(AbstractGitSCMSource.java:581) at jenkins.plugins.git.AbstractGitSCMSource$8.run(AbstractGitSCMSource.java:561) at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:372) at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:561) at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:373) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:283) at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:641) 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)

 Job XML Config property section.

<properties><org.jenkinsci.plugins.workflow.multibranch.PipelineTriggerProperty plugin="multibranch-action-triggers@1.8"><createActionJobsToTrigger/><deleteActionJobsToTrigger>ECIM-Remove-Feature</deleteActionJobsToTrigger><quitePeriod>0</quitePeriod><additionalParameters/></org.jenkinsci.plugins.workflow.multibranch.PipelineTriggerProperty></properties>
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

aytuncbeken.ab@gmail.com (JIRA)

unread,
Mar 28, 2020, 9:36:02 AM3/28/20
to jenkinsc...@googlegroups.com
Aytunc BEKEN started work on Bug JENKINS-61601
 
Change By: Aytunc BEKEN
Status: Open In Progress

aytuncbeken.ab@gmail.com (JIRA)

unread,
Mar 28, 2020, 10:54:02 AM3/28/20
to jenkinsc...@googlegroups.com
Aytunc BEKEN commented on Bug JENKINS-61601
 
Re: Unable to trigger job on deletion of branch when configured with job DSL.

Fixed with 1.8.1 release. Please let me know if it is solved on your side.

Thanks

aytuncbeken.ab@gmail.com (JIRA)

unread,
Mar 28, 2020, 10:54:02 AM3/28/20
to jenkinsc...@googlegroups.com

shadycuz@gmail.com (JIRA)

unread,
Apr 1, 2020, 1:03:04 PM4/1/20
to jenkinsc...@googlegroups.com
Levi Blaney updated an issue
Change By: Levi Blaney
Attachment: image-2020-04-01-22-32-50-050.png

shadycuz@gmail.com (JIRA)

unread,
Apr 1, 2020, 1:08:12 PM4/1/20
to jenkinsc...@googlegroups.com
Levi Blaney commented on Bug JENKINS-61601
 
Re: Unable to trigger job on deletion of branch when configured with job DSL.

Aytunc BEKEN,

Thanks for patching that so quickly. The error is now gone from the logs but still we don't see the job being triggered. 

The logs now have a warning. 

2020-04-01 16:48:28.803+0000 [id=6070]  WARNING o.j.p.w.m.PipelineTriggerProperty#triggerActionJobs: [MultiBranch Action Triggers Plugin] feat%2Ffusionpub_timeout not included by the Include Filter
2020-04-01 16:48:28.804+0000 [id=6070]  WARNING o.j.p.w.m.PipelineTriggerProperty#triggerActionJobs: [MultiBranch Action Triggers Plugin] feat%2Ffusionpub_timeout not included by the Include Filter
2020-04-01 16:48:28.804+0000 [id=6070]  WARNING o.j.p.w.m.PipelineTriggerProperty#triggerActionJobs: [MultiBranch Action Triggers Plugin] feat%2Ffusionpub_timeout not included by the Include Filter
2020-04-01 16:48:28.804+0000 [id=6070]  WARNING o.j.p.w.m.PipelineTriggerProperty#triggerActionJobs: [MultiBranch Action Triggers Plugin] feat%2Ffusionpub_timeout not included by the Include Filter
2020-04-01 16:48:28.812+0000 [id=6098]  INFO    j.b.WorkspaceLocatorImpl$Deleter$CleanupTask#run: deleting obsolete workspace /var/jenkins_home/workspace/y-Feature_feat_fusionpub_timeout@libs on master

As you can see in my co-workers post we don't specify an include filter in the DSL, but it is in the Jenkins GUI. Maybe defaulted somehow?

It should catch everything? Our branches are prefixed with fix/ and feat/ which the multiple pipeline job URL encodes it? Is that messing up the filter? I could try specifying the include filter in the DSL if you think that would help? 

This setup used to work but did break sometime around December? We felt we did something so didn't report the issue. We really enjoy the plugin, it's what makes the multipipeline job usable for us. 

Thanks

shadycuz@gmail.com (JIRA)

unread,
Apr 1, 2020, 1:19:03 PM4/1/20
to jenkinsc...@googlegroups.com
Levi Blaney edited a comment on Bug JENKINS-61601
[~aytuncbeken],


Thanks for patching that so quickly. The error is now gone from the logs but still we don't see the job being triggered. 

The logs now have a warning. 


{code:java}

2020-04-01 16:48:28.803+0000 [id=6070]  WARNING o.j.p.w.m.PipelineTriggerProperty#triggerActionJobs: [MultiBranch Action Triggers Plugin] feat%2Ffusionpub_timeout not included by the Include Filter
2020-04-01 16:48:28.804+0000 [id=6070]  WARNING o.j.p.w.m.PipelineTriggerProperty#triggerActionJobs: [MultiBranch Action Triggers Plugin] feat%2Ffusionpub_timeout not included by the Include Filter
2020-04-01 16:48:28.804+0000 [id=6070]  WARNING o.j.p.w.m.PipelineTriggerProperty#triggerActionJobs: [MultiBranch Action Triggers Plugin] feat%2Ffusionpub_timeout not included by the Include Filter
2020-04-01 16:48:28.804+0000 [id=6070]  WARNING o.j.p.w.m.PipelineTriggerProperty#triggerActionJobs: [MultiBranch Action Triggers Plugin] feat%2Ffusionpub_timeout not included by the Include Filter
2020-04-01 16:48:28.812+0000 [id=6098]  INFO    j.b.WorkspaceLocatorImpl$Deleter$CleanupTask#run: deleting obsolete workspace /var/jenkins_home/workspace/y-Feature_feat_fusionpub_timeout@libs on master
{code}

As you can see in my co-workers post we don't specify an include filter in the DSL, but it is in the Jenkins GUI. Maybe defaulted somehow?

!image-2020-04-01-22-32-50-050.png|width=706,height=217!


It should catch everything? Our branches are prefixed with fix/ and feat/ which the multiple pipeline job URL encodes it? Is that messing up the filter? I could try specifying the include filter in the DSL if you think that would help? 

This setup used to work but did break sometime around December? We felt we did something so didn't report the issue. We really enjoy the plugin, it's what makes the multipipeline job usable for us. 

Thanks


EDIT: Just noticed our job XML is missing the * even though the GUI shows it? Let me add it to DSL.

shadycuz@gmail.com (JIRA)

unread,
Apr 1, 2020, 1:31:03 PM4/1/20
to jenkinsc...@googlegroups.com

Adding the include filter to our JobDSL did put it in the config.xml and the plugin is now working perfectly Aytunc BEKEN, I will ping Neha Singh and have her close this issue =) 

Thanks!

aytuncbeken.ab@gmail.com (JIRA)

unread,
Apr 2, 2020, 10:59:02 AM4/2/20
to jenkinsc...@googlegroups.com

Levi Blaney Thanks for the feedback and detailed explanation. You are right, * character comes from the UI not defined in the code. I think this is the reason why It was failing with JOB dsl. I am happy that fix is worked. I will check this situation for other variables in the plugin to prevent future possible error.

Thanks.

aytuncbeken.ab@gmail.com (JIRA)

unread,
Apr 2, 2020, 11:01:04 AM4/2/20
to jenkinsc...@googlegroups.com
Aytunc BEKEN edited a comment on Bug JENKINS-61601
[~shadycuz] Thanks for the feedback and detailed explanation. You are right, * character comes from the UI not defined in the code. I think this is the reason why It was failing with JOB dsl. I am happy that fix is worked. I will check this situation for other variables in the plugin to prevent future possible error.

Thanks.


neha.mhf@gmail.com (JIRA)

unread,
Apr 3, 2020, 9:08:06 AM4/3/20
to jenkinsc...@googlegroups.com

neha.mhf@gmail.com (JIRA)

unread,
Apr 3, 2020, 9:08:06 AM4/3/20
to jenkinsc...@googlegroups.com

aytuncbeken.ab@gmail.com (JIRA)

unread,
Apr 4, 2020, 8:33:03 AM4/4/20
to jenkinsc...@googlegroups.com

aytuncbeken.ab@gmail.com (JIRA)

unread,
Apr 4, 2020, 8:33:03 AM4/4/20
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages