From 9d04525431e7a45a2be8dc02c005b737b2f0bcf0 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 11 Jan 2022 14:40:15 +0000 Subject: [PATCH 01/27] Correct hierarchical import of artifacts from release repositories --- import/importer.groovy | 8 ++++---- meta/folder.groovy | 10 ++++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/import/importer.groovy b/import/importer.groovy index 8bb565a..2c40215 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -200,11 +200,11 @@ def hierarchyartifactimportfromrepo(meta, importoptions, String destpath) { def importedmeta = meta.importrelated(importoptions.m_appendtoparentmeta, destpath, rooturl, rootrevision, gh.getGitInfo(destpath)) - relatedimportinfo = importedmeta.getassociated() + def collectedmetalist = importedmeta.getassociated(destpath) echo "Cloning associated repos" - for(relatedmetainfo in relatedimportinfo) { - def relatedmeta = relatedmetainfo.meta - def relatedoffsetpath = relatedmetainfo.offsetpath + for(def collectedmeta in collectedmetalist) { + def relatedmeta = collectedmeta.metainfo + def relatedoffsetpath = collectedmeta.accumulatedpath def cloneurl = relatedmeta.releaseinfo.releaserepoURL def clonerevision = "refs/tags/${relatedmeta.releasetag()}" def clonepath = "${destpath}/${relatedoffsetpath}" diff --git a/meta/folder.groovy b/meta/folder.groovy index b9e898c..1fdd3ff 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -701,10 +701,6 @@ class MetaInfo extends GISJsonSerialised { associatedmeta = new ArrayList() } - List getassociated() { - return associatedmeta - } - void markreleased() { script.echo("Marking product: ${productinfo.productname} component: ${productinfo.subcomponentname} as released") releaseinfo.markreleased() @@ -1079,6 +1075,7 @@ class MetaInfo extends GISJsonSerialised { return [ 'metacollection' : ii.metacollection, 'metamap' : ii.metamap, 'comment': ii.comment ] } + // Walks all layers of associated data only def allrelatedmeta(String metapath = '') { def ArrayList metacollection = new ArrayList() def Map metamap = new LinkedHashMap() @@ -1092,6 +1089,11 @@ class MetaInfo extends GISJsonSerialised { return results.metacollection } + // Walks 1 layer of associated data only + def getassociated(String metapath) { + return releasewalker(1, '', metapath) + } + Map putwithshortestoffsetpath(Map releasemetacollection, String uniquestring, CollectedMeta metaitem) { if (releasemetacollection.containsKey(uniquestring)) { def existingentry = releasemetacollection[uniquestring] From 51224e052613daa518de977758d630a026b8bf73 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 11 Jan 2022 15:08:15 +0000 Subject: [PATCH 02/27] Correct hierarchical import of artifacts from release repositories --- import/importer.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/import/importer.groovy b/import/importer.groovy index 2c40215..773c7a7 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -214,7 +214,7 @@ def hierarchyartifactimportfromrepo(meta, importoptions, String destpath) { gh.stripgithistory(clonepath) - def metafilepath = "${clonepath}/${relatedmeta.metafilepath()}" + def metafilepath = "${clonepath}${relatedmeta.metafilepath()}" echo "Marking related meta as released and rewriting meta file: ${metafilepath}" rewritemetafileasreleased(relatedmeta, metafilepath) } From 8be38b88522cc3a8a119d6ae98e38ae13c6b9025 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 11 Jan 2022 15:14:48 +0000 Subject: [PATCH 03/27] Correct hierarchical import of artifacts from release repositories --- import/importer.groovy | 6 ++++-- meta/folder.groovy | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/import/importer.groovy b/import/importer.groovy index 773c7a7..621e5f2 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -199,9 +199,11 @@ def hierarchyartifactimportfromrepo(meta, importoptions, String destpath) { gh.gitCheckoutAlt(rooturl, rootrevision, destpath, "", 1, true, sparseitemlist) def importedmeta = meta.importrelated(importoptions.m_appendtoparentmeta, destpath, rooturl, rootrevision, gh.getGitInfo(destpath)) - + + echo "Getting associated metadata from path ${destpath}" def collectedmetalist = importedmeta.getassociated(destpath) - echo "Cloning associated repos" + + echo "Cloning associated repos inside ${destpath}" for(def collectedmeta in collectedmetalist) { def relatedmeta = collectedmeta.metainfo def relatedoffsetpath = collectedmeta.accumulatedpath diff --git a/meta/folder.groovy b/meta/folder.groovy index 1fdd3ff..12bc2cb 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -1090,8 +1090,8 @@ class MetaInfo extends GISJsonSerialised { } // Walks 1 layer of associated data only - def getassociated(String metapath) { - return releasewalker(1, '', metapath) + def getassociated(String rootpath) { + return releasewalker(1, rootpath, "${rootpath}/${METAFOLDERNAME}") } Map putwithshortestoffsetpath(Map releasemetacollection, String uniquestring, CollectedMeta metaitem) { From 5c3c949e374c1b59a53e75bb0469910b9efd195d Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 11 Jan 2022 15:20:27 +0000 Subject: [PATCH 04/27] Correct hierarchical import of artifacts from release repositories --- import/importer.groovy | 4 ++-- meta/folder.groovy | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/import/importer.groovy b/import/importer.groovy index 621e5f2..208e66b 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -200,10 +200,10 @@ def hierarchyartifactimportfromrepo(meta, importoptions, String destpath) { def importedmeta = meta.importrelated(importoptions.m_appendtoparentmeta, destpath, rooturl, rootrevision, gh.getGitInfo(destpath)) - echo "Getting associated metadata from path ${destpath}" + echo "Getting associated metadata from path: ${destpath}" def collectedmetalist = importedmeta.getassociated(destpath) - echo "Cloning associated repos inside ${destpath}" + echo "Cloning associated repos inside path: ${destpath}" for(def collectedmeta in collectedmetalist) { def relatedmeta = collectedmeta.metainfo def relatedoffsetpath = collectedmeta.accumulatedpath diff --git a/meta/folder.groovy b/meta/folder.groovy index 12bc2cb..de613f5 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -1091,7 +1091,7 @@ class MetaInfo extends GISJsonSerialised { // Walks 1 layer of associated data only def getassociated(String rootpath) { - return releasewalker(1, rootpath, "${rootpath}/${METAFOLDERNAME}") + return releasewalker(1, '', "${rootpath}/${METAFOLDERNAME}") } Map putwithshortestoffsetpath(Map releasemetacollection, String uniquestring, CollectedMeta metaitem) { From eb72549852e5f60ad5b1f5782406ef7d28d4e95f Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 11 Jan 2022 15:45:17 +0000 Subject: [PATCH 05/27] Correct hierarchical import of artifacts from release repositories --- meta/folder.groovy | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index de613f5..f08ecae 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -608,6 +608,7 @@ class MetaInfo extends GISJsonSerialised { abstract void deserialiseJson(rawmeta) abstract LinkedHashMap serialisationdata() abstract String getrelatedid() + abstract void markreleased() } class RelatedMetaInfo_v0_1 extends RelatedMetaInfo { @@ -642,6 +643,10 @@ class MetaInfo extends GISJsonSerialised { String getrelatedid() { return uniqueid } + + void markreleased() { + meta.releaseinfo.markreleased() + } } class RelatedMetaInfo_v0_2 extends RelatedMetaInfo { @@ -674,6 +679,10 @@ class MetaInfo extends GISJsonSerialised { String getrelatedid() { return uniqueid } + + void markreleased() { + // Do nothing + } } private ProductInfo productinfo @@ -705,7 +714,7 @@ class MetaInfo extends GISJsonSerialised { script.echo("Marking product: ${productinfo.productname} component: ${productinfo.subcomponentname} as released") releaseinfo.markreleased() for (associated in associatedmeta) { - associated.meta.releaseinfo.markreleased() + associated.markreleased() } } From b365f5b41825d26767635818b6ef2ed8c2583f62 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 11 Jan 2022 15:58:45 +0000 Subject: [PATCH 06/27] Correct hierarchical import of artifacts from release repositories --- meta/folder.groovy | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index f08ecae..9558ce9 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -1094,7 +1094,9 @@ class MetaInfo extends GISJsonSerialised { ArrayList releasewalker(int maxdepth, String startpath = '', String startmetapath = '') { def ArrayList metacollection = new ArrayList() def Map metamap = new LinkedHashMap() - def results = walkrelated(new IterationInfo(metacollection, metamap, 'meta', 0, startpath, startmetapath, true, maxdepth)) + def IterationInfo ii = new IterationInfo(metacollection, metamap, 'meta', 0, startpath, startmetapath, true, maxdepth) + script.echo("Release walker interation info at start:\n${ii.show()}") + def results = walkrelated(ii) return results.metacollection } From 00afcebd3df0b2489e424488ec7dd742770e4b1d Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 11 Jan 2022 16:23:57 +0000 Subject: [PATCH 07/27] Correct hierarchical import of artifacts from release repositories --- import/importer.groovy | 3 +++ meta/folder.groovy | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/import/importer.groovy b/import/importer.groovy index 208e66b..0e870af 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -202,6 +202,9 @@ def hierarchyartifactimportfromrepo(meta, importoptions, String destpath) { echo "Getting associated metadata from path: ${destpath}" def collectedmetalist = importedmeta.getassociated(destpath) + for(def collectedmeta in collectedmetalist) { + echo "Collection meta item: ${collectedmeta.metainfo.componentversionuniqueidentifier()} offset path: ${collectedmeta.accumulatedpath}" + } echo "Cloning associated repos inside path: ${destpath}" for(def collectedmeta in collectedmetalist) { diff --git a/meta/folder.groovy b/meta/folder.groovy index 9558ce9..b6d9a76 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -1095,7 +1095,7 @@ class MetaInfo extends GISJsonSerialised { def ArrayList metacollection = new ArrayList() def Map metamap = new LinkedHashMap() def IterationInfo ii = new IterationInfo(metacollection, metamap, 'meta', 0, startpath, startmetapath, true, maxdepth) - script.echo("Release walker interation info at start:\n${ii.show()}") + script.echo("Release walker iteration info at start:\n${ii.show()}") def results = walkrelated(ii) return results.metacollection } From 1a0dcf9ac2f7b6fb8f2b2bdca9746e2bb45fc9aa Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 11 Jan 2022 16:34:23 +0000 Subject: [PATCH 08/27] Correct hierarchical import of artifacts from release repositories --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index b6d9a76..6715145 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -1102,7 +1102,7 @@ class MetaInfo extends GISJsonSerialised { // Walks 1 layer of associated data only def getassociated(String rootpath) { - return releasewalker(1, '', "${rootpath}/${METAFOLDERNAME}") + return releasewalker(2, '', "${rootpath}/${METAFOLDERNAME}") // Max depth 2 (including itself) } Map putwithshortestoffsetpath(Map releasemetacollection, String uniquestring, CollectedMeta metaitem) { From aaa7b8ac086bbba6aa5e483f890214f029e59ebf Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 11 Jan 2022 17:39:57 +0000 Subject: [PATCH 09/27] Correct hierarchical import of artifacts from release repositories --- import/importer.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/import/importer.groovy b/import/importer.groovy index 0e870af..22dbc9e 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -56,7 +56,7 @@ class ImportOptions { m_sourceselect = sourceselect break default: - error("Unknown type of artifact source select: ${m_sourceselect}") + m_script.error("Unknown type of artifact source select: ${m_sourceselect}") } } From 0c87c2bccb2ebbeb78df00e015b73ce4dad20aad Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 11 Jan 2022 17:42:14 +0000 Subject: [PATCH 10/27] Correct hierarchical import of artifacts from release repositories --- import/importer.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/import/importer.groovy b/import/importer.groovy index 22dbc9e..6ec0841 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -56,7 +56,7 @@ class ImportOptions { m_sourceselect = sourceselect break default: - m_script.error("Unknown type of artifact source select: ${m_sourceselect}") + m_script.error("Unknown type of artifact source select: ${sourceselect}") } } From 2c26b221f12ad963c322612f2935afeb2705c68c Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 11 Jan 2022 18:09:03 +0000 Subject: [PATCH 11/27] Correct hierarchical import of artifacts from release repositories --- import/importer.groovy | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/import/importer.groovy b/import/importer.groovy index 6ec0841..bb0d32e 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -151,7 +151,7 @@ def conditionalClean(ImportOptions importoptions, String destpath) { } } -def artifactimportfrombuildjob(meta, importoptions, String destpath) { +def artifactimportfrombuildjob(meta, ImportOptions importoptions, String destpath) { if (importoptions.m_sourceselect != 'Jenkins job artifact') { error("Import options settings have not been set for: Jenkins job artifact") return @@ -183,7 +183,7 @@ def rewritemetafileasreleased(meta, String filepath) { meta.saveJsonSerialised(filepath) } -def hierarchyartifactimportfromrepo(meta, importoptions, String destpath) { +def hierarchyartifactimportfromrepo(meta, ImportOptions importoptions, String destpath) { if (importoptions.m_sourceselect != 'Release repository') { error("Import options settings have not been set for: Release repository") return @@ -234,7 +234,7 @@ def hierarchyartifactimportfromrepo(meta, importoptions, String destpath) { return importedmeta } -def artifactimportfromrepo(meta, importoptions, String destpath) { +def artifactimportfromrepo(meta, ImportOptions importoptions, String destpath) { if (importoptions.m_sourceselect != 'Release repository') { error("Import options settings have not been set for: Release repository") return @@ -262,7 +262,7 @@ def artifactimportfromrepo(meta, importoptions, String destpath) { return importedmeta } -def artifactimport(meta, importoptions, String destpath) { +def artifactimport(meta, ImportOptions importoptions, String destpath) { switch (importoptions.m_sourceselect) { case 'Jenkins job artifact': case 'Jenkins job artefact': @@ -347,7 +347,13 @@ def artifactimport(meta, } // Import the artifacts of a named child component found below parent meta's hierarchy -def artifactimport(meta, parentmeta, String parentmetapath, String childproduct, String childsubcomponent, importoptions, String destinationfolder) { +def artifactimport(meta, + parentmeta, + String parentmetapath, + String childproduct, + String childsubcomponent, + ImportOptions importoptions, + String destinationfolder) { // Import from parent meta def childmeta = meta.getNewMetaObject() def childmeta2 @@ -356,7 +362,7 @@ def artifactimport(meta, parentmeta, String parentmetapath, String childproduct, def findresults = parentmeta.findAssociatedMeta(parentmetapath, childproduct, childsubcomponent) if (findresults.matchfound) { childmeta = findresults.matchedmetaitem.metainfo - if (childmeta.releaseinfo.released) { + if (importoptions.m_sourceselect == 'Release repository' || childmeta.releaseinfo.released) { importoptions.releaserepo(childmeta.releaseinfo.releaserepoURL, childmeta.releasetag()) } else { importoptions.jenkinsjob(childmeta.jenkinsbuildinfo.buildjobname, childmeta.jenkinsbuildinfo.buildnumber) From f821da79d81ee32c13f98d60210f76e09c4bb772 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 13 Jan 2022 12:38:49 +0000 Subject: [PATCH 12/27] CORE-594 - Debug installer creation --- import/importer.groovy | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/import/importer.groovy b/import/importer.groovy index bb0d32e..8df88e1 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -45,6 +45,10 @@ class ImportOptions { m_appendtoparentmeta = appendtoparentmeta } + void show() { + script.echo(this.toString()) + } + void setsourceselect(String sourceselect) { sourceselect = sourceselect.trim() switch (sourceselect) { @@ -263,6 +267,7 @@ def artifactimportfromrepo(meta, ImportOptions importoptions, String destpath) { } def artifactimport(meta, ImportOptions importoptions, String destpath) { + importoptions.show() switch (importoptions.m_sourceselect) { case 'Jenkins job artifact': case 'Jenkins job artefact': From cfcdf5c827e9614001893376e96dc7e6f9c441a8 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 13 Jan 2022 12:40:52 +0000 Subject: [PATCH 13/27] CORE-594 - Debug installer creation --- import/importer.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/import/importer.groovy b/import/importer.groovy index 8df88e1..8bc96a3 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -46,7 +46,7 @@ class ImportOptions { } void show() { - script.echo(this.toString()) + m_script.echo(this.toString()) } void setsourceselect(String sourceselect) { From 5b3f7a7226ba252489459f8b74f767491f00e5ae Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 13 Jan 2022 13:03:32 +0000 Subject: [PATCH 14/27] CORE-594 - Debug installer creation --- import/importer.groovy | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/import/importer.groovy b/import/importer.groovy index 8bc96a3..2f7611e 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -45,8 +45,22 @@ class ImportOptions { m_appendtoparentmeta = appendtoparentmeta } - void show() { - m_script.echo(this.toString()) + String show() { + return """m_incrementversionnumber: ${m_incrementversionnumber} + m_filter: ${m_filter} + m_excludes: ${m_excludes} + m_fingerprint: ${m_fingerprint} + m_nested: ${m_nested} + m_flatten: ${m_flatten} + m_includemetainfilter: ${m_includemetainfilter} + m_clean: ${m_clean} + m_appendtoparentmeta: ${m_appendtoparentmeta} + m_sourceselect: ${m_sourceselect} + m_jobname: ${m_jobname} + m_buildnumberorselector: ${m_buildnumberorselector} + m_repo: ${m_repo} + m_revision: ${m_revision} + """ } void setsourceselect(String sourceselect) { @@ -267,7 +281,7 @@ def artifactimportfromrepo(meta, ImportOptions importoptions, String destpath) { } def artifactimport(meta, ImportOptions importoptions, String destpath) { - importoptions.show() + echo "Importing artifacts: Import options:\n${importoptions.show()}\n to: ${destpath}" switch (importoptions.m_sourceselect) { case 'Jenkins job artifact': case 'Jenkins job artefact': From a1c2d3b336a64e7bfa71e45381b74e78ea3b07f3 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 13 Jan 2022 13:35:50 +0000 Subject: [PATCH 15/27] CORE-594 - Debug installer creation --- import/importer.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/import/importer.groovy b/import/importer.groovy index 2f7611e..af40c5f 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -127,7 +127,7 @@ class ImportOptions { m_jobname = jobname.trim() m_buildnumberorselector = [ $class: 'ParameterizedBuildSelector', - parameterName: "${buildnumberorselector}" + parameterName: "${buildnumberorselector}" ] setsourceselect('Jenkins job artifact') } From 36ed63e11b8a994ce8fefe0b8b903f25765e5814 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 13 Jan 2022 13:39:13 +0000 Subject: [PATCH 16/27] CORE-594 - Debug installer creation --- import/importer.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/import/importer.groovy b/import/importer.groovy index af40c5f..b2dc41b 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -114,7 +114,7 @@ class ImportOptions { m_appendtoparentmeta = appendtoparentmeta } - void jenkinsjob(String jobname, buildnumberorselector) { + void jenkinsjob(String jobname, String buildnumberorselector) { m_jobname = jobname.trim() m_buildnumberorselector = [ $class: 'ParameterizedBuildSelector', From 945f83759dfb6817275abed13480f3ff18c51675 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 13 Jan 2022 14:16:27 +0000 Subject: [PATCH 17/27] CORE-594 - Debug installer creation --- import/importer.groovy | 10 ++++++++-- install/installhelper.groovy | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/import/importer.groovy b/import/importer.groovy index b2dc41b..d6fb4d4 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -20,6 +20,8 @@ class ImportOptions { String m_repo String m_revision + + boolean m_showdetails ImportOptions(script, String sourceselect = 'Jenkins job artifact', @@ -31,7 +33,8 @@ class ImportOptions { boolean flatten = false, boolean includemetainfilter = true, boolean clean = true, - appendtoparentmeta = true) { + appendtoparentmeta = true, + show = false) { m_script = script m_sourceselect = sourceselect.trim() m_incrementversionnumber = incrementversionnumber @@ -43,6 +46,7 @@ class ImportOptions { m_includemetainfilter = includemetainfilter m_clean = clean m_appendtoparentmeta = appendtoparentmeta + m_showdetails = show } String show() { @@ -281,7 +285,9 @@ def artifactimportfromrepo(meta, ImportOptions importoptions, String destpath) { } def artifactimport(meta, ImportOptions importoptions, String destpath) { - echo "Importing artifacts: Import options:\n${importoptions.show()}\n to: ${destpath}" + if (importoptions.m_show) { + echo "Importing artifacts:\nImport options:\n${importoptions.show()}\nto: ${destpath}" + } switch (importoptions.m_sourceselect) { case 'Jenkins job artifact': case 'Jenkins job artefact': diff --git a/install/installhelper.groovy b/install/installhelper.groovy index 96a8b2e..2915d0c 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -26,6 +26,7 @@ def copyToFinalPosition(String pathToIntermediate, String finalBaseFolder, Strin def Map artifactsImporter(meta, importer, artifactDetails, installerDetails) { artifactFetched = [:] + echo ("artifactDetails:\n${artifactDetails}\ninstallerDetails:\n${installerDetails}") def importoptions = importer.getNewImportOptions() for (installer in toBuild) { def artifactKeys = installerDetails.get(installer)[1] From d70f63344e8faef8448b5267eca6093bde946145 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 13 Jan 2022 14:21:53 +0000 Subject: [PATCH 18/27] CORE-594 - Debug installer creation --- import/importer.groovy | 10 +++++++--- install/installhelper.groovy | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/import/importer.groovy b/import/importer.groovy index d6fb4d4..4948cad 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -34,7 +34,7 @@ class ImportOptions { boolean includemetainfilter = true, boolean clean = true, appendtoparentmeta = true, - show = false) { + showdetails = false) { m_script = script m_sourceselect = sourceselect.trim() m_incrementversionnumber = incrementversionnumber @@ -46,7 +46,7 @@ class ImportOptions { m_includemetainfilter = includemetainfilter m_clean = clean m_appendtoparentmeta = appendtoparentmeta - m_showdetails = show + m_showdetails = showdetails } String show() { @@ -147,6 +147,10 @@ class ImportOptions { releaserepo(repo, revision) setsourceselect(sourceselect) } + + void showdetails(boolean showdetails) { + m_showdetails = showdetails + } } ImportOptions getNewImportOptions() { @@ -285,7 +289,7 @@ def artifactimportfromrepo(meta, ImportOptions importoptions, String destpath) { } def artifactimport(meta, ImportOptions importoptions, String destpath) { - if (importoptions.m_show) { + if (importoptions.m_showdetails) { echo "Importing artifacts:\nImport options:\n${importoptions.show()}\nto: ${destpath}" } switch (importoptions.m_sourceselect) { diff --git a/install/installhelper.groovy b/install/installhelper.groovy index 2915d0c..9c11499 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -23,11 +23,12 @@ def copyToFinalPosition(String pathToIntermediate, String finalBaseFolder, Strin } // Given details about artifacts to import and details of installers to build, import artifacts that are required -def Map artifactsImporter(meta, importer, artifactDetails, installerDetails) { +def Map artifactsImporter(meta, importer, artifactDetails, installerDetails, boolean showdetails = false) { artifactFetched = [:] echo ("artifactDetails:\n${artifactDetails}\ninstallerDetails:\n${installerDetails}") def importoptions = importer.getNewImportOptions() + importoptions.showdetails(showdetails) for (installer in toBuild) { def artifactKeys = installerDetails.get(installer)[1] if (artifactKeys instanceof java.lang.String) { From 05a32d03f832828ddca41325ef2b6b9934b2aebc Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 13 Jan 2022 14:29:40 +0000 Subject: [PATCH 19/27] CORE-594 - Debug installer creation --- install/installhelper.groovy | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/install/installhelper.groovy b/install/installhelper.groovy index 9c11499..214fa84 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -26,7 +26,9 @@ def copyToFinalPosition(String pathToIntermediate, String finalBaseFolder, Strin def Map artifactsImporter(meta, importer, artifactDetails, installerDetails, boolean showdetails = false) { artifactFetched = [:] - echo ("artifactDetails:\n${artifactDetails}\ninstallerDetails:\n${installerDetails}") + if (showdetails) { + echo ("toBuild:\n${toBuild}\nartifactDetails:\n${artifactDetails}\ninstallerDetails:\n${installerDetails}") + } def importoptions = importer.getNewImportOptions() importoptions.showdetails(showdetails) for (installer in toBuild) { From d2820996984068d8632ff5060ec3fd1c0758a699 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 13 Jan 2022 14:36:22 +0000 Subject: [PATCH 20/27] CORE-594 - Debug installer creation --- install/installhelper.groovy | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/install/installhelper.groovy b/install/installhelper.groovy index 214fa84..a637fac 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -32,10 +32,17 @@ def Map artifactsImporter(meta, importer, artifactDetails, installerDetails, boo def importoptions = importer.getNewImportOptions() importoptions.showdetails(showdetails) for (installer in toBuild) { - def artifactKeys = installerDetails.get(installer)[1] + def installerinfo = installerDetails.get(installer) + if (showdetails) { + echo ("installer:\n${installer}\installerinfo:\n${installerinfo}") + } + def artifactKeys = installerinfo[1] if (artifactKeys instanceof java.lang.String) { artifactKeys = [ artifactKeys ] } + if (showdetails) { + echo ("artifactKeys:\n${artifactKeys}") + } for (artifactKey in artifactKeys) { (sourceProject, sourceselector, destFolder, incrementversionnumber, toCopy, notToCopy, binariesFolders) = artifactDetails.get(artifactKey) if (artifactFetched.get(artifactKey) == null) { From f1987cb9f47afdbdcefdc545567b71d86fee0c9d Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 13 Jan 2022 14:38:48 +0000 Subject: [PATCH 21/27] CORE-594 - Debug installer creation --- install/installhelper.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/installhelper.groovy b/install/installhelper.groovy index a637fac..926775e 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -34,7 +34,7 @@ def Map artifactsImporter(meta, importer, artifactDetails, installerDetails, boo for (installer in toBuild) { def installerinfo = installerDetails.get(installer) if (showdetails) { - echo ("installer:\n${installer}\installerinfo:\n${installerinfo}") + echo ("installer:\n${installer}\ninstallerinfo:\n${installerinfo}") } def artifactKeys = installerinfo[1] if (artifactKeys instanceof java.lang.String) { From fb721bb774e5a849d316aea9939bb4ddc491fe92 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 13 Jan 2022 14:44:49 +0000 Subject: [PATCH 22/27] CORE-594 - Debug installer creation --- install/installhelper.groovy | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/install/installhelper.groovy b/install/installhelper.groovy index 926775e..3a1cd23 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -44,7 +44,11 @@ def Map artifactsImporter(meta, importer, artifactDetails, installerDetails, boo echo ("artifactKeys:\n${artifactKeys}") } for (artifactKey in artifactKeys) { - (sourceProject, sourceselector, destFolder, incrementversionnumber, toCopy, notToCopy, binariesFolders) = artifactDetails.get(artifactKey) + artifactDetail = artifactDetails.get(artifactKey) + if (showdetails) { + echo ("artifactKey: ${artifactKey}\nartifactDetail:\n${artifactDetail}") + } + (sourceProject, sourceselector, destFolder, incrementversionnumber, toCopy, notToCopy, binariesFolders) = artifactDetail if (artifactFetched.get(artifactKey) == null) { importoptions.jenkinsjob(sourceProject, sourceselector) importoptions.setincrementversionnumber(incrementversionnumber) From eda480161f3b55b34ed217607eaf978fd5b425df Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 13 Jan 2022 15:12:47 +0000 Subject: [PATCH 23/27] CORE-594 - Debug installer creation --- install/installhelper.groovy | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install/installhelper.groovy b/install/installhelper.groovy index 3a1cd23..77b917c 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -60,6 +60,9 @@ def Map artifactsImporter(meta, importer, artifactDetails, installerDetails, boo } } } + if (showdetails) { + echo ("artifactFetched:\n${artifactFetched}") + } return artifactFetched } From cdd00fdeefd8663a92cf303d3cbc6d4e88ce754d Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 13 Jan 2022 16:28:00 +0000 Subject: [PATCH 24/27] CORE-594 - Debug installer creation --- install/installhelper.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/installhelper.groovy b/install/installhelper.groovy index 77b917c..6763cb1 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -23,7 +23,7 @@ def copyToFinalPosition(String pathToIntermediate, String finalBaseFolder, Strin } // Given details about artifacts to import and details of installers to build, import artifacts that are required -def Map artifactsImporter(meta, importer, artifactDetails, installerDetails, boolean showdetails = false) { +def Map artifactsImporter(meta, importer, toBuild, artifactDetails, installerDetails, boolean showdetails = false) { artifactFetched = [:] if (showdetails) { From 6a415afe26eaa813ef1a5df891b9cfc52f1ee2ce Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 13 Jan 2022 18:46:33 +0000 Subject: [PATCH 25/27] CORE-594 - Debug installer creation --- install/installhelper.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/install/installhelper.groovy b/install/installhelper.groovy index 6763cb1..57fe65b 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -111,6 +111,7 @@ def checkISMfilebackend(String xml) { def checkISMfile(String ISMfile) { echo "Checking ISM file: ${ISMfile}" def xml = readFile(ISMfile) + echo "ISM file xml: ${xml}" (exitcode, message) = checkISMfilebackend(xml) echo message if (exitcode > 0) { From 951032de5a24f774f294d2241e67ad4260b9301a Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 13 Jan 2022 22:17:14 +0000 Subject: [PATCH 26/27] CORE-594 - Debug installer creation --- install/installhelper.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/installhelper.groovy b/install/installhelper.groovy index 57fe65b..8dbf23e 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -111,7 +111,7 @@ def checkISMfilebackend(String xml) { def checkISMfile(String ISMfile) { echo "Checking ISM file: ${ISMfile}" def xml = readFile(ISMfile) - echo "ISM file xml: ${xml}" + //echo "ISM file xml: ${xml}" (exitcode, message) = checkISMfilebackend(xml) echo message if (exitcode > 0) { From 8e15e7b6ce1690fadd187ac6542a82c78a8c0831 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 14 Jan 2022 10:21:06 +0000 Subject: [PATCH 27/27] CORE-594 - Import artifacts using full name --- artifacts/metaexport.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artifacts/metaexport.groovy b/artifacts/metaexport.groovy index 8e5e56e..a40e9a8 100644 --- a/artifacts/metaexport.groovy +++ b/artifacts/metaexport.groovy @@ -4,7 +4,7 @@ def combineSubjobArtifacts(meta, importer, subJobs) { for (subJob in subJobs) { def subJobObject = subJob[0] if (subJobObject != null) { - def subJobName = subJobObject.getProjectName() + def subJobName = subJobObject.getFullProjectName() def subJobNumber = subJobObject.getNumber() def destFolder = subJob[1] def boolean incrementversionnumber = subJob[2]