Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 6.x] Remove --label flag for gh issue list #443

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ jacocoTestReport {
}
}

String version = '6.4.8'
String version = '6.5.0'

task updateVersion {
doLast {
Expand Down
2 changes: 1 addition & 1 deletion tests/jenkins/TestCloseBuildSuccessGithubIssue.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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}"))
}

Expand Down
2 changes: 1 addition & 1 deletion tests/jenkins/TestCloseGithubIssue.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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}"))
}

Expand Down
4 changes: 2 additions & 2 deletions tests/jenkins/TestUpdateBuildFailuresIssues.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
2 changes: 1 addition & 1 deletion tests/jenkins/jobs/CloseGithubIssue_JenkinsFile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Original file line number Diff line number Diff line change
Expand Up @@ -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**.
Expand All @@ -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**.
Expand All @@ -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**.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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**.
Expand All @@ -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**.
Expand All @@ -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**.
Expand Down
4 changes: 2 additions & 2 deletions tests/jenkins/jobs/CreateGithubIssue_Jenkinsfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Loading
Loading