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

Better Support for Job DSL configuration of GitHub Organization Folder #30

Open
thorntonryan opened this issue Dec 11, 2020 · 2 comments

Comments

@thorntonryan
Copy link

Description

Hello! For starters, thank you for the excellent plugin! I've used it to good effect on my team's Jenkins server. I appreciate your work!

I have a comment / suggestion:
I think it would be great if this plugin offered a better way to configure this plugin through the Jobs DSL plugin for a GitHub organization style job.

Unless I'm missing something obvious, I don't see an easy way / dynamic syntax for configuring this plugin via Jobs DSL.

Workaround

Fortunately, configuring this plugin for a GitHub organization folder is still possible, albeit a little awkward, by using the configure block to manually add the XML:

organizationFolder('Org') {
	organizations {
		github {
			...
		}
	}

	// configure github-pr-comment-build-plugin
	configure { organizationFolder -> 
		def strategy = organizationFolder << strategy(class: 'jenkins.branch.DefaultBranchPropertyStrategy') {
			properties(class: 'java.util.Arrays$ArrayList') {
				a(class: 'jenkins.branch.BranchProperty-array') {
					"com.adobe.jenkins.github__pr__comment__build.TriggerPRCommentBranchProperty"(plugin :'github-pr-comment-build') {
						commentBody('.*Do: Build.*')
					}
				}
			}
		}
	}

}

Not as nice as first class support, but better than nothing :)

@bluesliverx
Copy link
Contributor

Sorry that it's been months without me getting back to you. I should definitely add Job DSL support here, though I don't use organization folders at all and therefore don't have a test bed for it to be honest.
I also don't have much time to try to add this, so if you happen to get a moment, feel free to submit a PR. I've automated the release process recently so it should be quite simple once a PR is merged.

@lprimak
Copy link
Contributor

lprimak commented Sep 19, 2022

I have this so I can test if needed

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

No branches or pull requests

3 participants