Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
johnny990 opened this issue May 20, 2024 · 0 comments

Comments

@johnny990
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant