Skip to content

Commit

Permalink
Internal - Adapt to Call Home API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
eyalb4doc committed Dec 25, 2024
1 parent 841a3a2 commit e4a0fc1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion artifactory/commands/transferfiles/transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func (tdc *TransferFilesCommand) reportTransferFilesUsage() {
AttributeValue: sourceStorageInfo.BinariesSize,
},
}
if err = usage.NewArtifactoryCallHome().SendUsage(coreutils.GetCliUserAgent(), tdc.CommandName(), tdc.targetStorageInfoManager.GetServiceManager(), reportUsageAttributes...); err != nil {
if err = usage.NewArtifactoryCallHome().Send(coreutils.GetCliUserAgent(), tdc.CommandName(), tdc.targetStorageInfoManager.GetServiceManager(), reportUsageAttributes...); err != nil {
log.Debug(err.Error())
}
}
Expand Down
8 changes: 4 additions & 4 deletions common/commands/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,20 @@ func reportUsage(command Command, channel chan<- bool) {

serverDetails, err := command.ServerDetails()
if err != nil {
log.Debug("Usage reporting:", err.Error())
log.Debug("Usage reporting. Failed accessing ServerDetails.", err.Error())
return
}
if serverDetails == nil || serverDetails.ArtifactoryUrl == "" {
return
}
serviceManager, err := utils.CreateServiceManager(serverDetails, -1, 0, false)
if err != nil {
log.Debug("Usage reporting:", err.Error())
log.Debug("Usage reporting. Failed creating the Artifactory Service Manager.", err.Error())
return
}
ArtifactoryVersion, err := serviceManager.GetVersion()
if err != nil {
log.Debug("Usage reporting:", err.Error())
log.Debug("Usage reporting. Failed getting the Artifactory", err.Error())
return
}

Expand Down Expand Up @@ -99,7 +99,7 @@ func reportUsageToVisibilitySystem(command Command, serverDetails *config.Server

func reportUsageToArtifactoryCallHome(command Command, serviceManager rtClient.ArtifactoryServicesManager) {
log.Debug(usageReporter.ArtifactoryCallHomePrefix, "Sending info...")
if err := usage.NewArtifactoryCallHome().SendUsage(coreutils.GetCliUserAgent(), command.CommandName(), serviceManager); err != nil {
if err := usage.NewArtifactoryCallHome().Send(coreutils.GetCliUserAgent(), command.CommandName(), serviceManager); err != nil {
log.Debug(err.Error())
}
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ require (
gopkg.in/warnings.v0 v0.1.2 // indirect
)

replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.28.1-0.20241223175448-88f1089d0694
replace github.com/jfrog/jfrog-client-go => github.com/eyalbe4/jfrog-client-go v1.28.1-0.20241225095445-ce46100f95eb

// replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go v1.8.9-0.20241121100855-e7a75ceee2bd

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcej
github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
github.com/eyalbe4/jfrog-client-go v1.28.1-0.20241225095445-ce46100f95eb h1:DgmqzmU62LwBjuQdduH2iobx4QatkvEV3DFDxfPLvZE=
github.com/eyalbe4/jfrog-client-go v1.28.1-0.20241225095445-ce46100f95eb/go.mod h1:2ySOMva54L3EYYIlCBYBTcTgqfrrQ19gtpA/MWfA/ec=
github.com/forPelevin/gomoji v1.2.0 h1:9k4WVSSkE1ARO/BWywxgEUBvR/jMnao6EZzrql5nxJ8=
github.com/forPelevin/gomoji v1.2.0/go.mod h1:8+Z3KNGkdslmeGZBC3tCrwMrcPy5GRzAD+gL9NAwMXg=
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
Expand Down Expand Up @@ -93,8 +95,6 @@ github.com/jfrog/build-info-go v1.10.7 h1:10NVHYg0193gJpQft+S4WQfvYMtj5jlwwhJRvk
github.com/jfrog/build-info-go v1.10.7/go.mod h1:JcISnovFXKx3wWf3p1fcMmlPdt6adxScXvoJN4WXqIE=
github.com/jfrog/gofrog v1.7.6 h1:QmfAiRzVyaI7JYGsB7cxfAJePAZTzFz0gRWZSE27c6s=
github.com/jfrog/gofrog v1.7.6/go.mod h1:ntr1txqNOZtHplmaNd7rS4f8jpA5Apx8em70oYEe7+4=
github.com/jfrog/jfrog-client-go v1.28.1-0.20241223175448-88f1089d0694 h1:1EP8yAhB+SGTXhfGa/w4S748S12qJKXU4u/yiAJxnX0=
github.com/jfrog/jfrog-client-go v1.28.1-0.20241223175448-88f1089d0694/go.mod h1:2ySOMva54L3EYYIlCBYBTcTgqfrrQ19gtpA/MWfA/ec=
github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4=
github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
Expand Down
2 changes: 1 addition & 1 deletion utils/usage/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func (ur *UsageReporter) reportToArtifactory(features ...ReportFeature) (err err
if err != nil {
return
}
return usage.NewArtifactoryCallHome().SendUsageToArtifactory(ur.ProductId, serviceManager, converted...)
return usage.NewArtifactoryCallHome().SendToArtifactory(ur.ProductId, serviceManager, converted...)
}

func convertAttributesToMap(reportFeature ReportFeature) (converted map[string]string) {
Expand Down

0 comments on commit e4a0fc1

Please sign in to comment.