-
Notifications
You must be signed in to change notification settings - Fork 58
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
Make plugin compatible with Job DSL #41
Conversation
Thanks for the PR. I'll test drive the changes in the next days. |
src/main/java/org/jenkinsci/plugin/gitea/ForkPullRequestDiscoveryTrait.java
Outdated
Show resolved
Hide resolved
src/main/java/org/jenkinsci/plugin/gitea/ForkPullRequestDiscoveryTrait.java
Outdated
Show resolved
Hide resolved
Hi @LEDfan. I've tested your changes and now it's really easy to configure traits. 👍 If you could add those changes to your PR as well, this would be awesome. Otherwise, I'll create an additional PR based on your changes. Please let me know how we proceed. The changes would be...
...to achieve a configuration like the following. organizationFolder('gitea-org') {
displayName('This is my Gitea organization')
organizations {
gitea {
serverUrl("https://git.example.com")
repoOwner("owner")
credentialsId("gitea-token-credentials")
traits {
// Repository filter
sourceWildcardFilter {
includes("gitea-plugin")
excludes("")
}
// Branch/Tag/PR filter
headRegexFilter {
regex("^(main|develop\\/.*|v\\d+|PR-.*)\$")
}
giteaExcludeArchivedRepositories {}
giteaTagDiscovery {}
giteaSSHCheckout {
credentialsId('ssh-gitea')
}
giteaBranchDiscovery {
strategyId(1)
}
giteaPullRequestDiscovery {
strategyId(1)
}
giteaForkDiscovery {
strategyId(1)
trust {
giteaTrustContributors {}
// giteaTrustEveryone {}
// giteaTrustNobody {}
}
}
// Override webhook management
giteaWebhookRegistration {
mode('ITEM')
// mode('DISABLED')
}
}
}
}
} |
Co-authored-by: Steven <61625851+justusbunsi@users.noreply.github.com>
Thanks @justusbunsi for the additional fixes, I integrated them into this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for your addition to the plugin. 🤗
FYI, I've updated the PR description to match the actual changes. |
Hi
First of all, a big thanks for picking up maintenance for this plugin again!
We are using this plugin with an initial root job using the job DSL. The current version of the plugin has two problems regarding DSL support:
traits
ofgiteaSCMNavigator
giteaForkDiscovery
traitThis PR adds full support for configuration via the Job DSL plugin.
Fixes: