Skip to content

Commit

Permalink
chore: use convenience method to GetCategory() (#5296)
Browse files Browse the repository at this point in the history
* chore: use convenience method to get category vector

* chore: update gaf

* chore: update final gaf
  • Loading branch information
PeterSchafer committed Jun 6, 2024
1 parent 2caa494 commit 58b1a50
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions cliv2/cmd/cliv2/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -517,14 +517,13 @@ func MainWithErrorCode() int {
}

// init Analytics
knownCommands, knownFlags := instrumentation.GetKnownCommandsAndFlags(globalEngine)
cliAnalytics := globalEngine.GetAnalytics()
cliAnalytics.SetVersion(cliv2.GetFullVersion())
cliAnalytics.SetCmdArguments(os.Args)
cliAnalytics.SetOperatingSystem(internalOS)
cliAnalytics.GetInstrumentation().SetUserAgent(ua)
cliAnalytics.GetInstrumentation().SetInteractionId(instrumentation.AssembleUrnFromUUID(interactionId))
cliAnalytics.GetInstrumentation().SetCategory(instrumentation.DetermineCategoryFromArgs(os.Args, knownCommands, knownFlags))
cliAnalytics.GetInstrumentation().SetCategory(instrumentation.DetermineCategory(os.Args, globalEngine))
cliAnalytics.GetInstrumentation().SetStage(instrumentation.DetermineStage(cliAnalytics.IsCiEnvironment()))
cliAnalytics.GetInstrumentation().SetStatus(analytics.Success)

Expand Down
2 changes: 1 addition & 1 deletion cliv2/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/snyk/cli-extension-sbom v0.0.0-20240523084359-a2830fadb001
github.com/snyk/container-cli v0.0.0-20240322120441-6d9b9482f9b1
github.com/snyk/error-catalog-golang-public v0.0.0-20240527112826-2b77438d25f1
github.com/snyk/go-application-framework v0.0.0-20240605102342-67b064c1e417
github.com/snyk/go-application-framework v0.0.0-20240606122504-961e838cb356
github.com/snyk/go-httpauth v0.0.0-20240307114523-1f5ea3f55c65
github.com/snyk/snyk-iac-capture v0.6.5
github.com/snyk/snyk-ls v0.0.0-20240603144138-b7b4b7626a10
Expand Down
4 changes: 2 additions & 2 deletions cliv2/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -731,8 +731,8 @@ github.com/snyk/container-cli v0.0.0-20240322120441-6d9b9482f9b1 h1:9RKY9NdX5DrJ
github.com/snyk/container-cli v0.0.0-20240322120441-6d9b9482f9b1/go.mod h1:38w+dcAQp9eG3P5t2eNS9eG0reut10AeJjLv5lJ5lpM=
github.com/snyk/error-catalog-golang-public v0.0.0-20240527112826-2b77438d25f1 h1:49X/bTeiWdi+DrkTbTSw5BePpQ6LiucIt++/Z+MB95U=
github.com/snyk/error-catalog-golang-public v0.0.0-20240527112826-2b77438d25f1/go.mod h1:Ytttq7Pw4vOCu9NtRQaOeDU2dhBYUyNBe6kX4+nIIQ4=
github.com/snyk/go-application-framework v0.0.0-20240605102342-67b064c1e417 h1:piXelZOB/V+kfUGouG/nm6F2YKNCXH993bC0YqtW+gc=
github.com/snyk/go-application-framework v0.0.0-20240605102342-67b064c1e417/go.mod h1:1T6hnPUgT0lJPO0g3VjwvW0fCKDcgst8bgXs+wCfmW8=
github.com/snyk/go-application-framework v0.0.0-20240606122504-961e838cb356 h1:1o4uMyLtiE6wibY8G57DQcsUDlMolyu1WP9eauJX2QQ=
github.com/snyk/go-application-framework v0.0.0-20240606122504-961e838cb356/go.mod h1:1T6hnPUgT0lJPO0g3VjwvW0fCKDcgst8bgXs+wCfmW8=
github.com/snyk/go-httpauth v0.0.0-20240307114523-1f5ea3f55c65 h1:CEQuYv0Go6MEyRCD3YjLYM2u3Oxkx8GpCpFBd4rUTUk=
github.com/snyk/go-httpauth v0.0.0-20240307114523-1f5ea3f55c65/go.mod h1:88KbbvGYlmLgee4OcQ19yr0bNpXpOr2kciOthaSzCAg=
github.com/snyk/policy-engine v0.30.11 h1:wUy5LMar2vccMbNM62MSBRdjAQAhAbIm7aNXXO+g2tk=
Expand Down

0 comments on commit 58b1a50

Please sign in to comment.