From 492be64f57c01fc622bb86f7580bdca6fd68ccc2 Mon Sep 17 00:00:00 2001 From: dsagar Date: Thu, 17 Feb 2022 09:44:00 -0800 Subject: [PATCH 1/3] fix(2646): Do not include parameters from external builds during remote join --- launch.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/launch.go b/launch.go index 96a8e14..e16055a 100644 --- a/launch.go +++ b/launch.go @@ -310,6 +310,9 @@ func SetExternalMeta(api screwdriver.API, pipelineID, parentBuildID int, mergedM externalMetaFile := "sd@" + strconv.Itoa(parentJob.PipelineID) + ":" + parentJob.Name + ".json" writeMetafile(metaSpace, externalMetaFile, metaLog, parentBuild.Meta) if join { + // Always exclude parameters from external meta + delete(parentBuild.Meta, "parameters") + resultMeta = deepMergeJSON(resultMeta, parentBuild.Meta) } From 2043753cd0135b6a37c4e5615e445702e5b2277c Mon Sep 17 00:00:00 2001 From: dsagar Date: Fri, 18 Feb 2022 09:47:08 -0800 Subject: [PATCH 2/3] fix(2646): Deep copy parent build meta before deleting the parameters --- launch.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/launch.go b/launch.go index e16055a..8817308 100644 --- a/launch.go +++ b/launch.go @@ -310,8 +310,15 @@ func SetExternalMeta(api screwdriver.API, pipelineID, parentBuildID int, mergedM externalMetaFile := "sd@" + strconv.Itoa(parentJob.PipelineID) + ":" + parentJob.Name + ".json" writeMetafile(metaSpace, externalMetaFile, metaLog, parentBuild.Meta) if join { + marshallValue, err := json.Marshal(parentBuild.Meta) + if err != nil { + return resultMeta, fmt.Errorf("Cloning meta of Parent Build ID %d: %v", parentBuildID, err) + } + var externalParentBuildMeta map[string]interface{} + json.Unmarshal(marshallValue, &externalParentBuildMeta) + // Always exclude parameters from external meta - delete(parentBuild.Meta, "parameters") + delete(externalParentBuildMeta, "parameters") resultMeta = deepMergeJSON(resultMeta, parentBuild.Meta) } From 39c6cd98741eaa8bb71dded9597208d8888abbc2 Mon Sep 17 00:00:00 2001 From: dsagar Date: Fri, 18 Feb 2022 16:32:40 -0800 Subject: [PATCH 3/3] fix(2646): use parent build meta without parameters --- launch.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launch.go b/launch.go index 8817308..ae557ac 100644 --- a/launch.go +++ b/launch.go @@ -320,7 +320,7 @@ func SetExternalMeta(api screwdriver.API, pipelineID, parentBuildID int, mergedM // Always exclude parameters from external meta delete(externalParentBuildMeta, "parameters") - resultMeta = deepMergeJSON(resultMeta, parentBuild.Meta) + resultMeta = deepMergeJSON(resultMeta, externalParentBuildMeta) } // delete local version of external meta