Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
eyalbe4 committed Nov 4, 2024
2 parents 7bc3b3c + 63e06cd commit 2c52565
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
9 changes: 5 additions & 4 deletions artifactory/services/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ package services
import (
"errors"
"fmt"
"github.com/jfrog/build-info-go/entities"
"github.com/jfrog/gofrog/crypto"
ioutils "github.com/jfrog/gofrog/io"
"github.com/jfrog/gofrog/version"
"net/http"
"os"
"path"
"path/filepath"
"sort"
"strings"

"github.com/jfrog/build-info-go/entities"
"github.com/jfrog/gofrog/crypto"
ioutils "github.com/jfrog/gofrog/io"
"github.com/jfrog/gofrog/version"

"github.com/jfrog/jfrog-client-go/http/httpclient"

"github.com/jfrog/gofrog/parallel"
Expand Down
10 changes: 5 additions & 5 deletions artifactory/services/utils/searchutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,25 +242,25 @@ func FilterResultsByBuild(specFile *CommonParams, flags CommonConf, requiredArti
// AND
// 2. Properties weren't fetched during 'build' filtering
// Otherwise, nil will be returned
func fetchProps(specFile *CommonParams, flags CommonConf, requiredArtifactProps RequiredArtifactProps, reader *content.ContentReader) (*content.ContentReader, error) {
func fetchProps(specFile *CommonParams, flags CommonConf, requiredArtifactProps RequiredArtifactProps, reader *content.ContentReader) (r *content.ContentReader, err error) {
if !includePropertiesInAqlForSpec(specFile) && specFile.Build == "" && requiredArtifactProps != NONE {
var readerWithProps *content.ContentReader
var err error
switch requiredArtifactProps {
case ALL:
readerWithProps, err = searchProps(specFile.Aql.ItemsFind, "*", []string{"*"}, flags)
case SYMLINK:
readerWithProps, err = searchProps(specFile.Aql.ItemsFind, "symlink.dest", []string{"*"}, flags)
}
if err != nil {
return nil, err
return
}
defer func() {
err = errors.Join(err, errorutils.CheckError(reader.Close()))
err = errors.Join(err, errorutils.CheckError(readerWithProps.Close()))
}()
return loadMissingProperties(reader, readerWithProps)
r, err = loadMissingProperties(reader, readerWithProps)
}
return nil, nil
return
}

func aqlSearch(aqlQuery string, flags CommonConf) (*content.ContentReader, error) {
Expand Down
4 changes: 3 additions & 1 deletion http/httpclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ package httpclient
import (
"bytes"
"context"
"github.com/minio/sha256-simd"
"strings"

"github.com/minio/sha256-simd"

//#nosec G505 -- sha1 is supported by Artifactory.
"crypto/sha1"
"encoding/hex"
Expand Down
6 changes: 6 additions & 0 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ const (
Version = "1.47.3"
)

const xrayDevVersion = "3.x-dev"

type MinVersionProduct string

const (
Expand Down Expand Up @@ -68,6 +70,10 @@ func getDefaultUserAgent() string {
}

func ValidateMinimumVersion(product MinVersionProduct, currentVersion, minimumVersion string) error {
if currentVersion == xrayDevVersion {
return nil
}

if !version.NewVersion(currentVersion).AtLeast(minimumVersion) {
return errorutils.CheckErrorf(MinimumVersionMsg, product, currentVersion, minimumVersion)
}
Expand Down

0 comments on commit 2c52565

Please sign in to comment.