Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions artifactory/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ func createLifecycleDetailsByFlags(c *cli.Context) (*coreConfig.ServerDetails, e
return nil, err
}
if lcDetails.Url == "" {
return nil, errors.New("platform URL is mandatory for lifecycle commands")
return nil, errors.New("platform URL is mandatory for lifecycle commands. Configure it via the --url flag or by running 'jf config add'")
}
PlatformToLifecycleUrls(lcDetails)
return lcDetails, nil
Expand Down Expand Up @@ -878,7 +878,7 @@ func usersCreateCmd(c *cli.Context) error {
usersCreateCmd := usersmanagement.NewUsersCreateCommand()
csvFilePath := c.String("csv")
if csvFilePath == "" {
return cliutils.PrintHelpAndReturnError("missing --csv <File Path>", c)
return cliutils.PrintHelpAndReturnError("missing --csv <File Path>. The CSV file must include a header row with the columns: username, password, email", c)
}
usersList, err := parseCSVToUsersList(csvFilePath)
if err != nil {
Expand Down Expand Up @@ -928,7 +928,7 @@ func usersDeleteCmd(c *cli.Context) error {
}

if len(usersNamesList) < 1 {
return cliutils.PrintHelpAndReturnError("missing <users list> OR --csv <users details file path>", c)
return cliutils.PrintHelpAndReturnError("missing <users list> OR --csv <users details file path>. Example: jf rt udel 'user1,user2' or jf rt udel --csv users.csv", c)
}

if !cliutils.GetQuietValue(c) && !coreutils.AskYesNo("This command will delete users. Are you sure you want to continue?\n"+
Expand Down
6 changes: 3 additions & 3 deletions buildtools/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ func GradleCmd(c *cli.Context) (err error) {
return cleanedArgs, nil, err
}
if serverDetails == nil {
return cleanedArgs, nil, fmt.Errorf("no default server configuration found. Please configure a server using 'jfrog config add' or specify a server using --server-id")
return cleanedArgs, nil, fmt.Errorf("no default server configuration found. Please configure a server using 'jf config add' or specify a server using --server-id")
}
return cleanedArgs, serverDetails, nil
}
Expand Down Expand Up @@ -1508,7 +1508,7 @@ func extractHelmServerDetails(args []string) ([]string, *coreConfig.ServerDetail
return cleanedArgs, nil, err
}
if serverDetails == nil {
return cleanedArgs, nil, fmt.Errorf("no default server configuration found. Please configure a server using 'jfrog config add' or specify a server using --server-id")
return cleanedArgs, nil, fmt.Errorf("no default server configuration found. Please configure a server using 'jf config add' or specify a server using --server-id")
}
return cleanedArgs, serverDetails, nil
}
Expand Down Expand Up @@ -1695,7 +1695,7 @@ func terraformCmd(c *cli.Context) error {
case "publish", "p":
return terraformPublishCmd(configFilePath, filteredArgs, c)
default:
return errorutils.CheckErrorf("Terraform command: '%s' is not supported. %s", cmdName, cliutils.GetDocumentationMessage())
return errorutils.CheckErrorf("Terraform command: '%s' is not supported. Supported commands: publish. %s", cmdName, cliutils.GetDocumentationMessage())
}
}

