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

This commit is contained in:
Dan Hawkins 2019-10-25 16:18:19 +01:00
commit b32a5116dd
4 changed files with 5 additions and 44 deletions

View file

@ -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 = '') {

View file

@ -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;

View file

@ -51,7 +51,7 @@ def hierarchyartifactimportfromrepo(meta, String repo, String revision, String d
def ArrayList<String> 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<String> 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()}"

View file

@ -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<String> releasedfromhere = new ArrayList<String>(), // These items are recorded in meta as released from here
ArrayList<String> releasedfromsubmeta = new ArrayList<String>(), // These items are not recorded in meta as released from here
String metafilepath ="${METAFOLDERNAME}/${METAFILENAME}"