result) {
23 | final GitHubPRTrigger gitHubPRTrigger = ghPRTriggerFromJob(job);
24 | if (nonNull(gitHubPRTrigger)) {
25 | result.add(gitHubPRTrigger.getRepoFullName(job));
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/java/org/jenkinsci/plugins/github/pullrequest/webhook/PullRequestInfo.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.webhook;
2 |
3 | /**
4 | * Bean class to store main info from payload of webhook
5 | *
6 | * @author lanwen (Merkushev Kirill)
7 | */
8 | public class PullRequestInfo {
9 | private final String repo;
10 | private final int num;
11 | private String target;
12 |
13 | public PullRequestInfo(String repo, int num) {
14 | this(repo, num, null);
15 | }
16 |
17 | public PullRequestInfo(String repo, int num, String target) {
18 | this.repo = repo;
19 | this.num = num;
20 | this.target = target;
21 | }
22 |
23 | public String getRepo() {
24 | return repo;
25 | }
26 |
27 | public int getNum() {
28 | return num;
29 | }
30 |
31 | public String getTarget() {
32 | return target;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/branch/GitHubBranch/index.groovy:
--------------------------------------------------------------------------------
1 | package com.github.kostyasha.github.integration.branch.GitHubBranch
2 |
3 | a(href: my.htmlUrl) {
4 | img(src: rootURL + my.iconFileName, width: "16", height: "16")
5 | text(my.name)
6 | }
7 |
8 | table(width: "1000px") {
9 | tr() {
10 | td("SHA1: " + my.getCommitSha())
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/branch/GitHubBranchBadgeAction/badge.groovy:
--------------------------------------------------------------------------------
1 | package com.github.kostyasha.github.integration.branch.GitHubBranchBadgeAction
2 |
3 | import lib.FormTagLib
4 | import lib.LayoutTagLib
5 | import com.github.kostyasha.github.integration.branch.GitHubBranch
6 |
7 | def l = namespace(LayoutTagLib);
8 | def f = namespace(FormTagLib);
9 | def j = namespace("jelly:core");
10 |
11 | a(href: "${my.htmlUrl}/tree/${my.branchName}") {
12 | img(src: "${rootURL}${GitHubBranch.iconFileName}",
13 | title: my.title,
14 | width: "16",
15 | height: "16"
16 | )
17 | text("${my.branchName}")
18 | }
19 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/branch/GitHubBranchCause/description.groovy:
--------------------------------------------------------------------------------
1 | package com.github.kostyasha.github.integration.branch.GitHubBranchCause
2 |
3 | import lib.FormTagLib
4 |
5 | def f = namespace(FormTagLib);
6 |
7 | if (my.htmlUrl != null) {
8 | text("GitHub branch ")
9 | a(href: "${my.htmlUrl}/tree/${my.branchName}") {
10 | text("${my.branchName}")
11 | }
12 | text(": ${my.reason}")
13 | } else {
14 | text("Branch deleted")
15 | }
16 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/branch/GitHubBranchPollingLogAction/index.groovy:
--------------------------------------------------------------------------------
1 | package com.github.kostyasha.github.integration.branch.GitHubBranchPollingLogAction
2 |
3 | import lib.FormTagLib
4 | import lib.LayoutTagLib
5 |
6 | def f = namespace(FormTagLib);
7 | def l = namespace(LayoutTagLib);
8 | def t = namespace("/lib/hudson")
9 | def st = namespace("jelly:stapler");
10 | def j = namespace("jelly:core");
11 |
12 | def context = my.job ? my.job : my.run
13 |
14 | l.layout(title: my.displayName) {
15 | st.include(page: "sidepanel", it: context)
16 | l.main_panel() {
17 | h1(my.displayName);
18 | // h4("Polling log of last attempt of build.")
19 | l.rightspace() {
20 | a(href: "pollingLog"){
21 | l.icon(class: "icon-document icon-md")
22 | text("View as plain text")
23 | }
24 | }
25 |
26 | if (my.logExists) {
27 | pre() {
28 | j.whitespace() {
29 | my.writePollingLogTo(output);
30 | }
31 | }
32 | } else {
33 | text("There is no logs so far.");
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/branch/GitHubBranchTrigger/help-abortRunning.html:
--------------------------------------------------------------------------------
1 | If selected, when a new PR build is triggered, if there are already running/building
2 | builds/runs for that PR on the executors, they'll be aborted in favor of this most recent build.
3 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/branch/GitHubBranchTrigger/help-events.html:
--------------------------------------------------------------------------------
1 |
2 | GitHub events or statuses that should or should not trigger a build for branch.
3 |
4 | The specified events will be checked in order, and the first to match will
5 | be used, so be sure to put events/statuses that should prevent triggering a
6 | build first in order.
7 |
8 | If you want to skip PR, you must place skip events firstly.
9 |
10 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/branch/GitHubBranchTrigger/help-skipFirstRun.html:
--------------------------------------------------------------------------------
1 |
2 | If selected, older, pre-existing PRs will be skipped on the first run of the
3 | persistence-based check, and will be marked as seen. Any changes to those PRs after the first
4 | check will be treated normally, triggering builds as configured.
5 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/branch/GitHubBranchTrigger/help-triggerMode.html:
--------------------------------------------------------------------------------
1 |
2 | Trigger modes.
3 |
4 | Cron : Checks for PRs to build periodically.
5 | Hooks : Listens for GitHub webhook events.
6 | Hooks plus Cron : Not fully supported - combines webhooks and cron checks.
7 | Transient Hooks : Not fully supported - listens for GitHub webhook events, does not preserve state for pull requests across runs or Jenkins restarts, etc.
8 |
9 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/branch/events/impl/GitHubBranchCommitEvent/config.groovy:
--------------------------------------------------------------------------------
1 | package com.github.kostyasha.github.integration.branch.events.impl.GitHubBranchCommitEvent
2 |
3 | import com.github.kostyasha.github.integration.branch.events.impl.GitHubBranchCommitEvent
4 | import lib.FormTagLib
5 |
6 | def f = namespace(FormTagLib)
7 |
8 | if (instance == null) {
9 | instance = new GitHubBranchCommitEvent()
10 | }
11 |
12 | f.block {
13 | table(style: 'width:100%; margin-left: 5px;') {
14 | f.entry() {
15 | f.hetero_list(name: "checks",
16 | items: instance.checks,
17 | descriptors: descriptor.getEventDescriptors(),
18 | hasHeader: true
19 | )
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/branch/events/impl/GitHubBranchCreatedEvent/config.groovy:
--------------------------------------------------------------------------------
1 | package com.github.kostyasha.github.integration.branch.events.impl.GitHubBranchCreatedEvent
2 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/branch/events/impl/GitHubBranchRestrictionFilter/config.groovy:
--------------------------------------------------------------------------------
1 | package com.github.kostyasha.github.integration.branch.events.impl.GitHubBranchRestrictionFilter
2 |
3 | import lib.FormTagLib
4 | import lib.LayoutTagLib
5 |
6 | def l = namespace(LayoutTagLib);
7 | def f = namespace(FormTagLib);
8 | def j = namespace("jelly:core");
9 |
10 | f.entry(field: "exclude", title: "Exclude branches that match criteria?") {
11 | f.checkbox()
12 | }
13 |
14 | f.entry(field: "matchAsPattern", title: "Match branches against pattern criteria?") {
15 | f.checkbox()
16 | }
17 |
18 | f.entry(title: "Branch Names or Patterns") {
19 | f.textarea(field: "matchCriteriaStr")
20 | }
21 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/branch/events/impl/commitchecks/impl/GitHubBranchCommitMessageCheck/config.groovy:
--------------------------------------------------------------------------------
1 | package com.github.kostyasha.github.integration.branch.events.impl.commitchecks.impl.GitHubBranchCommitMessageCheck
2 |
3 | import lib.FormTagLib
4 |
5 | def f = namespace(FormTagLib);
6 |
7 | f.entry(field: "exclude", title: "Exclude commits that match criteria?") {
8 | f.checkbox()
9 | }
10 |
11 | f.entry(title: _("Message Patterns"), field: "matchCriteria") {
12 | f.expandableTextbox()
13 | }
14 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/branch/events/impl/commitchecks/impl/GitHubBranchCommitMessageCheck/help-matchCriteria.html:
--------------------------------------------------------------------------------
1 |
2 | Inclusion/Exclusion uses pattern matching
3 |
4 |
5 | .*\[maven-release-plugin\].*
6 |
7 | The example above illustrates that if only revisions with "[maven-release-plugin]" message in first comment line have
8 | been committed to the SCM a build will not occur.
9 |
10 |
11 | You can create more complex patterns using embedded flag expressions.
12 |
13 |
14 | (?s).*FOO.*
15 |
16 | This example will search FOO message in all comment lines.
17 |
18 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/branch/events/impl/commitchecks/impl/GitHubBranchCommitMessageCheck/help.html:
--------------------------------------------------------------------------------
1 |
2 | If set, the plugin will only build revisions commited with messages that match the pattern. If 'skip' is
3 | selected, any revisions with matching messages will be ignored.
4 |
5 |
6 | This can be used to exclude commits done by the build itself from triggering another build, assuming the build
7 | server commits the change with a distinct message.
8 |
9 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/generic/errors/GitHubErrorsAction/jobMain.groovy:
--------------------------------------------------------------------------------
1 | package com.github.kostyasha.github.integration.generic.errors.GitHubErrorsAction
2 |
3 | def t = namespace("/lib/hudson")
4 | def st = namespace("jelly:stapler");
5 |
6 | if (from?.hasVisibleErrors()) {
7 | // indent like in hudson/model/AbstractProject/main.jelly
8 | table(style: "margin-left:1em;") {
9 | t.summary(icon: "warning.png") {
10 | b(from.description)
11 | br()
12 | from.getErrorsSnapshot().eachWithIndex() { error, index ->
13 | if (error.isVisible()) {
14 | b(++index + " " + error.title)
15 | div(style: "margin-left:2em") {
16 | raw(error.getHtmlDescription())
17 | }
18 | st.include(page: "index.jelly", it: error, optional: true)
19 | }
20 | }
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/generic/repoprovider/GitHubPluginRepoProvider/config.groovy:
--------------------------------------------------------------------------------
1 | package com.github.kostyasha.github.integration.generic.repoprovider.GitHubPluginRepoProvider
2 |
3 | import com.github.kostyasha.github.integration.generic.repoprovider.GitHubPluginRepoProvider
4 | import lib.FormTagLib
5 |
6 | def f = namespace(FormTagLib);
7 | def st = namespace("jelly:stapler")
8 |
9 | if (instance == null) {
10 | instance = new GitHubPluginRepoProvider();
11 | }
12 |
13 | f.entry(title: "Cache connection?", field: "cacheConnection") {
14 | f.checkbox(default: false)
15 | }
16 |
17 | f.entry(title: "Manage hooks", field: "manageHooks") {
18 | f.checkbox()
19 | }
20 |
21 | f.entry(title: "Repository requested permission", field: "repoPermission") {
22 | f.enum() {
23 | text(my.name())
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/generic/repoprovider/GitHubPluginRepoProvider/help-cacheConnection.html:
--------------------------------------------------------------------------------
1 | Old trigger behaviour when connection resolved first from global settings and then used locally.
2 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/generic/repoprovider/GitHubPluginRepoProvider/help-manageHooks.html:
--------------------------------------------------------------------------------
1 | Allow disable registering hooks even if it specified in global settings.
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/generic/repoprovider/GitHubPluginRepoProvider/help-repoPermission.html:
--------------------------------------------------------------------------------
1 | ADMIN, PUSH or PULL repository permission required for choosing connection from
2 | `GitHub Plugin` `GitHub Server Configs`.
3 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/multibranch/GitHubBranchBuildStrategy/config.groovy:
--------------------------------------------------------------------------------
1 | package com.github.kostyasha.github.integration.multibranch.GitHubBranchBuildStrategy
2 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/multibranch/GitHubBranchBuildStrategy/help.html:
--------------------------------------------------------------------------------
1 |
2 | Ensures that skipped causes are honored on new branch item creation
3 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/multibranch/action/GitHubSCMSourcesReposAction/index.groovy:
--------------------------------------------------------------------------------
1 | package com.github.kostyasha.github.integration.multibranch.action.GitHubSCMSourcesReposAction
2 |
3 | import com.github.kostyasha.github.integration.branch.GitHubBranchCause
4 | import hudson.model.Item
5 | import lib.FormTagLib
6 | import lib.LayoutTagLib
7 |
8 | println("test")
9 | f.entry(title: "test")
10 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/multibranch/handler/GitHubBranchHandler/config.groovy:
--------------------------------------------------------------------------------
1 | package com.github.kostyasha.github.integration.multibranch.handler.GitHubBranchHandler
2 |
3 | import com.github.kostyasha.github.integration.branch.events.GitHubBranchEventDescriptor
4 | import com.github.kostyasha.github.integration.multibranch.handler.GitHubBranchHandler
5 | import lib.FormTagLib
6 |
7 | def f = namespace(FormTagLib);
8 | def st = namespace("jelly:stapler")
9 |
10 | if (instance == null) {
11 | instance = new GitHubBranchHandler();
12 | }
13 |
14 | f.entry(title: _("Trigger Events"), help: descriptor.getHelpFile('events')) {
15 | f.hetero_list(name: "events",
16 | items: instance.events,
17 | descriptors: GitHubBranchEventDescriptor.all(),
18 | hasHeader: true
19 | )
20 | }
21 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/multibranch/handler/GitHubPRHandler/config.groovy:
--------------------------------------------------------------------------------
1 | package com.github.kostyasha.github.integration.multibranch.handler.GitHubPRHandler
2 |
3 | import com.github.kostyasha.github.integration.multibranch.handler.GitHubPRHandler
4 | import lib.FormTagLib
5 | import org.jenkinsci.plugins.github.pullrequest.events.GitHubPREventDescriptor
6 |
7 | def f = namespace(FormTagLib);
8 | def st = namespace("jelly:stapler")
9 |
10 | if (instance == null) {
11 | instance = new GitHubPRHandler();
12 | }
13 |
14 | f.entry(title: _("Trigger Events"), help: descriptor.getHelpFile('events')) {
15 | f.hetero_list(name: "events",
16 | items: instance.events,
17 | descriptors: GitHubPREventDescriptor.all(),
18 | hasHeader: true
19 | )
20 | }
21 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/multibranch/handler/GitHubTagHandler/config.groovy:
--------------------------------------------------------------------------------
1 | package com.github.kostyasha.github.integration.multibranch.handler.GitHubTagHandler
2 |
3 | import com.github.kostyasha.github.integration.tag.events.GitHubTagEventDescriptor
4 | import com.github.kostyasha.github.integration.multibranch.handler.GitHubTagHandler
5 | import lib.FormTagLib
6 |
7 | def f = namespace(FormTagLib);
8 | def st = namespace("jelly:stapler")
9 |
10 | if (instance == null) {
11 | instance = new GitHubTagHandler();
12 | }
13 |
14 | f.entry(title: _("Trigger Events"), help: descriptor.getHelpFile('events')) {
15 | f.hetero_list(name: "events",
16 | items: instance.events,
17 | descriptors: GitHubTagEventDescriptor.all(),
18 | hasHeader: true
19 | )
20 | }
21 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/multibranch/repoprovider/GitHubPluginRepoProvider2/config.groovy:
--------------------------------------------------------------------------------
1 | package com.github.kostyasha.github.integration.multibranch.repoprovider.GitHubPluginRepoProvider2
2 |
3 | import com.github.kostyasha.github.integration.multibranch.repoprovider.GitHubPluginRepoProvider2
4 | import lib.FormTagLib
5 |
6 | def f = namespace(FormTagLib);
7 | def st = namespace("jelly:stapler")
8 |
9 | if (instance == null) {
10 | instance = new GitHubPluginRepoProvider2();
11 | }
12 |
13 | f.entry(title: "Cache connection?", field: "cacheConnection") {
14 | f.checkbox(default: false)
15 | }
16 |
17 | f.entry(title: "Manage hooks", field: "manageHooks") {
18 | f.checkbox()
19 | }
20 |
21 | f.entry(title: "Repository requested permission", field: "repoPermission") {
22 | f.enum() {
23 | text(my.name())
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/multibranch/scm/AsIsGitSCMFactory/config.groovy:
--------------------------------------------------------------------------------
1 | package com.github.kostyasha.github.integration.multibranch.scm.AsIsGitSCMFactory
2 |
3 | import lib.FormTagLib
4 |
5 | def f = namespace(FormTagLib);
6 |
7 | f.property(name: "gitSCM")
8 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/tag/GitHubTag/index.groovy:
--------------------------------------------------------------------------------
1 | package com.github.kostyasha.github.integration.tag.GitHubTag
2 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/tag/GitHubTagCause/description.groovy:
--------------------------------------------------------------------------------
1 | package com.github.kostyasha.github.integration.tag.GitHubTagCause
2 |
3 | import lib.FormTagLib
4 |
5 | def f = namespace(FormTagLib);
6 |
7 | if (my.htmlUrl != null) {
8 | text("GitHub tag ")
9 | a(href: "${my.htmlUrl}") {
10 | text("${my.tagName}")
11 | }
12 | text(": ${my.reason}")
13 | } else{
14 | text("Tag deleted")
15 | }
16 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/tag/events/impl/GitHubTagCreatedEvent/config.groovy:
--------------------------------------------------------------------------------
1 | package com.github.kostyasha.github.integration.tag.events.impl.GitHubTagCreatedEvent
2 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/com/github/kostyasha/github/integration/tag/events/impl/GitHubTagRestrictionFilter/config.groovy:
--------------------------------------------------------------------------------
1 | package com.github.kostyasha.github.integration.tag.events.impl.GitHubTagRestrictionFilter
2 |
3 | import lib.FormTagLib
4 | import lib.LayoutTagLib
5 |
6 | def l = namespace(LayoutTagLib);
7 | def f = namespace(FormTagLib);
8 | def j = namespace("jelly:core");
9 |
10 | f.entry(field: "exclude", title: "Exclude tags that match criteria?") {
11 | f.checkbox()
12 | }
13 |
14 | f.entry(field: "matchAsPattern", title: "Match tags against pattern criteria?") {
15 | f.checkbox()
16 | }
17 |
18 | f.entry(title: "Tags Names or Patterns") {
19 | f.textarea(field: "matchCriteriaStr")
20 | }
21 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/index.jelly:
--------------------------------------------------------------------------------
1 |
2 |
3 | GitHub Integration Plugin for Jenkins
4 |
5 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRBadgeAction/badge.groovy:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.GitHubPRBadgeAction
2 |
3 | import lib.FormTagLib
4 | import lib.LayoutTagLib
5 | import org.jenkinsci.plugins.github.pullrequest.GitHubPRPullRequest
6 |
7 | def l = namespace(LayoutTagLib);
8 | def f = namespace(FormTagLib);
9 | def j = namespace("jelly:core");
10 |
11 | a(href: my.htmlUrl) {
12 | img(src: "${rootURL}${GitHubPRPullRequest.iconFileName}",
13 | title: my.title,
14 | width: "16",
15 | height: "16"
16 | )
17 | text("#${my.number}")
18 | }
19 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRBuildChooser/config.groovy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KostyaSha/github-integration-plugin/50adabf6a628fd03c532224a187221899d8d1930/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRBuildChooser/config.groovy
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRBuildChooser/help.html:
--------------------------------------------------------------------------------
1 |
2 | TODO Git build chooser strategy
3 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRCause/description.groovy:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.GitHubPRCause
2 |
3 | import lib.FormTagLib
4 |
5 | def f = namespace(FormTagLib);
6 |
7 | if (my.htmlUrl != null) {
8 | text("GitHub PR ")
9 | a(href: "${my.htmlUrl}") {
10 | text("#${my.number}")
11 | }
12 | text(": ${my.reason}")
13 | } else {
14 | text("GitHub PR deleted")
15 | }
16 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRLabel/config.groovy:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.GitHubPRLabel
2 |
3 | import lib.FormTagLib;
4 |
5 | def f = namespace(FormTagLib);
6 |
7 | f.entry(title: _("Labels"), field: "labels") {
8 | f.expandableTextbox()
9 | }
10 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRLabel/help-labels.html:
--------------------------------------------------------------------------------
1 |
2 | Every new label on new line
3 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRLabel/help.html:
--------------------------------------------------------------------------------
1 |
2 | Help page for GitHubPRLabel class. Not used anywhere?
3 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRMessage/config.groovy:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.GitHubPRMessage
2 |
3 | import lib.FormTagLib
4 |
5 | def f = namespace(FormTagLib);
6 |
7 | f.entry(title: _('Content'), field: 'content') {
8 | f.expandableTextbox()
9 | }
10 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRMessage/help-content.html:
--------------------------------------------------------------------------------
1 |
2 | Message content that will be posted. Support core variable expansion i.e. ${WORKSPACE}.
3 | If token-macro plugin enabled, then support token expansion.
4 | If email-ext plugin enabled, then support expanding groovy templates with ${SCRIPT, path="template.groovy"}.
5 |
6 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRPollingLogAction/index.groovy:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.GitHubPRPollingLogAction
2 |
3 | import lib.FormTagLib
4 | import lib.LayoutTagLib
5 |
6 | def f = namespace(FormTagLib);
7 | def l = namespace(LayoutTagLib);
8 | def t = namespace("/lib/hudson")
9 | def st = namespace("jelly:stapler");
10 | def j = namespace("jelly:core");
11 |
12 | def context = my.job ? my.job : my.run
13 |
14 | l.layout(title: my.displayName) {
15 | st.include(page: "sidepanel", it: context)
16 | l.main_panel() {
17 | h1(my.displayName);
18 | // h4("Polling log of last attempt of build.")
19 | l.rightspace() {
20 | a(href: "pollingLog"){
21 | l.icon(class: "icon-document icon-md")
22 | text("View as plain text")
23 | }
24 | }
25 |
26 | if (my.logExists) {
27 | pre() {
28 | j.whitespace() {
29 | my.writePollingLogTo(output);
30 | }
31 | }
32 | } else {
33 | text("There is no logs so far.");
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRPullRequest/index.groovy:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.GitHubPRPullRequest
2 |
3 | import com.google.common.base.Joiner
4 |
5 | a(href: my.htmlUrl) {
6 | img(src: rootURL + my.iconFileName, width: "16", height: "16")
7 | text(" #" + my.number + ": " + my.title)
8 | }
9 |
10 | table(width: "1000px") {
11 | tr() {
12 | td("Head SHA: " + my.headSha)
13 | td("Author: " + my.userLogin)
14 | td("Issue updated at " + my.issueUpdatedAt)
15 | }
16 | tr() {
17 | td("Source branch: " + my.headRef)
18 | td("Author's email: " + my.userEmail)
19 | td("PR updated at " + my.prUpdatedAt)
20 | }
21 | tr() {
22 | td("Target branch: " + my.baseRef)
23 | td(my.mergeable ? "PR mergeable " : "PR NOT mergeable")
24 | td("Last commented at " + my.lastCommentCreatedAt)
25 | }
26 | tr() {
27 | def labels = (my.labels) ? Joiner.on(", ").join((List) my.labels.collect { x -> "\"" + x + "\"" }) : "none"
28 | td(colspan: 3, "Labels: " + labels)
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRTrigger/global.groovy:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger
2 |
3 | import lib.FormTagLib
4 |
5 | def f = namespace(FormTagLib);
6 |
7 | f.section(title: _(descriptor.displayName)) {
8 | f.entry(title: _("Published Jenkins URL"), field: "publishedURL") {
9 | f.textbox()
10 | }
11 |
12 | f.entry(title: "Actualise local repo on factory creation", field: "actualiseOnFactory") {
13 | f.checkbox(default: false)
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRTrigger/help-abortRunning.html:
--------------------------------------------------------------------------------
1 | If selected, when a new PR build is triggered, if there are already running/building
2 | builds/runs for that PR on the executors, they'll be aborted in favor of this most recent build.
3 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRTrigger/help-branchRestriction.html:
--------------------------------------------------------------------------------
1 |
2 | Limit job run to certain branch matches.
3 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRTrigger/help-cacheSize.html:
--------------------------------------------------------------------------------
1 |
2 | OkHttp connector disk cache size in MB.
3 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRTrigger/help-cancelQueued.html:
--------------------------------------------------------------------------------
1 |
2 | If selected, when a new PR build is triggered, if there are already pending
3 | builds for that PR in the queue, they'll be removed from the queue in favor
4 | of this most recent build.
5 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRTrigger/help-events.html:
--------------------------------------------------------------------------------
1 |
2 | GitHub events or statuses that should or should not trigger a build of a pull request.
3 |
4 | The specified events will be checked in order, and the first to match will
5 | be used, so be sure to put events/statuses that should prevent triggering a
6 | build first in order.
7 |
8 | For performance reasons, "Pull Request Opened" should go before other
9 | events that require more detailed checking of the pull request, such as
10 | "Comment Matched to Pattern". But if you want to skip PR, you must place skip events firstly.
11 |
12 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRTrigger/help-preStatus.html:
--------------------------------------------------------------------------------
1 |
2 | Updates the GitHub pull request's status to PENDING once the build for that pull request has been queued to run.
3 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRTrigger/help-skipFirstRun.html:
--------------------------------------------------------------------------------
1 |
2 | If selected, older, pre-existing PRs will be skipped on the first run of the
3 | persistence-based check, and will be marked as seen. Any changes to those PRs after the first
4 | check will be treated normally, triggering builds as configured.
5 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRTrigger/help-triggerMode.html:
--------------------------------------------------------------------------------
1 |
2 | Trigger modes.
3 |
4 | Cron : Checks for PRs to build periodically.
5 | Hooks : Listens for GitHub webhook events.
6 | Hooks plus Cron : Not fully supported - combines webhooks and cron checks.
7 | Transient Hooks : Not fully supported - listens for GitHub webhook events, does not preserve state for pull requests across runs or Jenkins restarts, etc.
8 |
9 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRTrigger/help-useGitHubHooks.html:
--------------------------------------------------------------------------------
1 |
2 | Not implemented yet!
3 | Whether to use GitHub hooks instead of cron runs.
4 |
5 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRTrigger/help-userRestriction.html:
--------------------------------------------------------------------------------
1 |
2 | Adds ability to restrict who is allowed to run and whitelist users/orgs.
3 | Users can be updated with special comment from allowed users/orgs.
4 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRTrigger/help.html:
--------------------------------------------------------------------------------
1 |
2 | Trigger that integrates with GitHub Pull Requests and Issues activities and launches runs in response.
3 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/builders/GitHubPRStatusBuilder/config.groovy:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.builders.GitHubPRStatusBuilder
2 |
3 | import lib.FormTagLib
4 | import org.jenkinsci.plugins.github.pullrequest.builders.GitHubPRStatusBuilder
5 |
6 | def f = namespace(FormTagLib);
7 |
8 | // Stapler doesn't produce default values, so recreate object
9 | if (instance == null) {
10 | instance = new GitHubPRStatusBuilder()
11 | }
12 |
13 | f.entry(title: _("Build status message")) {
14 | f.property(field: "statusMessage")
15 | }
16 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/events/impl/GitHubPRCloseEvent/help.html:
--------------------------------------------------------------------------------
1 |
2 | Triggers when a pull request is closed. Works only when
3 | pull request was opened and closed between persistence-based trigger runs.
4 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/events/impl/GitHubPRCommentEvent/config.groovy:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPRCommentEvent
2 |
3 | import lib.FormTagLib;
4 |
5 | def f = namespace(FormTagLib);
6 |
7 | f.entry(title: _("Comment Pattern"), field: "comment") {
8 | f.textbox()
9 | }
10 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/events/impl/GitHubPRCommentEvent/help.html:
--------------------------------------------------------------------------------
1 |
2 | Triggers when a comment matching the pattern is posted in a pull request.
3 | For example Test ([A-Za-z0-9 ,!]+) tags please.
4 |
5 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/events/impl/GitHubPRCommitEvent/help.html:
--------------------------------------------------------------------------------
1 |
2 | Triggers when a previously built pull request's hash has changed from the
3 | previous state (i.e., a new commit is pushed, or force-pushed).
4 |
5 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/events/impl/GitHubPRDescriptionEvent/config.groovy:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPRDescriptionEvent
2 |
3 | import lib.FormTagLib;
4 |
5 | def f = namespace(FormTagLib);
6 |
7 | f.entry(title: _("Skip build phrase"), field: "skipMsg") {
8 | f.textbox()
9 | }
10 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/events/impl/GitHubPRDescriptionEvent/help.html:
--------------------------------------------------------------------------------
1 |
2 | If given, don't build a pull request if its description contains the given string.
3 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/events/impl/GitHubPRLabelAddedEvent/config.groovy:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPRLabelAddedEvent
2 |
3 | import lib.FormTagLib;
4 |
5 | def f = namespace(FormTagLib);
6 |
7 | f.entry() {
8 | f.property(field: "label")
9 | }
10 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/events/impl/GitHubPRLabelAddedEvent/help.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Triggers run when label is added to pull request.
7 | Set of labels is considered added only when at least one label of set was newly added
8 | (was not saved in local PR previously) AND every label of set exists on remote PR now.
9 |
10 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/events/impl/GitHubPRLabelExistsEvent/config.groovy:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPRLabelExistsEvent
2 |
3 | import lib.FormTagLib;
4 |
5 | def f = namespace(FormTagLib);
6 |
7 | f.entry(field: "skip", title: "Skip pull requests with existing label(s)?") {
8 | f.checkbox()
9 | }
10 |
11 | f.entry() {
12 | f.property(field: "label")
13 | }
14 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/events/impl/GitHubPRLabelExistsEvent/help.html:
--------------------------------------------------------------------------------
1 |
2 | Triggers when all the given labels are on a pull request, or blocks triggering
3 | if all the given labels are on a pull request.
4 |
5 | NOTE : This can cause infinite triggers of pull requests
6 | when the skip option isn't selected, so be careful.
7 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/events/impl/GitHubPRLabelNotExistsEvent/config.groovy:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPRLabelNotExistsEvent
2 |
3 | import lib.FormTagLib;
4 |
5 | def f = namespace(FormTagLib);
6 |
7 | f.entry(field: "skip", title: "Skip pull requests with missing label(s)?") {
8 | f.checkbox()
9 | }
10 |
11 | f.entry() {
12 | f.property(field: "label")
13 | }
14 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/events/impl/GitHubPRLabelNotExistsEvent/help.html:
--------------------------------------------------------------------------------
1 |
2 | Triggers or skips triggering when all the given labels are missing from a pull request.
3 |
4 | NOTE : This can cause infinite triggers of pull requests
5 | when the skip option isn't selected, so be careful.
6 |
7 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/events/impl/GitHubPRLabelPatternExistsEvent/config.groovy:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPRLabelPatternExistsEvent
2 |
3 | import lib.FormTagLib;
4 |
5 | def f = namespace(FormTagLib);
6 |
7 | f.entry(field: "skip", title: "Skip pull requests with label(s) matching pattern?") {
8 | f.checkbox()
9 | }
10 |
11 | f.entry() {
12 | f.property(field: "label")
13 | }
14 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/events/impl/GitHubPRLabelPatternExistsEvent/help.html:
--------------------------------------------------------------------------------
1 |
2 | Triggers when a label on a pull request matches the given pattern, or blocks
3 | triggering when a label matches, as configured.
4 |
5 | NOTE : This can cause infinite triggers of pull requests
6 | when the skip option isn't selected, so be careful.
7 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/events/impl/GitHubPRLabelRemovedEvent/config.groovy:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPRLabelRemovedEvent
2 |
3 | import lib.FormTagLib;
4 |
5 | def f = namespace(FormTagLib);
6 |
7 | f.entry() {
8 | f.property(field: "label")
9 | }
10 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/events/impl/GitHubPRLabelRemovedEvent/help.html:
--------------------------------------------------------------------------------
1 |
2 | Triggers a build when the label or labels specified are removed from a
3 | pull request. Note that with multiple labels, all of the labels must be
4 | removed to cause the trigger to fire.
5 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/events/impl/GitHubPRNonMergeableEvent/config.groovy:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPRNonMergeableEvent
2 |
3 | import lib.FormTagLib;
4 |
5 | def f = namespace(FormTagLib);
6 |
7 | f.entry(field: "skip", title: "Skip building unmergable pull requests?") {
8 | f.checkbox()
9 | }
10 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/events/impl/GitHubPRNumber/config.groovy:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPRNumber
2 |
3 | import lib.FormTagLib;
4 |
5 | def f = namespace(FormTagLib);
6 |
7 | f.entry(field: "number", title: "PR Number") {
8 | f.number()
9 | }
10 |
11 | f.entry(field: "match", title: "Match number?") {
12 | f.checkbox()
13 | }
14 |
15 | f.entry(field: "skip", title: "Skip when matching?") {
16 | f.checkbox()
17 | }
18 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/events/impl/GitHubPRNumber/help-match.html:
--------------------------------------------------------------------------------
1 | Defines whether the pull request number in the trigger event must match to the above PR number.
2 | If not, then logic is not applied and the event wouldn't influence on the trigger result.
3 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/events/impl/GitHubPRNumber/help-number.html:
--------------------------------------------------------------------------------
1 | PR number to run additional checks against
2 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/events/impl/GitHubPRNumber/help-skip.html:
--------------------------------------------------------------------------------
1 | Defines whether a matching or non matching pull request number in the trigger event, depending on the above "Match number" flag, skips building instead of triggering a build.
2 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/events/impl/GitHubPROpenEvent/help.html:
--------------------------------------------------------------------------------
1 |
2 | Triggers a build of a pull request when the pull request is opened or reopened.
3 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/extra/GitHubPRLabelUnblockQueueCondition/config.groovy:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.extra.GitHubPRLabelUnblockQueueCondition
2 |
3 | import lib.FormTagLib;
4 |
5 | def f = namespace(FormTagLib);
6 |
7 | f.property(field: "label")
8 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/pipeline/SetCommitStatusStep/config.groovy:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.pipeline.SetCommitStatusStep
2 |
3 | import lib.FormTagLib;
4 |
5 | def f = namespace(FormTagLib);
6 |
7 |
8 | f.entry(title: _("Status context"), field: "context") {
9 | f.textbox()
10 | }
11 |
12 | f.entry(title: _("Status"), field: "state") {
13 | f.enum() {
14 | text(my.name().toLowerCase().capitalize())
15 | }
16 | }
17 |
18 | f.entry(title: _("Status message"), field: "message") {
19 | f.textarea()
20 | }
21 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/pipeline/SetCommitStatusStep/help-context.html:
--------------------------------------------------------------------------------
1 |
2 | A string label to differentiate this status from the status of other systems.
3 |
4 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/pipeline/SetCommitStatusStep/help-message.html:
--------------------------------------------------------------------------------
1 |
2 | A short detail message to add to the status
3 |
4 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/pipeline/SetCommitStatusStep/help-state.html:
--------------------------------------------------------------------------------
1 |
2 | State of the status indicating the progress or completion of the check.
3 |
4 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/pipeline/SetCommitStatusStep/help.html:
--------------------------------------------------------------------------------
1 |
2 | Sets the commit status of the commit that triggered a pull request build. Note that this
3 | step can only be used by builds that were triggered by a pull request.
4 |
5 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/publishers/impl/GitHubPRBuildStatusPublisher/BuildMessage/config.groovy:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.publishers.impl.GitHubPRBuildStatusPublisher.BuildMessage
2 |
3 | import lib.FormTagLib;
4 |
5 | def f = namespace(FormTagLib);
6 |
7 | f.entry(title: _("Build success message")) {
8 | f.property(field: "successMsg")
9 | }
10 |
11 | f.entry(title: _("Build failure message")) {
12 | f.property(field: "failureMsg")
13 | }
14 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/publishers/impl/GitHubPRBuildStatusPublisher/config.groovy:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.publishers.impl.GitHubPRBuildStatusPublisher;
2 |
3 | import org.jenkinsci.plugins.github.pullrequest.publishers.impl.GitHubPRBuildStatusPublisher
4 |
5 | def f = namespace(lib.FormTagLib);
6 |
7 | // Stapler doesn't produce default values, so recreate object
8 | if (instance == null) {
9 | instance = new GitHubPRBuildStatusPublisher();
10 | }
11 |
12 | f.optionalProperty(title: "Use only for builds with specific status", field: "statusVerifier")
13 |
14 | f.entry(title: _("Status message")) {
15 | f.property(field: "statusMsg")
16 | }
17 |
18 | f.entry(title: _("Mark unstable build in GitHub as "), field: "unstableAs") {
19 | f.enum() {
20 | text(my.name())
21 | }
22 | }
23 |
24 | f.optionalProperty(title: "Use messages in case of status setting failure", field: "buildMessage")
25 |
26 | f.optionalProperty(title: "Handle publisher errors", field: "errorHandler")
27 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/publishers/impl/GitHubPRBuildStatusPublisher/help-statusMsg.html:
--------------------------------------------------------------------------------
1 |
2 | Description message for GitHub status.
3 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/publishers/impl/GitHubPRClosePublisher/config.groovy:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.publishers.impl.GitHubPRClosePublisher
2 |
3 | import lib.FormTagLib;
4 |
5 | def f = namespace(FormTagLib);
6 |
7 | f.optionalProperty(title: "Use only for builds with specific status", field: "statusVerifier")
8 |
9 | f.optionalProperty(title: "Handle publisher errors", field: "errorHandler")
10 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/publishers/impl/GitHubPRCommentPublisher/config.groovy:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.publishers.impl.GitHubPRCommentPublisher
2 |
3 | import lib.FormTagLib;
4 | import org.jenkinsci.plugins.github.pullrequest.publishers.impl.GitHubPRCommentPublisher;
5 |
6 | def f = namespace(FormTagLib);
7 |
8 | // Stapler doesn't produce default values, so recreate object
9 | if (instance == null) {
10 | instance = new GitHubPRCommentPublisher();
11 | }
12 |
13 | f.optionalProperty(title: "Use only for builds with specific status", field: "statusVerifier")
14 |
15 | //f.entry(title:_("Comment content"), field:"comment"){
16 | f.property(field: "comment")
17 | //}
18 |
19 | f.optionalProperty(title: "Handle publisher errors", field: "errorHandler")
20 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/publishers/impl/GitHubPRLabelAddPublisher/config.groovy:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.publishers.impl.GitHubPRLabelAddPublisher
2 |
3 | import lib.FormTagLib
4 |
5 | def f = namespace(FormTagLib);
6 |
7 | f.optionalProperty(title: "Use only for builds with specific status", field: "statusVerifier")
8 |
9 | f.entry(title: _("Labels to add")) {
10 | f.property(field: "labelProperty")
11 | }
12 |
13 | f.optionalProperty(title: "Handle publisher errors", field: "errorHandler")
14 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/publishers/impl/GitHubPRLabelRemovePublisher/config.groovy:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.publishers.impl.GitHubPRLabelRemovePublisher
2 |
3 | import lib.FormTagLib
4 |
5 | def f = namespace(FormTagLib);
6 |
7 | f.optionalProperty(title: "Use only for builds with specific status", field: "statusVerifier")
8 |
9 | //f.entry(title:_("Labels to remove")) {
10 | f.property(field: "labelProperty")
11 | //}
12 |
13 | f.optionalProperty(title: "Handle publisher errors", field: "errorHandler")
14 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/restrictions/GitHubPRBranchRestriction/config.groovy:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.restrictions.GitHubPRBranchRestriction
2 |
3 | import lib.FormTagLib;
4 |
5 | def f = namespace(FormTagLib);
6 |
7 | f.entry(title: _("Whitelist Target Branches:"), field: "targetBranch") {
8 | f.expandableTextbox()
9 | }
10 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/restrictions/GitHubPRUserRestriction/config.groovy:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.restrictions.GitHubPRUserRestriction
2 |
3 | import lib.FormTagLib;
4 |
5 | def f = namespace(FormTagLib);
6 |
7 | f.entry(title: _("Organizations"), field: "orgs") {
8 | f.textarea()
9 | }
10 |
11 | f.entry(title: _("Users"), field: "users") {
12 | f.textarea()
13 | }
14 |
15 | //f.entry(title: _("Whitelist user msg"), field: "whitelistUserMsg") {
16 | // f.textbox(default: ".*add\\W+to\\W+whitelist.*")
17 | //}
18 |
19 | //f.entry(title: _("Organisations members as admins"),
20 | // field: "allowMembersOfWhitelistedOrgsAsAdmin") {
21 | // f.checkbox()
22 | //}
23 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/utils/PublisherErrorHandler/config.groovy:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.utils.PublisherErrorHandler
2 |
3 | import lib.FormTagLib;
4 |
5 | def f = namespace(FormTagLib);
6 |
7 | f.entry(title: _("If publisher failed mark build as "), field: "buildStatus") {
8 | f.select()
9 | }
10 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/resources/org/jenkinsci/plugins/github/pullrequest/utils/StatusVerifier/config.groovy:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.utils.StatusVerifier
2 |
3 | import lib.FormTagLib;
4 |
5 | def f = namespace(FormTagLib);
6 |
7 | f.entry(title: _("Run when build status is better or equal"), field: "buildStatus") {
8 | f.select()
9 | }
10 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/webapp/git-tag.svg:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/main/webapp/scripts/featureButton.js:
--------------------------------------------------------------------------------
1 | function callFeature(button, answerPlaceId, parameters) {
2 | fetch(button.action, {
3 | method: "post",
4 | headers: crumb.wrap({
5 | "Content-Type": "application/x-www-form-urlencoded",
6 | }),
7 | body: new URLSearchParams(parameters),
8 | }).then(rsp => {
9 | rsp.text().then((responseText) => {
10 | answerPlaceId.innerHTML = responseText;
11 | });
12 | });
13 | return false;
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/java/com/github/kostyasha/github/integration/branch/its/GitHubBranchTriggerITest.java:
--------------------------------------------------------------------------------
1 | package com.github.kostyasha.github.integration.branch.its;
2 |
3 | import hudson.model.FreeStyleProject;
4 | import hudson.tasks.Shell;
5 | import org.junit.Ignore;
6 | import org.junit.Test;
7 |
8 | import static org.jenkinsci.plugins.github_integration.junit.GHRule.getDefaultBranchTrigger;
9 | import static org.jenkinsci.plugins.github_integration.junit.GHRule.getPreconfiguredProperty;
10 |
11 | /**
12 | * @author Kanstantsin Shautsou
13 | */
14 | @Ignore
15 | public class GitHubBranchTriggerITest extends BranchITest {
16 | @Test
17 | public void freestyleTest() throws Exception {
18 | // create job
19 | FreeStyleProject job = jRule.createFreeStyleProject("freestyle-job");
20 |
21 | job.addProperty(getPreconfiguredProperty(ghRule.getGhRepo()));
22 |
23 | job.addTrigger(getDefaultBranchTrigger());
24 |
25 | job.getBuildersList().add(new Shell("env && sleep 2"));
26 |
27 | job.save();
28 |
29 | super.smokeTest(job);
30 | }
31 | }
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/java/com/github/kostyasha/github/integration/branch/test/InjectJenkinsMembersRule.java:
--------------------------------------------------------------------------------
1 | package com.github.kostyasha.github.integration.branch.test;
2 |
3 | import org.junit.rules.ExternalResource;
4 | import org.jvnet.hudson.test.JenkinsRule;
5 |
6 | /**
7 | * Helpful class to make possible usage of
8 | * {@code @Inject
9 | * public GitHubPluginConfig config;
10 | * }
11 | *
12 | * in test fields instead of static calls {@link org.jenkinsci.plugins.github.GitHubPlugin#configuration()}
13 | *
14 | * See {@link com.cloudbees.jenkins.GitHubSetCommitStatusBuilderTest} for example
15 | * Should be used after JenkinsRule initialized
16 | *
17 | * {@code public RuleChain chain = RuleChain.outerRule(jRule).around(new InjectJenkinsMembersRule(jRule, this)); }
18 | *
19 | * @author lanwen (Merkushev Kirill)
20 | */
21 | public class InjectJenkinsMembersRule extends ExternalResource {
22 |
23 | private JenkinsRule jRule;
24 | private Object instance;
25 |
26 | /**
27 | * @param jRule Jenkins rule
28 | * @param instance test class instance
29 | */
30 | public InjectJenkinsMembersRule(JenkinsRule jRule, Object instance) {
31 | this.jRule = jRule;
32 | this.instance = instance;
33 | }
34 |
35 | @Override
36 | protected void before() throws Throwable {
37 | jRule.getInstance().getInjector().injectMembers(instance);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/java/org/jenkinsci/plugins/github/pullrequest/data/GitHubPREnvTest.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.data;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.hamcrest.Matchers.startsWith;
6 | import static org.junit.Assert.assertThat;
7 |
8 | /**
9 | * @author lanwen (Merkushev Kirill)
10 | */
11 | public class GitHubPREnvTest {
12 |
13 | @Test
14 | public void shouldAddPrefixToStringVars() throws Exception {
15 | assertThat(GitHubPREnv.values()[0].param("value").getName(), startsWith(GitHubPREnv.PREFIX));
16 | }
17 |
18 | @Test
19 | public void shouldAddPrefixToBoolVars() throws Exception {
20 | assertThat(GitHubPREnv.values()[0].param(true).getName(), startsWith(GitHubPREnv.PREFIX));
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/java/org/jenkinsci/plugins/github/pullrequest/trigger/check/SkipFirstRunForPRFilterTest.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.trigger.check;
2 |
3 | import org.jenkinsci.plugins.github.pullrequest.util.TaskListenerWrapperRule;
4 | import org.junit.Rule;
5 | import org.junit.Test;
6 | import org.junit.runner.RunWith;
7 | import org.kohsuke.github.GHPullRequest;
8 | import org.mockito.junit.MockitoJUnitRunner;
9 |
10 | import static org.hamcrest.MatcherAssert.assertThat;
11 | import static org.hamcrest.Matchers.is;
12 | import static org.jenkinsci.plugins.github.pullrequest.trigger.check.SkipFirstRunForPRFilter.ifSkippedFirstRun;
13 |
14 | /**
15 | * @author lanwen (Merkushev Kirill)
16 | */
17 | @RunWith(MockitoJUnitRunner.class)
18 | public class SkipFirstRunForPRFilterTest {
19 |
20 | @Rule
21 | public TaskListenerWrapperRule tlRule = new TaskListenerWrapperRule();
22 |
23 | @Test
24 | public void shouldSkipIfFR() throws Exception {
25 | assertThat("skip", ifSkippedFirstRun(tlRule.getListener(), true).apply(new GHPullRequest()), is(false));
26 | }
27 |
28 | @Test
29 | public void shouldNotSkipIfNotSkipFR() throws Exception {
30 | assertThat("not skip", ifSkippedFirstRun(tlRule.getListener(), false).apply(new GHPullRequest()), is(true));
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/java/org/jenkinsci/plugins/github/pullrequest/trigger/check/SkippedCauseFilterTest.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.trigger.check;
2 |
3 | import org.jenkinsci.plugins.github.pullrequest.GitHubPRCause;
4 | import org.jenkinsci.plugins.github.pullrequest.util.TaskListenerWrapperRule;
5 | import org.junit.Rule;
6 | import org.junit.Test;
7 | import org.junit.runner.RunWith;
8 | import org.mockito.Mock;
9 | import org.mockito.junit.MockitoJUnitRunner;
10 |
11 | import static org.hamcrest.MatcherAssert.assertThat;
12 | import static org.hamcrest.Matchers.is;
13 | import static org.mockito.Mockito.when;
14 |
15 | /**
16 | * @author lanwen (Merkushev Kirill)
17 | */
18 | @RunWith(MockitoJUnitRunner.class)
19 | public class SkippedCauseFilterTest {
20 |
21 | @Mock
22 | private GitHubPRCause cause;
23 |
24 | @Rule
25 | public TaskListenerWrapperRule tlRule = new TaskListenerWrapperRule();
26 |
27 | @Test
28 | public void shouldSkip() throws Exception {
29 | when(cause.isSkip()).thenReturn(true);
30 | assertThat("skip", new SkippedCauseFilter(tlRule.getListener()).apply(cause), is(false));
31 | }
32 |
33 | @Test
34 | public void shouldNotSkip() throws Exception {
35 | when(cause.isSkip()).thenReturn(false);
36 | assertThat("not skip", new SkippedCauseFilter(tlRule.getListener()).apply(cause), is(true));
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/java/org/jenkinsci/plugins/github/pullrequest/util/TaskListenerWrapperRule.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.util;
2 |
3 | import org.jenkinsci.plugins.github.pullrequest.utils.LoggingTaskListenerWrapper;
4 | import org.junit.rules.TemporaryFolder;
5 |
6 | import static com.google.common.base.Charsets.UTF_8;
7 |
8 | /**
9 | * Rule with provides task listener with logging to file and to logger
10 | *
11 | * @author lanwen (Merkushev Kirill)
12 | */
13 | public class TaskListenerWrapperRule extends TemporaryFolder {
14 | LoggingTaskListenerWrapper listener;
15 |
16 | @Override
17 | protected void before() throws Throwable {
18 | super.before();
19 | listener = new LoggingTaskListenerWrapper(newFile(), UTF_8);
20 | }
21 |
22 | public LoggingTaskListenerWrapper getListener() {
23 | return listener;
24 | }
25 | }
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/java/org/jenkinsci/plugins/github/pullrequest/util/TestUtil.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github.pullrequest.util;
2 |
3 | import java.nio.charset.StandardCharsets;
4 | import org.apache.commons.io.IOUtils;
5 |
6 | import java.io.File;
7 | import java.io.IOException;
8 | import java.lang.reflect.Field;
9 |
10 | import static java.lang.String.format;
11 | import static org.apache.commons.lang3.ClassUtils.PACKAGE_SEPARATOR;
12 |
13 | public final class TestUtil {
14 | private TestUtil() {
15 | }
16 |
17 | public static Field getPrivateField(String fieldName, Class> clazz) throws NoSuchFieldException {
18 | Field field = clazz.getDeclaredField(fieldName);
19 | if (!field.isAccessible()) {
20 | field.setAccessible(true);
21 | }
22 | return field;
23 | }
24 |
25 | public static String classpath(Class> clazz, String path) {
26 | try {
27 | return IOUtils.toString(clazz.getClassLoader().getResourceAsStream(
28 | clazz.getName().replace(PACKAGE_SEPARATOR, File.separator) + File.separator + path
29 | ), StandardCharsets.UTF_8);
30 | } catch (IOException e) {
31 | throw new RuntimeException(format("Can't load %s for class %s", path, clazz), e);
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/java/org/jenkinsci/plugins/github_integration/awaitility/GHBranchAppeared.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github_integration.awaitility;
2 |
3 | import org.kohsuke.github.GHBranch;
4 | import org.kohsuke.github.GHRepository;
5 | import org.slf4j.Logger;
6 | import org.slf4j.LoggerFactory;
7 |
8 | import java.util.Map;
9 | import java.util.concurrent.Callable;
10 |
11 | import static java.lang.System.currentTimeMillis;
12 |
13 | /**
14 | * @author Kanstantsin Shautsou
15 | */
16 | public class GHBranchAppeared implements Callable {
17 | private static final Logger LOG = LoggerFactory.getLogger(GHPRAppeared.class);
18 |
19 | private final String branchName;
20 | private final GHRepository repository;
21 | private final long startTime;
22 |
23 | public GHBranchAppeared(final GHRepository repository, String branchName) {
24 | this.branchName = branchName;
25 | this.repository = repository;
26 | startTime = currentTimeMillis();
27 | }
28 |
29 | @Override
30 | public Boolean call() throws Exception {
31 | for (Map.Entry entry : repository.getBranches().entrySet()) {
32 | if (entry.getKey().equals(branchName)) {
33 | LOG.debug("[WAIT] appeared branch {}, delay {} ms", branchName, currentTimeMillis() - startTime);
34 | return true;
35 | }
36 | }
37 | LOG.debug("[WAIT] no Branch {}", branchName);
38 | return false;
39 | }
40 |
41 | public static GHBranchAppeared ghBranchAppeared(GHRepository repository, String branchName) {
42 | return new GHBranchAppeared(repository, branchName);
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/java/org/jenkinsci/plugins/github_integration/awaitility/GHFromServerConfigAppeared.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github_integration.awaitility;
2 |
3 | import org.jenkinsci.plugins.github.config.GitHubServerConfig;
4 | import org.kohsuke.github.GitHub;
5 | import org.slf4j.Logger;
6 | import org.slf4j.LoggerFactory;
7 |
8 | import java.util.concurrent.Callable;
9 |
10 | import static java.lang.System.currentTimeMillis;
11 | import static org.jenkinsci.plugins.github.config.GitHubServerConfig.loginToGithub;
12 | import static java.util.Objects.nonNull;
13 |
14 | /**
15 | * @author Kanstantsin Shautsou
16 | */
17 | public class GHFromServerConfigAppeared implements Callable {
18 | private static final Logger LOG = LoggerFactory.getLogger(GHFromServerConfigAppeared.class);
19 | private GitHubServerConfig gitHubServerConfig;
20 | final long timeBefore;
21 |
22 | public GHFromServerConfigAppeared(GitHubServerConfig gitHubServerConfig) {
23 | this.gitHubServerConfig = gitHubServerConfig;
24 | timeBefore = currentTimeMillis();
25 | }
26 |
27 | @Override
28 | public Boolean call() throws Exception {
29 | GitHub gitHub = loginToGithub().apply(gitHubServerConfig);
30 | if (nonNull(gitHub)) {
31 | LOG.debug("loginToGithub() delay {} ms.", currentTimeMillis() - timeBefore);
32 | return true;
33 | }
34 |
35 | throw new AssertionError("GitHub doesn't appear");
36 | }
37 |
38 | public static Callable ghAppeared(GitHubServerConfig gitHubServerConfig) {
39 | return new GHFromServerConfigAppeared(gitHubServerConfig);
40 | }
41 | }
42 |
43 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/java/org/jenkinsci/plugins/github_integration/awaitility/GHPRAppeared.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github_integration.awaitility;
2 |
3 | import org.kohsuke.github.GHIssueState;
4 | import org.kohsuke.github.GHPullRequest;
5 | import org.kohsuke.github.GHRepository;
6 | import org.slf4j.Logger;
7 | import org.slf4j.LoggerFactory;
8 |
9 | import java.util.concurrent.Callable;
10 |
11 | import static java.lang.System.currentTimeMillis;
12 |
13 | /**
14 | * @author Kanstantsin Shautsou
15 | */
16 | public class GHPRAppeared implements Callable {
17 | private static final Logger LOG = LoggerFactory.getLogger(GHPRAppeared.class);
18 |
19 | private final GHPullRequest pullRequest;
20 | private final GHRepository repository;
21 | private final long startTime;
22 |
23 | public GHPRAppeared(final GHPullRequest pullRequest) {
24 | this.pullRequest = pullRequest;
25 | repository = pullRequest.getRepository();
26 | startTime = currentTimeMillis();
27 | }
28 |
29 | @Override
30 | public Boolean call() throws Exception {
31 | for (GHPullRequest pr : repository.listPullRequests(GHIssueState.OPEN)) {
32 | if (pr.getNumber() == pullRequest.getNumber()) {
33 | LOG.debug("[WAIT] appeared PR {}, delay {} ms", pullRequest.getNumber(), currentTimeMillis() - startTime);
34 | return true;
35 | }
36 | }
37 | LOG.debug("[WAIT] no PR {}", pullRequest.getNumber());
38 | return false;
39 | }
40 |
41 | public static GHPRAppeared ghPRAppeared(GHPullRequest pullRequest) {
42 | return new GHPRAppeared(pullRequest);
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/java/org/jenkinsci/plugins/github_integration/awaitility/GHRepoAppeared.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github_integration.awaitility;
2 |
3 | import org.kohsuke.github.GHRepository;
4 | import org.kohsuke.github.GitHub;
5 | import org.slf4j.Logger;
6 | import org.slf4j.LoggerFactory;
7 |
8 | import java.io.FileNotFoundException;
9 | import java.util.concurrent.Callable;
10 |
11 | import static java.util.Objects.isNull;
12 | import static java.util.Objects.nonNull;
13 |
14 | /**
15 | * @author Kanstantsin Shautsou
16 | */
17 | public class GHRepoAppeared implements Callable {
18 | private static final Logger LOG = LoggerFactory.getLogger(GHRepoAppeared.class);
19 |
20 | private final GitHub gitHub;
21 | private final String repoName;
22 |
23 | public GHRepoAppeared(final GitHub gitHub, final String repoName) {
24 | this.gitHub = gitHub;
25 | this.repoName = repoName;
26 | }
27 |
28 | @Override
29 | public Boolean call() throws Exception {
30 | GHRepository repository = null;
31 | try {
32 | repository = gitHub.getRepository(repoName);
33 | } catch (FileNotFoundException ignore) {
34 | }
35 | LOG.debug("[WAIT] GitHub repository '{}' {}", repoName, isNull(repository) ? "doesn't appeared" : "appeared");
36 | return nonNull(repository);
37 | }
38 |
39 | public static Callable ghRepoAppeared(final GitHub gitHub, final String repoName) {
40 | return new GHRepoAppeared(gitHub, repoName);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/java/org/jenkinsci/plugins/github_integration/awaitility/GHRepoDeleted.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github_integration.awaitility;
2 |
3 | import org.kohsuke.github.GHRepository;
4 | import org.kohsuke.github.GitHub;
5 | import org.slf4j.Logger;
6 | import org.slf4j.LoggerFactory;
7 |
8 | import java.io.FileNotFoundException;
9 | import java.util.concurrent.Callable;
10 |
11 | import static java.util.Objects.isNull;
12 |
13 | /**
14 | * @author Kanstantsin Shautsou
15 | */
16 | public class GHRepoDeleted implements Callable {
17 | private static final Logger LOG = LoggerFactory.getLogger(GHRepoDeleted.class);
18 |
19 | private GitHub gitHub;
20 | private String repoName;
21 |
22 | public GHRepoDeleted(final GitHub gitHub, final String repoName) {
23 | this.gitHub = gitHub;
24 | this.repoName = repoName;
25 | }
26 |
27 | @Override
28 | public Boolean call() throws Exception {
29 | GHRepository repository;
30 | try {
31 | repository = gitHub.getRepository(repoName);
32 | } catch (FileNotFoundException ignore) {
33 | LOG.debug("[WAIT] GitHub repository '{}' doesn't found", repoName);
34 | return true;
35 | }
36 |
37 | LOG.debug("[WAIT] GitHub repository '{}' {}", repoName, isNull(repository) ? "doesn't found" : "exists");
38 | return isNull(repository);
39 | }
40 |
41 | public static Callable ghRepoDeleted(final GitHub gitHub, final String repoName) {
42 | return new GHRepoDeleted(gitHub, repoName);
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/java/org/jenkinsci/plugins/github_integration/hamcrest/CommitStatusMatcher.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github_integration.hamcrest;
2 |
3 | //import org.hamcrest.Factory;
4 | import org.hamcrest.FeatureMatcher;
5 | import org.hamcrest.Matcher;
6 | import org.kohsuke.github.GHCommitState;
7 | import org.kohsuke.github.GHCommitStatus;
8 |
9 | import static org.hamcrest.core.Is.is;
10 |
11 | /**
12 | * @author Kanstantsin Shautsou
13 | */
14 | public class CommitStatusMatcher extends FeatureMatcher {
15 | private String context;
16 | private GHCommitState state;
17 | private String description;
18 |
19 | public CommitStatusMatcher(Matcher super Boolean> subMatcher,
20 | String context,
21 | GHCommitState state,
22 | String description) {
23 | super(subMatcher, "", "");
24 | this.context = context;
25 | this.state = state;
26 | this.description = description;
27 | }
28 |
29 | @Override
30 | protected Boolean featureValueOf(GHCommitStatus commitStatus) {
31 | return commitStatus.getState().equals(state) &&
32 | commitStatus.getContext().equals(context) &&
33 | commitStatus.getDescription().equals(description);
34 | }
35 |
36 | //@Factory
37 | public static CommitStatusMatcher commitStatus(String context,
38 | GHCommitState state,
39 | String description) {
40 | return new CommitStatusMatcher(is(true), context, state, description);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/java/org/jenkinsci/plugins/github_integration/its/FreestyleITest.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github_integration.its;
2 |
3 | import hudson.model.FreeStyleProject;
4 | import hudson.tasks.Shell;
5 | import org.jenkinsci.plugins.github.pullrequest.GitHubPRMessage;
6 | import org.jenkinsci.plugins.github.pullrequest.builders.GitHubPRStatusBuilder;
7 | import org.jenkinsci.plugins.github.pullrequest.publishers.impl.GitHubPRBuildStatusPublisher;
8 | import org.jenkinsci.plugins.github.pullrequest.publishers.impl.GitHubPRCommentPublisher;
9 | import org.junit.Ignore;
10 | import org.junit.Test;
11 |
12 | import static org.jenkinsci.plugins.github_integration.junit.GHRule.getPreconfiguredProperty;
13 | import static org.jenkinsci.plugins.github_integration.junit.GHRule.getPreconfiguredPRTrigger;
14 |
15 | /**
16 | * @author Kanstantsin Shautsou
17 | */
18 | @Ignore
19 | public class FreestyleITest extends AbstractPRTest {
20 |
21 | @Test
22 | public void freestyleTest() throws Exception {
23 | // create job
24 | FreeStyleProject job = jRule.createFreeStyleProject("freestyle-job");
25 |
26 | job.addProperty(getPreconfiguredProperty(ghRule.getGhRepo()));
27 |
28 | job.addTrigger(getPreconfiguredPRTrigger());
29 |
30 | job.getBuildersList().add(new GitHubPRStatusBuilder());
31 | job.getBuildersList().add(new Shell("sleep 10"));
32 |
33 | job.getPublishersList().add(new GitHubPRBuildStatusPublisher());
34 | job.getPublishersList().add(new GitHubPRCommentPublisher(new GitHubPRMessage("Comment"), null, null));
35 |
36 | job.save();
37 |
38 | super.basicTest(job);
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/java/org/jenkinsci/plugins/github_integration/its/WorkflowFailTest.java:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github_integration.its;
2 |
3 | import org.jenkinsci.plugins.workflow.job.WorkflowJob;
4 | import org.junit.Ignore;
5 | import org.junit.Rule;
6 | import org.junit.Test;
7 | import org.jvnet.hudson.test.JenkinsRule;
8 | import org.jvnet.hudson.test.recipes.WithTimeout;
9 | import org.slf4j.Logger;
10 | import org.slf4j.LoggerFactory;
11 |
12 | /**
13 | * @author Kanstantsin Shautsou
14 | */
15 | @Ignore(value = "Test class")
16 | public class WorkflowFailTest {
17 |
18 | private static final Logger LOG = LoggerFactory.getLogger(WorkflowFailTest.class);
19 |
20 | @Rule
21 | public JenkinsRule j = new JenkinsRule();
22 |
23 | @WithTimeout(value = 0)
24 | @Test
25 | public void testWFHSError() throws Exception {
26 | final WorkflowJob workflow = j.getInstance().createProject(WorkflowJob.class, "workflow");
27 | workflow.save();
28 | LOG.info(workflow.getAbsoluteUrl());
29 | j.configRoundtrip(workflow); // fails
30 | // j.pause();
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/resources/checkstyle/checkstyle-suppressions.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/resources/com/github/kostyasha/github/integration/branch/GitHubBranchTriggerTest/actualiseRepo/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/resources/com/github/kostyasha/github/integration/branch/GitHubBranchTriggerTest/actualiseRepo/jobs/project/com.github.kostyasha.github.integration.branch.GitHubBranchRepository.runtime.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | KostyaSha-auto/test
4 | https://github.com/KostyaSha-auto/test/
5 | git://github.com/KostyaSha-auto/test.git
6 | git@github.com:KostyaSha-auto/test.git
7 |
8 |
9 | old-repo
10 |
11 | old-repo
12 | 6dcb09b5b57875f334f61aebed695e2e4193fffb
13 | https://github.com/KostyaSha-auto/test/tree/old-repo
14 |
15 |
16 |
17 | old-branch
18 |
19 | old-branch
20 | 6dcb09b5b57875f334f61aebed695e2e4193ffbe
21 | https://github.com/KostyaSha-auto/test/tree/old-branch
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/resources/com/github/kostyasha/github/integration/branch/GitHubBranchTriggerTest/actualiseRepo/jobs/project/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | false
4 |
5 |
6 | https://github.com/KostyaSha-auto/test/
7 |
8 |
9 |
10 | false
11 | false
12 | false
13 | false
14 |
15 |
16 |
17 | CRON
18 | false
19 | false
20 | false
21 |
22 |
23 |
24 |
25 | false
26 |
27 |
28 | false
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/resources/com/github/kostyasha/github/integration/branch/GitHubBranchTriggerTest/buildButtonsPerms/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/resources/com/github/kostyasha/github/integration/branch/GitHubBranchTriggerTest/buildButtonsPerms/jobs/project/com.github.kostyasha.github.integration.branch.GitHubBranchRepository.runtime.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | for-removal
6 |
7 | for-removal
8 | 6dcb09b5b57875f334f61aebed695e2e4193fffe
9 | http://localhost/org/repo/tree/for-removal
10 |
11 |
12 |
13 | should-change
14 |
15 | should-change
16 | 6dcb09b5b57875f334f61aebed695e2e4193ffbb
17 | http://localhost/org/repo/tree/should-change
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/resources/com/github/kostyasha/github/integration/branch/GitHubBranchTriggerTest/buildButtonsPerms/jobs/project/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | false
4 |
5 |
6 | http://localhost/org/repo/
7 |
8 |
9 |
10 | false
11 | false
12 | false
13 | false
14 |
15 |
16 |
17 | CRON
18 | false
19 | false
20 | false
21 |
22 |
23 |
24 |
25 | false
26 |
27 |
28 | false
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/resources/com/github/kostyasha/github/integration/branch/GitHubBranchTriggerTest/someTest/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/resources/com/github/kostyasha/github/integration/branch/GitHubBranchTriggerTest/someTest/jobs/project/com.github.kostyasha.github.integration.branch.GitHubBranchRepository.runtime.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | org/repo
4 | http://localhost/org/repo
5 | git://localhost/org/repo.git
6 | git@localhost:org/repo.git
7 |
8 |
9 | for-removal
10 |
11 | for-removal
12 | 6dcb09b5b57875f334f61aebed695e2e4193fffe
13 | http://localhost/org/repo/tree/for-removal
14 |
15 |
16 |
17 | should-change
18 |
19 | should-change
20 | 6dcb09b5b57875f334f61aebed695e2e4193ffbb
21 | http://localhost/org/repo/tree/should-change
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/resources/com/github/kostyasha/github/integration/branch/test/GHMockRule/branch-should-change.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "should-change",
3 | "commit": {
4 | "sha": "6dcb09b5b57875f334f61aebed695e2e4193ffgg",
5 | "commit": {
6 | "url": "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193ffgg",
7 | "message": "Merge pull request #6 from Spaceghost/patch-1\n\nNew line at end of file."
8 | },
9 | "url": "https://api.github.com/repos/octocat/Hello-World/commits/7fd1a60b01f91b314f59955a4e4d4e80d8edf11d",
10 | "committer": {
11 | "gravatar_id": "",
12 | "avatar_url": "https://secure.gravatar.com/avatar/7ad39074b0584bc555d0417ae3e7d974?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
13 | "url": "https://api.github.com/users/octocat",
14 | "id": 583231,
15 | "login": "octocat"
16 | }
17 | },
18 | "protected": true,
19 | "protection_url": "https://api.github.com/repos/octocat/Hello-World/branches/should-change/protection"
20 | }
21 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/resources/com/github/kostyasha/github/integration/branch/test/GHMockRule/org-repo-branches.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "name": "new-branch",
4 | "commit": {
5 | "sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
6 | "url": "https://api.github.com/repos/octocat/Hello-World/commits/c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc"
7 | },
8 | "protected": true,
9 | "protection_url": "https://api.github.com/repos/octocat/Hello-World/branches/new-branch/protection"
10 | },
11 | {
12 | "name": "should-change",
13 | "commit": {
14 | "sha": "6dcb09b5b57875f334f61aebed695e2e4193ffgg",
15 | "url": "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193ffgg"
16 | },
17 | "protected": true,
18 | "protection_url": "https://api.github.com/repos/octocat/Hello-World/branches/should-change/protection"
19 | }
20 | ]
21 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/resources/com/github/kostyasha/github/integration/branch/test/GHMockRule/user.json:
--------------------------------------------------------------------------------
1 | {
2 | "login": "login",
3 | "id": 2341,
4 | "avatar_url": "",
5 | "gravatar_id": "",
6 | "url": "https://api.github.com/users/login",
7 | "html_url": "https://github.com/login",
8 | "followers_url": "https://api.github.com/users/login/followers",
9 | "following_url": "https://api.github.com/users/login/following{/other_user}",
10 | "gists_url": "https://api.github.com/users/login/gists{/gist_id}",
11 | "starred_url": "https://api.github.com/users/login/starred{/owner}{/repo}",
12 | "subscriptions_url": "https://api.github.com/users/login/subscriptions",
13 | "organizations_url": "https://api.github.com/users/login/orgs",
14 | "repos_url": "https://api.github.com/users/login/repos",
15 | "events_url": "https://api.github.com/users/login/events{/privacy}",
16 | "received_events_url": "https://api.github.com/users/login/received_events",
17 | "type": "User",
18 | "site_admin": false,
19 | "name": "User",
20 | "company": "Company",
21 | "blog": "http://blog.blog",
22 | "location": "Location",
23 | "email": null,
24 | "hireable": null,
25 | "bio": null,
26 | "public_repos": 1,
27 | "public_gists": 1,
28 | "followers": 1,
29 | "following": 1,
30 | "created_at": "2012-07-12T16:12:59Z",
31 | "updated_at": "2015-10-05T08:55:34Z",
32 | "private_gists": 1,
33 | "total_private_repos": 0,
34 | "owned_private_repos": 0,
35 | "disk_usage": 10,
36 | "collaborators": 0,
37 | "plan": {
38 | "name": "free",
39 | "space": 976562499,
40 | "collaborators": 0,
41 | "private_repos": 0
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/resources/dsl/branch-jobdsl.groovy:
--------------------------------------------------------------------------------
1 | freeStyleJob('gh-branch') {
2 |
3 | triggers {
4 | onBranch {
5 | setPreStatus()
6 | cancelQueued()
7 |
8 | mode {
9 | cron()
10 | heavyHooks()
11 | heavyHooksCron()
12 | }
13 |
14 | repoProviders {
15 | gitHubPlugin {
16 | manageHooks(false)
17 | cacheConnection(false)
18 | permission { pull() }
19 | }
20 | }
21 |
22 | events {
23 |
24 | branchRestriction {
25 | matchCritieria('master')
26 | matchCritieria('other')
27 | }
28 |
29 | commitChecks {
30 | commitMessagePattern {
31 | excludeMatching()
32 | matchCritieria('^(?s)\\[(release|unleash)\\-maven\\-plugin\\].*')
33 | }
34 | }
35 |
36 | created()
37 | hashChanged()
38 | deleted()
39 | }
40 |
41 | whitelistedBranches('master')
42 | }
43 |
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/resources/invalidConfig/org.jenkinsci.plugins.github.pullrequest.GitHubPRRepository.runtime.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/resources/logback.groovy_:
--------------------------------------------------------------------------------
1 | import ch.qos.logback.classic.encoder.PatternLayoutEncoder
2 | import ch.qos.logback.core.ConsoleAppender
3 |
4 | import static ch.qos.logback.classic.Level.DEBUG
5 | import static ch.qos.logback.classic.Level.INFO
6 |
7 | appender("STDOUT", ConsoleAppender) {
8 | encoder(PatternLayoutEncoder) {
9 | pattern = "%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n"
10 | }
11 | }
12 |
13 | logger("org.jenkinsci.plugins.github", DEBUG)
14 | logger("org.jenkinsci.plugins.github_integration", DEBUG)
15 |
16 | root(INFO, ["STDOUT"])
17 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 | %d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRTriggerMockTest/actualiseRepo/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRTriggerMockTest/actualiseRepo/jobs/project/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | false
6 |
7 |
8 | https://localhost/org/old-repo/
9 | display-name
10 |
11 |
12 |
13 | true
14 | false
15 | false
16 | false
17 |
18 |
19 |
20 | HEAVY_HOOKS
21 |
22 |
23 |
24 |
25 | false
26 | false
27 | false
28 |
29 |
30 | false
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRTriggerMockTest/actualiseRepo/jobs/project/org.jenkinsci.plugins.github.pullrequest.GitHubPRRepository.runtime.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | org/old-repo
4 | https://localhost/org/old-repo/
5 | git://localhost/org/old-repo.git
6 | git@localhost:org/old-repo.git
7 |
8 |
9 | 1
10 |
11 | 1
12 | 2016-04-18 06:53:41.0 UTC
13 | Update README.md
14 | 2016-04-18 06:53:41.0 UTC
15 | 65d0f7818009811e5d5eb703ebad38bbcc816b49
16 | KostyaSha-auto-patch-1
17 | true
18 | master
19 | KostyaSha-auto
20 | https://localhost/org/old-repo/pull/1
21 | 2016-04-18 06:53:41.0 UTC
22 | KostyaSha-auto
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRTriggerMockTest/badStatePR/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRTriggerMockTest/badStatePR/jobs/test-job/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | false
6 |
7 |
8 | https://localhost/org/repo/
9 | display-name
10 |
11 |
12 |
13 | true
14 | false
15 | false
16 | false
17 |
18 |
19 |
20 | HEAVY_HOOKS
21 |
22 |
23 |
24 |
25 | false
26 | false
27 | false
28 |
29 |
30 | false
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRTriggerMockTest/badStatePR/jobs/test-job/org.jenkinsci.plugins.github.pullrequest.GitHubPRRepository.runtime.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | org/repo
4 | https://localhost/org/repo/
5 | git://localhost/org/repo.git
6 | git@localhost:org/repo.git
7 |
8 |
9 | 1
10 |
11 | 1
12 | 2016-04-18 06:53:41.0 UTC
13 | Update README.md
14 | 2016-04-18 06:53:41.0 UTC
15 | 65d0f7818009811e5d5eb703ebad38bbcc816b49
16 | KostyaSha-auto-patch-1
17 | true
18 | master
19 | KostyaSha-auto
20 | https://localhost/org/repo/pull/1
21 | 2016-04-18 06:53:41.0 UTC
22 | KostyaSha-auto
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRTriggerTest/buildButtonsPerms/jobs/project/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | false
6 |
7 |
8 | https://localhost.localdomain/KostyaSha-auto/test/
9 | display-name
10 |
11 |
12 |
13 | true
14 | false
15 | false
16 | false
17 |
18 |
19 |
20 | CRON
21 |
22 |
23 |
24 |
25 | false
26 | false
27 | false
28 |
29 |
30 | false
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRTriggerTest/buildButtonsPerms/jobs/project/org.jenkinsci.plugins.github.pullrequest.GitHubPRRepository.runtime.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | KostyaSha-auto/test
4 | https://github.com/KostyaSha-auto/test/
5 | git://github.com/KostyaSha-auto/test.git
6 | git@github.com:KostyaSha-auto/test.git
7 |
8 |
9 | 1
10 |
11 | 1
12 | 2016-04-18 06:53:41.0 UTC
13 | Update README.md
14 | 2016-04-18 06:53:41.0 UTC
15 | 65d0f7818009811e5d5eb703ebad38bbcc816b49
16 | KostyaSha-auto-patch-1
17 | true
18 | master
19 | KostyaSha-auto
20 | https://github.com/KostyaSha-auto/test/pull/1
21 |
22 | 2016-04-18 06:53:41.0 UTC
23 | KostyaSha-auto
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/resources/org/jenkinsci/plugins/github/pullrequest/GitHubPRTriggerTest/ensureOldValid/jobs/test-job/org.jenkinsci.plugins.github.pullrequest.GitHubPRRepository.runtime.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | KostyaSha-auto/test
4 | https://github.com/KostyaSha-auto/test/
5 | git://github.com/KostyaSha-auto/test.git
6 | git@github.com:KostyaSha-auto/test.git
7 |
8 |
9 | 1
10 |
11 | 1
12 | 2016-04-18 06:53:41.0 UTC
13 | Update README.md
14 | 2016-04-18 06:53:41.0 UTC
15 | 65d0f7818009811e5d5eb703ebad38bbcc816b49
16 | KostyaSha-auto-patch-1
17 | true
18 | master
19 | KostyaSha-auto
20 | https://github.com/KostyaSha-auto/test/pull/1
21 |
22 | 2016-04-18 06:53:41.0 UTC
23 | KostyaSha-auto
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/resources/org/jenkinsci/plugins/github_integration/its/WorkflowITest/testContextStatuses.groovy:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github_integration.its.WorkflowITest
2 |
3 |
4 | try {
5 | setGitHubPullRequestStatus state: 'PENDING', context: 'custom-context1', message: "Run #${env.BUILD_NUMBER} started"
6 | setGitHubPullRequestStatus state: 'PENDING', context: 'custom-context2', message: "Run #${env.BUILD_NUMBER} started"
7 |
8 | node('master') {
9 | step([
10 | $class : 'GitHubPRStatusBuilder',
11 | statusMessage: [
12 | content: "Run #${env.BUILD_NUMBER} started"
13 | ]
14 | ])
15 |
16 | sh 'sleep 10 && env'
17 |
18 | setGitHubPullRequestStatus state: 'SUCCESS', context: 'custom-context1', message: 'Tests passed'
19 | setGitHubPullRequestStatus state: 'SUCCESS', context: 'custom-context2', message: 'Tests passed'
20 | step([
21 | $class : 'GitHubPRBuildStatusPublisher',
22 | statusMsg : [
23 | content: 'Run #${BUILD_NUMBER} ended normally'
24 | ],
25 | unstableAs: 'FAILURE'
26 | ])
27 | }
28 | } catch (Exception e) {
29 | setGitHubPullRequestStatus state: 'FAILURE', context: 'custom-context1', message: 'Some tests failed'
30 | setGitHubPullRequestStatus state: 'FAILURE', context: 'custom-context2', message: 'Some tests failed'
31 | throw e
32 | }
33 |
--------------------------------------------------------------------------------
/github-pullrequest-plugin/src/test/resources/org/jenkinsci/plugins/github_integration/its/WorkflowITest/workflowTest.groovy:
--------------------------------------------------------------------------------
1 | package org.jenkinsci.plugins.github_integration.its.WorkflowITest
2 |
3 | node('master') {
4 | step([
5 | $class : 'GitHubPRStatusBuilder',
6 | statusMessage: [
7 | content: "Build #${env.BUILD_NUMBER} started"
8 | ]
9 | ])
10 | //
11 | // checkout([
12 | // $class: 'GitSCM',
13 | // branches: [[name: "origin-pull/pull/${GITHUB_PR_NUMBER}/merge"]],
14 | // doGenerateSubmoduleConfigurations: false,
15 | // extensions: [],
16 | // submoduleCfg: [],
17 | // userRemoteConfigs: [
18 | // [
19 | // credentialsId: 'df5e384b-e836-42a0-b5cc-445e88ac6700',
20 | // name: 'origin-pull',
21 | // refspec: "+refs/pull/${GITHUB_PR_NUMBER}/merge:refs/remotes/origin-pull/pull/${GITHUB_PR_NUMBER}/merge",
22 | // url: 'git://github.com/KostyaSha/test-repo.git'
23 | // ]
24 | // ]
25 | // ])
26 |
27 | sh 'sleep 10 && env'
28 | step([
29 | $class : 'GitHubPRBuildStatusPublisher',
30 | statusMsg : [
31 | content: 'Build #${BUILD_NUMBER} ended'
32 | ],
33 | unstableAs: 'FAILURE'
34 | ])
35 | }
36 |
--------------------------------------------------------------------------------
/travis.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -e
4 | set -o pipefail
5 |
6 | #sudo apt-get update && sudo apt-get install oracle-java8-installer
7 | java -version
8 |
9 | ./mvnw -v
10 | ./mvnw -Dignore.random.failures=true clean verify -Ptravis | grep -v Download
11 |
--------------------------------------------------------------------------------