Skip to content

not possible to set git behaviour changes via DSL (excludeFromPoll() , excludeFromChangeSet()) #158

@johnny990

Description

@johnny990

Describe the bug
We provision our multibranch pipelines via DSL scripts and would like not to include library changes to job changeset. From the plugin documentation I see there're couple of options to achieve desired behavior and it is working when set n UI.
But in case I set it in the DSL, the seed job will fail with the following error:

ERROR: (unknown source) No signature of method: javaposse.jobdsl.plugin.structs.DescribableListContext.excludeFromChangeSet() is applicable for argument types: () values: []

DSL part is the following:

factory {
        remoteJenkinsFileWorkflowBranchProjectFactory {
            localMarker('')
            matchBranches(false)
            remoteJenkinsFile("pipelines/${repositoryNameVar}/Jenkinsfile")
            remoteJenkinsFileSCM {
                gitSCM {
                    userRemoteConfigs {
                        userRemoteConfig {
                            name('') //Custom Repository Name or ID
                            url("${bitbucketURL}/${repositoryOwnerVar}/${libraryRepo}.git") //URL for the repository
                            refspec('')
                            credentialsId('git-creds')
                        }
                        browser {} // Leave blank for default Git Browser
                        gitTool('') //Leave blank for default git executable
                    }
                    branches {
                        branchSpec {
                            name("refs/heads/${pipelineBranch}")
                        }
                    }
                    extensions {
                           excludeFromPoll()
                    }
                }                
            }
        }
    }

If it is set from the UI, config.xml is the following:

<extensions>
        <org.jenkinsci.plugins.workflow.multibranch.extended.scm.ExcludeFromPoll plugin="[email protected]"/>
</extensions>

To Reproduce
Steps to reproduce the behavior:

  1. Add the following code to job DL and run seed job:
extensions {
  excludeFromPoll()
  excludeFromChangeSet()
}

Expected behavior
Job is provisioned and git behavior changes applied

Desktop (please complete the following information):
Plugin versions:

  • remote-file: 1.24
  • job-dsl-plugin: 1.87

Jenkins: 2.452.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions