8000 Feature/support multiple sources by rimapol · Pull Request #2983 · jfrog/jfrog-cli · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Feature/support multiple sources #2983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 32 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
85df682
Introduce e2e tests for lifecycle anotate command.
rimapol May 4, 2025
18abaa9
Merge commit
rimapol May 15, 2025
18c423e
Introduce miltisource option for create release bundles
rimapol May 15, 2025
cb2ed40
Introduce e2e tests for create release bundle with multiple sources
rimapol May 18, 2025
9c4fae7
Introduce support for create release bundle from multiple sources def…
rimapol May 22, 2025
f778099
Merge remote-tracking branch 'upstream/dev' into feature/support-mult…
rimapol May 22, 2025
003b2bb
Update dependencies
rimapol May 22, 2025
772ea90
Update dependencies
rimapol May 22, 2025
321a672
Update dependencies
rimapol May 22, 2025
990818a
Update dependency
rimapol May 22, 2025
0528c13
Fix lynt errors
rimapol May 22, 2025
a9d1b26
Fix lynt errors
rimapol May 22, 2025
2eb30fc
Fix lynt errors
rimapol May 22, 2025
33632af
Revert format changes
rimapol May 22, 2025
62af840
Remove unused
rimapol May 22, 2025
0ed9067
update dependencies
rimapol Jun 3, 2025
48fd1d5
update dependencies and resolve conflicts
rimapol Jun 3, 2025
9c11eeb
update dependencies
rimapol Jun 9, 2025
25eb278
Merge branch 'dev' into feature/support-multiple-sources
rimapol Jun 10, 2025
4820a39
Update tests after change source flags names
rimapol Jun 12, 2025
6ec7393
Resolve dependencies
rimapol Jun 12, 2025
c14f9a8
Merge remote-tracking branch 'origin/dev' into v2
jfrog-ecosystem Jun 12, 2025
f528050
Update tests
rimapol Jun 12, 2025
98bb068
Update dependencies
rimapol Jun 12, 2025
42822e2
Resolve conflicts
rimapol Jun 12, 2025
aab4749
Fix CheckError issue
rimapol Jun 12, 2025
24638d4
Update dependencies
rimapol Jun 12, 2025
bf48764
Update dependencies
rimapol Jun 12, 2025
de572d8
Update dependencies
rimapol Jun 12, 2025
fb49b6e
Merge branch 'jfrog:v2' into feature/support-multiple-sources
rimapol Jun 12, 2025
c9b95ae
Update dependencies
rimapol Jun 13, 2025
013bb99
Fix lint
rimapol Jun 13, 2025
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 buildtools/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ func terraformCmd(c *cli.Context) error {
case "publish", "p":
return terraformPublishCmd(configFilePath, filteredArgs, c)
default:
return errorutils.CheckErrorf("Terraform command:\"" + cmdName + "\" is not supported. " + cliutils.GetDocumentationMessage())
return errorutils.CheckError(errors.New("Terraform command:\"" + cmdName + "\" is not supported. " + cliutils.GetDocumentationMessage()))
}
}

Expand Down Expand Up @@ -1114,7 +1114,7 @@ func getProjectConfigPathOrThrow(projectType project.ProjectType, cmdName, confi
return
}
if !exists {
return "", errorutils.CheckErrorf(getMissingConfigErrMsg(cmdName, configCmdName))
return "", errorutils.CheckError(errors.New(getMissingConfigErrMsg(cmdName, configCmdName)))
}
return
}
Expand Down Expand Up @@ -1165,5 +1165,5 @@ func getTwineConfigPath() (configFilePath string, err error) {
return
}
}
return "", errorutils.CheckErrorf(getMissingConfigErrMsg("twine", "pip-config OR pipenv-config"))
return "", errorutils.CheckError(errors.New(getMissingConfigErrMsg("twine", "pip-config OR pipenv-config")))
}
3 changes: 2 additions & 1 deletion config/cli.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package config

import (
"errors"
"fmt"
"github.com/jfrog/jfrog-cli-core/v2/general/token"
"os"
Expand Down Expand Up @@ -297,7 +298,7 @@ func validatePathsExist(paths ...string) error {
return err
}
if !exists {
return errorutils.CheckErrorf("file does not exit at " + path)
return errorutils.CheckError(errors.New("file does not exit at " + path))
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions general/ai/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,12 @@ func sendRestAPI(apiType ApiType, content interface{}) (response string, err err
if err = errorutils.CheckResponseStatus(resp, http.StatusOK); err != nil {
switch resp.StatusCode {
case http.StatusInternalServerError:
err = errorutils.CheckErrorf("JFrog CLI-AI model endpoint is not available. Please try again later.")
err = errorutils.CheckError(errors.New("JFrog CLI-AI model endpoint is not available. Please try again later"))
case http.StatusNotAcceptable:
err = errorutils.CheckErrorf("The system is currently handling multiple requests from other users\n" +
"Please try submitting your question again in a few minutes. Thank you for your patience!")
err = errorutils.CheckError(errors.New("The system is currently handling multiple requests from other users\n" +
"Please try submitting your question again in a few minutes. Thank you for your patience!"))
default:
err = errorutils.CheckErrorf("JFrog CLI-AI server is not available. Please check your network or try again later:\n" + err.Error())
err = errorutils.CheckError(errors.New("JFrog CLI-AI server is not available. Please check your network or try again later:\n" + err.Error()))
}
return
}
Expand Down
22 changes: 18 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/jfrog/jfrog-cli

go 1.23.9
go 1.24.2

toolchain go1.24.3

replace (
// Should not be updated to 0.2.6 due to a bug (https://github.com/jfrog/jfrog-cli-core/pull/372)
Expand Down Expand Up @@ -191,10 +193,22 @@ require (

// replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go v1.8.9-0.20250529104758-6d769a684388

// replace github.com/jfrog/jfrog-cli-artifactory => github.com/jfrog/jfrog-cli-artifactory v0.3.2-0.20250527103322-0361d8f5612d
// replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.28.1-0.20250406105605-ee90d11546f9
//replace github.com/jfrog/jfrog-client-go => github.com/rimapol/jfrog-client-go feature/support-multiple-sources
replace github.com/jfrog/jfrog-client-go => github.com/rimapol/jfrog-client-go v0.0.0-20250612223352-8bf50cddd4bd

// replace github.com/jfrog/jfrog-client-go => ../jfrog-client-go
// replace github.com/jfrog/jfrog-cli-core/v2 => github.com/rimapol/jfrog-cli-core/v2 dev
replace github.com/jfrog/jfrog-cli-core/v2 => github.com/rimapol/jfrog-cli-core/v2 v2.0.0-20250613000840-75a0253c1164

// replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20250527091824-60a3b4b741aa
// replace github.com/jfrog/jfrog-cli-artifactory => github.com/jfrog/jfrog-cli-artifactory v0.2.2-0.20250414045808-41544959f9b9
//replace github.com/jfrog/jfrog-cli-artifactory => github.com/rimapol/jfrog-cli-artifactory feature/support-multiple-sources
replace github.com/jfrog/jfrog-cli-artifactory => github.com/rimapol/jfrog-cli-artifactory v0.0.0-20250612225735-0c71fe131507

//replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.28.1-0.20250508130334-f159cff9b11a
// replace github.com/jfrog/jfrog-cli-artifactory => ../jfrog-cli-artifactory

//replace github.com/jfrog/jfrog-cli-security => github.com/jfrog/jfrog-cli-security v1.17.2-0.20250511132918-d9cc4cd50020
//replace github.com/jfrog/jfrog-cli-security => github.com/rimapol/jfrog-cli-security dev
replace github.com/jfrog/jfrog-cli-security => github.com/rimapol/jfrog-cli-security v1.17.2-0.20250612225936-b0fafec0c190

//replace github.com/jfrog/jfrog-cli-security => ../jfrog-cli-security
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,8 @@ github.com/jfrog/gofrog v1.7.6 h1:QmfAiRzVyaI7JYGsB7cxfAJePAZTzFz0gRWZSE27c6s=
github.com/jfrog/gofrog v1.7.6/go.mod h1:ntr1txqNOZtHplmaNd7rS4f8jpA5Apx8em70oYEe7+4=
github.com/jfrog/jfrog-apps-config v1.0.1 h1:mtv6k7g8A8BVhlHGlSveapqf4mJfonwvXYLipdsOFMY=
github.com/jfrog/jfrog-apps-config v1.0.1/go.mod h1:8AIIr1oY9JuH5dylz2S6f8Ym2MaadPLR6noCBO4C22w=
github.com/jfrog/jfrog-cli-artifactory v0.3.2 h1:oBhiHBtWZCe4rG/WSwFWw3gqGnkcj3/TrfyyECh7AvM=
github.com/jfrog/jfrog-cli-artifactory v0.3.2/go.mod h1:nRWIPgWl6IiZ7u5Ss40BL1YcL/naWwRgnrGllFBV0Ao=
github.com/jfrog/jfrog-cli-core/v2 v2.59.0 h1:Oqi2+skTbJIRDVyhN8kJdCP8w3w1mzXS1/Mx5AIuMsU=
github.com/jfrog/jfrog-cli-core/v2 v2.59.0/go.mod h1:1zZB8vn4yIh/hPj3ed82pI5IhKK9/SzeHsofMcknN68=
github.com/jfrog/jfrog-cli-platform-services v1.9.0 h1:r/ETgJuMUOUu12w20ydsF6paqEaj0khH6bxMRsdNz1Y=
github.com/jfrog/jfrog-cli-platform-services v1.9.0/go.mod h1:pMZMSwhj7yA4VKyj0Skr2lObIyGpZUxNJ40DSLKXU38=
github.com/jfrog/jfrog-cli-security v1.19.0 h1:4qggon1biuOvjMjHZ5IWDA4Mh+qp2qecWEdeX6s4Xv8=
github.com/jfrog/jfrog-cli-security v1.19.0/go.mod h1:QMoGTGfKMSnXOuWv3/IclZU+M/AshoJMt68Ft6l7EdE=
github.com/jfrog/jfrog-client-go v1.54.1 h1:IvobRCmwFS/HDht6Vv1JtGzPPytmOX3qS57hRC5fU98=
github.com/jfrog/jfrog-client-go v1.54.1/go.mod h1:1v0eih4thdPA4clBo9TuvAMT25sGDr1IQJ81DXQ/lBY=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/jszwec/csvutil v1.10.0 h1:upMDUxhQKqZ5ZDCs/wy+8Kib8rZR8I8lOR34yJkdqhI=
Expand Down Expand Up @@ -307,6 +299,14 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw=
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
github.com/rimapol/jfrog-cli-artifactory v0.0.0-20250612225735-0c71fe131507 h1:jXPnRk1kZt7U8oM/yW0gZIsAzeunqoFT/VNh1PY3mOY=
github.com/rimapol/jfrog-cli-artifactory v0.0.0-20250612225735-0c71fe131507/go.mod h1:R8M4nSvRs0k6t5T5SQatGu5iGawEuciSnZH2dZGDFro=
github.com/rimapol/jfrog-cli-core/v2 v2.0.0-20250613000840-75a0253c1164 h1:My2TNxqTLNs/9l5gqn21MkmjsD4hpIiR5hoViLn9Dlw=
github.com/rimapol/jfrog-cli-core/v2 v2.0.0-20250613000840-75a0253c1164/go.mod h1:jmmyqO42y83CfmMJ5DK+6wAIoibb97FFDNq8r3RGGqU=
github.com/rimapol/jfrog-cli-security v1.17.2-0.20250612225936-b0fafec0c190 h1:e2cJcn4P/Jo3FsoWcLy6Vi2BYXBFxPt1sG81/UNztfQ=
github.com/rimapol/jfrog-cli-security v1.17.2-0.20250612225936-b0fafec0c190/go.mod h1:rYzpRXWzLrBPZYXBEzTgbfymJ/+HrTI+nzkng8WwsPY=
github.com/rimapol/jfrog-client-go v0.0.0-20250612223352-8bf50cddd4bd h1:EE5uFJxpxKQnbYHBCVBtftjdVLChANFFgogavBgLKdQ=
github.com/rimapol/jfrog-client-go v0.0.0-20250612223352-8bf50cddd4bd/go.mod h1:1v0eih4thdPA4clBo9TuvAMT25sGDr1IQJ81DXQ/lBY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
Expand Down
197 changes: 197 additions & 0 deletions lifecycle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import (
"os"
"path"
"path/filepath"
"strconv"
"strings"
"testing"
"time"
)
Expand All @@ -45,6 +47,7 @@ const (
artifactoryLifecycleSetTagMinVersion = "7.111.0"
rbManifestName = "release-bundle.json.evd"
releaseBundlesV2 = "release-bundles-v2"
minMultiSourcesArtifactoryVersion = "7.114.0"
)

var (
Expand Down Expand Up @@ -94,6 +97,88 @@ func compareRbArtifacts(t *testing.T, actual services.ReleaseBundleSpecResponse,
assert.ElementsMatch(t, actualArtifactsPaths, expected)
}

func TestReleaseBundleCreationFromMultiBuildsUsingCommandFlag(t *testing.T) {

cleanCallback := initLifecycleTest(t, minMultiSourcesArtifactoryVersion)
defer cleanCallback()
lcManager := getLcServiceManager(t)

deleteBuilds := uploadBuilds(t)
defer deleteBuilds()

createRbFromMultiSourcesUsingCommandFlags(t, lcManager, createBuildsSource(), "", tests.LcRbName1, number1, "default", true)
defer deleteReleaseBundle(t, lcManager, tests.LcRbName1, number1)
assertStatusCompleted(t, lcManager, tests.LcRbName1, number1, "")
}

func TestReleaseBundleCreationFromMultiBundlesUsingCommandFlag(t *testing.T) {

cleanCallback := initLifecycleTest(t, minMultiSourcesArtifactoryVersion)
defer cleanCallback()
lcManager := getLcServiceManager(t)

deleteBuilds := uploadBuilds(t)
defer deleteBuilds()

createRbFromSpec(t, tests.LifecycleBuilds12, tests.LcRbName1, number1, true, true)
defer deleteReleaseBundle(t, lcManager, tests.LcRbName1, number1)

createRbFromSpec(t, tests.LifecycleBuilds3, tests.LcRbName2, number2, true, true)
defer deleteReleaseBundle(t, lcManager, tests.LcRbName2, number2)

createRbFromMultiSourcesUsingCommandFlags(t, lcManager, "", createReleaseBundlesSource(), tests.LcRbName3, number3, "default", true)
defer deleteReleaseBundle(t, lcManager, tests.LcRbName3, number3)
assertStatusCompleted(t, lcManager, tests.LcRbName3, number3, "")
}

func TestReleaseBundleCreationFromMultipleBuildsAndBundlesUsingCommandFlags(t *testing.T) {

cleanCallback := initLifecycleTest(t, minMultiSourcesArtifactoryVersion)
defer cleanCallback()
lcManager := getLcServiceManager(t)

deleteBuilds := uploadBuilds(t)
defer deleteBuilds()

createRbFromSpec(t, tests.LifecycleBuilds12, tests.LcRbName1, number1, true, true)
defer deleteReleaseBundle(t, lcManager, tests.LcRbName1, number1)

createRbFromSpec(t, tests.LifecycleBuilds3, tests.LcRbName2, number2, true, true)
defer deleteReleaseBundle(t, lcManager, tests.LcRbName2, number2)

createRbFromMultiSourcesUsingCommandFlags(t, lcManager, createBuildsSource(), createReleaseBundlesSource(), tests.LcRbName3, number3, "default", true)
defer deleteReleaseBundle(t, lcManager, tests.LcRbName3, number3)
assertStatusCompleted(t, lcManager, tests.LcRbName3, number3, "")
}

func TestReleaseBundleCreationFromMultipleSourcesUsingSpec(t *testing.T) {

cleanCallback := initLifecycleTest(t, minMultiSourcesArtifactoryVersion)
defer cleanCallback()
lcManager := getLcServiceManager(t)

deleteBuilds := uploadBuilds(t)
defer deleteBuilds()

createRbFromSpec(t, tests.LifecycleBuilds12, tests.LcRbName1, number1, true, true)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

createRbFromSpec is only creating release bundle from single source, how is it testing multipleResource from a spec?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bhanurp In this test I previously create regular release bundles from a single source and then I create a multi-source release-bundle using these previously created release bundles.

defer deleteReleaseBundle(t, lcManager, tests.LcRbName1, number1)

createRbFromSpec(t, tests.LifecycleBuilds3, tests.LcRbName2, number2, true, true)
defer deleteReleaseBundle(t, lcManager, tests.LcRbName2, number2)

createRbFromSpec(t, tests.LifecycleMultipleSources, tests.LcRbName3, number3, true, true)
defer deleteReleaseBundle(t, lcManager, tests.LcRbName3, number3)
assertStatusCompleted(t, lcManager, tests.LcRbName3, number3, "")
}

func createBuildsSource() string {
return fmt.Sprintf("name=%s, id=%s, include-deps=%s; name=%s, id=%s", tests.LcBuildName1, number1, "true", tests.LcBuildName2, number2)
}

func createReleaseBundlesSource() string {
return fmt.Sprintf("name=%s, version=%s; name=%s, version=%s", tests.LcRbName1, number1, tests.LcRbName2, number2)
}

func TestReleaseBundleCreationFromAql(t *testing.T) {
testReleaseBundleCreation(t, tests.UploadDevSpecA, tests.LifecycleAql, tests.GetExpectedLifecycleCreationByAql(), false)
}
Expand Down Expand Up @@ -282,6 +367,118 @@ func TestCreateBundleWithoutSpecAndWithProject(t *testing.T) {
defer deleteReleaseBundleWithProject(t, lcManager, tests.LcRbName1, number1, tests.ProjectKey)
}

func createRbFromMultiSourcesUsingCommandFlags(t *testing.T, lcManager *lifecycle.LifecycleServicesManager, buildsSourcesOption, bundlesSourcesOption,
rbName, rbVersion, project string, sync bool) {
var sources []services.RbSource
sources = buildMultiSources(sources, buildsSourcesOption, bundlesSourcesOption, project)

rbDetails := services.ReleaseBundleDetails{
ReleaseBundleName: rbName,
ReleaseBundleVersion: rbVersion,
}
queryParams := services.CommonOptionalQueryParams{
Async: !sync,
ProjectKey: project,
}

assert.NoError(t, lcManager.CreateReleaseBundlesFromMultipleSources(rbDetails, queryParams, gpgKeyPairName, sources))
}

func buildMultiSources(sources []services.RbSource, buildsSourcesStr, bundlesSourcesStr, projectKey string) []services.RbSource {
// Process Builds
if buildsSourcesStr != "" {
sources = buildMultiBuildSources(sources, buildsSourcesStr)
}

// Process Release Bundles
if bundlesSourcesStr != "" {
sources = buildMultiBundleSources(sources, bundlesSourcesStr, projectKey)
}

return sources
}

func buildMultiBundleSources(sources []services.RbSource, bundlesSourcesStr, projectKey string) []services.RbSource {
var releaseBundleSources []services.ReleaseBundleSource
bundleEntries := strings.Split(bundlesSourcesStr, ";")
for _, entry := range bundleEntries {
entry = strings.TrimSpace(entry)
if entry == "" {
continue
}
// Assuming the format "name=xxx, version=xxx"
components := strings.Split(entry, ",")
if len(components) != 2 {
continue
}
name := strings.TrimSpace(strings.Split(components[0], "=")[1])
version := strings.TrimSpace(strings.Split(components[1], "=")[1])

releaseBundleSources = append(releaseBundleSources, services.ReleaseBundleSource{
ProjectKey: projectKey,
ReleaseBundleName: name,
ReleaseBundleVersion: version,
})
}
if len(releaseBundleSources) > 0 {
sources = append(sources, services.RbSource{
SourceType: "release_bundles",
ReleaseBundles: releaseBundleSources,
})
}
return sources
}

func buildMultiBuildSources(sources []services.RbSource, sourcesStr string) []services.RbSource {
var buildSources []services.BuildSource
buildEntries := strings.Split(sourcesStr, ";")
for _, entry := range buildEntries {
entry = strings.TrimSpace(entry)
if entry == "" {
continue
}
// Assuming the format "name=xxx, number=xxx, include-dep=true"
components := strings.Split(entry, ",")
if len(components) < 2 {
continue
}

name := strings.TrimSpace(strings.Split(components[0], "=")[1])
number := strings.TrimSpace(strings.Split(components[1], "=")[1])

includeDepStr := "false"
if len(components) >= 3 {
parts := strings.Split(components[2], "=")
if len(parts) > 1 {
includeDepStr = strings.TrimSpace(parts[1])
}
}

includeDep, _ := strconv.ParseBool(includeDepStr)

buildSources = append(buildSources, services.BuildSource{
BuildRepository: getBuildInfoRepositoryByProject("default"),
BuildName: name,
BuildNumber: number,
IncludeDependencies: includeDep,
})
}
if len(buildSources) > 0 {
sources = append(sources, services.RbSource{
SourceType: "builds",
Builds: buildSources,
})
}
return sources
}

func getBuildInfoRepositoryByProject(projectKey string) string {
buildRepo := "artifactory"
if projectKey != "" && projectKey != "default" {
buildRepo = projectKey
}
return buildRepo + "-build-info"
}
func createRbWithFlags(t *testing.T, specFilePath, sourceOption, buildName, buildNumber, rbName, rbVersion, project string,
sync, withoutSigningKey bool) {
argsAndOptions := []string{
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func execMain() error {
cli.CommandHelpTemplate = commandHelpTemplate
cli.AppHelpTemplate = getAppHelpTemplate()
app.CommandNotFound = func(c *cli.Context, command string) {
_, err = fmt.Fprintf(c.App.Writer, "'"+c.App.Name+" "+command+"' is not a jf command. See --help\n")
_, err = fmt.Fprintf(c.App.Writer, "%s", `'`+c.App.Name+" "+command+"' is not a jf command. See --help\n")
if err != nil {
clientlog.Debug(err)
os.Exit(1)
Expand Down
3 changes: 2 additions & 1 deletion plugins/commands/uninstall.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package commands

import (
"errors"
"github.com/jfrog/jfrog-cli-core/v2/utils/coreutils"
"github.com/jfrog/jfrog-cli-core/v2/utils/plugins"
"github.com/jfrog/jfrog-cli/utils/cliutils"
Expand Down Expand Up @@ -50,5 +51,5 @@ func runUninstallCmd(requestedPlugin string) error {
}

func generateNoPluginFoundError(pluginName string) error {
return errorutils.CheckErrorf("plugin '" + pluginName + "' could not be found")
return errorutils.CheckError(errors.New("plugin '" + pluginName + "' could not be found"))
}
7 changes: 4 additions & 3 deletions plugins/commands/utils/utils.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package utils

import (
"errors"
"github.com/jfrog/jfrog-cli-core/v2/utils/config"
"github.com/jfrog/jfrog-client-go/utils/errorutils"
"github.com/jfrog/jfrog-client-go/utils/io/httputils"
Expand Down Expand Up @@ -119,11 +120,11 @@ func AssertPluginVersion(versionCmdOut string, expectedPluginVersion string) err
// Get the actual version which is after the last space. (expected output to -v for example: "plugin-name version v1.0.0")
split := strings.Split(strings.TrimSpace(versionCmdOut), " ")
if len(split) != 3 {
return errorutils.CheckErrorf("failed verifying plugin version. Unexpected plugin output for version command: '" + versionCmdOut + "'")
return errorutils.CheckError(errors.New("failed verifying plugin version. Unexpected plugin output for version command: '" + versionCmdOut + "'"))
}
if split[2] != expectedPluginVersion {
return errorutils.CheckErrorf("provided version does not match the plugin's actual version. " +
"Provided: '" + expectedPluginVersion + "', Actual: '" + split[2] + "'")
return errorutils.CheckError(errors.New("provided version does not match the plugin's actual version. " +
"Provided: '" + expectedPluginVersion + "', Actual: '" + split[2] + "'"))
}
return nil
}
Expand Down
Loading
Loading
0