From b32a5116dd657f59b30ef079c6bc9c1056833796 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 25 Oct 2019 16:18:19 +0100 Subject: [PATCH 01/15] GIS-1621 - Remove local diffing (superceded); Add as much git info to a meta object when it is not being provided - for old jobs not providing meta information --- configuration/configuration.groovy | 2 +- differences/do.groovy | 18 ------------------ import/importer.groovy | 4 ++-- meta/folder.groovy | 25 ++----------------------- 4 files changed, 5 insertions(+), 44 deletions(-) delete mode 100644 differences/do.groovy diff --git a/configuration/configuration.groovy b/configuration/configuration.groovy index b8c0b47..2a7f1ab 100644 --- a/configuration/configuration.groovy +++ b/configuration/configuration.groovy @@ -5,7 +5,7 @@ def registerConfigurationInfo(meta, String configurationName, String configurati } def registerPipelineScriptConfiguration(meta) { - registerConfigurationInfo(meta, 'pipeline script', '-', '-', gh.getGitInfo("${autobuilder.getautobuildpath()}")) + registerConfigurationInfo(meta, 'pipeline script', '-', '-', gh.getGitInfo(autobuilder.getautobuildpath())) } def gitCheckoutAndRegister(meta, String tool, String gitURL, String revision, String targetDir, String repoRoot = "", int cloneDepth = 1, boolean shallowClone = true, String filter = '') { diff --git a/differences/do.groovy b/differences/do.groovy deleted file mode 100644 index 32f18b5..0000000 --- a/differences/do.groovy +++ /dev/null @@ -1,18 +0,0 @@ - -def differences(meta, String sourcerevision, String previoussourcerevision, String sourcepath) { - def String cs = autobuilder.commonscripts() - def String difffile = meta.difffilepath() - def String jirakey = meta.productinfo.jirakey - if (isUnix()) { - sh """ - "${PYTHON}" -u "${cs}/differences/show_release_differences.py" -g "${sourcepath}" -s "${sourcerevision}" -p "${previoussourcerevision}" -j "${jirakey}" -o "opposite notcommon" -f "${difffile}" - """ - } - else { - bat """ - "${PYTHON}" -u "${cs}\\differences\\show_release_differences.py" -g "${sourcepath}" -s "${sourcerevision}" -p "${previoussourcerevision}" -j "${jirakey}" -o "opposite notcommon" -f "${difffile}" - """ - } -} - -return this; diff --git a/import/importer.groovy b/import/importer.groovy index ba5eb0b..78c0d62 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -51,7 +51,7 @@ def hierarchyartifactimportfromrepo(meta, String repo, String revision, String d def ArrayList sparseitemlist = gh.convertSparseItemsString(filter) gh.gitCheckoutAlt(rooturl, rootrevision, destpath, "", 1, true, sparseitemlist) - def importedmeta = meta.importrelated(destpath) + def importedmeta = meta.importrelated(destpath, rooturl, rootrevision, gh.getGitInfo(destpath)) relatedimportinfo = importedmeta.getassociated() echo "Cloning associated repos" @@ -90,7 +90,7 @@ def artifactimportfromrepo(meta, String repo, String revision, String destpath, def ArrayList sparseitemlist = gh.convertSparseItemsString(filter) gh.gitCheckoutAlt(rooturl, rootrevision, destpath, "", 1, true, sparseitemlist) - def importedmeta = meta.importrelated(destpath) + def importedmeta = meta.importrelated(destpath, rooturl, rootrevision, gh.getGitInfo(destpath)) gh.stripgithistory(destpath) def metafilepath = "${destpath}/${meta.metafilepath()}" diff --git a/meta/folder.groovy b/meta/folder.groovy index 6967def..6371f38 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -429,11 +429,8 @@ class PublishableInfo extends GISJsonSerialised { class MetaInfo extends GISJsonSerialised { private static String FORMAT = "0.1" private static String METAFOLDERNAME = "meta" - private static String DIFFFOLDERNAME = "diff" private static String METAFILENAME = "info.json" - private static String METADIFFFILENAME = "differences.txt" private static String METAARTIFACTS = "${METAFOLDERNAME}/**" - private static String DIFFARTIFACTS = "${DIFFFOLDERNAME}/**" class RelatedMetaInfo extends GISJsonSerialised { String offsetpath @@ -607,11 +604,7 @@ class MetaInfo extends GISJsonSerialised { return METAFOLDERNAME + "/" + METAFILENAME } - static String difffilepath() { - return DIFFFOLDERNAME + "/" + METADIFFFILENAME - } - - MetaInfo importrelated(String destpath) { + MetaInfo importrelated(String destpath, String givenRepo = 'Unknown', String givenRevision = 'Unknown', String givenSHA = 'Unknown') { MetaInfo mi = new MetaInfo(script) def String adjustedpath = relativize(destpath) @@ -620,22 +613,12 @@ class MetaInfo extends GISJsonSerialised { mi.deserialiseJson(importedmetafile) } else { script.echo("Could not deserialise meta at file: ${importedmetafile} (destpath: ${destpath})- Does not exist") + mi.addConfigurationInfo('', givenRepo, givenRevision, givenSHA) } RelatedMetaInfo rmi = new RelatedMetaInfo(script, adjustedpath, mi) associatedmeta.add(rmi) - def importedmetadifffile = adjustedpath + "/" + difffilepath() - if (script.fileExists(importedmetadifffile)) { - def String newcontents = script.readFile(file: importedmetadifffile) - def String currentcontents = "" - if (script.fileExists(difffilepath())) { - currentcontents = script.readFile(file: difffilepath()) - } - - script.writeFile(file: difffilepath(), text: currentcontents + "\n" + mi.productinfo.productname + " " + mi.productinfo.subcomponentname + ":\n" + newcontents) - } - return mi } @@ -660,10 +643,6 @@ class MetaInfo extends GISJsonSerialised { return METAFOLDERNAME } - static String difffolder() { - return DIFFFOLDERNAME - } - String generateartifacts(ArrayList releasedfromhere = new ArrayList(), // These items are recorded in meta as released from here ArrayList releasedfromsubmeta = new ArrayList(), // These items are not recorded in meta as released from here String metafilepath ="${METAFOLDERNAME}/${METAFILENAME}" From f6a55441cf4edca1b789332df255a59ae3979843 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 25 Oct 2019 16:20:57 +0100 Subject: [PATCH 02/15] GIS-1621 - Remove local diffing (superceded); Add as much git info to a meta object when it is not being provided - for old jobs not providing meta information --- meta/folder.groovy | 4 ---- 1 file changed, 4 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 6371f38..2e142a2 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -756,10 +756,6 @@ MetaInfo metareset(script) { deleteDir() } - dir(mi.difffolder()) { - deleteDir() - } - return mi } From a13f11435b7dec72fe8a98a2838b6995ec890f5a Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 25 Oct 2019 16:59:55 +0100 Subject: [PATCH 03/15] GIS-1621 - Remove local diffing (superceded); Add as much git info to a meta object when it is not being provided - for old jobs not providing meta information --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 2e142a2..e5f34f0 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -647,7 +647,7 @@ class MetaInfo extends GISJsonSerialised { ArrayList releasedfromsubmeta = new ArrayList(), // These items are not recorded in meta as released from here String metafilepath ="${METAFOLDERNAME}/${METAFILENAME}" ) { - def String artifactlist = "${METAARTIFACTS},${DIFFARTIFACTS}" + def String artifactlist = METAARTIFACTS releaseinfo.addReleaseItem(METAARTIFACTS) for (releaseitem in releasedfromhere) { artifactlist += "," + releaseitem From d0ed9310fc8502e8153cc8277341f734368c620c Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 7 Nov 2019 09:11:10 +0000 Subject: [PATCH 04/15] GIS-1621 - Be selective with releases - don't show those with tags beginning with erroneous_ superceded_ faulty_ inmainline_ unless SHOWALL parameter is true --- publish/promptingpublish.groovy | 16 +++++++++++++++- publish/publishitems.groovy | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index ced73a2..670501d 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -53,7 +53,21 @@ pipeline { steps { script { gh = load("${autobuilder.commonscripts()}/versioncontrol/git.groovy") - def releases = gh.gettaglist(SOURCEDIR) + def allreleases = gh.gettaglist(SOURCEDIR) + showall = SHOWALL ?: 'false' + def releases + if (showall) { + releases = allreleases + } else { + for (release in allreleases) { + if (!release.toLowerCase().startsWith("superceded_") && + !release.toLowerCase().startsWith("erroneous_") && + !release.toLowerCase().startsWith("faulty_") && + !release.toLowerCase().startsWith("inmainline_")) { + releases.append(release) + } + } + } timeout(time: 10, unit: 'MINUTES') { release = input( message: 'Please select the software version', diff --git a/publish/publishitems.groovy b/publish/publishitems.groovy index d84123d..677970e 100644 --- a/publish/publishitems.groovy +++ b/publish/publishitems.groovy @@ -124,4 +124,4 @@ PublishableItemsSelection createItemSelector( return pis } -return this; \ No newline at end of file +return this; From 1f55e79acfa5989183c409e7e6d8f60ee96ed57b Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 7 Nov 2019 09:22:23 +0000 Subject: [PATCH 05/15] GIS-1621 - Be selective with releases - don't show those with tags beginning with erroneous_ superceded_ faulty_ inmainline_ unless SHOWALL parameter is true --- publish/promptingpublish.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index 670501d..fb312f0 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -63,6 +63,7 @@ pipeline { if (!release.toLowerCase().startsWith("superceded_") && !release.toLowerCase().startsWith("erroneous_") && !release.toLowerCase().startsWith("faulty_") && + !release.toLowerCase().startsWith("ignore_") && !release.toLowerCase().startsWith("inmainline_")) { releases.append(release) } From fc3d611c844ed2219061aae4d2fd4b5cde7f2398 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 7 Nov 2019 09:45:09 +0000 Subject: [PATCH 06/15] GIS-1621 - Be selective with releases - don't show those with tags beginning with erroneous_ superceded_ faulty_ inmainline_ unless SHOWALL parameter is true --- publish/promptingpublish.groovy | 2 ++ 1 file changed, 2 insertions(+) diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index fb312f0..6950754 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -55,11 +55,13 @@ pipeline { gh = load("${autobuilder.commonscripts()}/versioncontrol/git.groovy") def allreleases = gh.gettaglist(SOURCEDIR) showall = SHOWALL ?: 'false' + echo("showall: ${showall} ${SHOWALL}") def releases if (showall) { releases = allreleases } else { for (release in allreleases) { + echo("Evaluating: |${release}|") if (!release.toLowerCase().startsWith("superceded_") && !release.toLowerCase().startsWith("erroneous_") && !release.toLowerCase().startsWith("faulty_") && From 6ce20315af1d097c90e5bbfbfe51c6e1192c1520 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 7 Nov 2019 09:47:59 +0000 Subject: [PATCH 07/15] GIS-1621 - Be selective with releases - don't show those with tags beginning with erroneous_ superceded_ faulty_ inmainline_ unless SHOWALL parameter is true --- publish/promptingpublish.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index 6950754..80dc633 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -54,7 +54,7 @@ pipeline { script { gh = load("${autobuilder.commonscripts()}/versioncontrol/git.groovy") def allreleases = gh.gettaglist(SOURCEDIR) - showall = SHOWALL ?: 'false' + boolean showall = (SHOWALL == 'true') echo("showall: ${showall} ${SHOWALL}") def releases if (showall) { From 1bd181cd0b3f0ca44d0d61f67c7b73c08e335d5b Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 7 Nov 2019 09:50:30 +0000 Subject: [PATCH 08/15] GIS-1621 - Be selective with releases - don't show those with tags beginning with erroneous_ superceded_ faulty_ inmainline_ unless SHOWALL parameter is true --- publish/promptingpublish.groovy | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index 80dc633..bf95bb2 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -55,8 +55,7 @@ pipeline { gh = load("${autobuilder.commonscripts()}/versioncontrol/git.groovy") def allreleases = gh.gettaglist(SOURCEDIR) boolean showall = (SHOWALL == 'true') - echo("showall: ${showall} ${SHOWALL}") - def releases + def releases = new ArrayList() if (showall) { releases = allreleases } else { From 3e27e84050ddd73e8b852970a23c4b6a034962da Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 7 Nov 2019 09:53:52 +0000 Subject: [PATCH 09/15] GIS-1621 - Be selective with releases - don't show those with tags beginning with erroneous_ superceded_ faulty_ inmainline_ unless SHOWALL parameter is true --- publish/promptingpublish.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index bf95bb2..d8d5303 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -66,7 +66,7 @@ pipeline { !release.toLowerCase().startsWith("faulty_") && !release.toLowerCase().startsWith("ignore_") && !release.toLowerCase().startsWith("inmainline_")) { - releases.append(release) + releases.add(release) } } } From d5ab89e81edbc4d984bebcc026ec7a1b67d1b703 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 7 Nov 2019 09:55:55 +0000 Subject: [PATCH 10/15] GIS-1621 - Be selective with releases - don't show those with tags beginning with erroneous_ superceded_ faulty_ inmainline_ unless SHOWALL parameter is true --- publish/promptingpublish.groovy | 1 - 1 file changed, 1 deletion(-) diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index d8d5303..f2372cd 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -60,7 +60,6 @@ pipeline { releases = allreleases } else { for (release in allreleases) { - echo("Evaluating: |${release}|") if (!release.toLowerCase().startsWith("superceded_") && !release.toLowerCase().startsWith("erroneous_") && !release.toLowerCase().startsWith("faulty_") && From 15f4c4acd3800602327f91f082cb08653e6b0c08 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 7 Nov 2019 17:39:56 +0000 Subject: [PATCH 11/15] GIS-1621 - Add some output to debug why configuration information is not being added to imported logic meta --- import/importer.groovy | 4 ++-- meta/folder.groovy | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/import/importer.groovy b/import/importer.groovy index 78c0d62..25b2614 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -85,7 +85,7 @@ def hierarchyartifactimportfromrepo(meta, String repo, String revision, String d def artifactimportfromrepo(meta, String repo, String revision, String destpath, boolean incrementversionnumber = true, String filter = '', String excludes = '', boolean fingerprint = false) { def rooturl = repo.trim() def rootrevision = revision.trim() - echo "Cloning root release repo: ${rooturl}, revision: ${rootrevision} at folder: ${destpath}" + echo "Cloning release repo: ${rooturl}, revision: ${rootrevision} at folder: ${destpath}" def ArrayList sparseitemlist = gh.convertSparseItemsString(filter) gh.gitCheckoutAlt(rooturl, rootrevision, destpath, "", 1, true, sparseitemlist) @@ -94,7 +94,7 @@ def artifactimportfromrepo(meta, String repo, String revision, String destpath, gh.stripgithistory(destpath) def metafilepath = "${destpath}/${meta.metafilepath()}" - echo "Marking root meta as released and rewriting meta file: ${metafilepath}" + echo "Marking meta as released and rewriting meta file: ${metafilepath}" rewritemetafileasreleased(importedmeta, metafilepath) if (incrementversionnumber) { diff --git a/meta/folder.groovy b/meta/folder.groovy index e5f34f0..40f03aa 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -511,6 +511,7 @@ class MetaInfo extends GISJsonSerialised { void addConfigurationInfo(String configurationname, String configurationURL, String configurationversion, String configurationSHA) { def ConfigurationInfo ci = new ConfigurationInfo(script, configurationname, configurationURL, configurationversion, configurationSHA) + script.echo("Adding configuration info: name: ${configurationname} url: ${configurationURL} version: ${configurationversion} sha: ${configurationSHA}") configurationinfo.add(ci) } From a006c13b6280e72626dad107020906361787383e Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 8 Nov 2019 17:44:18 +0000 Subject: [PATCH 12/15] GIS-1621 - Debug release filtering --- publish/promptingpublish.groovy | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index f2372cd..6f0a6a5 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -54,17 +54,20 @@ pipeline { script { gh = load("${autobuilder.commonscripts()}/versioncontrol/git.groovy") def allreleases = gh.gettaglist(SOURCEDIR) - boolean showall = (SHOWALL == 'true') + boolean filterredundantreleases = (FILTER_REDUNDANT_RELEASES == 'true') def releases = new ArrayList() - if (showall) { + if (!filterredundantreleases) { + echo("Showing all releases") releases = allreleases } else { + echo("Showing filtered releases") for (release in allreleases) { if (!release.toLowerCase().startsWith("superceded_") && !release.toLowerCase().startsWith("erroneous_") && !release.toLowerCase().startsWith("faulty_") && !release.toLowerCase().startsWith("ignore_") && !release.toLowerCase().startsWith("inmainline_")) { + echo("Showing release: ${release}") releases.add(release) } } From da6b830e8cc068a105ac89e3cb5905ee16fc16c4 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 9 Nov 2019 08:03:23 +0000 Subject: [PATCH 13/15] GIS-1621 - Debug release filtering --- publish/promptingpublish.groovy | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index 6f0a6a5..29e9bfd 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -62,11 +62,11 @@ pipeline { } else { echo("Showing filtered releases") for (release in allreleases) { - if (!release.toLowerCase().startsWith("superceded_") && - !release.toLowerCase().startsWith("erroneous_") && - !release.toLowerCase().startsWith("faulty_") && - !release.toLowerCase().startsWith("ignore_") && - !release.toLowerCase().startsWith("inmainline_")) { + if (!release.toLowerCase().startsWith("superceded") && + !release.toLowerCase().startsWith("erroneous") && + !release.toLowerCase().startsWith("faulty") && + !release.toLowerCase().startsWith("ignore") && + !release.toLowerCase().startsWith("inmainline")) { echo("Showing release: ${release}") releases.add(release) } From 6b5490069869ca03c4284a2eaa1e39b7574a9558 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 9 Nov 2019 08:08:42 +0000 Subject: [PATCH 14/15] GIS-1621 - Debug release filtering --- publish/promptingpublish.groovy | 2 ++ 1 file changed, 2 insertions(+) diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index 29e9bfd..80305ab 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -69,6 +69,8 @@ pipeline { !release.toLowerCase().startsWith("inmainline")) { echo("Showing release: ${release}") releases.add(release) + } else { + echo("Not showing release: ${release}") } } } From f64c71e0cd54074f5f941a465619712ed52e547c Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 9 Nov 2019 08:53:13 +0000 Subject: [PATCH 15/15] GIS-1621 - Remove publish filter debug log --- publish/promptingpublish.groovy | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index 80305ab..c0e4837 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -54,9 +54,9 @@ pipeline { script { gh = load("${autobuilder.commonscripts()}/versioncontrol/git.groovy") def allreleases = gh.gettaglist(SOURCEDIR) - boolean filterredundantreleases = (FILTER_REDUNDANT_RELEASES == 'true') + boolean filterredundantreleases = def releases = new ArrayList() - if (!filterredundantreleases) { + if (FILTER_REDUNDANT_RELEASES == 'false') { echo("Showing all releases") releases = allreleases } else { @@ -67,10 +67,10 @@ pipeline { !release.toLowerCase().startsWith("faulty") && !release.toLowerCase().startsWith("ignore") && !release.toLowerCase().startsWith("inmainline")) { - echo("Showing release: ${release}") + //echo("Showing release: ${release}") releases.add(release) } else { - echo("Not showing release: ${release}") + //echo("Not showing release: ${release}") } } }