diff --git a/build.gradle b/build.gradle index c39bc07a..60d79815 100644 --- a/build.gradle +++ b/build.gradle @@ -128,7 +128,7 @@ jacocoTestReport { } } -String version = '7.0.1' +String version = '7.1.0' task updateVersion { doLast { diff --git a/tests/jenkins/TestCloseGithubIssue.groovy b/tests/jenkins/TestCloseGithubIssue.groovy index dddff6c2..d589cc93 100644 --- a/tests/jenkins/TestCloseGithubIssue.groovy +++ b/tests/jenkins/TestCloseGithubIssue.groovy @@ -29,8 +29,7 @@ class TestCloseGithubIssue extends BuildPipelineTest { this.registerLibTester(new CloseGithubIssueLibTester( 'https://github.com/opensearch-project/opensearch-build', 'Test GH issue title', - 'Test GH issue close comment', - 'label101', + 'Test GH issue close comment' )) super.testPipeline("tests/jenkins/jobs/CloseGithubIssue_JenkinsFile") assertThat(getCommands('sh', 'script'), hasItem("{script=gh issue list --repo https://github.com/opensearch-project/opensearch-build -S \"Test GH issue title in:title\" --json number --jq '.[0].number', returnStdout=true}")) diff --git a/tests/jenkins/jobs/CloseGithubIssue_JenkinsFile b/tests/jenkins/jobs/CloseGithubIssue_JenkinsFile index e8e31301..414141cf 100644 --- a/tests/jenkins/jobs/CloseGithubIssue_JenkinsFile +++ b/tests/jenkins/jobs/CloseGithubIssue_JenkinsFile @@ -16,8 +16,7 @@ pipeline { closeGithubIssue( repoUrl: 'https://github.com/opensearch-project/opensearch-build', issueTitle: 'Test GH issue title', - closeComment: 'Test GH issue close comment', - label: 'label101' + closeComment: 'Test GH issue close comment' ) } } diff --git a/tests/jenkins/jobs/CloseGithubIssue_JenkinsFile.txt b/tests/jenkins/jobs/CloseGithubIssue_JenkinsFile.txt index b636bc40..192e25dd 100644 --- a/tests/jenkins/jobs/CloseGithubIssue_JenkinsFile.txt +++ b/tests/jenkins/jobs/CloseGithubIssue_JenkinsFile.txt @@ -3,7 +3,7 @@ CloseGithubIssue_JenkinsFile.echo(Executing on agent [label:none]) CloseGithubIssue_JenkinsFile.stage(closeGithubIssue, groovy.lang.Closure) CloseGithubIssue_JenkinsFile.script(groovy.lang.Closure) - CloseGithubIssue_JenkinsFile.closeGithubIssue({repoUrl=https://github.com/opensearch-project/opensearch-build, issueTitle=Test GH issue title, closeComment=Test GH issue close comment, label=label101}) + CloseGithubIssue_JenkinsFile.closeGithubIssue({repoUrl=https://github.com/opensearch-project/opensearch-build, issueTitle=Test GH issue title, closeComment=Test GH issue close comment}) closeGithubIssue.usernamePassword({credentialsId=jenkins-github-bot-token, passwordVariable=GITHUB_TOKEN, usernameVariable=GITHUB_USER}) closeGithubIssue.withCredentials([[GITHUB_USER, GITHUB_TOKEN]], groovy.lang.Closure) closeGithubIssue.sh({script=gh issue list --repo https://github.com/opensearch-project/opensearch-build -S "Test GH issue title in:title" --json number --jq '.[0].number', returnStdout=true}) diff --git a/tests/jenkins/jobs/UpdateBuildFailureIssue_Jenkinsfile.txt b/tests/jenkins/jobs/UpdateBuildFailureIssue_Jenkinsfile.txt index f3b404d9..7bb4d57a 100644 --- a/tests/jenkins/jobs/UpdateBuildFailureIssue_Jenkinsfile.txt +++ b/tests/jenkins/jobs/UpdateBuildFailureIssue_Jenkinsfile.txt @@ -60,7 +60,7 @@ ccc --repo https://github.com/opensearch-project/asynchronous-search.git --body Checkout the [wiki](https://github.com/opensearch-project/opensearch-build/wiki/Building-an-OpenSearch-and-OpenSearch-Dashboards-Distribution) to reproduce the failure locally.", returnStdout=true}) updateBuildFailureIssues.sleep({time=3, unit=SECONDS}) updateBuildFailureIssues.closeGithubIssue({repoUrl=https://github.com/opensearch-project/sql.git, issueTitle=[AUTOCUT] Distribution Build Failed for sql-2.2.0, closeComment=Closing the issue as the distribution build for sql has passed for version: **2.2.0**. - Please see build log at www.example.com/job/build_url/32/display/redirect, label=autocut,v2.2.0}) + Please see build log at www.example.com/job/build_url/32/display/redirect}) closeGithubIssue.usernamePassword({credentialsId=jenkins-github-bot-token, passwordVariable=GITHUB_TOKEN, usernameVariable=GITHUB_USER}) closeGithubIssue.withCredentials([[GITHUB_USER, GITHUB_TOKEN]], groovy.lang.Closure) closeGithubIssue.sh({script=gh issue list --repo https://github.com/opensearch-project/sql.git -S "[AUTOCUT] Distribution Build Failed for sql-2.2.0 in:title" --json number --jq '.[0].number', returnStdout=true}) diff --git a/tests/jenkins/lib-testers/CloseGithubIssueLibTester.groovy b/tests/jenkins/lib-testers/CloseGithubIssueLibTester.groovy index 9ef114e2..dadd0505 100644 --- a/tests/jenkins/lib-testers/CloseGithubIssueLibTester.groovy +++ b/tests/jenkins/lib-testers/CloseGithubIssueLibTester.groovy @@ -15,13 +15,11 @@ class CloseGithubIssueLibTester extends LibFunctionTester { private String repoUrl private String issueTitle private String closeComment - private String label - public CloseGithubIssueLibTester(repoUrl, issueTitle, closeComment, label){ + public CloseGithubIssueLibTester(repoUrl, issueTitle, closeComment){ this.repoUrl = repoUrl this.issueTitle = issueTitle this.closeComment = closeComment - this.label = label } @@ -35,13 +33,11 @@ class CloseGithubIssueLibTester extends LibFunctionTester { assertThat(call.args.repoUrl.first(), notNullValue()) assertThat(call.args.issueTitle.first(), notNullValue()) assertThat(call.args.closeComment.first(), notNullValue()) - assertThat(call.args.label.first(), notNullValue()) } @Override boolean expectedParametersMatcher(Object call) { - return call.args.label.first().equals(this.label) - && call.args.repoUrl.first().equals(this.repoUrl) + return call.args.repoUrl.first().equals(this.repoUrl) && call.args.issueTitle.first().equals(this.issueTitle) && call.args.closeComment.first().equals(this.closeComment) } diff --git a/vars/closeGithubIssue.groovy b/vars/closeGithubIssue.groovy index 2cc7c481..b6868573 100644 --- a/vars/closeGithubIssue.groovy +++ b/vars/closeGithubIssue.groovy @@ -12,10 +12,8 @@ @param args.repoUrl - GitHub repository URL to create issue @param args.issueTitle - GitHub issue title @param args.closeComment - GitHub issue leave a closing comment - @param args.label - GitHub issue label to be attached along with 'untriaged'. Defaults to autocut. */ void call(Map args = [:]) { - label = args.label ?: 'autocut' try { withCredentials([usernamePassword(credentialsId: 'jenkins-github-bot-token', passwordVariable: 'GITHUB_TOKEN', usernameVariable: 'GITHUB_USER')]) { def issuesNumber = sh( diff --git a/vars/updateBuildFailureIssues.groovy b/vars/updateBuildFailureIssues.groovy index 05049978..6389d867 100644 --- a/vars/updateBuildFailureIssues.groovy +++ b/vars/updateBuildFailureIssues.groovy @@ -70,8 +70,7 @@ void call(Map args = [:]) { closeGithubIssue( repoUrl: component.repository, issueTitle: "[AUTOCUT] Distribution Build Failed for ${component.name}-${currentVersion}", - closeComment: ghIssueBody, - label: "autocut,v${currentVersion}" + closeComment: ghIssueBody ) sleep(time:3, unit:'SECONDS') }