From 39bc28e9d49b8ebf8559cea042a0b9427b2e55d6 Mon Sep 17 00:00:00 2001 From: Sayali Gaikawad Date: Fri, 12 Jan 2024 15:49:44 -0800 Subject: [PATCH 1/2] Add getComponentName method for test Manifest Signed-off-by: Sayali Gaikawad --- .gitignore | 2 +- src/jenkins/BuildManifest.groovy | 27 ++++++++++++++----------- src/jenkins/TestManifest.groovy | 34 ++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 4a4fae9bc..06ddb697b 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,4 @@ out.txt .classpath bin/* - +logback.log diff --git a/src/jenkins/BuildManifest.groovy b/src/jenkins/BuildManifest.groovy index cf300dcb2..8aa8d8387 100644 --- a/src/jenkins/BuildManifest.groovy +++ b/src/jenkins/BuildManifest.groovy @@ -6,11 +6,12 @@ * this file be licensed under the Apache-2.0 license or a * compatible open source license. */ - package jenkins class BuildManifest implements Serializable { + class Build implements Serializable { + String id String name String version @@ -57,6 +58,7 @@ class BuildManifest implements Serializable { this.architecture, ].join('-') + '.' + getExtension() } + } class Components extends HashMap { @@ -67,9 +69,11 @@ class BuildManifest implements Serializable { this[component.name] = component } } + } class Component implements Serializable { + String name String version String ref @@ -103,25 +107,25 @@ class BuildManifest implements Serializable { buildNumber, this.build.platform, this.build.architecture - ].join("/") + ].join('/') } public String getArtifactRoot(String jobName, String buildNumber) { return [ this.getArtifactRootWithoutDistribution(jobName, buildNumber), this.build.distribution - ].join("/") + ].join('/') } - + public String getIndexFileRoot(String jobName) { return [ jobName, this.build.version, - "index", + 'index', this.build.platform, this.build.architecture, this.build.distribution - ].join("/") + ].join('/') } public String getArtifactRootUrlWithoutDistribution(String publicArtifactUrl = 'https://ci.opensearch.org/ci/dbc', String jobName, String buildNumber) { @@ -144,7 +148,7 @@ class BuildManifest implements Serializable { 'builds', this.build.getFilename(), 'manifest.yml' - ].join("/") + ].join('/') } public String getBundleManifestUrl(String publicArtifactUrl = 'https://ci.opensearch.org/ci/dbc', String jobName, String buildNumber) { @@ -153,7 +157,7 @@ class BuildManifest implements Serializable { 'dist', this.build.getFilename(), 'manifest.yml' - ].join("/") + ].join('/') } public String getArtifactUrl(String publicArtifactUrl = 'https://ci.opensearch.org/ci/dbc', String jobName, String buildNumber) { @@ -162,7 +166,7 @@ class BuildManifest implements Serializable { 'dist', this.build.getFilename(), this.build.getFilenameWithExtension() - ].join("/") + ].join('/') } public String getArtifactArchitecture() { @@ -182,7 +186,7 @@ class BuildManifest implements Serializable { } public String getMinArtifact() { - components.get(build.name.replace(' ','-'))?.artifacts?.get("dist")?.first() + components.get(build.name.replace(' ', '-'))?.artifacts?.get('dist')?.first() } public String getCommitId (String name) { @@ -191,11 +195,12 @@ class BuildManifest implements Serializable { public ArrayList getNames() { def componentsName = [] - this.components.each{key, value -> componentsName.add(key)} + this.components.each { key, value -> componentsName.add(key) } return componentsName } public String getRepo(String name) { return this.components.get(name).repository } + } diff --git a/src/jenkins/TestManifest.groovy b/src/jenkins/TestManifest.groovy index 645cfc412..1ac27a58d 100644 --- a/src/jenkins/TestManifest.groovy +++ b/src/jenkins/TestManifest.groovy @@ -10,8 +10,10 @@ package jenkins class TestManifest { + class Ci implements Serializable { class Image implements Serializable { + String name String args @@ -19,6 +21,7 @@ class TestManifest { this.name = data.name this.args = data.args } + } Image image @@ -26,14 +29,45 @@ class TestManifest { Ci(Map data) { this.image = new TestManifest.Ci.Image(data.image) } + + } + + class Components extends HashMap { + + Components(ArrayList data) { + data.each { item -> + Component component = new Component(item) + this[component.name] = component + } + } + + } + + class Component implements Serializable { + + String name + + Component(Map data) { + this.name = data.name + } + } String name Ci ci + Components components TestManifest(Map data) { this.name = data.name this.ci = data.ci ? new TestManifest.Ci(data.ci) : null + this.components = data.components ? new TestManifest.Components(data.components) : null + } + + public ArrayList getComponentNames() { + def componentsName = [] + this.components.each { key, value -> componentsName.add(key) } + return componentsName } + } From b65becf1e500b620262eceab2526b5ab0a3d600c Mon Sep 17 00:00:00 2001 From: Sayali Gaikawad Date: Wed, 17 Jan 2024 12:44:04 -0800 Subject: [PATCH 2/2] Bump the version Signed-off-by: Sayali Gaikawad --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index d7eea41fb..861029a4d 100644 --- a/build.gradle +++ b/build.gradle @@ -121,7 +121,7 @@ jacocoTestReport { } } -String version = '6.0.0' +String version = '6.1.0' task updateVersion { doLast {