Expand Down
6 changes: 3 additions & 3 deletions config/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func ValidateServerId(serverId string) error {
reservedIds := []string{"delete", "use", "show", "clear"}
for _, reservedId := range reservedIds {
if serverId == reservedId {
return fmt.Errorf("server can't have one of the following ID's: %s\n%s", strings.Join(reservedIds, ", "), cliutils.GetDocumentationMessage())
return fmt.Errorf("'%s' is a reserved name and cannot be used as a server ID. Reserved names: %s", serverId, strings.Join(reservedIds, ", "))
}
}
return nil
Expand All @@ -265,7 +265,7 @@ func validateServerExistence(serverId string, operation configOperation) error {
func validateConfigFlags(configCommandConfiguration *commands.ConfigCommandConfiguration) error {
// Validate the option is not used along with access token
if configCommandConfiguration.BasicAuthOnly && configCommandConfiguration.ServerDetails.AccessToken != "" {
return errorutils.CheckErrorf("the --%s option is only supported when username and password/API key are provided", cliutils.BasicAuthOnly)
return errorutils.CheckErrorf("the --%s option is only supported when username and password/access token are provided", cliutils.BasicAuthOnly)
}
if err := validatePathsExist(configCommandConfiguration.ServerDetails.SshKeyPath, configCommandConfiguration.ServerDetails.ClientCertPath, configCommandConfiguration.ServerDetails.ClientCertKeyPath); err != nil {
return err
Expand Down Expand Up @@ -300,7 +300,7 @@ func validatePathsExist(paths ...string) error {
return err
}
if !exists {
return errorutils.CheckErrorf("file does not exit at %s", path)
return errorutils.CheckErrorf("file does not exist at %s", path)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion general/summary/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func invokeSectionMarkdownGeneration(section MarkdownSection) error {
case Evidence:
return generateEvidenceMarkdown()
default:
return fmt.Errorf("unknown section: %s", section)
return fmt.Errorf("unknown section: %s. Valid sections: security, build-info, upload, evidence", section)
}
}

Expand Down
2 changes: 1 addition & 1 deletion pipelines/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func createPipelinesDetailsByFlags(c *cli.Context) (*coreConfig.ServerDetails, e
return nil, err
}
if plDetails.PipelinesUrl == "" {
return nil, errors.New("no JFrog Pipelines URL specified as part of the server configuration")
return nil, errors.New("no JFrog Pipelines URL specified as part of the server configuration. Run 'jf config edit <server-id>' and set the Pipelines URL")
}
return plDetails, nil
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/utils/signatureutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func getPluginsSignatures() ([]*components.PluginSignature, error) {
}

func logSkippablePluginsError(msg, pluginName string, err error) {
log.Error(fmt.Sprintf("%s%s: '%s'. Skiping...", pluginsErrorPrefix, msg, pluginName))
log.Error(fmt.Sprintf("%s%s: '%s'. Skipping...", pluginsErrorPrefix, msg, pluginName))
if err != nil {
log.Error("Error was: " + err.Error())
}
Expand Down
4 changes: 2 additions & 2 deletions utils/buildinfo/buildinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ func addArtifactsToBuildInfo(buildInfo *buildinfo.BuildInfo, serverDetails *conf
log.Debug("Collecting artifacts for build info...")

if len(buildInfo.Modules) == 0 {
return fmt.Errorf("no modules found in build info")
return fmt.Errorf("no modules found in build info. Ensure you ran a build command (e.g., jf mvn, jf npm) with --build-name and --build-number before publishing")
}

// Get the main module (should be the Poetry module)
Expand Down Expand Up @@ -697,7 +697,7 @@ func inferPoetryConfigFromToml(_ project.ProjectType) (*project.RepositoryConfig

sources := viper.Get("tool.poetry.source")
if sources == nil {
return nil, fmt.Errorf("no Poetry sources found in pyproject.toml")
return nil, fmt.Errorf("no Poetry sources found in pyproject.toml. Add a source pointing to your JFrog repository. See 'jf poetry-config --help' for details")
}

// Get list of configured servers from jf config
Expand Down
10 changes: 5 additions & 5 deletions utils/cliutils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func GetCliError(err error, success, failed int, failNoOp bool) error {
return coreutils.CliError{ExitCode: coreutils.ExitCodeError, ErrorMsg: errorMessage}
}
case coreutils.ExitCodeFailNoOp:
return coreutils.CliError{ExitCode: coreutils.ExitCodeFailNoOp, ErrorMsg: "No errors, but also no files affected (fail-no-op flag)."}
return coreutils.CliError{ExitCode: coreutils.ExitCodeFailNoOp, ErrorMsg: "No files were affected by the operation. To allow this, remove the --fail-no-op flag."}
default:
return nil
}
Expand Down Expand Up @@ -641,12 +641,12 @@ func getLatestCliVersionFromGithubAPI() (githubVersionInfo githubResponse, err e
log.Debug(fmt.Sprintf("Sending HTTP %s request to: %s", req.Method, req.URL))
resp, body, err := doHttpRequest(client, req)
if err != nil {
err = errors.New("couldn't get latest JFrog CLI latest version info from GitHub API: " + err.Error())
err = errors.New("couldn't get the latest JFrog CLI version info from GitHub API: " + err.Error())
return
}
err = errorutils.CheckResponseStatusWithBody(resp, body, http.StatusOK)
if resp.StatusCode == http.StatusForbidden && githubToken == "" {
err = errors.New("received HTTP status Forbidden from Github, there is no GitHub token, please set github token to avoid anonymous calls rate limits: " + string(body))
err = errors.New("GitHub API rate limit exceeded. Set the JFROG_CLI_GITHUB_TOKEN environment variable to authenticate and avoid rate limits: " + string(body))
return
}
if err != nil {
Expand All @@ -660,7 +660,7 @@ func getLatestCliVersionFromGithubAPI() (githubVersionInfo githubResponse, err e
}
// Validate the received version tag format
if !isValidVersionTag(githubVersionInfo.TagName) {
err = errors.New("invalid version tag format received from GitHub API")
err = errors.New("invalid version tag format received from GitHub API. You can suppress this check with JFROG_CLI_AVOID_NEW_VERSION_WARNING=true")
}
return
}
Expand Down Expand Up @@ -746,7 +746,7 @@ func getDebFlag(c *cli.Context) (deb string, err error) {
deb = c.String("deb")
slashesCount := strings.Count(deb, "/") - strings.Count(deb, "\\/")
if deb != "" && slashesCount != 2 {
return "", errors.New("the --deb option should be in the form of distribution/component/architecture")
return "", errors.New("the --deb option should be in the form of distribution/component/architecture (e.g., bionic/main/amd64)")
}
return deb, nil
}
Expand Down
Loading