Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev' into add_repo_context_sca…
Browse files Browse the repository at this point in the history
…n_graph
  • Loading branch information
attiasas committed Nov 28, 2024
2 parents c243bb1 + ecc791f commit a53eeb4
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
const (
Development = "development"
Agent = "jfrog-client-go"
Version = "1.48.0"
Version = "1.48.1"
)

const xrayDevVersion = "3.x-dev"
Expand Down
4 changes: 2 additions & 2 deletions xray/services/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ func (ss *ScanService) ScanGraph(scanParams XrayGraphScanParams) (string, error)
}
url := ss.XrayDetails.GetUrl() + scanGraphAPI

// When XSC is enabled, modify the URL.
if scanParams.XrayVersion != "" && scanParams.XscVersion != "" {
// When XSC is enabled and MultiScanId is provided, modify the URL to use XSC scan graph (analytics enabled)
if scanParams.XrayVersion != "" && scanParams.XscVersion != "" && scanParams.MultiScanId != "" {
url = xscUtils.XrayUrlToXscUrl(ss.XrayDetails.GetUrl(), scanParams.XrayVersion) + XscGraphAPI
}
url += createScanGraphQueryParams(scanParams)
Expand Down
2 changes: 1 addition & 1 deletion xray/services/xsc/xsc.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/jfrog/jfrog-client-go/xsc/services"
)

// XscService is the Xray Source Control service in the Xray service, available from v3.108.0.
// XscService is the Xray Source Control service in the Xray service, available from v3.107.13.
// This service replaces the Xray Source Control service, which was available as a standalone service.
type XscInnerService struct {
client *jfroghttpclient.JfrogHttpClient
Expand Down
2 changes: 1 addition & 1 deletion xsc/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

// XscServicesManager defines the http client and general configuration
// Deprecated from Xray version 3.108.0, XSC is transitioning to Xray as inner service.
// Deprecated from Xray version 3.107.13, XSC is transitioning to Xray as inner service.
type XscServicesManager struct {
client *jfroghttpclient.JfrogHttpClient
config config.Config
Expand Down
2 changes: 1 addition & 1 deletion xsc/services/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const (
MinXrayVersionXscTransitionToXray = "3.107.13"
)

// From Xray version 3.108.0, XSC is transitioning to Xray as inner service. This function will return compatible URL.
// From Xray version 3.107.13, XSC is transitioning to Xray as inner service. This function will return compatible URL.
func XrayUrlToXscUrl(xrayUrl, xrayVersion string) string {
if !IsXscXrayInnerService(xrayVersion) {
log.Debug(fmt.Sprintf("Xray version is lower than %s, XSC is not an inner service in Xray.", MinXrayVersionXscTransitionToXray))
Expand Down
4 changes: 2 additions & 2 deletions xsc/services/utils/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ func TestXrayUrlToXscUrl(t *testing.T) {
xrayVersion string
expectedValue string
}{
{"after transition", "http://platform.jfrog.io/xray/", "3.108.0", "http://platform.jfrog.io/xray/api/v1/xsc/"},
{"before transition", "http://platform.jfrog.io/xray/", "3.107.0", "http://platform.jfrog.io/xsc/api/v1/"},
{"after transition", "http://platform.jfrog.io/xray/", "3.107.13", "http://platform.jfrog.io/xray/api/v1/xsc/"},
{"before transition", "http://platform.jfrog.io/xray/", "3.106.0", "http://platform.jfrog.io/xsc/api/v1/"},
}
for _, test := range tests {
t.Run(test.testName, func(t *testing.T) {
Expand Down

0 comments on commit a53eeb4

Please sign in to comment.