@@ -11,12 +11,13 @@ import (
1111 "github.com/jfrog/jfrog-cli-core/v2/utils/config"
1212 "github.com/jfrog/jfrog-cli-core/v2/utils/coreutils"
1313 "github.com/jfrog/jfrog-cli-core/v2/utils/usage"
14- "github.com/jfrog/jfrog-cli-security/jas"
15- "github.com/jfrog/jfrog-cli-security/utils/results"
16- "github.com/jfrog/jfrog-cli-security/utils/results/conversion"
1714 clientutils "github.com/jfrog/jfrog-client-go/utils"
1815 "github.com/jfrog/jfrog-client-go/utils/log"
1916 xscservices "github.com/jfrog/jfrog-client-go/xsc/services"
17+
18+ "github.com/jfrog/jfrog-cli-security/jas"
19+ "github.com/jfrog/jfrog-cli-security/utils/results"
20+ "github.com/jfrog/jfrog-cli-security/utils/results/conversion"
2021)
2122
2223func CreateAnalyticsEvent (product xscservices.ProductName , eventType xscservices.EventType , serviceDetails * config.ServerDetails ) * xscservices.XscAnalyticsGeneralEvent {
@@ -117,6 +118,23 @@ func CreateFinalizedEvent(xrayVersion, multiScanId string, startTime time.Time,
117118 }
118119}
119120
121+ func SendGitIntegrationEvent (serverDetails * config.ServerDetails , xrayVersion , projectKey , eventType , gitProvider , gitOwner , gitRepository , gitBranch , eventStatus , failureReason string ) error {
122+ xscService , err := CreateXscService (serverDetails , xray .WithScopedProjectKey (projectKey ))
123+ if err != nil {
124+ return err
125+ }
126+ gitIntegrationEvent := xscservices.GitIntegrationEvent {
127+ EventType : eventType ,
128+ GitProvider : gitProvider ,
129+ GitOwner : gitOwner ,
130+ GitRepository : gitRepository ,
131+ GitBranch : gitBranch ,
132+ EventStatus : eventStatus ,
133+ FailureReason : failureReason ,
134+ }
135+ return xscService .SendGitIntegrationEvent (gitIntegrationEvent , xrayVersion )
136+ }
137+
120138func checkVersionForGitRepoKeyAnalytics (xrayVersion string ) bool {
121139 // TODO: Private patch, remove when not needed anymore
122140 if xrayVersion == "3.111.13" {
0 commit comments