Skip to content

Commit

Permalink
Merge branch 'dev' into bump-ver-from-2.63.2-to-2.64.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eyalbe4 authored Aug 21, 2024
2 parents 5a3f594 + c7e41b7 commit 640f9a9
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 20 deletions.
9 changes: 6 additions & 3 deletions artifactory/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package artifactory
import (
"errors"
"fmt"
ioutils "github.com/jfrog/gofrog/io"
"github.com/jfrog/jfrog-cli/utils/accesstoken"
"os"
"strconv"
"strings"

ioutils "github.com/jfrog/gofrog/io"
"github.com/jfrog/jfrog-cli/utils/accesstoken"

"github.com/jfrog/gofrog/version"
"github.com/jfrog/jfrog-cli-core/v2/artifactory/commands/transferinstall"
"github.com/jfrog/jfrog-cli/docs/artifactory/transferplugininstall"
Expand Down Expand Up @@ -2648,7 +2649,9 @@ func createDefaultDownloadSpec(c *cli.Context) (*spec.SpecFiles, error) {
func setTransitiveInDownloadSpec(downloadSpec *spec.SpecFiles) {
transitive := os.Getenv(coreutils.TransitiveDownload)
if transitive == "" {
return
if transitive = os.Getenv(coreutils.TransitiveDownloadExperimental); transitive == "" {
return
}
}
for fileIndex := 0; fileIndex < len(downloadSpec.Files); fileIndex++ {
downloadSpec.Files[fileIndex].Transitive = transitive
Expand Down
2 changes: 1 addition & 1 deletion docs/artifactory/download/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "github.com/jfrog/jfrog-cli/docs/common"
var Usage = []string{"rt dl [command options] <source pattern> [target pattern]",
"rt dl --spec=<File Spec path> [command options]"}

var EnvVar = []string{common.JfrogCliTransitiveDownloadExperimental, common.JfrogCliFailNoOp}
var EnvVar = []string{common.JfrogCliTransitiveDownload, common.JfrogCliFailNoOp}

func GetDescription() string {
return "Download files from Artifactory to local file system."
Expand Down
14 changes: 8 additions & 6 deletions docs/common/env.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package common

import (
"github.com/jfrog/jfrog-client-go/artifactory/services"
"strings"

"github.com/jfrog/jfrog-client-go/artifactory/services"

"github.com/jfrog/jfrog-cli-core/v2/utils/coreutils"
)

Expand Down Expand Up @@ -53,11 +54,12 @@ const (
Can be optionally used with the JFROG_CLI_PLUGINS_SERVER environment variable.
Determines the name of the local repository to use.`

JfrogCliTransitiveDownloadExperimental = ` JFROG_CLI_TRANSITIVE_DOWNLOAD_EXPERIMENTAL
JfrogCliTransitiveDownload = ` JFROG_CLI_TRANSITIVE_DOWNLOAD
[Default: false]
Set to true to look for artifacts also in remote repositories when using the 'rt download' command.
The search will run on the first five remote repositories within the virtual repository.
This feature is experimental and available on Artifactory version 7.17.0 or higher.`
Set this option to true to include remote repositories in artifact searches when using the 'rt download' command.
The search will target the first five remote repositories within the virtual repository.
This feature is available starting from Artifactory version 7.17.0.
NOTE: Enabling this option may increase the load on Artifactory instances that are proxied by multiple remote repositories. `

JfrogCliReleasesRepo = ` JFROG_CLI_RELEASES_REPO
Configured Artifactory repository name from which to download the jar needed by the mvn/gradle command.
Expand Down Expand Up @@ -126,7 +128,7 @@ func GetGlobalEnvVars() string {
Ci,
JfrogCliPluginsServer,
JfrogCliPluginsRepo,
JfrogCliTransitiveDownloadExperimental,
JfrogCliTransitiveDownload,
JfrogCliReleasesRepo,
JfrogCliDependenciesDir,
JfrogCliMinChecksumDeploySizeKb,
Expand Down
16 changes: 7 additions & 9 deletions general/ai/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package ai
import (
"bufio"
"bytes"
"encoding/json"
"errors"
"fmt"
"github.com/jfrog/jfrog-cli-core/v2/utils/coreutils"
Expand All @@ -29,13 +30,6 @@ type QuestionBody struct {
Question string `json:"question"`
}

type FeedbackBody struct {
QuestionBody
LlmAnswer string `json:"llm_answer"`
IsAccurate bool `json:"is_accurate"`
ExpectedAnswer string `json:"expected_answer"`
}

func HowCmd(c *cli.Context) error {
if show, err := cliutils.ShowCmdHelpIfNeeded(c, c.Args()); show || err != nil {
return err
Expand Down Expand Up @@ -70,15 +64,19 @@ func HowCmd(c *cli.Context) error {
}

func askQuestion(question string) (response string, err error) {
contentBytes, err := json.Marshal(QuestionBody{Question: question})
if errorutils.CheckError(err) != nil {
return
}
client, err := httpclient.ClientBuilder().Build()
if errorutils.CheckError(err) != nil {
return
}
req, err := http.NewRequest(http.MethodPost, cliAiAskApiPath, bytes.NewBufferString(question))
req, err := http.NewRequest(http.MethodPost, cliAiAskApiPath, bytes.NewBuffer(contentBytes))
if errorutils.CheckError(err) != nil {
return
}
req.Header.Set("Content-Type", "text/plain")
req.Header.Set("Content-Type", "application/json")
req.Header.Set(apiHeader, "true")
log.Debug(fmt.Sprintf("Sending HTTP %s request to: %s", req.Method, req.URL))
resp, err := client.GetClient().Do(req)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
)

// replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20240811150357-12a9330a2d67
// replace github.com/jfrog/jfrog-cli-core/v2 => github.com/eyalbe4/jfrog-cli-core/v2 v2.55.3-0.20240821161232-d9ee8b2b6e9c

// replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.28.1-0.20240806162439-01bb7dcd43fc

Expand Down

0 comments on commit 640f9a9

Please sign in to comment.