Skip to content

Commit

Permalink
Close the created autocut issues
Browse files Browse the repository at this point in the history
Signed-off-by: Prudhvi Godithi <pgodithi@amazon.com>
  • Loading branch information
prudhvigodithi committed Jul 27, 2023
1 parent b422ae0 commit 747d534
Show file tree
Hide file tree
Showing 10 changed files with 214 additions and 82 deletions.
9 changes: 6 additions & 3 deletions jenkins/opensearch-dashboards/distribution-build.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,10 @@ pipeline {
manifest: "${INPUT_MANIFEST}"
)
}

closeBuildSuccessGithubIssue(
message: buildMessage(search: 'pass'),
inputManifestPath: "manifests/$INPUT_MANIFEST"
)
postCleanup()
}
}
Expand All @@ -909,14 +912,14 @@ pipeline {
if (params.PUBLISH_NOTIFICATION) {
publishNotification(
icon: ':warning:',
message: buildFailureMessage(),
message: buildMessage(search: 'fail'),
credentialsId: 'jenkins-build-notice-webhook',
manifest: "${INPUT_MANIFEST}"
)
}
if (params.CREATE_GITHUB_ISSUE) {
createGithubIssue(
message: buildFailureMessage()
message: buildMessage(search: 'fail'),
)
}

Expand Down
13 changes: 10 additions & 3 deletions jenkins/opensearch-dashboards/integ-test.jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
lib = library(identifier: 'jenkins@4.2.2', retriever: modernSCM([
lib = library(identifier: 'jenkins@main', retriever: modernSCM([
$class: 'GitSCMSource',
remote: 'https://github.com/opensearch-project/opensearch-build-libraries.git',
remote: 'https://github.com/prudhvigodithi/opensearch-build-libraries.git',
]))

def docker_images = [
Expand Down Expand Up @@ -196,7 +196,14 @@ pipeline {
testManifest: "manifests/${TEST_MANIFEST}",
localPath: "${WORKSPACE}/${distribution}",
switchUserNonRoot: "${switch_user_non_root}"
)
)
String closeCommentMessage = "Closing the issue as the Integration Test passed for ${local_component}<br>Version: ${version}<br>Distribution: ${distribution}<br>Architecture: ${architecture}<br>Platform: ${platform}<br><br>Please check the logs: ${RUN_DISPLAY_URL}<br><br> *"
closeGithubIssue(
repoUrl: buildManifestObj.getRepo("${local_component}"),
issueTitle: "[AUTOCUT] Integration Test failed for ${local_component}: ${version} ${distribution} distribution",
closeComment: closeCommentMessage,
label: "autocut,v${version},integ-test-failure"
)
}
} catch (e) {
echo "Error running integtest for component ${local_component}, creating Github issue"
Expand Down
88 changes: 47 additions & 41 deletions jenkins/opensearch/distribution-build.jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
lib = library(identifier: 'jenkins@4.3.0', retriever: modernSCM([
lib = library(identifier: 'jenkins@main', retriever: modernSCM([
$class: 'GitSCMSource',
remote: 'https://github.com/opensearch-project/opensearch-build-libraries.git',
remote: 'https://github.com/prudhvigodithi/opensearch-build-libraries.git',
]))

pipeline {
Expand Down Expand Up @@ -132,7 +132,7 @@ pipeline {
}
stage('build') {
parallel {
stage('build-opensearch-snapshot-linux-x64-tar') {
/*stage('build-opensearch-snapshot-linux-x64-tar') {
when {
beforeAgent true
expression{
Expand Down Expand Up @@ -173,8 +173,8 @@ pipeline {
postCleanup()
}
}
}
stage('build-opensearch-snapshot-linux-arm64-tar') {
}*/
/*stage('build-opensearch-snapshot-linux-arm64-tar') {
when {
beforeAgent true
expression{
Expand Down Expand Up @@ -212,8 +212,8 @@ pipeline {
postCleanup()
}
}
}
stage('build-opensearch-snapshot-macos-x64-tar') {
}*/
/*stage('build-opensearch-snapshot-macos-x64-tar') {
when {
beforeAgent true
expression{
Expand Down Expand Up @@ -250,8 +250,8 @@ pipeline {
postCleanup()
}
}
}
stage('build-opensearch-snapshot-windows-x64-zip') {
}*/
/*stage('build-opensearch-snapshot-windows-x64-zip') {
when {
beforeAgent true
expression{
Expand Down Expand Up @@ -288,8 +288,8 @@ pipeline {
postCleanup()
}
}
}
stage('build-and-test-linux-x64-tar') {
}*/
/*stage('build-and-test-linux-x64-tar') {
when {
beforeAgent true
expression{
Expand Down Expand Up @@ -367,7 +367,7 @@ pipeline {
}
}
}
}
}*/
stage('build-and-test-linux-x64-rpm') {
when {
beforeAgent true
Expand Down Expand Up @@ -395,7 +395,8 @@ pipeline {
platform: 'linux',
architecture: 'x64',
distribution: 'rpm',
stashName: "build-archive-linux-x64-rpm-${JOB_NAME}-${BUILD_NUMBER}"
stashName: "build-archive-linux-x64-rpm-pgodithi-distribution-build-opensearch-${BUILD_NUMBER}"
// stashName: "build-archive-linux-x64-rpm-${JOB_NAME}-${BUILD_NUMBER}"
)
}
}
Expand All @@ -405,7 +406,7 @@ pipeline {
}
}
}
stage('assemble-archive-and-test-linux-x64-rpm') {
/*stage('assemble-archive-and-test-linux-x64-rpm') {
agent {
docker {
label AGENT_X64
Expand Down Expand Up @@ -456,10 +457,10 @@ pipeline {
}
}
}
}
}*/
}
}
stage('build-and-test-linux-x64-deb') {
/*stage('build-and-test-linux-x64-deb') {
when {
beforeAgent true
expression{
Expand Down Expand Up @@ -540,8 +541,8 @@ pipeline {
}
}
}
}
stage('build-and-test-linux-arm64-tar') {
}*/
/*stage('build-and-test-linux-arm64-tar') {
when {
beforeAgent true
expression{
Expand Down Expand Up @@ -618,8 +619,8 @@ pipeline {
}
}
}
}
stage('build-and-test-linux-arm64-rpm') {
}*/
/*stage('build-and-test-linux-arm64-rpm') {
when {
beforeAgent true
expression{
Expand Down Expand Up @@ -709,8 +710,8 @@ pipeline {
}
}
}
}
stage('build-and-test-linux-arm64-deb') {
}*/
/*stage('build-and-test-linux-arm64-deb') {
when {
beforeAgent true
expression{
Expand Down Expand Up @@ -791,8 +792,8 @@ pipeline {
}
}
}
}
stage('build-and-test-windows-x64-zip') {
}*/
/*stage('build-and-test-windows-x64-zip') {
when {
beforeAgent true
expression{
Expand Down Expand Up @@ -838,10 +839,10 @@ pipeline {
}
}
}
}
}*/
}
}
stage('update index file') {
/*stage('update index file') {
agent {
docker {
label AGENT_X64
Expand All @@ -860,8 +861,8 @@ pipeline {
}
}
}
}
stage('docker build') {
}*.
/*stage('docker build') {
when {
beforeAgent true
allOf{
Expand Down Expand Up @@ -896,10 +897,10 @@ pipeline {
)
}
}
}
}*/
}
post {
always {
/*always {
node(AGENT_X64) {
script {
buildInfoYaml(
Expand All @@ -912,12 +913,13 @@ pipeline {
postCleanup()
}
}
}
}*/
success {
node(AGENT_X64) {
checkout scm
script {
List<String> stages = []
if (params.BUILD_PLATFORM.contains('linux')) {
/*if (params.BUILD_PLATFORM.contains('linux')) {
stages = [
'build-and-test-linux-x64-tar',
'assemble-archive-and-test-linux-x64-rpm',
Expand All @@ -926,12 +928,12 @@ pipeline {
'assemble-archive-and-test-linux-arm64-rpm',
'assemble-archive-and-test-linux-arm64-deb',
]
}
if (params.BUILD_PLATFORM.contains('windows')){
}*/
/*if (params.BUILD_PLATFORM.contains('windows')){
stages.add('build-and-test-windows-x64-zip')
}
}*/

if (params.PUBLISH_NOTIFICATION) {
/*if (params.PUBLISH_NOTIFICATION) {
def stashed = lib.jenkins.Messages.new(this).get(stages)

publishNotification(
Expand All @@ -941,7 +943,11 @@ pipeline {
credentialsId: 'jenkins-build-notice-webhook',
manifest: "${INPUT_MANIFEST}"
)
}
}*/
closeBuildSuccessGithubIssue(
message: buildMessage(search: 'pass'),
inputManifestPath: "manifests/$INPUT_MANIFEST"
)

postCleanup()
}
Expand All @@ -951,17 +957,17 @@ pipeline {
node(AGENT_X64) {
checkout scm
script {
if (params.PUBLISH_NOTIFICATION) {
/*if (params.PUBLISH_NOTIFICATION) {
publishNotification(
icon: ':warning:',
message: buildFailureMessage(),
message: buildMessage(search: 'fail'),
credentialsId: 'jenkins-build-notice-webhook',
manifest: "${INPUT_MANIFEST}"
)
}
}*/
if (params.CREATE_GITHUB_ISSUE) {
createBuildFailureGithubIssue(
message: buildFailureMessage(),
message: buildMessage(search: 'fail'),
inputManifestPath: "manifests/$INPUT_MANIFEST"
)
}
Expand Down
11 changes: 9 additions & 2 deletions jenkins/opensearch/integ-test.jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
lib = library(identifier: 'jenkins@4.2.2', retriever: modernSCM([
lib = library(identifier: 'jenkins@main', retriever: modernSCM([
$class: 'GitSCMSource',
remote: 'https://github.com/opensearch-project/opensearch-build-libraries.git',
remote: 'https://github.com/prudhvigodithi/opensearch-build-libraries.git',
]))

def docker_images = [
Expand Down Expand Up @@ -161,6 +161,13 @@ pipeline {
localPath: "${WORKSPACE}/${distribution}",
switchUserNonRoot: "${switch_user_non_root}"
)
String closeCommentMessage = "Closing the issue as the Integration Test passed for ${local_component}<br>Version: ${version}<br>Distribution: ${distribution}<br>Architecture: ${architecture}<br>Platform: ${platform}<br><br>Please check the logs: ${RUN_DISPLAY_URL}<br><br> *"
closeGithubIssue(
repoUrl: buildManifestObj.getRepo("${local_component}"),
issueTitle: "[AUTOCUT] Integration Test failed for ${local_component}: ${version} ${distribution} distribution",
closeComment: closeCommentMessage,
label: "autocut,v${version},integ-test-failure"
)
}
} catch (e) {
echo "Error running integtest for component ${local_component}, creating Github issue"
Expand Down
2 changes: 1 addition & 1 deletion manifests/2.8.0/opensearch-2.8.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build:
version: 2.8.0
ci:
image:
name: opensearchstaging/ci-runner:ci-runner-centos7-opensearch-build-v2
name: opensearchstaging/ci-runner:ci-runner-centos7-opensearch-build-v3
args: -e JAVA_HOME=/opt/java/openjdk-17
components:
- name: OpenSearch
Expand Down
1 change: 1 addition & 0 deletions src/run_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def main() -> int:
builder.checkout(work_dir.name)
builder.build(build_recorder)
builder.export_artifacts(build_recorder)
logging.info(f"Build successful {component.name}")
except:
logging.error(f"Error building {component.name}, retry with: {args.component_command(component.name)}")
raise
Expand Down
Loading

0 comments on commit 747d534

Please sign in to comment.