Skip to content
This repository was archived by the owner on May 24, 2024. It is now read-only.

Commit 63f8054

Browse files
Make confluence content ID unique also with versions
Signed-off-by: Łukasz Gryglicki <[email protected]>
1 parent f3f0abd commit 63f8054

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cmd/confluence/confluence.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,9 +1241,11 @@ func (j *DSConfluence) GetModelData(ctx *shared.Ctx, docs []interface{}) (data m
12411241
contributors = append(contributors, contributor)
12421242
}
12431243
}
1244-
confluenceContentID, err = insightsConf.GenerateConfluenceContentID(j.URL, nonEmptySpaceID, string(contentType), entityID)
1244+
sVersion := fmt.Sprintf("%.0f", version)
1245+
entityIDWithVersion := entityID + "-" + sVersion
1246+
confluenceContentID, err = insightsConf.GenerateConfluenceContentID(j.URL, nonEmptySpaceID, string(contentType), entityIDWithVersion)
12451247
if err != nil {
1246-
shared.Printf("GenerateConfluenceContentID(%s,%s,%s): %+v for %+v", j.URL, nonEmptySpaceID, contentType, entityID, err, doc)
1248+
shared.Printf("GenerateConfluenceContentID(%s,%s,%s): %+v for %+v", j.URL, nonEmptySpaceID, contentType, entityIDWithVersion, err, doc)
12471249
return
12481250
}
12491251
confluenceSpaceID, err = insightsConf.GenerateConfluenceSpaceID(j.URL, nonEmptySpaceID)
@@ -1266,7 +1268,7 @@ func (j *DSConfluence) GetModelData(ctx *shared.Ctx, docs []interface{}) (data m
12661268
ServerURL: j.URL,
12671269
ContentID: entityID,
12681270
ContentURL: url,
1269-
Version: fmt.Sprintf("%.0f", version),
1271+
Version: sVersion,
12701272
Type: contentType,
12711273
Title: title,
12721274
Body: sBody,

0 commit comments

Comments
 (0)