From 73d88c2093626a7e0aa17d3993b8d46cdc6a17c1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 13 Jun 2024 18:58:50 +0000 Subject: [PATCH] Remove `--label` flag for `gh issue list` (#442) Signed-off-by: Prudhvi Godithi (cherry picked from commit 31c876f050c0ebad0f64f39c0ff2a5237f0f1c38) Signed-off-by: github-actions[bot] --- build.gradle | 2 +- .../jenkins/TestCloseBuildSuccessGithubIssue.groovy | 2 +- tests/jenkins/TestCloseGithubIssue.groovy | 2 +- tests/jenkins/TestUpdateBuildFailuresIssues.groovy | 4 ++-- .../CloseBuildSuccessGithubIssue_JenkinsFile.txt | 2 +- tests/jenkins/jobs/CloseGithubIssue_JenkinsFile.txt | 2 +- ...ldFailureGithubExistingIssueCheck_Jenkinsfile.txt | 12 ++++++------ .../CreateBuildFailureGithubIssue_Jenkinsfile.txt | 12 ++++++------ tests/jenkins/jobs/CreateGithubIssue_Jenkinsfile.txt | 4 ++-- .../jobs/EditGithubIssue_Jenkinsfile_IssueBody.txt | 4 ++-- vars/closeGithubIssue.groovy | 2 +- vars/createGithubIssue.groovy | 4 ++-- 12 files changed, 26 insertions(+), 26 deletions(-) diff --git a/build.gradle b/build.gradle index fde8659fd..8613d4a22 100644 --- a/build.gradle +++ b/build.gradle @@ -127,7 +127,7 @@ jacocoTestReport { } } -String version = '6.4.8' +String version = '6.5.0' task updateVersion { doLast { diff --git a/tests/jenkins/TestCloseBuildSuccessGithubIssue.groovy b/tests/jenkins/TestCloseBuildSuccessGithubIssue.groovy index 5b417dcf9..20ee51b86 100644 --- a/tests/jenkins/TestCloseBuildSuccessGithubIssue.groovy +++ b/tests/jenkins/TestCloseBuildSuccessGithubIssue.groovy @@ -28,7 +28,7 @@ class TestCloseBuildSuccessGithubIssue extends BuildPipelineTest { @Test public void testExistingGithubIssue() { super.testPipeline('tests/jenkins/jobs/CloseBuildSuccessGithubIssue_JenkinsFile') - assertThat(getCommands('sh', 'script'), hasItem("{script=gh issue list --repo https://github.com/opensearch-project/OpenSearch.git -S \"[AUTOCUT] Distribution Build Failed for OpenSearch-2.0.0 in:title\" --label autocut,v2.0.0 --json number --jq '.[0].number', returnStdout=true}")) + assertThat(getCommands('sh', 'script'), hasItem("{script=gh issue list --repo https://github.com/opensearch-project/OpenSearch.git -S \"[AUTOCUT] Distribution Build Failed for OpenSearch-2.0.0 in:title\" --json number --jq '.[0].number', returnStdout=true}")) assertThat(getCommands('sh', 'script'), hasItem("{script=gh issue close bbb\nccc -R opensearch-project/OpenSearch --comment \"Closing the issue as the distribution build for OpenSearch has passed for version: **2.0.0**.\n Please see build log at www.example.com/jobs/test/123/consoleFull\", returnStdout=true}")) } diff --git a/tests/jenkins/TestCloseGithubIssue.groovy b/tests/jenkins/TestCloseGithubIssue.groovy index db4955347..dddff6c26 100644 --- a/tests/jenkins/TestCloseGithubIssue.groovy +++ b/tests/jenkins/TestCloseGithubIssue.groovy @@ -33,7 +33,7 @@ class TestCloseGithubIssue extends BuildPipelineTest { 'label101', )) 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\" --label label101 --json number --jq '.[0].number', returnStdout=true}")) + 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}")) assertThat(getCommands('sh', 'script'), hasItem("{script=gh issue close bbb\nccc -R opensearch-project/opensearch-build --comment \"Test GH issue close comment\", returnStdout=true}")) } diff --git a/tests/jenkins/TestUpdateBuildFailuresIssues.groovy b/tests/jenkins/TestUpdateBuildFailuresIssues.groovy index 681dea8d4..5e7fba5ae 100644 --- a/tests/jenkins/TestUpdateBuildFailuresIssues.groovy +++ b/tests/jenkins/TestUpdateBuildFailuresIssues.groovy @@ -50,8 +50,8 @@ class TestUpdateBuildFailuresIssues extends BuildPipelineTest { return [stdout: "30", exitValue: 0] } runScript('tests/jenkins/jobs/UpdateBuildFailureIssue_Jenkinsfile') - assertThat(getCommands('sh', 'sql'), hasItem("{script=gh issue list --repo https://github.com/opensearch-project/sql.git -S \"[AUTOCUT] Distribution Build Failed for sql-2.2.0 in:title\" --label autocut,v2.2.0 --json number --jq '.[0].number', returnStdout=true}")) - assertThat(getCommands('sh', 'sql'), hasItem("{script=gh issue close 30 -R opensearch-project/sql --comment \"Closing the issue as the distribution build for sql has passed for version: **2.2.0**.\n Please see build log at www.example.com/job/build_url/32/display/redirect\", returnStdout=true}")) + assertThat(getCommands('sh', 'sql'), hasItem("{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}")) + assertThat(getCommands('sh', 'sql'), hasItem("{script=gh issue close bbb\nccc -R opensearch-project/sql --comment \"Closing the issue as the distribution build for sql has passed for version: **2.2.0**.\n Please see build log at www.example.com/job/build_url/32/display/redirect\", returnStdout=true}")) } @Test diff --git a/tests/jenkins/jobs/CloseBuildSuccessGithubIssue_JenkinsFile.txt b/tests/jenkins/jobs/CloseBuildSuccessGithubIssue_JenkinsFile.txt index e447c65bb..daf608a39 100644 --- a/tests/jenkins/jobs/CloseBuildSuccessGithubIssue_JenkinsFile.txt +++ b/tests/jenkins/jobs/CloseBuildSuccessGithubIssue_JenkinsFile.txt @@ -11,7 +11,7 @@ Please see build log at www.example.com/jobs/test/123/consoleFull, label=autocut,v2.0.0}) 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.git -S "[AUTOCUT] Distribution Build Failed for OpenSearch-2.0.0 in:title" --label autocut,v2.0.0 --json number --jq '.[0].number', returnStdout=true}) + closeGithubIssue.sh({script=gh issue list --repo https://github.com/opensearch-project/OpenSearch.git -S "[AUTOCUT] Distribution Build Failed for OpenSearch-2.0.0 in:title" --json number --jq '.[0].number', returnStdout=true}) closeGithubIssue.sh({script=gh issue close bbb ccc -R opensearch-project/OpenSearch --comment "Closing the issue as the distribution build for OpenSearch has passed for version: **2.0.0**. Please see build log at www.example.com/jobs/test/123/consoleFull", returnStdout=true}) diff --git a/tests/jenkins/jobs/CloseGithubIssue_JenkinsFile.txt b/tests/jenkins/jobs/CloseGithubIssue_JenkinsFile.txt index acc8ef946..b636bc404 100644 --- a/tests/jenkins/jobs/CloseGithubIssue_JenkinsFile.txt +++ b/tests/jenkins/jobs/CloseGithubIssue_JenkinsFile.txt @@ -6,6 +6,6 @@ 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.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" --label label101 --json number --jq '.[0].number', returnStdout=true}) + 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}) closeGithubIssue.sh({script=gh issue close bbb ccc -R opensearch-project/opensearch-build --comment "Test GH issue close comment", returnStdout=true}) diff --git a/tests/jenkins/jobs/CreateBuildFailureGithubExistingIssueCheck_Jenkinsfile.txt b/tests/jenkins/jobs/CreateBuildFailureGithubExistingIssueCheck_Jenkinsfile.txt index 6af5d4812..3460e4ff7 100644 --- a/tests/jenkins/jobs/CreateBuildFailureGithubExistingIssueCheck_Jenkinsfile.txt +++ b/tests/jenkins/jobs/CreateBuildFailureGithubExistingIssueCheck_Jenkinsfile.txt @@ -13,10 +13,10 @@ The failed build stage will be marked as unstable(!). Please see ./build.sh step for more details, label=autocut,v2.0.0}) createGithubIssue.usernamePassword({credentialsId=jenkins-github-bot-token, passwordVariable=GITHUB_TOKEN, usernameVariable=GITHUB_USER}) createGithubIssue.withCredentials([[GITHUB_USER, GITHUB_TOKEN]], groovy.lang.Closure) - createGithubIssue.sh({script=gh issue list --repo https://github.com/opensearch-project/OpenSearch.git -S "[AUTOCUT] Distribution Build Failed for OpenSearch-2.0.0 in:title" --label "autocut,v2.0.0" --json number --jq '.[0].number', returnStdout=true}) + createGithubIssue.sh({script=gh issue list --repo https://github.com/opensearch-project/OpenSearch.git -S "[AUTOCUT] Distribution Build Failed for OpenSearch-2.0.0 in:title" --json number --jq '.[0].number', returnStdout=true}) createGithubIssue.sh({script=date -d "3 days ago" +'%Y-%m-%d', returnStdout=true}) createGithubIssue.sh({script=gh issue list --repo https://github.com/opensearch-project/OpenSearch.git -S "[AUTOCUT] Distribution Build Failed for OpenSearch-2.0.0 in:title is:closed closed:>=bbb -ccc" --label "autocut,v2.0.0" --json number --jq '.[0].number', returnStdout=true}) +ccc" --json number --jq '.[0].number', returnStdout=true}) createGithubIssue.println(Issue already exists, adding a comment) createGithubIssue.sh({script=gh issue comment bbb ccc --repo https://github.com/opensearch-project/OpenSearch.git --body "***Received Error***: **Error building OpenSearch, retry with: ./build.sh manifests/2.2.0/opensearch-2.2.0.yml --component OpenSearch --snapshot**. @@ -30,10 +30,10 @@ ccc --repo https://github.com/opensearch-project/OpenSearch.git --body "***Recei The failed build stage will be marked as unstable(!). Please see ./build.sh step for more details, label=autocut,v2.0.0}) createGithubIssue.usernamePassword({credentialsId=jenkins-github-bot-token, passwordVariable=GITHUB_TOKEN, usernameVariable=GITHUB_USER}) createGithubIssue.withCredentials([[GITHUB_USER, GITHUB_TOKEN]], groovy.lang.Closure) - createGithubIssue.sh({script=gh issue list --repo https://github.com/opensearch-project/geospatial.git -S "[AUTOCUT] Distribution Build Failed for geospatial-2.0.0 in:title" --label "autocut,v2.0.0" --json number --jq '.[0].number', returnStdout=true}) + createGithubIssue.sh({script=gh issue list --repo https://github.com/opensearch-project/geospatial.git -S "[AUTOCUT] Distribution Build Failed for geospatial-2.0.0 in:title" --json number --jq '.[0].number', returnStdout=true}) createGithubIssue.sh({script=date -d "3 days ago" +'%Y-%m-%d', returnStdout=true}) createGithubIssue.sh({script=gh issue list --repo https://github.com/opensearch-project/geospatial.git -S "[AUTOCUT] Distribution Build Failed for geospatial-2.0.0 in:title is:closed closed:>=bbb -ccc" --label "autocut,v2.0.0" --json number --jq '.[0].number', returnStdout=true}) +ccc" --json number --jq '.[0].number', returnStdout=true}) createGithubIssue.println(Issue already exists, adding a comment) createGithubIssue.sh({script=gh issue comment bbb ccc --repo https://github.com/opensearch-project/geospatial.git --body "***Received Error***: **Error building geospatial, retry with: ./build.sh manifests/2.2.0/opensearch-2.2.0.yml --component geospatial**. @@ -47,10 +47,10 @@ ccc --repo https://github.com/opensearch-project/geospatial.git --body "***Recei The failed build stage will be marked as unstable(!). Please see ./build.sh step for more details, label=autocut,v2.0.0}) createGithubIssue.usernamePassword({credentialsId=jenkins-github-bot-token, passwordVariable=GITHUB_TOKEN, usernameVariable=GITHUB_USER}) createGithubIssue.withCredentials([[GITHUB_USER, GITHUB_TOKEN]], groovy.lang.Closure) - createGithubIssue.sh({script=gh issue list --repo https://github.com/opensearch-project/performance-analyzer.git -S "[AUTOCUT] Distribution Build Failed for performance-analyzer-2.0.0 in:title" --label "autocut,v2.0.0" --json number --jq '.[0].number', returnStdout=true}) + createGithubIssue.sh({script=gh issue list --repo https://github.com/opensearch-project/performance-analyzer.git -S "[AUTOCUT] Distribution Build Failed for performance-analyzer-2.0.0 in:title" --json number --jq '.[0].number', returnStdout=true}) createGithubIssue.sh({script=date -d "3 days ago" +'%Y-%m-%d', returnStdout=true}) createGithubIssue.sh({script=gh issue list --repo https://github.com/opensearch-project/performance-analyzer.git -S "[AUTOCUT] Distribution Build Failed for performance-analyzer-2.0.0 in:title is:closed closed:>=bbb -ccc" --label "autocut,v2.0.0" --json number --jq '.[0].number', returnStdout=true}) +ccc" --json number --jq '.[0].number', returnStdout=true}) createGithubIssue.println(Issue already exists, adding a comment) createGithubIssue.sh({script=gh issue comment bbb ccc --repo https://github.com/opensearch-project/performance-analyzer.git --body "***Received Error***: **Error building performance-analyzer, retry with: ./build.sh manifests/2.2.0/opensearch-2.2.0ed in the next build. This might have performance impact if it keeps failing. Run the javaToolchains task for more det.yml --component performance-analyzer**. diff --git a/tests/jenkins/jobs/CreateBuildFailureGithubIssue_Jenkinsfile.txt b/tests/jenkins/jobs/CreateBuildFailureGithubIssue_Jenkinsfile.txt index 6af5d4812..3460e4ff7 100644 --- a/tests/jenkins/jobs/CreateBuildFailureGithubIssue_Jenkinsfile.txt +++ b/tests/jenkins/jobs/CreateBuildFailureGithubIssue_Jenkinsfile.txt @@ -13,10 +13,10 @@ The failed build stage will be marked as unstable(!). Please see ./build.sh step for more details, label=autocut,v2.0.0}) createGithubIssue.usernamePassword({credentialsId=jenkins-github-bot-token, passwordVariable=GITHUB_TOKEN, usernameVariable=GITHUB_USER}) createGithubIssue.withCredentials([[GITHUB_USER, GITHUB_TOKEN]], groovy.lang.Closure) - createGithubIssue.sh({script=gh issue list --repo https://github.com/opensearch-project/OpenSearch.git -S "[AUTOCUT] Distribution Build Failed for OpenSearch-2.0.0 in:title" --label "autocut,v2.0.0" --json number --jq '.[0].number', returnStdout=true}) + createGithubIssue.sh({script=gh issue list --repo https://github.com/opensearch-project/OpenSearch.git -S "[AUTOCUT] Distribution Build Failed for OpenSearch-2.0.0 in:title" --json number --jq '.[0].number', returnStdout=true}) createGithubIssue.sh({script=date -d "3 days ago" +'%Y-%m-%d', returnStdout=true}) createGithubIssue.sh({script=gh issue list --repo https://github.com/opensearch-project/OpenSearch.git -S "[AUTOCUT] Distribution Build Failed for OpenSearch-2.0.0 in:title is:closed closed:>=bbb -ccc" --label "autocut,v2.0.0" --json number --jq '.[0].number', returnStdout=true}) +ccc" --json number --jq '.[0].number', returnStdout=true}) createGithubIssue.println(Issue already exists, adding a comment) createGithubIssue.sh({script=gh issue comment bbb ccc --repo https://github.com/opensearch-project/OpenSearch.git --body "***Received Error***: **Error building OpenSearch, retry with: ./build.sh manifests/2.2.0/opensearch-2.2.0.yml --component OpenSearch --snapshot**. @@ -30,10 +30,10 @@ ccc --repo https://github.com/opensearch-project/OpenSearch.git --body "***Recei The failed build stage will be marked as unstable(!). Please see ./build.sh step for more details, label=autocut,v2.0.0}) createGithubIssue.usernamePassword({credentialsId=jenkins-github-bot-token, passwordVariable=GITHUB_TOKEN, usernameVariable=GITHUB_USER}) createGithubIssue.withCredentials([[GITHUB_USER, GITHUB_TOKEN]], groovy.lang.Closure) - createGithubIssue.sh({script=gh issue list --repo https://github.com/opensearch-project/geospatial.git -S "[AUTOCUT] Distribution Build Failed for geospatial-2.0.0 in:title" --label "autocut,v2.0.0" --json number --jq '.[0].number', returnStdout=true}) + createGithubIssue.sh({script=gh issue list --repo https://github.com/opensearch-project/geospatial.git -S "[AUTOCUT] Distribution Build Failed for geospatial-2.0.0 in:title" --json number --jq '.[0].number', returnStdout=true}) createGithubIssue.sh({script=date -d "3 days ago" +'%Y-%m-%d', returnStdout=true}) createGithubIssue.sh({script=gh issue list --repo https://github.com/opensearch-project/geospatial.git -S "[AUTOCUT] Distribution Build Failed for geospatial-2.0.0 in:title is:closed closed:>=bbb -ccc" --label "autocut,v2.0.0" --json number --jq '.[0].number', returnStdout=true}) +ccc" --json number --jq '.[0].number', returnStdout=true}) createGithubIssue.println(Issue already exists, adding a comment) createGithubIssue.sh({script=gh issue comment bbb ccc --repo https://github.com/opensearch-project/geospatial.git --body "***Received Error***: **Error building geospatial, retry with: ./build.sh manifests/2.2.0/opensearch-2.2.0.yml --component geospatial**. @@ -47,10 +47,10 @@ ccc --repo https://github.com/opensearch-project/geospatial.git --body "***Recei The failed build stage will be marked as unstable(!). Please see ./build.sh step for more details, label=autocut,v2.0.0}) createGithubIssue.usernamePassword({credentialsId=jenkins-github-bot-token, passwordVariable=GITHUB_TOKEN, usernameVariable=GITHUB_USER}) createGithubIssue.withCredentials([[GITHUB_USER, GITHUB_TOKEN]], groovy.lang.Closure) - createGithubIssue.sh({script=gh issue list --repo https://github.com/opensearch-project/performance-analyzer.git -S "[AUTOCUT] Distribution Build Failed for performance-analyzer-2.0.0 in:title" --label "autocut,v2.0.0" --json number --jq '.[0].number', returnStdout=true}) + createGithubIssue.sh({script=gh issue list --repo https://github.com/opensearch-project/performance-analyzer.git -S "[AUTOCUT] Distribution Build Failed for performance-analyzer-2.0.0 in:title" --json number --jq '.[0].number', returnStdout=true}) createGithubIssue.sh({script=date -d "3 days ago" +'%Y-%m-%d', returnStdout=true}) createGithubIssue.sh({script=gh issue list --repo https://github.com/opensearch-project/performance-analyzer.git -S "[AUTOCUT] Distribution Build Failed for performance-analyzer-2.0.0 in:title is:closed closed:>=bbb -ccc" --label "autocut,v2.0.0" --json number --jq '.[0].number', returnStdout=true}) +ccc" --json number --jq '.[0].number', returnStdout=true}) createGithubIssue.println(Issue already exists, adding a comment) createGithubIssue.sh({script=gh issue comment bbb ccc --repo https://github.com/opensearch-project/performance-analyzer.git --body "***Received Error***: **Error building performance-analyzer, retry with: ./build.sh manifests/2.2.0/opensearch-2.2.0ed in the next build. This might have performance impact if it keeps failing. Run the javaToolchains task for more det.yml --component performance-analyzer**. diff --git a/tests/jenkins/jobs/CreateGithubIssue_Jenkinsfile.txt b/tests/jenkins/jobs/CreateGithubIssue_Jenkinsfile.txt index e0a317c00..3e01918e5 100644 --- a/tests/jenkins/jobs/CreateGithubIssue_Jenkinsfile.txt +++ b/tests/jenkins/jobs/CreateGithubIssue_Jenkinsfile.txt @@ -6,9 +6,9 @@ CreateGithubIssue_Jenkinsfile.createGithubIssue({repoUrl=https://github.com/opensearch-project/opensearch-build, issueTitle=Test GH issue title, issueBody=Test GH issue body, label=label101, daysToReOpen=5}) createGithubIssue.usernamePassword({credentialsId=jenkins-github-bot-token, passwordVariable=GITHUB_TOKEN, usernameVariable=GITHUB_USER}) createGithubIssue.withCredentials([[GITHUB_USER, GITHUB_TOKEN]], groovy.lang.Closure) - createGithubIssue.sh({script=gh issue list --repo https://github.com/opensearch-project/opensearch-build -S "Test GH issue title in:title" --label "label101" --json number --jq '.[0].number', returnStdout=true}) + createGithubIssue.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}) createGithubIssue.sh({script=date -d "5 days ago" +'%Y-%m-%d', returnStdout=true}) - createGithubIssue.sh({script=gh issue list --repo https://github.com/opensearch-project/opensearch-build -S "Test GH issue title in:title is:closed closed:>=2023-10-24" --label "label101" --json number --jq '.[0].number', returnStdout=true}) + createGithubIssue.sh({script=gh issue list --repo https://github.com/opensearch-project/opensearch-build -S "Test GH issue title in:title is:closed closed:>=2023-10-24" --json number --jq '.[0].number', returnStdout=true}) createGithubIssue.println(Issue already exists, adding a comment) createGithubIssue.sh({script=gh issue comment bbb ccc --repo https://github.com/opensearch-project/opensearch-build --body "Test GH issue body", returnStdout=true}) diff --git a/tests/jenkins/jobs/EditGithubIssue_Jenkinsfile_IssueBody.txt b/tests/jenkins/jobs/EditGithubIssue_Jenkinsfile_IssueBody.txt index f8632b7a2..769523757 100644 --- a/tests/jenkins/jobs/EditGithubIssue_Jenkinsfile_IssueBody.txt +++ b/tests/jenkins/jobs/EditGithubIssue_Jenkinsfile_IssueBody.txt @@ -6,10 +6,10 @@ EditGithubIssue_Jenkinsfile.createGithubIssue({repoUrl=https://github.com/opensearch-project/opensearch-build, issueTitle=Test GH issue title, issueBodyFile=issueBody.md, issueEdit=true, label=label101}) createGithubIssue.usernamePassword({credentialsId=jenkins-github-bot-token, passwordVariable=GITHUB_TOKEN, usernameVariable=GITHUB_USER}) createGithubIssue.withCredentials([[GITHUB_USER, GITHUB_TOKEN]], groovy.lang.Closure) - createGithubIssue.sh({script=gh issue list --repo https://github.com/opensearch-project/opensearch-build -S "Test GH issue title in:title" --label "label101" --json number --jq '.[0].number', returnStdout=true}) + createGithubIssue.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}) createGithubIssue.sh({script=date -d "3 days ago" +'%Y-%m-%d', returnStdout=true}) createGithubIssue.sh({script=gh issue list --repo https://github.com/opensearch-project/opensearch-build -S "Test GH issue title in:title is:closed closed:>=bbb -ccc" --label "label101" --json number --jq '.[0].number', returnStdout=true}) +ccc" --json number --jq '.[0].number', returnStdout=true}) createGithubIssue.println(Issue already exists, editing the issue body) createGithubIssue.sh({script=gh issue edit bbb ccc --repo https://github.com/opensearch-project/opensearch-build --body-file issueBody.md, returnStdout=true}) diff --git a/vars/closeGithubIssue.groovy b/vars/closeGithubIssue.groovy index f93966721..2cc7c4818 100644 --- a/vars/closeGithubIssue.groovy +++ b/vars/closeGithubIssue.groovy @@ -19,7 +19,7 @@ void call(Map args = [:]) { try { withCredentials([usernamePassword(credentialsId: 'jenkins-github-bot-token', passwordVariable: 'GITHUB_TOKEN', usernameVariable: 'GITHUB_USER')]) { def issuesNumber = sh( - script: "gh issue list --repo ${args.repoUrl} -S \"${args.issueTitle} in:title\" --label ${label} --json number --jq '.[0].number'", + script: "gh issue list --repo ${args.repoUrl} -S \"${args.issueTitle} in:title\" --json number --jq '.[0].number'", returnStdout: true ).trim() if (!issuesNumber.isEmpty()) { diff --git a/vars/createGithubIssue.groovy b/vars/createGithubIssue.groovy index 70af3557c..1fec00138 100644 --- a/vars/createGithubIssue.groovy +++ b/vars/createGithubIssue.groovy @@ -24,7 +24,7 @@ void call(Map args = [:]) { try { withCredentials([usernamePassword(credentialsId: 'jenkins-github-bot-token', passwordVariable: 'GITHUB_TOKEN', usernameVariable: 'GITHUB_USER')]) { def openIssue = sh( - script: "gh issue list --repo ${args.repoUrl} -S \"${args.issueTitle} in:title\" --label \"${label}\" --json number --jq '.[0].number'", + script: "gh issue list --repo ${args.repoUrl} -S \"${args.issueTitle} in:title\" --json number --jq '.[0].number'", returnStdout: true ).trim() @@ -34,7 +34,7 @@ void call(Map args = [:]) { ).trim() def closedIssue = sh( - script: "gh issue list --repo ${args.repoUrl} -S \"${args.issueTitle} in:title is:closed closed:>=${currentDayMinusDaysToReOpen}\" --label \"${label}\" --json number --jq '.[0].number'", + script: "gh issue list --repo ${args.repoUrl} -S \"${args.issueTitle} in:title is:closed closed:>=${currentDayMinusDaysToReOpen}\" --json number --jq '.[0].number'", returnStdout: true ).trim()