From 1f151bda358eadadcec004c0b4725b43f9fb3a5e Mon Sep 17 00:00:00 2001 From: Bhanu Reddy Date: Fri, 10 Jan 2025 16:38:19 +0530 Subject: [PATCH 01/15] Moved distribution commands out of cli-core to cli-artifactory --- go.mod | 10 +++++----- go.sum | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index b13ffded1..f02862fb7 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,7 @@ require ( github.com/testcontainers/testcontainers-go v0.34.0 github.com/urfave/cli v1.22.16 github.com/xeipuuv/gojsonschema v1.2.0 - golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c + golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 gopkg.in/yaml.v2 v2.4.0 ) @@ -170,15 +170,15 @@ 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.20250130104846-27e495de291e +replace github.com/jfrog/jfrog-cli-core/v2 => github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250110105406-518b60799f6c -replace github.com/jfrog/jfrog-cli-artifactory => github.com/jfrog/jfrog-cli-artifactory v0.1.12-0.20250128042424-bb6a289e237c +replace github.com/jfrog/jfrog-cli-artifactory => github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250110110027-5fcd32e2d9e6 -replace github.com/jfrog/jfrog-cli-security => github.com/jfrog/jfrog-cli-security v1.14.2-0.20250130082759-0d5b0bef7b8e +replace github.com/jfrog/jfrog-cli-security => github.com/bhanurp/jfrog-cli-security v1.14.1-0.20250110102743-dcdd4ba39961 // replace github.com/jfrog/jfrog-cli-security => github.com/EyalDelarea/jfrog-cli-security v0.0.0-20241121103043-02719f295f02 -replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.28.1-0.20250126110945-81abbdde452f +// replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.28.1-0.20241225183733-80a5e1ba7a2c // replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go v1.8.9-0.20241220065541-91828d43d8b9 diff --git a/go.sum b/go.sum index b4a4e5d43..8f51448e4 100644 --- a/go.sum +++ b/go.sum @@ -32,6 +32,12 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/beevik/etree v1.4.0 h1:oz1UedHRepuY3p4N5OjE0nK1WLCqtzHf25bxplKOHLs= github.com/beevik/etree v1.4.0/go.mod h1:cyWiXwGoasx60gHvtnEh5x8+uIjUVnjWqBvEnhnqKDA= +github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250110110027-5fcd32e2d9e6 h1:hebEApEhvwUdIaVOFXFPaS6nclLu+smNkSb9nOQ5x/4= +github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250110110027-5fcd32e2d9e6/go.mod h1:2bMm7UHMiJY1DEJTLSFJyRCiR8kCwx71m/FoFJezNNo= +github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250110105406-518b60799f6c h1:WsagVG0HJs+I285t35Ds8kXgcoHqL2EVon9f7siYDG0= +github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250110105406-518b60799f6c/go.mod h1:2yRPxfL9DXml92anDHi1U4mVHxca6xyTjRikY+gd8nw= +github.com/bhanurp/jfrog-cli-security v1.14.1-0.20250110102743-dcdd4ba39961 h1:IOh42JFwLx8Whd4qEx85VqSvXCI4Zh4nbUCyAP2qUF0= +github.com/bhanurp/jfrog-cli-security v1.14.1-0.20250110102743-dcdd4ba39961/go.mod h1:I4ToHnRSHxVdI7Adjq4GR6pIkbiFoEzs2fTKqyRBRNs= github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M= github.com/bradleyjkemp/cupaloy/v2 v2.8.0/go.mod h1:bm7JXdkRd4BHJk9HpwqAI8BoAY1lps46Enkdqw6aRX0= github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= @@ -171,16 +177,10 @@ 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.1.12-0.20250128042424-bb6a289e237c h1:9975QDk6vBZG7vjsKVCuQB56r4xxeoYHHjmTzxbd4H8= -github.com/jfrog/jfrog-cli-artifactory v0.1.12-0.20250128042424-bb6a289e237c/go.mod h1:/sP5tyuFpH9WJp0+vztczuXcxIYHlMye0CDWCxhy4/M= -github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20250130104846-27e495de291e h1:cJJxXI45QLJsaCr5ChOTToCJpLoRTBGlXu/Z6DZB9jk= -github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20250130104846-27e495de291e/go.mod h1:3vP0hv13zJYvhXlgKIXmWSN8ADvGUQgxVVCqcO8hOeM= github.com/jfrog/jfrog-cli-platform-services v1.6.0 h1:2fBIDxnQaFWStZqMEUI2I3nkNjDmknxxHcmpeLxtocc= github.com/jfrog/jfrog-cli-platform-services v1.6.0/go.mod h1:u3lMRG7XC8MeUy/OPkHkZnsgCMIi0br4sjk2/W1Pm8I= -github.com/jfrog/jfrog-cli-security v1.14.2-0.20250130082759-0d5b0bef7b8e h1:h+cmivlTt1tKsfyLBPj6DbZB76JGI4jCXlkuaUgCT4o= -github.com/jfrog/jfrog-cli-security v1.14.2-0.20250130082759-0d5b0bef7b8e/go.mod h1:nFW0dGvSCRD8pZ35tOH9WFANvlEI8Sg1YpD+uM8uxD4= -github.com/jfrog/jfrog-client-go v1.28.1-0.20250126110945-81abbdde452f h1:2IIy3XfvmEp5zJgakKZiyKGGeVyDsouwYmtD+4QiVd4= -github.com/jfrog/jfrog-client-go v1.28.1-0.20250126110945-81abbdde452f/go.mod h1:ohIfKpMBCQsE9kunrKQ1wvoExpqsPLaluRFO186B5EM= +github.com/jfrog/jfrog-client-go v1.49.0 h1:NaTK6+LQBEJafL//6ntnS/eVx1dZMJnxydALwWHKORQ= +github.com/jfrog/jfrog-client-go v1.49.0/go.mod h1:ohIfKpMBCQsE9kunrKQ1wvoExpqsPLaluRFO186B5EM= github.com/jszwec/csvutil v1.10.0 h1:upMDUxhQKqZ5ZDCs/wy+8Kib8rZR8I8lOR34yJkdqhI= github.com/jszwec/csvutil v1.10.0/go.mod h1:/E4ONrmGkwmWsk9ae9jpXnv9QT8pLHEPcCirMFhxG9I= github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= @@ -409,8 +409,8 @@ golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDf golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= -golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c h1:KL/ZBHXgKGVmuZBZ01Lt57yE5ws8ZPSkkihmEyq7FXc= -golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c/go.mod h1:tujkw807nyEEAamNbDrEGzRav+ilXA7PCRAd6xsmwiU= +golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 h1:yqrTHse8TCMW1M1ZCP+VAR/l0kKxwaAIqN/il7x4voA= +golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8/go.mod h1:tujkw807nyEEAamNbDrEGzRav+ilXA7PCRAd6xsmwiU= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= From b04e477f6139eca8549243a83f0c2411c2504552 Mon Sep 17 00:00:00 2001 From: Bhanu Reddy Date: Wed, 29 Jan 2025 12:56:35 +0530 Subject: [PATCH 02/15] Moved distribution commands definition to jfrog-cli-artifactory --- distribution/cli.go | 323 -------------------------------------------- go.mod | 8 +- go.sum | 16 +-- main.go | 9 +- 4 files changed, 14 insertions(+), 342 deletions(-) delete mode 100644 distribution/cli.go diff --git a/distribution/cli.go b/distribution/cli.go deleted file mode 100644 index 9a4db23ac..000000000 --- a/distribution/cli.go +++ /dev/null @@ -1,323 +0,0 @@ -package distribution - -import ( - "errors" - distributionCommands "github.com/jfrog/jfrog-cli-artifactory/distribution/commands" - commonCliUtils "github.com/jfrog/jfrog-cli-core/v2/common/cliutils" - "github.com/jfrog/jfrog-cli-core/v2/common/commands" - "github.com/jfrog/jfrog-cli-core/v2/common/spec" - coreCommonDocs "github.com/jfrog/jfrog-cli-core/v2/docs/common" - coreConfig "github.com/jfrog/jfrog-cli-core/v2/utils/config" - "github.com/jfrog/jfrog-cli/docs/artifactory/releasebundlecreate" - "github.com/jfrog/jfrog-cli/docs/artifactory/releasebundledelete" - "github.com/jfrog/jfrog-cli/docs/artifactory/releasebundledistribute" - "github.com/jfrog/jfrog-cli/docs/artifactory/releasebundlesign" - "github.com/jfrog/jfrog-cli/docs/artifactory/releasebundleupdate" - "github.com/jfrog/jfrog-cli/docs/common" - "github.com/jfrog/jfrog-cli/utils/cliutils" - "github.com/jfrog/jfrog-cli/utils/distribution" - distributionServices "github.com/jfrog/jfrog-client-go/distribution/services" - distributionServicesUtils "github.com/jfrog/jfrog-client-go/distribution/services/utils" - "github.com/jfrog/jfrog-client-go/utils/errorutils" - "github.com/urfave/cli" - "os" - "path/filepath" - "strings" -) - -func GetCommands() []cli.Command { - return cliutils.GetSortedCommands(cli.CommandsByName{ - { - Name: "release-bundle-create", - Flags: cliutils.GetCommandFlags(cliutils.ReleaseBundleV1Create), - Aliases: []string{"rbc"}, - Usage: releasebundlecreate.GetDescription(), - HelpName: coreCommonDocs.CreateUsage("ds rbc", releasebundlecreate.GetDescription(), releasebundlecreate.Usage), - UsageText: releasebundlecreate.GetArguments(), - ArgsUsage: common.CreateEnvVars(), - BashComplete: coreCommonDocs.CreateBashCompletionFunc(), - Action: releaseBundleCreateCmd, - }, - { - Name: "release-bundle-update", - Flags: cliutils.GetCommandFlags(cliutils.ReleaseBundleV1Update), - Aliases: []string{"rbu"}, - Usage: releasebundleupdate.GetDescription(), - HelpName: coreCommonDocs.CreateUsage("ds rbu", releasebundleupdate.GetDescription(), releasebundleupdate.Usage), - UsageText: releasebundleupdate.GetArguments(), - ArgsUsage: common.CreateEnvVars(), - BashComplete: coreCommonDocs.CreateBashCompletionFunc(), - Action: releaseBundleUpdateCmd, - }, - { - Name: "release-bundle-sign", - Flags: cliutils.GetCommandFlags(cliutils.ReleaseBundleV1Sign), - Aliases: []string{"rbs"}, - Usage: releasebundlesign.GetDescription(), - HelpName: coreCommonDocs.CreateUsage("ds rbs", releasebundlesign.GetDescription(), releasebundlesign.Usage), - UsageText: releasebundlesign.GetArguments(), - ArgsUsage: common.CreateEnvVars(), - BashComplete: coreCommonDocs.CreateBashCompletionFunc(), - Action: releaseBundleSignCmd, - }, - { - Name: "release-bundle-distribute", - Flags: cliutils.GetCommandFlags(cliutils.ReleaseBundleV1Distribute), - Aliases: []string{"rbd"}, - Usage: releasebundledistribute.GetDescription(), - HelpName: coreCommonDocs.CreateUsage("ds rbd", releasebundledistribute.GetDescription(), releasebundledistribute.Usage), - UsageText: releasebundledistribute.GetArguments(), - ArgsUsage: common.CreateEnvVars(), - BashComplete: coreCommonDocs.CreateBashCompletionFunc(), - Action: releaseBundleDistributeCmd, - }, - { - Name: "release-bundle-delete", - Flags: cliutils.GetCommandFlags(cliutils.ReleaseBundleV1Delete), - Aliases: []string{"rbdel"}, - Usage: releasebundledelete.GetDescription(), - HelpName: coreCommonDocs.CreateUsage("ds rbdel", releasebundledelete.GetDescription(), releasebundledelete.Usage), - UsageText: releasebundledelete.GetArguments(), - ArgsUsage: common.CreateEnvVars(), - BashComplete: coreCommonDocs.CreateBashCompletionFunc(), - Action: releaseBundleDeleteCmd, - }, - }) -} - -func releaseBundleCreateCmd(c *cli.Context) error { - if !(c.NArg() == 2 && c.IsSet("spec") || (c.NArg() == 3 && !c.IsSet("spec"))) { - return cliutils.WrongNumberOfArgumentsHandler(c) - } - if c.IsSet("detailed-summary") && !c.IsSet("sign") { - return cliutils.PrintHelpAndReturnError("The --detailed-summary option can't be used without --sign", c) - } - var releaseBundleCreateSpec *spec.SpecFiles - var err error - if c.IsSet("spec") { - releaseBundleCreateSpec, err = cliutils.GetSpec(c, true, true) - } else { - releaseBundleCreateSpec = createDefaultReleaseBundleSpec(c) - } - if err != nil { - return err - } - err = spec.ValidateSpec(releaseBundleCreateSpec.Files, false, true) - if err != nil { - return err - } - - params, err := createReleaseBundleCreateUpdateParams(c, c.Args().Get(0), c.Args().Get(1)) - if err != nil { - return err - } - releaseBundleCreateCmd := distributionCommands.NewReleaseBundleCreateCommand() - dsDetails, err := createDistributionDetailsByFlags(c) - if err != nil { - return err - } - releaseBundleCreateCmd.SetServerDetails(dsDetails).SetReleaseBundleCreateParams(params).SetSpec(releaseBundleCreateSpec).SetDryRun(c.Bool("dry-run")).SetDetailedSummary(c.Bool("detailed-summary")) - - err = commands.Exec(releaseBundleCreateCmd) - if releaseBundleCreateCmd.IsDetailedSummary() { - if summary := releaseBundleCreateCmd.GetSummary(); summary != nil { - return cliutils.PrintBuildInfoSummaryReport(summary.IsSucceeded(), summary.GetSha256(), err) - } - } - return err -} - -func releaseBundleUpdateCmd(c *cli.Context) error { - if !(c.NArg() == 2 && c.IsSet("spec") || (c.NArg() == 3 && !c.IsSet("spec"))) { - return cliutils.WrongNumberOfArgumentsHandler(c) - } - if c.IsSet("detailed-summary") && !c.IsSet("sign") { - return cliutils.PrintHelpAndReturnError("The --detailed-summary option can't be used without --sign", c) - } - var releaseBundleUpdateSpec *spec.SpecFiles - var err error - if c.IsSet("spec") { - releaseBundleUpdateSpec, err = cliutils.GetSpec(c, true, true) - } else { - releaseBundleUpdateSpec = createDefaultReleaseBundleSpec(c) - } - if err != nil { - return err - } - err = spec.ValidateSpec(releaseBundleUpdateSpec.Files, false, true) - if err != nil { - return err - } - - params, err := createReleaseBundleCreateUpdateParams(c, c.Args().Get(0), c.Args().Get(1)) - if err != nil { - return err - } - releaseBundleUpdateCmd := distributionCommands.NewReleaseBundleUpdateCommand() - dsDetails, err := createDistributionDetailsByFlags(c) - if err != nil { - return err - } - releaseBundleUpdateCmd.SetServerDetails(dsDetails).SetReleaseBundleUpdateParams(params).SetSpec(releaseBundleUpdateSpec).SetDryRun(c.Bool("dry-run")).SetDetailedSummary(c.Bool("detailed-summary")) - - err = commands.Exec(releaseBundleUpdateCmd) - if releaseBundleUpdateCmd.IsDetailedSummary() { - if summary := releaseBundleUpdateCmd.GetSummary(); summary != nil { - return cliutils.PrintBuildInfoSummaryReport(summary.IsSucceeded(), summary.GetSha256(), err) - } - } - return err -} - -func releaseBundleSignCmd(c *cli.Context) error { - if c.NArg() != 2 { - return cliutils.WrongNumberOfArgumentsHandler(c) - } - - params := distributionServices.NewSignBundleParams(c.Args().Get(0), c.Args().Get(1)) - params.StoringRepository = c.String("repo") - params.GpgPassphrase = c.String("passphrase") - releaseBundleSignCmd := distributionCommands.NewReleaseBundleSignCommand() - dsDetails, err := createDistributionDetailsByFlags(c) - if err != nil { - return err - } - releaseBundleSignCmd.SetServerDetails(dsDetails).SetReleaseBundleSignParams(params).SetDetailedSummary(c.Bool("detailed-summary")) - err = commands.Exec(releaseBundleSignCmd) - if releaseBundleSignCmd.IsDetailedSummary() { - if summary := releaseBundleSignCmd.GetSummary(); summary != nil { - return cliutils.PrintBuildInfoSummaryReport(summary.IsSucceeded(), summary.GetSha256(), err) - } - } - return err -} - -func releaseBundleDistributeCmd(c *cli.Context) error { - if err := distribution.ValidateReleaseBundleDistributeCmd(c); err != nil { - return err - } - - dsDetails, err := createDistributionDetailsByFlags(c) - if err != nil { - return err - } - distributionRules, maxWaitMinutes, params, err := distribution.InitReleaseBundleDistributeCmd(c) - if err != nil { - return err - } - - distributeCmd := distributionCommands.NewReleaseBundleDistributeV1Command() - distributeCmd.SetServerDetails(dsDetails). - SetDistributeBundleParams(params). - SetDistributionRules(distributionRules). - SetDryRun(c.Bool("dry-run")). - SetSync(c.Bool("sync")). - SetMaxWaitMinutes(maxWaitMinutes). - SetAutoCreateRepo(c.Bool("create-repo")) - - return commands.Exec(distributeCmd) -} - -func releaseBundleDeleteCmd(c *cli.Context) error { - if c.NArg() != 2 { - return cliutils.WrongNumberOfArgumentsHandler(c) - } - var distributionRules *spec.DistributionRules - if c.IsSet("dist-rules") { - if c.IsSet("site") || c.IsSet("city") || c.IsSet("country-code") { - return cliutils.PrintHelpAndReturnError("flag --dist-rules can't be used with --site, --city or --country-code", c) - } - var err error - distributionRules, err = spec.CreateDistributionRulesFromFile(c.String("dist-rules")) - if err != nil { - return err - } - } else { - distributionRules = distribution.CreateDefaultDistributionRules(c) - } - - params := distributionServices.NewDeleteReleaseBundleParams(c.Args().Get(0), c.Args().Get(1)) - params.DeleteFromDistribution = c.BoolT("delete-from-dist") - params.Sync = c.Bool("sync") - maxWaitMinutes, err := cliutils.GetIntFlagValue(c, "max-wait-minutes", 60) - if err != nil { - return err - } - params.MaxWaitMinutes = maxWaitMinutes - distributeBundleCmd := distributionCommands.NewReleaseBundleDeleteParams() - dsDetails, err := createDistributionDetailsByFlags(c) - if err != nil { - return err - } - distributeBundleCmd.SetQuiet(cliutils.GetQuietValue(c)).SetServerDetails(dsDetails).SetDistributeBundleParams(params).SetDistributionRules(distributionRules).SetDryRun(c.Bool("dry-run")) - - return commands.Exec(distributeBundleCmd) -} - -func createDefaultReleaseBundleSpec(c *cli.Context) *spec.SpecFiles { - return spec.NewBuilder(). - Pattern(c.Args().Get(2)). - Target(c.String("target")). - Props(c.String("props")). - Build(c.String("build")). - Bundle(c.String("bundle")). - Exclusions(cliutils.GetStringsArrFlagValue(c, "exclusions")). - Regexp(c.Bool("regexp")). - TargetProps(c.String("target-props")). - Ant(c.Bool("ant")). - BuildSpec() -} - -func createReleaseBundleCreateUpdateParams(c *cli.Context, bundleName, bundleVersion string) (distributionServicesUtils.ReleaseBundleParams, error) { - releaseBundleParams := distributionServicesUtils.NewReleaseBundleParams(bundleName, bundleVersion) - releaseBundleParams.SignImmediately = c.Bool("sign") - releaseBundleParams.StoringRepository = c.String("repo") - releaseBundleParams.GpgPassphrase = c.String("passphrase") - releaseBundleParams.Description = c.String("desc") - if c.IsSet("release-notes-path") { - bytes, err := os.ReadFile(c.String("release-notes-path")) - if err != nil { - return releaseBundleParams, errorutils.CheckError(err) - } - releaseBundleParams.ReleaseNotes = string(bytes) - releaseBundleParams.ReleaseNotesSyntax, err = populateReleaseNotesSyntax(c) - if err != nil { - return releaseBundleParams, err - } - } - return releaseBundleParams, nil -} - -func populateReleaseNotesSyntax(c *cli.Context) (distributionServicesUtils.ReleaseNotesSyntax, error) { - // If release notes syntax is set, use it - releaseNotesSyntax := c.String("release-notes-syntax") - if releaseNotesSyntax != "" { - switch releaseNotesSyntax { - case "markdown": - return distributionServicesUtils.Markdown, nil - case "asciidoc": - return distributionServicesUtils.Asciidoc, nil - case "plain_text": - return distributionServicesUtils.PlainText, nil - default: - return distributionServicesUtils.PlainText, errorutils.CheckErrorf("--release-notes-syntax must be one of: markdown, asciidoc or plain_text.") - } - } - // If the file extension is ".md" or ".markdown", use the Markdown syntax - extension := strings.ToLower(filepath.Ext(c.String("release-notes-path"))) - if extension == ".md" || extension == ".markdown" { - return distributionServicesUtils.Markdown, nil - } - return distributionServicesUtils.PlainText, nil -} - -func createDistributionDetailsByFlags(c *cli.Context) (*coreConfig.ServerDetails, error) { - dsDetails, err := cliutils.CreateServerDetailsWithConfigOffer(c, true, commonCliUtils.Ds) - if err != nil { - return nil, err - } - if dsDetails.DistributionUrl == "" { - return nil, errors.New("no JFrog Distribution URL specified, either via the --url flag or as part of the server configuration") - } - return dsDetails, nil -} diff --git a/go.mod b/go.mod index f02862fb7..4079925a6 100644 --- a/go.mod +++ b/go.mod @@ -170,11 +170,13 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace github.com/jfrog/jfrog-cli-core/v2 => github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250110105406-518b60799f6c +//replace github.com/jfrog/jfrog-cli-core/v2 => github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250123053843-d005557d62d9 +replace github.com/jfrog/jfrog-cli-core/v2 => github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250129071309-c13c59fc7662 -replace github.com/jfrog/jfrog-cli-artifactory => github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250110110027-5fcd32e2d9e6 +//replace github.com/jfrog/jfrog-cli-artifactory => github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250123060215-b15168492ff0 +replace github.com/jfrog/jfrog-cli-artifactory => github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250129072400-601650617bba -replace github.com/jfrog/jfrog-cli-security => github.com/bhanurp/jfrog-cli-security v1.14.1-0.20250110102743-dcdd4ba39961 +replace github.com/jfrog/jfrog-cli-security => github.com/bhanurp/jfrog-cli-security v1.14.1-0.20250123044515-d8a14cb8bdb7 // replace github.com/jfrog/jfrog-cli-security => github.com/EyalDelarea/jfrog-cli-security v0.0.0-20241121103043-02719f295f02 diff --git a/go.sum b/go.sum index 8f51448e4..a08979843 100644 --- a/go.sum +++ b/go.sum @@ -32,12 +32,12 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/beevik/etree v1.4.0 h1:oz1UedHRepuY3p4N5OjE0nK1WLCqtzHf25bxplKOHLs= github.com/beevik/etree v1.4.0/go.mod h1:cyWiXwGoasx60gHvtnEh5x8+uIjUVnjWqBvEnhnqKDA= -github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250110110027-5fcd32e2d9e6 h1:hebEApEhvwUdIaVOFXFPaS6nclLu+smNkSb9nOQ5x/4= -github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250110110027-5fcd32e2d9e6/go.mod h1:2bMm7UHMiJY1DEJTLSFJyRCiR8kCwx71m/FoFJezNNo= -github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250110105406-518b60799f6c h1:WsagVG0HJs+I285t35Ds8kXgcoHqL2EVon9f7siYDG0= -github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250110105406-518b60799f6c/go.mod h1:2yRPxfL9DXml92anDHi1U4mVHxca6xyTjRikY+gd8nw= -github.com/bhanurp/jfrog-cli-security v1.14.1-0.20250110102743-dcdd4ba39961 h1:IOh42JFwLx8Whd4qEx85VqSvXCI4Zh4nbUCyAP2qUF0= -github.com/bhanurp/jfrog-cli-security v1.14.1-0.20250110102743-dcdd4ba39961/go.mod h1:I4ToHnRSHxVdI7Adjq4GR6pIkbiFoEzs2fTKqyRBRNs= +github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250129072400-601650617bba h1:DFrRcLHe6DisJDreQZfP1XJggWPmZSPG+bDcfrQVfGs= +github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250129072400-601650617bba/go.mod h1:GNZlq5SBw8mcb0s4IbIqAlZ2OOdOBxWop55T79zs1z0= +github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250129071309-c13c59fc7662 h1:vvQwp+ipKV3Y9qtfz+jpgcXMFzbAL6KZt7TYPXtfNjE= +github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250129071309-c13c59fc7662/go.mod h1:ALempEeph7JoZZS2ob7xK+0r9v82z8IBDzQB1hnaxuQ= +github.com/bhanurp/jfrog-cli-security v1.14.1-0.20250123044515-d8a14cb8bdb7 h1:RJdx6xJQte6Wpp0xXIP8wu4htAFDxUE3gUjYjgJDETA= +github.com/bhanurp/jfrog-cli-security v1.14.1-0.20250123044515-d8a14cb8bdb7/go.mod h1:GoNkmdj5Kss12smya4zKKNofQHywVNj5hYWrvlSWgGs= github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M= github.com/bradleyjkemp/cupaloy/v2 v2.8.0/go.mod h1:bm7JXdkRd4BHJk9HpwqAI8BoAY1lps46Enkdqw6aRX0= github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= @@ -179,8 +179,8 @@ github.com/jfrog/jfrog-apps-config v1.0.1 h1:mtv6k7g8A8BVhlHGlSveapqf4mJfonwvXYL github.com/jfrog/jfrog-apps-config v1.0.1/go.mod h1:8AIIr1oY9JuH5dylz2S6f8Ym2MaadPLR6noCBO4C22w= github.com/jfrog/jfrog-cli-platform-services v1.6.0 h1:2fBIDxnQaFWStZqMEUI2I3nkNjDmknxxHcmpeLxtocc= github.com/jfrog/jfrog-cli-platform-services v1.6.0/go.mod h1:u3lMRG7XC8MeUy/OPkHkZnsgCMIi0br4sjk2/W1Pm8I= -github.com/jfrog/jfrog-client-go v1.49.0 h1:NaTK6+LQBEJafL//6ntnS/eVx1dZMJnxydALwWHKORQ= -github.com/jfrog/jfrog-client-go v1.49.0/go.mod h1:ohIfKpMBCQsE9kunrKQ1wvoExpqsPLaluRFO186B5EM= +github.com/jfrog/jfrog-client-go v1.49.1 h1:AdJ+x+BSka3pCVDu6MCEvojwOmXvy1Q5S0dILvpfoDw= +github.com/jfrog/jfrog-client-go v1.49.1/go.mod h1:ohIfKpMBCQsE9kunrKQ1wvoExpqsPLaluRFO186B5EM= github.com/jszwec/csvutil v1.10.0 h1:upMDUxhQKqZ5ZDCs/wy+8Kib8rZR8I8lOR34yJkdqhI= github.com/jszwec/csvutil v1.10.0/go.mod h1:/E4ONrmGkwmWsk9ae9jpXnv9QT8pLHEPcCirMFhxG9I= github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= diff --git a/main.go b/main.go index dab9625c5..1001d880a 100644 --- a/main.go +++ b/main.go @@ -5,7 +5,7 @@ import ( "encoding/hex" "fmt" "github.com/agnivade/levenshtein" - artifactoryCLI "github.com/jfrog/jfrog-cli-artifactory/evidence/cli" + artifactoryCLI "github.com/jfrog/jfrog-cli-artifactory/cli" corecommon "github.com/jfrog/jfrog-cli-core/v2/docs/common" "github.com/jfrog/jfrog-cli-core/v2/plugins/components" coreconfig "github.com/jfrog/jfrog-cli-core/v2/utils/config" @@ -17,7 +17,6 @@ import ( "github.com/jfrog/jfrog-cli/buildtools" "github.com/jfrog/jfrog-cli/completion" "github.com/jfrog/jfrog-cli/config" - "github.com/jfrog/jfrog-cli/distribution" "github.com/jfrog/jfrog-cli/docs/common" aiDocs "github.com/jfrog/jfrog-cli/docs/general/ai" loginDocs "github.com/jfrog/jfrog-cli/docs/general/login" @@ -220,12 +219,6 @@ func getCommands() ([]cli.Command, error) { Subcommands: missioncontrol.GetCommands(), Category: commandNamespacesCategory, }, - { - Name: cliutils.CmdDistribution, - Usage: "Distribution V1 commands.", - Subcommands: distribution.GetCommands(), - Category: commandNamespacesCategory, - }, { Name: cliutils.CmdPipelines, Usage: "Pipelines commands.", From c9e26b9b5265bd2ca600920ca9d58641553e06f4 Mon Sep 17 00:00:00 2001 From: Bhanu Reddy Date: Fri, 31 Jan 2025 12:16:32 +0530 Subject: [PATCH 03/15] Updated dependencies --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 4079925a6..151fc8ae3 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,7 @@ require ( github.com/testcontainers/testcontainers-go v0.34.0 github.com/urfave/cli v1.22.16 github.com/xeipuuv/gojsonschema v1.2.0 - golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 + golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c gopkg.in/yaml.v2 v2.4.0 ) @@ -171,7 +171,7 @@ require ( ) //replace github.com/jfrog/jfrog-cli-core/v2 => github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250123053843-d005557d62d9 -replace github.com/jfrog/jfrog-cli-core/v2 => github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250129071309-c13c59fc7662 +replace github.com/jfrog/jfrog-cli-core/v2 => github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0 //replace github.com/jfrog/jfrog-cli-artifactory => github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250123060215-b15168492ff0 replace github.com/jfrog/jfrog-cli-artifactory => github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250129072400-601650617bba diff --git a/go.sum b/go.sum index a08979843..8de8c1d5f 100644 --- a/go.sum +++ b/go.sum @@ -34,8 +34,8 @@ github.com/beevik/etree v1.4.0 h1:oz1UedHRepuY3p4N5OjE0nK1WLCqtzHf25bxplKOHLs= github.com/beevik/etree v1.4.0/go.mod h1:cyWiXwGoasx60gHvtnEh5x8+uIjUVnjWqBvEnhnqKDA= github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250129072400-601650617bba h1:DFrRcLHe6DisJDreQZfP1XJggWPmZSPG+bDcfrQVfGs= github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250129072400-601650617bba/go.mod h1:GNZlq5SBw8mcb0s4IbIqAlZ2OOdOBxWop55T79zs1z0= -github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250129071309-c13c59fc7662 h1:vvQwp+ipKV3Y9qtfz+jpgcXMFzbAL6KZt7TYPXtfNjE= -github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250129071309-c13c59fc7662/go.mod h1:ALempEeph7JoZZS2ob7xK+0r9v82z8IBDzQB1hnaxuQ= +github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0 h1:8vIvDWathpxoHeQRadJ9Tm9dIGoikllbLwAH5la/sz4= +github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0/go.mod h1:3vP0hv13zJYvhXlgKIXmWSN8ADvGUQgxVVCqcO8hOeM= github.com/bhanurp/jfrog-cli-security v1.14.1-0.20250123044515-d8a14cb8bdb7 h1:RJdx6xJQte6Wpp0xXIP8wu4htAFDxUE3gUjYjgJDETA= github.com/bhanurp/jfrog-cli-security v1.14.1-0.20250123044515-d8a14cb8bdb7/go.mod h1:GoNkmdj5Kss12smya4zKKNofQHywVNj5hYWrvlSWgGs= github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M= @@ -409,8 +409,8 @@ golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDf golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= -golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 h1:yqrTHse8TCMW1M1ZCP+VAR/l0kKxwaAIqN/il7x4voA= -golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8/go.mod h1:tujkw807nyEEAamNbDrEGzRav+ilXA7PCRAd6xsmwiU= +golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c h1:KL/ZBHXgKGVmuZBZ01Lt57yE5ws8ZPSkkihmEyq7FXc= +golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c/go.mod h1:tujkw807nyEEAamNbDrEGzRav+ilXA7PCRAd6xsmwiU= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= From 353207b0ff08f8fa6b9e33a4a791ff83c6958376 Mon Sep 17 00:00:00 2001 From: Bhanu Reddy Date: Fri, 31 Jan 2025 13:39:11 +0530 Subject: [PATCH 04/15] Updated dependencies --- docs/artifactory/releasebundlecreate/help.go | 20 ------------------- docs/artifactory/releasebundledelete/help.go | 15 -------------- .../releasebundledistribute/help.go | 15 -------------- docs/artifactory/releasebundlesign/help.go | 15 -------------- docs/artifactory/releasebundleupdate/help.go | 20 ------------------- go.mod | 6 +++--- go.sum | 12 +++++------ 7 files changed, 9 insertions(+), 94 deletions(-) delete mode 100644 docs/artifactory/releasebundlecreate/help.go delete mode 100644 docs/artifactory/releasebundledelete/help.go delete mode 100644 docs/artifactory/releasebundledistribute/help.go delete mode 100644 docs/artifactory/releasebundlesign/help.go delete mode 100644 docs/artifactory/releasebundleupdate/help.go diff --git a/docs/artifactory/releasebundlecreate/help.go b/docs/artifactory/releasebundlecreate/help.go deleted file mode 100644 index 91df44ceb..000000000 --- a/docs/artifactory/releasebundlecreate/help.go +++ /dev/null @@ -1,20 +0,0 @@ -package releasebundlecreate - -var Usage = []string{"ds rbc [command options] ", - "ds rbc --spec= [command options] "} - -func GetDescription() string { - return "Create a release bundle v1." -} - -func GetArguments() string { - return ` release bundle name - The name of the release bundle. - - release bundle version - The release bundle version. - - pattern - Specifies the source path in Artifactory, from which the artifacts should be bundled, - in the following format: /. You can use wildcards to specify multiple artifacts.` -} diff --git a/docs/artifactory/releasebundledelete/help.go b/docs/artifactory/releasebundledelete/help.go deleted file mode 100644 index ec9e1fe7a..000000000 --- a/docs/artifactory/releasebundledelete/help.go +++ /dev/null @@ -1,15 +0,0 @@ -package releasebundledelete - -var Usage = []string{"ds rbdel [command options] "} - -func GetDescription() string { - return "Delete a release bundle v1." -} - -func GetArguments() string { - return ` release bundle name - Release bundle name. - - release bundle version - Release bundle version.` -} diff --git a/docs/artifactory/releasebundledistribute/help.go b/docs/artifactory/releasebundledistribute/help.go deleted file mode 100644 index b277a84d3..000000000 --- a/docs/artifactory/releasebundledistribute/help.go +++ /dev/null @@ -1,15 +0,0 @@ -package releasebundledistribute - -var Usage = []string{"ds rbd [command options] "} - -func GetDescription() string { - return "Distribute a release bundle v1." -} - -func GetArguments() string { - return ` release bundle name - Release bundle name. - - release bundle version - Release bundle version.` -} diff --git a/docs/artifactory/releasebundlesign/help.go b/docs/artifactory/releasebundlesign/help.go deleted file mode 100644 index 977874bd8..000000000 --- a/docs/artifactory/releasebundlesign/help.go +++ /dev/null @@ -1,15 +0,0 @@ -package releasebundlesign - -var Usage = []string{"ds rbs [command options] "} - -func GetDescription() string { - return "Sign a release bundle v1." -} - -func GetArguments() string { - return ` release bundle name - Release bundle name. - - release bundle version - Release bundle version.` -} diff --git a/docs/artifactory/releasebundleupdate/help.go b/docs/artifactory/releasebundleupdate/help.go deleted file mode 100644 index d7cd5541f..000000000 --- a/docs/artifactory/releasebundleupdate/help.go +++ /dev/null @@ -1,20 +0,0 @@ -package releasebundleupdate - -var Usage = []string{"ds rbu [command options] ", - "ds rbu --spec= [command options] "} - -func GetDescription() string { - return "Updates an existing unsigned release bundle v1 version." -} - -func GetArguments() string { - return ` release bundle name - The name of the release bundle. - - release bundle version - The release bundle version. - - pattern - Specifies the source path in Artifactory, from which the artifacts should be bundled, - in the following format: /. You can use wildcards to specify multiple artifacts.` -} diff --git a/go.mod b/go.mod index 151fc8ae3..d4e42096c 100644 --- a/go.mod +++ b/go.mod @@ -174,13 +174,13 @@ require ( replace github.com/jfrog/jfrog-cli-core/v2 => github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0 //replace github.com/jfrog/jfrog-cli-artifactory => github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250123060215-b15168492ff0 -replace github.com/jfrog/jfrog-cli-artifactory => github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250129072400-601650617bba +replace github.com/jfrog/jfrog-cli-artifactory => github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250131080518-62fe719b2c1e -replace github.com/jfrog/jfrog-cli-security => github.com/bhanurp/jfrog-cli-security v1.14.1-0.20250123044515-d8a14cb8bdb7 +replace github.com/jfrog/jfrog-cli-security => github.com/jfrog/jfrog-cli-security v1.14.2-0.20250130082759-0d5b0bef7b8e // replace github.com/jfrog/jfrog-cli-security => github.com/EyalDelarea/jfrog-cli-security v0.0.0-20241121103043-02719f295f02 -// replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.28.1-0.20241225183733-80a5e1ba7a2c +replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.28.1-0.20250126110945-81abbdde452f // replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go v1.8.9-0.20241220065541-91828d43d8b9 diff --git a/go.sum b/go.sum index 8de8c1d5f..5be672343 100644 --- a/go.sum +++ b/go.sum @@ -32,12 +32,10 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/beevik/etree v1.4.0 h1:oz1UedHRepuY3p4N5OjE0nK1WLCqtzHf25bxplKOHLs= github.com/beevik/etree v1.4.0/go.mod h1:cyWiXwGoasx60gHvtnEh5x8+uIjUVnjWqBvEnhnqKDA= -github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250129072400-601650617bba h1:DFrRcLHe6DisJDreQZfP1XJggWPmZSPG+bDcfrQVfGs= -github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250129072400-601650617bba/go.mod h1:GNZlq5SBw8mcb0s4IbIqAlZ2OOdOBxWop55T79zs1z0= +github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250131080518-62fe719b2c1e h1:iwM9zRS0HpVzqd0xFl7LZSLr4hTUIW8d8n/DxikveSs= +github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250131080518-62fe719b2c1e/go.mod h1:+oTMKRc+yQw0sy8TUStRuqD9D4UFfrksphiX4TbCqew= github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0 h1:8vIvDWathpxoHeQRadJ9Tm9dIGoikllbLwAH5la/sz4= github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0/go.mod h1:3vP0hv13zJYvhXlgKIXmWSN8ADvGUQgxVVCqcO8hOeM= -github.com/bhanurp/jfrog-cli-security v1.14.1-0.20250123044515-d8a14cb8bdb7 h1:RJdx6xJQte6Wpp0xXIP8wu4htAFDxUE3gUjYjgJDETA= -github.com/bhanurp/jfrog-cli-security v1.14.1-0.20250123044515-d8a14cb8bdb7/go.mod h1:GoNkmdj5Kss12smya4zKKNofQHywVNj5hYWrvlSWgGs= github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M= github.com/bradleyjkemp/cupaloy/v2 v2.8.0/go.mod h1:bm7JXdkRd4BHJk9HpwqAI8BoAY1lps46Enkdqw6aRX0= github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= @@ -179,8 +177,10 @@ github.com/jfrog/jfrog-apps-config v1.0.1 h1:mtv6k7g8A8BVhlHGlSveapqf4mJfonwvXYL github.com/jfrog/jfrog-apps-config v1.0.1/go.mod h1:8AIIr1oY9JuH5dylz2S6f8Ym2MaadPLR6noCBO4C22w= github.com/jfrog/jfrog-cli-platform-services v1.6.0 h1:2fBIDxnQaFWStZqMEUI2I3nkNjDmknxxHcmpeLxtocc= github.com/jfrog/jfrog-cli-platform-services v1.6.0/go.mod h1:u3lMRG7XC8MeUy/OPkHkZnsgCMIi0br4sjk2/W1Pm8I= -github.com/jfrog/jfrog-client-go v1.49.1 h1:AdJ+x+BSka3pCVDu6MCEvojwOmXvy1Q5S0dILvpfoDw= -github.com/jfrog/jfrog-client-go v1.49.1/go.mod h1:ohIfKpMBCQsE9kunrKQ1wvoExpqsPLaluRFO186B5EM= +github.com/jfrog/jfrog-cli-security v1.14.2-0.20250130082759-0d5b0bef7b8e h1:h+cmivlTt1tKsfyLBPj6DbZB76JGI4jCXlkuaUgCT4o= +github.com/jfrog/jfrog-cli-security v1.14.2-0.20250130082759-0d5b0bef7b8e/go.mod h1:nFW0dGvSCRD8pZ35tOH9WFANvlEI8Sg1YpD+uM8uxD4= +github.com/jfrog/jfrog-client-go v1.28.1-0.20250126110945-81abbdde452f h1:2IIy3XfvmEp5zJgakKZiyKGGeVyDsouwYmtD+4QiVd4= +github.com/jfrog/jfrog-client-go v1.28.1-0.20250126110945-81abbdde452f/go.mod h1:ohIfKpMBCQsE9kunrKQ1wvoExpqsPLaluRFO186B5EM= github.com/jszwec/csvutil v1.10.0 h1:upMDUxhQKqZ5ZDCs/wy+8Kib8rZR8I8lOR34yJkdqhI= github.com/jszwec/csvutil v1.10.0/go.mod h1:/E4ONrmGkwmWsk9ae9jpXnv9QT8pLHEPcCirMFhxG9I= github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= From 63d82b265c8b51b0b3cc1d12c754bde2228c9463 Mon Sep 17 00:00:00 2001 From: Bhanu Reddy Date: Sun, 2 Feb 2025 13:07:50 +0530 Subject: [PATCH 05/15] Moved distrobution tests to cli-artifactory --- distribution_test.go | 635 ------------------------------------------- 1 file changed, 635 deletions(-) delete mode 100644 distribution_test.go diff --git a/distribution_test.go b/distribution_test.go deleted file mode 100644 index 3c232c3c0..000000000 --- a/distribution_test.go +++ /dev/null @@ -1,635 +0,0 @@ -package main - -import ( - "encoding/json" - "errors" - "fmt" - coreTestUtils "github.com/jfrog/jfrog-cli-core/v2/common/tests" - "github.com/jfrog/jfrog-cli-core/v2/utils/config" - "github.com/jfrog/jfrog-cli-core/v2/utils/coreutils" - coreTests "github.com/jfrog/jfrog-cli-core/v2/utils/tests" - "github.com/jfrog/jfrog-cli/inttestutils" - "github.com/jfrog/jfrog-cli/utils/tests" - "github.com/jfrog/jfrog-client-go/auth" - distributionServices "github.com/jfrog/jfrog-client-go/distribution/services" - clientDistUtils "github.com/jfrog/jfrog-client-go/distribution/services/utils" - clientUtils "github.com/jfrog/jfrog-client-go/utils" - "github.com/jfrog/jfrog-client-go/utils/distribution" - "github.com/jfrog/jfrog-client-go/utils/io/fileutils" - "github.com/jfrog/jfrog-client-go/utils/io/httputils" - "github.com/jfrog/jfrog-client-go/utils/log" - "github.com/stretchr/testify/assert" - "net/http" - "os" - "path/filepath" - "strconv" - "testing" -) - -const ( - bundleVersion = "10" - distributionEndpoint = "distribution/" -) - -var ( - distributionDetails *config.ServerDetails - distAuth auth.ServiceDetails - distHttpDetails httputils.HttpClientDetails - // JFrog CLI for Distribution commands - distributionCli *coreTests.JfrogCli -) - -func InitDistributionTests() { - initDistributionCli() - inttestutils.CleanUpOldBundles(distHttpDetails, bundleVersion, distributionCli) - InitArtifactoryTests() - inttestutils.SendGpgKeys(artHttpDetails, distHttpDetails) -} - -func CleanDistributionTests() { - deleteCreatedRepos() -} - -func authenticateDistribution() string { - *tests.JfrogUrl = clientUtils.AddTrailingSlashIfNeeded(*tests.JfrogUrl) - distributionDetails = &config.ServerDetails{DistributionUrl: *tests.JfrogUrl + distributionEndpoint} - cred := "--url=" + distributionDetails.DistributionUrl - if *tests.JfrogAccessToken != "" { - distributionDetails.AccessToken = *tests.JfrogAccessToken - cred += " --access-token=" + *tests.JfrogAccessToken - } else { - distributionDetails.Password = *tests.JfrogPassword - cred += " --password=" + *tests.JfrogPassword - } - // Due to a bug in distribution when authenticate with a multi-scope token, - // we must send a username as well as token or password. - distributionDetails.User = *tests.JfrogUser - cred += " --user=" + *tests.JfrogUser - - var err error - if distAuth, err = distributionDetails.CreateDistAuthConfig(); err != nil { - coreutils.ExitOnErr(errors.New("Failed while attempting to authenticate with Distribution: " + err.Error())) - } - distributionDetails.DistributionUrl = distAuth.GetUrl() - distHttpDetails = distAuth.CreateHttpClientDetails() - return cred -} - -func initDistributionCli() { - if distributionCli != nil { - return - } - cred := authenticateDistribution() - distributionCli = coreTests.NewJfrogCli(execMain, "jfrog ds", cred) -} - -func initDistributionTest(t *testing.T) { - if !*tests.TestDistribution { - t.Skip("Skipping distribution test. To run distribution test add the '-test.distribution=true' option.") - } -} - -func cleanDistributionTest(t *testing.T) { - err := distributionCli.Exec("rbdel", tests.BundleName, bundleVersion, "--site=*", "--delete-from-dist", "--quiet", "--sync") - if err != nil { - // If release bundle already deleted during the tests no need to fail here - assert.ErrorContains(t, err, fmt.Sprintf("Release Bundle Version '%s/%s' was not found", tests.BundleName, bundleVersion)) - } - - inttestutils.CleanDistributionRepositories(t, serverDetails) - tests.CleanFileSystem() -} - -func TestBundleAsyncDistDownload(t *testing.T) { - initDistributionTest(t) - - // Upload files - specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) - assert.NoError(t, err) - runRt(t, "u", "--spec="+specFile) - - // Create and distribute release bundle - runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/b1.in", "--sign") - runDs(t, "rbd", tests.BundleName, bundleVersion, "--site=*", "--create-repo") - inttestutils.WaitForDistribution(t, tests.BundleName, bundleVersion, distHttpDetails) - - // Download by bundle version, b2 and b3 should not be downloaded, b1 should - runRt(t, "dl", tests.DistRepo1+"/data/*", tests.Out+fileutils.GetFileSeparator()+"download"+fileutils.GetFileSeparator()+"simple_by_build"+fileutils.GetFileSeparator(), "--bundle="+tests.BundleName+"/"+bundleVersion) - - // Validate files are downloaded by bundle version - paths, _ := fileutils.ListFilesRecursiveWalkIntoDirSymlink(tests.Out, false) - err = tests.ValidateListsIdentical(tests.GetBuildSimpleDownload(), paths) - assert.NoError(t, err) - - // Cleanup - cleanDistributionTest(t) -} - -func TestBundleDownloadUsingSpec(t *testing.T) { - initDistributionTest(t) - - // Upload files - specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) - assert.NoError(t, err) - runRt(t, "u", "--spec="+specFile) - - // Create release bundle - distributionRulesPath := filepath.Join(tests.GetTestResourcesPath(), "distribution", tests.DistributionRules) - runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/b1.in", "--sign") - runDs(t, "rbd", tests.BundleName, bundleVersion, "--dist-rules="+distributionRulesPath, "--sync", "--create-repo") - - // Download by bundle version with gpg validation, b2 and b3 should not be downloaded, b1 should - specFile, err = tests.CreateSpec(tests.BundleDownloadGpgSpec) - assert.NoError(t, err) - runRt(t, "dl", "--spec="+specFile) - - // Validate files are downloaded by bundle version - paths, _ := fileutils.ListFilesRecursiveWalkIntoDirSymlink(tests.Out, false) - err = tests.ValidateListsIdentical(tests.GetBuildSimpleDownload(), paths) - assert.NoError(t, err) - - // Cleanup - cleanDistributionTest(t) -} - -func TestBundleCreateByAql(t *testing.T) { - initDistributionTest(t) - - // Upload files - specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) - assert.NoError(t, err) - runRt(t, "u", "--spec="+specFile) - - // Create release bundle by AQL - spec, err := tests.CreateSpec(tests.DistributionCreateByAql) - assert.NoError(t, err) - runDs(t, "rbc", tests.BundleName, bundleVersion, "--spec="+spec, "--sign") - runDs(t, "rbd", tests.BundleName, bundleVersion, "--site=*", "--sync", "--create-repo") - - // Download by bundle version, b2 and b3 should not be downloaded, b1 should - specFile, err = tests.CreateSpec(tests.BundleDownloadSpec) - assert.NoError(t, err) - runRt(t, "dl", "--spec="+specFile) - - // Validate files are downloaded by bundle version - paths, _ := fileutils.ListFilesRecursiveWalkIntoDirSymlink(tests.Out, false) - err = tests.ValidateListsIdentical(tests.GetBuildSimpleDownload(), paths) - assert.NoError(t, err) - - // Cleanup - cleanDistributionTest(t) -} - -func TestBundleDownloadNoPattern(t *testing.T) { - initDistributionTest(t) - - // Upload files - specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) - assert.NoError(t, err) - runRt(t, "u", "--spec="+specFile) - - // Create release bundle - runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/b1.in", "--sign") - runDs(t, "rbd", tests.BundleName, bundleVersion, "--site=*", "--sync", "--create-repo") - - // Download by bundle name and version with pattern "*", b2 and b3 should not be downloaded, b1 should - runRt(t, "dl", "*", "out/download/simple_by_build/data/", "--bundle="+tests.BundleName+"/"+bundleVersion, "--flat") - - // Validate files are downloaded by bundle version - paths, _ := fileutils.ListFilesRecursiveWalkIntoDirSymlink(tests.Out, false) - err = tests.ValidateListsIdentical(tests.GetBuildSimpleDownload(), paths) - assert.NoError(t, err) - - // Download by bundle name and version without pattern, b2 and b3 should not be downloaded, b1 should - tests.CleanFileSystem() - specFile, err = tests.CreateSpec(tests.BundleDownloadSpecNoPattern) - assert.NoError(t, err) - runRt(t, "dl", "--spec="+specFile, "--flat") - - // Validate files are downloaded by bundle version - paths, _ = fileutils.ListFilesRecursiveWalkIntoDirSymlink(tests.Out, false) - err = tests.ValidateListsIdentical(tests.GetBuildSimpleDownload(), paths) - assert.NoError(t, err) - - // Cleanup - cleanDistributionTest(t) -} - -func TestBundleExclusions(t *testing.T) { - initDistributionTest(t) - - // Upload files - specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) - assert.NoError(t, err) - runRt(t, "u", "--spec="+specFile) - - // Create release bundle. Include b1.in and b2.in. Exclude b3.in. - runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/b*.in", "--sign", "--exclusions=*b3.in") - runDs(t, "rbd", tests.BundleName, bundleVersion, "--site=*", "--sync", "--create-repo") - - // Download by bundle version, b2 and b3 should not be downloaded, b1 should - runRt(t, "dl", tests.DistRepo1+"/data/*", tests.Out+fileutils.GetFileSeparator()+"download"+fileutils.GetFileSeparator()+"simple_by_build"+fileutils.GetFileSeparator(), "--bundle="+tests.BundleName+"/"+bundleVersion, "--exclusions=*b2.in") - - // Validate files are downloaded by bundle version - paths, _ := fileutils.ListFilesRecursiveWalkIntoDirSymlink(tests.Out, false) - err = tests.ValidateListsIdentical(tests.GetBuildSimpleDownload(), paths) - assert.NoError(t, err) - - // Cleanup - cleanDistributionTest(t) -} - -func TestBundleCopy(t *testing.T) { - initDistributionTest(t) - - // Upload files - specFileA, err := tests.CreateSpec(tests.DistributionUploadSpecA) - assert.NoError(t, err) - specFileB, err := tests.CreateSpec(tests.DistributionUploadSpecB) - assert.NoError(t, err) - runRt(t, "u", "--spec="+specFileA) - runRt(t, "u", "--spec="+specFileB) - - // Create release bundle - runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/a*", "--sign") - runDs(t, "rbd", tests.BundleName, bundleVersion, "--site=*", "--sync", "--create-repo") - - // Copy by bundle name and version - specFile, err := tests.CreateSpec(tests.CopyByBundleSpec) - assert.NoError(t, err) - runRt(t, "cp", "--spec="+specFile) - - // Validate files are copied by bundle version - spec, err := tests.CreateSpec(tests.CopyByBundleAssertSpec) - assert.NoError(t, err) - inttestutils.VerifyExistInArtifactory(tests.GetBundleCopyExpected(), spec, serverDetails, t) - - // Cleanup - cleanDistributionTest(t) -} - -func TestBundleSetProperties(t *testing.T) { - initDistributionTest(t) - - // Upload a file. - runRt(t, "u", "testdata/a/a1.in", tests.DistRepo1+"/a.in") - - // Create release bundle - runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/a.in", "--sign") - runDs(t, "rbd", tests.BundleName, bundleVersion, "--site=*", "--sync", "--create-repo") - - // Set the 'prop=red' property to the file. - runRt(t, "sp", tests.DistRepo1+"/a.*", "prop=red", "--bundle="+tests.BundleName+"/"+bundleVersion) - // Now let's change the property value, by searching for the 'prop=red'. - specFile, err := tests.CreateSpec(tests.DistributionSetDeletePropsSpec) - assert.NoError(t, err) - runRt(t, "sp", "prop=green", "--spec="+specFile, "--bundle="+tests.BundleName+"/"+bundleVersion) - - resultItems := searchItemsInArtifactory(t, tests.SearchDistRepoByInSuffix) - assert.NotZero(t, len(resultItems), "No artifacts were found.") - for _, item := range resultItems { - properties := item.Properties - assert.Equal(t, 2, len(properties), "Failed setting properties on item:", item.GetItemRelativePath()) - for _, prop := range properties { - if prop.Key == "sha256" { - continue - } - assert.Equal(t, "prop", prop.Key, "Wrong property key") - assert.Equal(t, "green", prop.Value, "Wrong property value") - } - } - cleanDistributionTest(t) -} - -func TestSignReleaseBundle(t *testing.T) { - initDistributionTest(t) - - // Upload files - specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) - assert.NoError(t, err) - runRt(t, "u", "--spec="+specFile) - - // Create a release bundle without --sign and make sure it is not signed - runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/b1.in") - distributableResponse := inttestutils.GetLocalBundle(t, tests.BundleName, bundleVersion, distHttpDetails) - inttestutils.AssertReleaseBundleOpen(t, distributableResponse) - - // Sign the release bundle and make sure it is signed - runDs(t, "rbs", tests.BundleName, bundleVersion) - distributableResponse = inttestutils.GetLocalBundle(t, tests.BundleName, bundleVersion, distHttpDetails) - inttestutils.AssertReleaseBundleSigned(t, distributableResponse) - - // Cleanup - cleanDistributionTest(t) -} - -func TestBundleDeleteLocal(t *testing.T) { - initDistributionTest(t) - - // Upload files - specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) - assert.NoError(t, err) - runRt(t, "u", "--spec="+specFile) - - // Create a release bundle - runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/b1.in", "--sign") - inttestutils.VerifyLocalBundleExistence(t, tests.BundleName, bundleVersion, true, distHttpDetails) - - // Delete release bundle locally - runDs(t, "rbdel", tests.BundleName, bundleVersion, "--site=*", "--delete-from-dist", "--quiet") - inttestutils.VerifyLocalBundleExistence(t, tests.BundleName, bundleVersion, false, distHttpDetails) - - // Cleanup - cleanDistributionTest(t) -} - -func TestUpdateReleaseBundle(t *testing.T) { - initDistributionTest(t) - - // Upload files - specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) - assert.NoError(t, err) - runRt(t, "u", "--spec="+specFile) - - // Create a release bundle with b2.in - runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/b2.in") - inttestutils.VerifyLocalBundleExistence(t, tests.BundleName, bundleVersion, true, distHttpDetails) - - // Update release bundle to have b1.in - runDs(t, "rbu", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/b1.in", "--sign") - - // Distribute release bundle - runDs(t, "rbd", tests.BundleName, bundleVersion, "--site=*", "--sync", "--create-repo") - - // GPG validation for release bundle - keyPath := filepath.Join(tests.GetTestResourcesPath(), "distribution", "public.key.1") - wrongKeyPath := filepath.Join(tests.GetTestResourcesPath(), "distribution", "public.key.2") - // Flag --gpg-key with no --bundle flag - returns error - runRtCmdExpectError(t, "dl", tests.DistRepo1+"/data/*", tests.Out+fileutils.GetFileSeparator()+"download"+fileutils.GetFileSeparator()+"simple_by_build"+fileutils.GetFileSeparator(), "--gpg-key="+wrongKeyPath) - // Validate with the wrong key - returns error - runRtCmdExpectError(t, "dl", tests.DistRepo1+"/data/*", tests.Out+fileutils.GetFileSeparator()+"download"+fileutils.GetFileSeparator()+"simple_by_build"+fileutils.GetFileSeparator(), "--bundle="+tests.BundleName+"/"+bundleVersion, "--gpg-key="+wrongKeyPath) - // Download by bundle version with the correct key, b2 and b3 should not be downloaded, b1 should - runRt(t, "dl", tests.DistRepo1+"/data/*", tests.Out+fileutils.GetFileSeparator()+"download"+fileutils.GetFileSeparator()+"simple_by_build"+fileutils.GetFileSeparator(), "--bundle="+tests.BundleName+"/"+bundleVersion, "--gpg-key="+keyPath) - - // Validate files are downloaded by bundle version - paths, _ := fileutils.ListFilesRecursiveWalkIntoDirSymlink(tests.Out, false) - err = tests.ValidateListsIdentical(tests.GetBuildSimpleDownload(), paths) - assert.NoError(t, err) - - // Cleanup - cleanDistributionTest(t) -} - -func TestCreateBundleText(t *testing.T) { - initDistributionTest(t) - - // Upload files - specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) - assert.NoError(t, err) - runRt(t, "u", "--spec="+specFile) - - // Create a release bundle with release notes and description - releaseNotesPath := filepath.Join(tests.GetTestResourcesPath(), "distribution", "releasenotes.md") - description := "thisIsADescription" - runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/*", "--release-notes-path="+releaseNotesPath, "--desc="+description) - - // Validate release notes and description - distributableResponse := inttestutils.GetLocalBundle(t, tests.BundleName, bundleVersion, distHttpDetails) - if distributableResponse != nil { - assert.Equal(t, description, distributableResponse.Description) - releaseNotes, err := os.ReadFile(releaseNotesPath) - assert.NoError(t, err) - assert.Equal(t, string(releaseNotes), distributableResponse.ReleaseNotes.Content) - assert.Equal(t, clientDistUtils.Markdown, distributableResponse.ReleaseNotes.Syntax) - } - - cleanDistributionTest(t) -} - -func TestCreateBundleProps(t *testing.T) { - initDistributionTest(t) - - // Upload files - specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) - assert.NoError(t, err) - runRt(t, "u", "--spec="+specFile) - - // Create and distribute release bundle with added props - runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/*", "--target-props=key1=val1;key2=val2,val3", "--sign") - inttestutils.VerifyLocalBundleExistence(t, tests.BundleName, bundleVersion, true, distHttpDetails) - runDs(t, "rbd", tests.BundleName, bundleVersion, "--site=*", "--sync", "--create-repo") - - // Verify props are added to the distributes artifact - verifyExistInArtifactoryByProps(tests.GetBundlePropsExpected(), tests.DistRepo1+"/data/", "key1=val1;key2=val2;key2=val3", t) - - cleanDistributionTest(t) -} - -func TestUpdateBundleProps(t *testing.T) { - initDistributionTest(t) - - // Upload files - specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) - assert.NoError(t, err) - runRt(t, "u", "--spec="+specFile) - - // Create, update and distribute release bundle with added props - runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/*") - runDs(t, "rbu", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/*", "--target-props=key1=val1", "--sign") - inttestutils.VerifyLocalBundleExistence(t, tests.BundleName, bundleVersion, true, distHttpDetails) - runDs(t, "rbd", tests.BundleName, bundleVersion, "--site=*", "--sync", "--create-repo") - - // Verify props are added to the distributes artifact - verifyExistInArtifactoryByProps(tests.GetBundlePropsExpected(), tests.DistRepo1+"/data/", "key1=val1", t) - - cleanDistributionTest(t) -} - -func TestBundlePathMappingFromPatternAndTarget(t *testing.T) { - initDistributionTest(t) - - // Upload files - specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) - assert.NoError(t, err) - runRt(t, "u", "--spec="+specFile) - - // Create and distribute release bundle with path mapping from /data/ to /target/ - runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/(*)", "--sign", "--target="+tests.DistRepo2+"/target/{1}") - runDs(t, "rbd", tests.BundleName, bundleVersion, "--site=*", "--sync") - - // Validate files are distributed to the target mapping - spec, err := tests.CreateSpec(tests.DistributionMappingDownload) - assert.NoError(t, err) - inttestutils.VerifyExistInArtifactory(tests.GetBundleMappingExpected(), spec, serverDetails, t) - - cleanDistributionTest(t) -} - -func TestBundlePathMappingFromPatternAndTargetUsingSpec(t *testing.T) { - initDistributionTest(t) - - // Upload files - specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) - assert.NoError(t, err) - runRt(t, "u", "--spec="+specFile) - - // Create and distribute release bundle with path mapping from /data/ to /target/ - spec, err := tests.CreateSpec(tests.DistributionCreateWithPatternAndTarget) - assert.NoError(t, err) - runDs(t, "rbc", tests.BundleName, bundleVersion, "--sign", "--spec="+spec) - runDs(t, "rbd", tests.BundleName, bundleVersion, "--site=*", "--sync") - - // Validate files are distributed to the target mapping - spec, err = tests.CreateSpec(tests.DistributionMappingDownload) - assert.NoError(t, err) - inttestutils.VerifyExistInArtifactory(tests.GetBundleMappingExpected(), spec, serverDetails, t) - - cleanDistributionTest(t) -} - -func TestBundlePathMappingUsingSpec(t *testing.T) { - initDistributionTest(t) - - // Upload files - specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) - assert.NoError(t, err) - runRt(t, "u", "--spec="+specFile) - - // Create and distribute release bundle with path mapping from /data/ to /target/ - spec, err := tests.CreateSpec(tests.DistributionCreateWithMapping) - assert.NoError(t, err) - runDs(t, "rbc", tests.BundleName, bundleVersion, "--sign", "--spec="+spec) - runDs(t, "rbd", tests.BundleName, bundleVersion, "--site=*", "--sync") - - // Validate files are distributed to the target mapping - spec, err = tests.CreateSpec(tests.DistributionMappingDownload) - assert.NoError(t, err) - inttestutils.VerifyExistInArtifactory(tests.GetBundleMappingExpected(), spec, serverDetails, t) - - cleanDistributionTest(t) -} - -func TestReleaseBundleCreateDetailedSummary(t *testing.T) { - initDistributionTest(t) - - // Upload files - specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) - assert.NoError(t, err) - runRt(t, "u", "--spec="+specFile) - - buffer, _, previousLog := coreTests.RedirectLogOutputToBuffer() - // Restore previous logger when the function returns - defer log.SetLogger(previousLog) - - // Create a release bundle with b2.in - runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/b2.in", "--sign", "--detailed-summary") - inttestutils.VerifyLocalBundleExistence(t, tests.BundleName, bundleVersion, true, distHttpDetails) - - tests.VerifySha256DetailedSummaryFromBuffer(t, buffer, previousLog) - - // Cleanup - cleanDistributionTest(t) -} - -func TestReleaseBundleUpdateDetailedSummary(t *testing.T) { - initDistributionTest(t) - - // Upload files - specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) - assert.NoError(t, err) - runRt(t, "u", "--spec="+specFile) - - buffer, _, previousLog := coreTests.RedirectLogOutputToBuffer() - // Restore previous logger when the function returns - defer log.SetLogger(previousLog) - - // Create a release bundle with b2.in - runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/b2.in") - inttestutils.VerifyLocalBundleExistence(t, tests.BundleName, bundleVersion, true, distHttpDetails) - - // Update release bundle to have b1.in - runDs(t, "rbu", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/b1.in", "--sign", "--detailed-summary") - - tests.VerifySha256DetailedSummaryFromBuffer(t, buffer, previousLog) - - // Cleanup - cleanDistributionTest(t) -} - -func TestReleaseBundleSignDetailedSummary(t *testing.T) { - initDistributionTest(t) - - // Upload files - specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) - assert.NoError(t, err) - runRt(t, "u", "--spec="+specFile) - - buffer, _, previousLog := coreTests.RedirectLogOutputToBuffer() - // Restore previous logger when the function returns - defer log.SetLogger(previousLog) - - // Create a release bundle with b2.in - runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/b2.in") - inttestutils.VerifyLocalBundleExistence(t, tests.BundleName, bundleVersion, true, distHttpDetails) - - // Update release bundle to have b1.in - runDs(t, "rbs", tests.BundleName, bundleVersion, "--detailed-summary") - - tests.VerifySha256DetailedSummaryFromBuffer(t, buffer, previousLog) - - // Cleanup - cleanDistributionTest(t) -} - -func TestDistributeSyncTimeout(t *testing.T) { - initDistributionTest(t) - - trackerId := "123" - statusRequestsReceived := 0 - testServer, mockServerDetails, _ := coreTestUtils.CreateDsRestsMockServer(t, func(w http.ResponseWriter, r *http.Request) { - if r.RequestURI == "/api/v1/distribution/"+tests.BundleName+"/"+bundleVersion { - w.WriteHeader(http.StatusOK) - content, err := json.Marshal(distribution.DistributionResponseBody{TrackerId: json.Number(trackerId)}) - assert.NoError(t, err) - _, err = w.Write(content) - assert.NoError(t, err) - return - } - if r.RequestURI == "/api/v1/release_bundle/"+tests.BundleName+"/"+bundleVersion+"/distribution/"+trackerId { - statusRequestsReceived++ - w.WriteHeader(http.StatusOK) - content, err := json.Marshal(distribution.DistributionStatusResponse{Status: distribution.InProgress}) - assert.NoError(t, err) - _, err = w.Write(content) - assert.NoError(t, err) - return - } - }) - defer testServer.Close() - - maxWaitMinutes := 1 - distributionRulesPath := filepath.Join(tests.GetTestResourcesPath(), "distribution", tests.DistributionRules) - - mockDsCli := coreTests.NewJfrogCli(execMain, "jfrog ds", "--url="+mockServerDetails.DistributionUrl) - err := mockDsCli.Exec("rbd", tests.BundleName, bundleVersion, "--dist-rules="+distributionRulesPath, "--sync", "--max-wait-minutes="+strconv.Itoa(maxWaitMinutes), "--create-repo") - assert.ErrorContains(t, err, "executor timeout after") - assert.ErrorAs(t, err, &clientUtils.RetryExecutorTimeoutError{}) - - expectedStatusRequests := (maxWaitMinutes * 60 / distributionServices.DefaultDistributeSyncSleepIntervalSeconds) + 1 - assert.Equal(t, expectedStatusRequests, statusRequestsReceived) - - // Cleanup - cleanDistributionTest(t) -} - -// Run `jfrog ds` command`. The first arg is the distribution command, such as 'rbc', 'rbu', etc. -func runDs(t *testing.T, args ...string) { - err := distributionCli.Exec(args...) - assert.NoError(t, err) -} - -// Run `jfrog rt` command and expected an error -func runRtCmdExpectError(t *testing.T, args ...string) { - err := artifactoryCli.Exec(args...) - assert.Error(t, err) -} From 18160f5b652afe650f12accd0e41ffdbdda31a4e Mon Sep 17 00:00:00 2001 From: Bhanu Reddy Date: Mon, 3 Feb 2025 15:02:40 +0530 Subject: [PATCH 06/15] Moved distribution to jfrog-cli-artifactory --- distribution_test.go | 635 +++++++++++++++++++++++++++++++++++++++++++ go.mod | 2 +- go.sum | 4 +- 3 files changed, 638 insertions(+), 3 deletions(-) create mode 100644 distribution_test.go diff --git a/distribution_test.go b/distribution_test.go new file mode 100644 index 000000000..3c232c3c0 --- /dev/null +++ b/distribution_test.go @@ -0,0 +1,635 @@ +package main + +import ( + "encoding/json" + "errors" + "fmt" + coreTestUtils "github.com/jfrog/jfrog-cli-core/v2/common/tests" + "github.com/jfrog/jfrog-cli-core/v2/utils/config" + "github.com/jfrog/jfrog-cli-core/v2/utils/coreutils" + coreTests "github.com/jfrog/jfrog-cli-core/v2/utils/tests" + "github.com/jfrog/jfrog-cli/inttestutils" + "github.com/jfrog/jfrog-cli/utils/tests" + "github.com/jfrog/jfrog-client-go/auth" + distributionServices "github.com/jfrog/jfrog-client-go/distribution/services" + clientDistUtils "github.com/jfrog/jfrog-client-go/distribution/services/utils" + clientUtils "github.com/jfrog/jfrog-client-go/utils" + "github.com/jfrog/jfrog-client-go/utils/distribution" + "github.com/jfrog/jfrog-client-go/utils/io/fileutils" + "github.com/jfrog/jfrog-client-go/utils/io/httputils" + "github.com/jfrog/jfrog-client-go/utils/log" + "github.com/stretchr/testify/assert" + "net/http" + "os" + "path/filepath" + "strconv" + "testing" +) + +const ( + bundleVersion = "10" + distributionEndpoint = "distribution/" +) + +var ( + distributionDetails *config.ServerDetails + distAuth auth.ServiceDetails + distHttpDetails httputils.HttpClientDetails + // JFrog CLI for Distribution commands + distributionCli *coreTests.JfrogCli +) + +func InitDistributionTests() { + initDistributionCli() + inttestutils.CleanUpOldBundles(distHttpDetails, bundleVersion, distributionCli) + InitArtifactoryTests() + inttestutils.SendGpgKeys(artHttpDetails, distHttpDetails) +} + +func CleanDistributionTests() { + deleteCreatedRepos() +} + +func authenticateDistribution() string { + *tests.JfrogUrl = clientUtils.AddTrailingSlashIfNeeded(*tests.JfrogUrl) + distributionDetails = &config.ServerDetails{DistributionUrl: *tests.JfrogUrl + distributionEndpoint} + cred := "--url=" + distributionDetails.DistributionUrl + if *tests.JfrogAccessToken != "" { + distributionDetails.AccessToken = *tests.JfrogAccessToken + cred += " --access-token=" + *tests.JfrogAccessToken + } else { + distributionDetails.Password = *tests.JfrogPassword + cred += " --password=" + *tests.JfrogPassword + } + // Due to a bug in distribution when authenticate with a multi-scope token, + // we must send a username as well as token or password. + distributionDetails.User = *tests.JfrogUser + cred += " --user=" + *tests.JfrogUser + + var err error + if distAuth, err = distributionDetails.CreateDistAuthConfig(); err != nil { + coreutils.ExitOnErr(errors.New("Failed while attempting to authenticate with Distribution: " + err.Error())) + } + distributionDetails.DistributionUrl = distAuth.GetUrl() + distHttpDetails = distAuth.CreateHttpClientDetails() + return cred +} + +func initDistributionCli() { + if distributionCli != nil { + return + } + cred := authenticateDistribution() + distributionCli = coreTests.NewJfrogCli(execMain, "jfrog ds", cred) +} + +func initDistributionTest(t *testing.T) { + if !*tests.TestDistribution { + t.Skip("Skipping distribution test. To run distribution test add the '-test.distribution=true' option.") + } +} + +func cleanDistributionTest(t *testing.T) { + err := distributionCli.Exec("rbdel", tests.BundleName, bundleVersion, "--site=*", "--delete-from-dist", "--quiet", "--sync") + if err != nil { + // If release bundle already deleted during the tests no need to fail here + assert.ErrorContains(t, err, fmt.Sprintf("Release Bundle Version '%s/%s' was not found", tests.BundleName, bundleVersion)) + } + + inttestutils.CleanDistributionRepositories(t, serverDetails) + tests.CleanFileSystem() +} + +func TestBundleAsyncDistDownload(t *testing.T) { + initDistributionTest(t) + + // Upload files + specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) + assert.NoError(t, err) + runRt(t, "u", "--spec="+specFile) + + // Create and distribute release bundle + runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/b1.in", "--sign") + runDs(t, "rbd", tests.BundleName, bundleVersion, "--site=*", "--create-repo") + inttestutils.WaitForDistribution(t, tests.BundleName, bundleVersion, distHttpDetails) + + // Download by bundle version, b2 and b3 should not be downloaded, b1 should + runRt(t, "dl", tests.DistRepo1+"/data/*", tests.Out+fileutils.GetFileSeparator()+"download"+fileutils.GetFileSeparator()+"simple_by_build"+fileutils.GetFileSeparator(), "--bundle="+tests.BundleName+"/"+bundleVersion) + + // Validate files are downloaded by bundle version + paths, _ := fileutils.ListFilesRecursiveWalkIntoDirSymlink(tests.Out, false) + err = tests.ValidateListsIdentical(tests.GetBuildSimpleDownload(), paths) + assert.NoError(t, err) + + // Cleanup + cleanDistributionTest(t) +} + +func TestBundleDownloadUsingSpec(t *testing.T) { + initDistributionTest(t) + + // Upload files + specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) + assert.NoError(t, err) + runRt(t, "u", "--spec="+specFile) + + // Create release bundle + distributionRulesPath := filepath.Join(tests.GetTestResourcesPath(), "distribution", tests.DistributionRules) + runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/b1.in", "--sign") + runDs(t, "rbd", tests.BundleName, bundleVersion, "--dist-rules="+distributionRulesPath, "--sync", "--create-repo") + + // Download by bundle version with gpg validation, b2 and b3 should not be downloaded, b1 should + specFile, err = tests.CreateSpec(tests.BundleDownloadGpgSpec) + assert.NoError(t, err) + runRt(t, "dl", "--spec="+specFile) + + // Validate files are downloaded by bundle version + paths, _ := fileutils.ListFilesRecursiveWalkIntoDirSymlink(tests.Out, false) + err = tests.ValidateListsIdentical(tests.GetBuildSimpleDownload(), paths) + assert.NoError(t, err) + + // Cleanup + cleanDistributionTest(t) +} + +func TestBundleCreateByAql(t *testing.T) { + initDistributionTest(t) + + // Upload files + specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) + assert.NoError(t, err) + runRt(t, "u", "--spec="+specFile) + + // Create release bundle by AQL + spec, err := tests.CreateSpec(tests.DistributionCreateByAql) + assert.NoError(t, err) + runDs(t, "rbc", tests.BundleName, bundleVersion, "--spec="+spec, "--sign") + runDs(t, "rbd", tests.BundleName, bundleVersion, "--site=*", "--sync", "--create-repo") + + // Download by bundle version, b2 and b3 should not be downloaded, b1 should + specFile, err = tests.CreateSpec(tests.BundleDownloadSpec) + assert.NoError(t, err) + runRt(t, "dl", "--spec="+specFile) + + // Validate files are downloaded by bundle version + paths, _ := fileutils.ListFilesRecursiveWalkIntoDirSymlink(tests.Out, false) + err = tests.ValidateListsIdentical(tests.GetBuildSimpleDownload(), paths) + assert.NoError(t, err) + + // Cleanup + cleanDistributionTest(t) +} + +func TestBundleDownloadNoPattern(t *testing.T) { + initDistributionTest(t) + + // Upload files + specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) + assert.NoError(t, err) + runRt(t, "u", "--spec="+specFile) + + // Create release bundle + runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/b1.in", "--sign") + runDs(t, "rbd", tests.BundleName, bundleVersion, "--site=*", "--sync", "--create-repo") + + // Download by bundle name and version with pattern "*", b2 and b3 should not be downloaded, b1 should + runRt(t, "dl", "*", "out/download/simple_by_build/data/", "--bundle="+tests.BundleName+"/"+bundleVersion, "--flat") + + // Validate files are downloaded by bundle version + paths, _ := fileutils.ListFilesRecursiveWalkIntoDirSymlink(tests.Out, false) + err = tests.ValidateListsIdentical(tests.GetBuildSimpleDownload(), paths) + assert.NoError(t, err) + + // Download by bundle name and version without pattern, b2 and b3 should not be downloaded, b1 should + tests.CleanFileSystem() + specFile, err = tests.CreateSpec(tests.BundleDownloadSpecNoPattern) + assert.NoError(t, err) + runRt(t, "dl", "--spec="+specFile, "--flat") + + // Validate files are downloaded by bundle version + paths, _ = fileutils.ListFilesRecursiveWalkIntoDirSymlink(tests.Out, false) + err = tests.ValidateListsIdentical(tests.GetBuildSimpleDownload(), paths) + assert.NoError(t, err) + + // Cleanup + cleanDistributionTest(t) +} + +func TestBundleExclusions(t *testing.T) { + initDistributionTest(t) + + // Upload files + specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) + assert.NoError(t, err) + runRt(t, "u", "--spec="+specFile) + + // Create release bundle. Include b1.in and b2.in. Exclude b3.in. + runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/b*.in", "--sign", "--exclusions=*b3.in") + runDs(t, "rbd", tests.BundleName, bundleVersion, "--site=*", "--sync", "--create-repo") + + // Download by bundle version, b2 and b3 should not be downloaded, b1 should + runRt(t, "dl", tests.DistRepo1+"/data/*", tests.Out+fileutils.GetFileSeparator()+"download"+fileutils.GetFileSeparator()+"simple_by_build"+fileutils.GetFileSeparator(), "--bundle="+tests.BundleName+"/"+bundleVersion, "--exclusions=*b2.in") + + // Validate files are downloaded by bundle version + paths, _ := fileutils.ListFilesRecursiveWalkIntoDirSymlink(tests.Out, false) + err = tests.ValidateListsIdentical(tests.GetBuildSimpleDownload(), paths) + assert.NoError(t, err) + + // Cleanup + cleanDistributionTest(t) +} + +func TestBundleCopy(t *testing.T) { + initDistributionTest(t) + + // Upload files + specFileA, err := tests.CreateSpec(tests.DistributionUploadSpecA) + assert.NoError(t, err) + specFileB, err := tests.CreateSpec(tests.DistributionUploadSpecB) + assert.NoError(t, err) + runRt(t, "u", "--spec="+specFileA) + runRt(t, "u", "--spec="+specFileB) + + // Create release bundle + runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/a*", "--sign") + runDs(t, "rbd", tests.BundleName, bundleVersion, "--site=*", "--sync", "--create-repo") + + // Copy by bundle name and version + specFile, err := tests.CreateSpec(tests.CopyByBundleSpec) + assert.NoError(t, err) + runRt(t, "cp", "--spec="+specFile) + + // Validate files are copied by bundle version + spec, err := tests.CreateSpec(tests.CopyByBundleAssertSpec) + assert.NoError(t, err) + inttestutils.VerifyExistInArtifactory(tests.GetBundleCopyExpected(), spec, serverDetails, t) + + // Cleanup + cleanDistributionTest(t) +} + +func TestBundleSetProperties(t *testing.T) { + initDistributionTest(t) + + // Upload a file. + runRt(t, "u", "testdata/a/a1.in", tests.DistRepo1+"/a.in") + + // Create release bundle + runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/a.in", "--sign") + runDs(t, "rbd", tests.BundleName, bundleVersion, "--site=*", "--sync", "--create-repo") + + // Set the 'prop=red' property to the file. + runRt(t, "sp", tests.DistRepo1+"/a.*", "prop=red", "--bundle="+tests.BundleName+"/"+bundleVersion) + // Now let's change the property value, by searching for the 'prop=red'. + specFile, err := tests.CreateSpec(tests.DistributionSetDeletePropsSpec) + assert.NoError(t, err) + runRt(t, "sp", "prop=green", "--spec="+specFile, "--bundle="+tests.BundleName+"/"+bundleVersion) + + resultItems := searchItemsInArtifactory(t, tests.SearchDistRepoByInSuffix) + assert.NotZero(t, len(resultItems), "No artifacts were found.") + for _, item := range resultItems { + properties := item.Properties + assert.Equal(t, 2, len(properties), "Failed setting properties on item:", item.GetItemRelativePath()) + for _, prop := range properties { + if prop.Key == "sha256" { + continue + } + assert.Equal(t, "prop", prop.Key, "Wrong property key") + assert.Equal(t, "green", prop.Value, "Wrong property value") + } + } + cleanDistributionTest(t) +} + +func TestSignReleaseBundle(t *testing.T) { + initDistributionTest(t) + + // Upload files + specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) + assert.NoError(t, err) + runRt(t, "u", "--spec="+specFile) + + // Create a release bundle without --sign and make sure it is not signed + runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/b1.in") + distributableResponse := inttestutils.GetLocalBundle(t, tests.BundleName, bundleVersion, distHttpDetails) + inttestutils.AssertReleaseBundleOpen(t, distributableResponse) + + // Sign the release bundle and make sure it is signed + runDs(t, "rbs", tests.BundleName, bundleVersion) + distributableResponse = inttestutils.GetLocalBundle(t, tests.BundleName, bundleVersion, distHttpDetails) + inttestutils.AssertReleaseBundleSigned(t, distributableResponse) + + // Cleanup + cleanDistributionTest(t) +} + +func TestBundleDeleteLocal(t *testing.T) { + initDistributionTest(t) + + // Upload files + specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) + assert.NoError(t, err) + runRt(t, "u", "--spec="+specFile) + + // Create a release bundle + runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/b1.in", "--sign") + inttestutils.VerifyLocalBundleExistence(t, tests.BundleName, bundleVersion, true, distHttpDetails) + + // Delete release bundle locally + runDs(t, "rbdel", tests.BundleName, bundleVersion, "--site=*", "--delete-from-dist", "--quiet") + inttestutils.VerifyLocalBundleExistence(t, tests.BundleName, bundleVersion, false, distHttpDetails) + + // Cleanup + cleanDistributionTest(t) +} + +func TestUpdateReleaseBundle(t *testing.T) { + initDistributionTest(t) + + // Upload files + specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) + assert.NoError(t, err) + runRt(t, "u", "--spec="+specFile) + + // Create a release bundle with b2.in + runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/b2.in") + inttestutils.VerifyLocalBundleExistence(t, tests.BundleName, bundleVersion, true, distHttpDetails) + + // Update release bundle to have b1.in + runDs(t, "rbu", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/b1.in", "--sign") + + // Distribute release bundle + runDs(t, "rbd", tests.BundleName, bundleVersion, "--site=*", "--sync", "--create-repo") + + // GPG validation for release bundle + keyPath := filepath.Join(tests.GetTestResourcesPath(), "distribution", "public.key.1") + wrongKeyPath := filepath.Join(tests.GetTestResourcesPath(), "distribution", "public.key.2") + // Flag --gpg-key with no --bundle flag - returns error + runRtCmdExpectError(t, "dl", tests.DistRepo1+"/data/*", tests.Out+fileutils.GetFileSeparator()+"download"+fileutils.GetFileSeparator()+"simple_by_build"+fileutils.GetFileSeparator(), "--gpg-key="+wrongKeyPath) + // Validate with the wrong key - returns error + runRtCmdExpectError(t, "dl", tests.DistRepo1+"/data/*", tests.Out+fileutils.GetFileSeparator()+"download"+fileutils.GetFileSeparator()+"simple_by_build"+fileutils.GetFileSeparator(), "--bundle="+tests.BundleName+"/"+bundleVersion, "--gpg-key="+wrongKeyPath) + // Download by bundle version with the correct key, b2 and b3 should not be downloaded, b1 should + runRt(t, "dl", tests.DistRepo1+"/data/*", tests.Out+fileutils.GetFileSeparator()+"download"+fileutils.GetFileSeparator()+"simple_by_build"+fileutils.GetFileSeparator(), "--bundle="+tests.BundleName+"/"+bundleVersion, "--gpg-key="+keyPath) + + // Validate files are downloaded by bundle version + paths, _ := fileutils.ListFilesRecursiveWalkIntoDirSymlink(tests.Out, false) + err = tests.ValidateListsIdentical(tests.GetBuildSimpleDownload(), paths) + assert.NoError(t, err) + + // Cleanup + cleanDistributionTest(t) +} + +func TestCreateBundleText(t *testing.T) { + initDistributionTest(t) + + // Upload files + specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) + assert.NoError(t, err) + runRt(t, "u", "--spec="+specFile) + + // Create a release bundle with release notes and description + releaseNotesPath := filepath.Join(tests.GetTestResourcesPath(), "distribution", "releasenotes.md") + description := "thisIsADescription" + runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/*", "--release-notes-path="+releaseNotesPath, "--desc="+description) + + // Validate release notes and description + distributableResponse := inttestutils.GetLocalBundle(t, tests.BundleName, bundleVersion, distHttpDetails) + if distributableResponse != nil { + assert.Equal(t, description, distributableResponse.Description) + releaseNotes, err := os.ReadFile(releaseNotesPath) + assert.NoError(t, err) + assert.Equal(t, string(releaseNotes), distributableResponse.ReleaseNotes.Content) + assert.Equal(t, clientDistUtils.Markdown, distributableResponse.ReleaseNotes.Syntax) + } + + cleanDistributionTest(t) +} + +func TestCreateBundleProps(t *testing.T) { + initDistributionTest(t) + + // Upload files + specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) + assert.NoError(t, err) + runRt(t, "u", "--spec="+specFile) + + // Create and distribute release bundle with added props + runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/*", "--target-props=key1=val1;key2=val2,val3", "--sign") + inttestutils.VerifyLocalBundleExistence(t, tests.BundleName, bundleVersion, true, distHttpDetails) + runDs(t, "rbd", tests.BundleName, bundleVersion, "--site=*", "--sync", "--create-repo") + + // Verify props are added to the distributes artifact + verifyExistInArtifactoryByProps(tests.GetBundlePropsExpected(), tests.DistRepo1+"/data/", "key1=val1;key2=val2;key2=val3", t) + + cleanDistributionTest(t) +} + +func TestUpdateBundleProps(t *testing.T) { + initDistributionTest(t) + + // Upload files + specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) + assert.NoError(t, err) + runRt(t, "u", "--spec="+specFile) + + // Create, update and distribute release bundle with added props + runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/*") + runDs(t, "rbu", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/*", "--target-props=key1=val1", "--sign") + inttestutils.VerifyLocalBundleExistence(t, tests.BundleName, bundleVersion, true, distHttpDetails) + runDs(t, "rbd", tests.BundleName, bundleVersion, "--site=*", "--sync", "--create-repo") + + // Verify props are added to the distributes artifact + verifyExistInArtifactoryByProps(tests.GetBundlePropsExpected(), tests.DistRepo1+"/data/", "key1=val1", t) + + cleanDistributionTest(t) +} + +func TestBundlePathMappingFromPatternAndTarget(t *testing.T) { + initDistributionTest(t) + + // Upload files + specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) + assert.NoError(t, err) + runRt(t, "u", "--spec="+specFile) + + // Create and distribute release bundle with path mapping from /data/ to /target/ + runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/(*)", "--sign", "--target="+tests.DistRepo2+"/target/{1}") + runDs(t, "rbd", tests.BundleName, bundleVersion, "--site=*", "--sync") + + // Validate files are distributed to the target mapping + spec, err := tests.CreateSpec(tests.DistributionMappingDownload) + assert.NoError(t, err) + inttestutils.VerifyExistInArtifactory(tests.GetBundleMappingExpected(), spec, serverDetails, t) + + cleanDistributionTest(t) +} + +func TestBundlePathMappingFromPatternAndTargetUsingSpec(t *testing.T) { + initDistributionTest(t) + + // Upload files + specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) + assert.NoError(t, err) + runRt(t, "u", "--spec="+specFile) + + // Create and distribute release bundle with path mapping from /data/ to /target/ + spec, err := tests.CreateSpec(tests.DistributionCreateWithPatternAndTarget) + assert.NoError(t, err) + runDs(t, "rbc", tests.BundleName, bundleVersion, "--sign", "--spec="+spec) + runDs(t, "rbd", tests.BundleName, bundleVersion, "--site=*", "--sync") + + // Validate files are distributed to the target mapping + spec, err = tests.CreateSpec(tests.DistributionMappingDownload) + assert.NoError(t, err) + inttestutils.VerifyExistInArtifactory(tests.GetBundleMappingExpected(), spec, serverDetails, t) + + cleanDistributionTest(t) +} + +func TestBundlePathMappingUsingSpec(t *testing.T) { + initDistributionTest(t) + + // Upload files + specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) + assert.NoError(t, err) + runRt(t, "u", "--spec="+specFile) + + // Create and distribute release bundle with path mapping from /data/ to /target/ + spec, err := tests.CreateSpec(tests.DistributionCreateWithMapping) + assert.NoError(t, err) + runDs(t, "rbc", tests.BundleName, bundleVersion, "--sign", "--spec="+spec) + runDs(t, "rbd", tests.BundleName, bundleVersion, "--site=*", "--sync") + + // Validate files are distributed to the target mapping + spec, err = tests.CreateSpec(tests.DistributionMappingDownload) + assert.NoError(t, err) + inttestutils.VerifyExistInArtifactory(tests.GetBundleMappingExpected(), spec, serverDetails, t) + + cleanDistributionTest(t) +} + +func TestReleaseBundleCreateDetailedSummary(t *testing.T) { + initDistributionTest(t) + + // Upload files + specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) + assert.NoError(t, err) + runRt(t, "u", "--spec="+specFile) + + buffer, _, previousLog := coreTests.RedirectLogOutputToBuffer() + // Restore previous logger when the function returns + defer log.SetLogger(previousLog) + + // Create a release bundle with b2.in + runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/b2.in", "--sign", "--detailed-summary") + inttestutils.VerifyLocalBundleExistence(t, tests.BundleName, bundleVersion, true, distHttpDetails) + + tests.VerifySha256DetailedSummaryFromBuffer(t, buffer, previousLog) + + // Cleanup + cleanDistributionTest(t) +} + +func TestReleaseBundleUpdateDetailedSummary(t *testing.T) { + initDistributionTest(t) + + // Upload files + specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) + assert.NoError(t, err) + runRt(t, "u", "--spec="+specFile) + + buffer, _, previousLog := coreTests.RedirectLogOutputToBuffer() + // Restore previous logger when the function returns + defer log.SetLogger(previousLog) + + // Create a release bundle with b2.in + runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/b2.in") + inttestutils.VerifyLocalBundleExistence(t, tests.BundleName, bundleVersion, true, distHttpDetails) + + // Update release bundle to have b1.in + runDs(t, "rbu", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/b1.in", "--sign", "--detailed-summary") + + tests.VerifySha256DetailedSummaryFromBuffer(t, buffer, previousLog) + + // Cleanup + cleanDistributionTest(t) +} + +func TestReleaseBundleSignDetailedSummary(t *testing.T) { + initDistributionTest(t) + + // Upload files + specFile, err := tests.CreateSpec(tests.DistributionUploadSpecB) + assert.NoError(t, err) + runRt(t, "u", "--spec="+specFile) + + buffer, _, previousLog := coreTests.RedirectLogOutputToBuffer() + // Restore previous logger when the function returns + defer log.SetLogger(previousLog) + + // Create a release bundle with b2.in + runDs(t, "rbc", tests.BundleName, bundleVersion, tests.DistRepo1+"/data/b2.in") + inttestutils.VerifyLocalBundleExistence(t, tests.BundleName, bundleVersion, true, distHttpDetails) + + // Update release bundle to have b1.in + runDs(t, "rbs", tests.BundleName, bundleVersion, "--detailed-summary") + + tests.VerifySha256DetailedSummaryFromBuffer(t, buffer, previousLog) + + // Cleanup + cleanDistributionTest(t) +} + +func TestDistributeSyncTimeout(t *testing.T) { + initDistributionTest(t) + + trackerId := "123" + statusRequestsReceived := 0 + testServer, mockServerDetails, _ := coreTestUtils.CreateDsRestsMockServer(t, func(w http.ResponseWriter, r *http.Request) { + if r.RequestURI == "/api/v1/distribution/"+tests.BundleName+"/"+bundleVersion { + w.WriteHeader(http.StatusOK) + content, err := json.Marshal(distribution.DistributionResponseBody{TrackerId: json.Number(trackerId)}) + assert.NoError(t, err) + _, err = w.Write(content) + assert.NoError(t, err) + return + } + if r.RequestURI == "/api/v1/release_bundle/"+tests.BundleName+"/"+bundleVersion+"/distribution/"+trackerId { + statusRequestsReceived++ + w.WriteHeader(http.StatusOK) + content, err := json.Marshal(distribution.DistributionStatusResponse{Status: distribution.InProgress}) + assert.NoError(t, err) + _, err = w.Write(content) + assert.NoError(t, err) + return + } + }) + defer testServer.Close() + + maxWaitMinutes := 1 + distributionRulesPath := filepath.Join(tests.GetTestResourcesPath(), "distribution", tests.DistributionRules) + + mockDsCli := coreTests.NewJfrogCli(execMain, "jfrog ds", "--url="+mockServerDetails.DistributionUrl) + err := mockDsCli.Exec("rbd", tests.BundleName, bundleVersion, "--dist-rules="+distributionRulesPath, "--sync", "--max-wait-minutes="+strconv.Itoa(maxWaitMinutes), "--create-repo") + assert.ErrorContains(t, err, "executor timeout after") + assert.ErrorAs(t, err, &clientUtils.RetryExecutorTimeoutError{}) + + expectedStatusRequests := (maxWaitMinutes * 60 / distributionServices.DefaultDistributeSyncSleepIntervalSeconds) + 1 + assert.Equal(t, expectedStatusRequests, statusRequestsReceived) + + // Cleanup + cleanDistributionTest(t) +} + +// Run `jfrog ds` command`. The first arg is the distribution command, such as 'rbc', 'rbu', etc. +func runDs(t *testing.T, args ...string) { + err := distributionCli.Exec(args...) + assert.NoError(t, err) +} + +// Run `jfrog rt` command and expected an error +func runRtCmdExpectError(t *testing.T, args ...string) { + err := artifactoryCli.Exec(args...) + assert.Error(t, err) +} diff --git a/go.mod b/go.mod index d4e42096c..08abf35c8 100644 --- a/go.mod +++ b/go.mod @@ -174,7 +174,7 @@ require ( replace github.com/jfrog/jfrog-cli-core/v2 => github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0 //replace github.com/jfrog/jfrog-cli-artifactory => github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250123060215-b15168492ff0 -replace github.com/jfrog/jfrog-cli-artifactory => github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250131080518-62fe719b2c1e +replace github.com/jfrog/jfrog-cli-artifactory => github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250203093105-851ae4215a75 replace github.com/jfrog/jfrog-cli-security => github.com/jfrog/jfrog-cli-security v1.14.2-0.20250130082759-0d5b0bef7b8e diff --git a/go.sum b/go.sum index 5be672343..4acdf2c9f 100644 --- a/go.sum +++ b/go.sum @@ -32,8 +32,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/beevik/etree v1.4.0 h1:oz1UedHRepuY3p4N5OjE0nK1WLCqtzHf25bxplKOHLs= github.com/beevik/etree v1.4.0/go.mod h1:cyWiXwGoasx60gHvtnEh5x8+uIjUVnjWqBvEnhnqKDA= -github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250131080518-62fe719b2c1e h1:iwM9zRS0HpVzqd0xFl7LZSLr4hTUIW8d8n/DxikveSs= -github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250131080518-62fe719b2c1e/go.mod h1:+oTMKRc+yQw0sy8TUStRuqD9D4UFfrksphiX4TbCqew= +github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250203093105-851ae4215a75 h1:hJbLS9V9z8NMKLwJ64FCUNCnRQrkvBBhcl2ilw4mqnQ= +github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250203093105-851ae4215a75/go.mod h1:29aMu6pLrjpXVBhRlkt2fTp0I52IrfP53nCq+Lygbrs= github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0 h1:8vIvDWathpxoHeQRadJ9Tm9dIGoikllbLwAH5la/sz4= github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0/go.mod h1:3vP0hv13zJYvhXlgKIXmWSN8ADvGUQgxVVCqcO8hOeM= github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M= From 5004cc1b3d771f67de69a0fbe728360dd00a15df Mon Sep 17 00:00:00 2001 From: Bhanu Reddy Date: Tue, 4 Feb 2025 14:32:18 +0530 Subject: [PATCH 07/15] Updated dependencies --- go.mod | 3 +-- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index e8f7e146d..e38858491 100644 --- a/go.mod +++ b/go.mod @@ -192,8 +192,7 @@ require ( //replace github.com/jfrog/jfrog-cli-core/v2 => github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250123053843-d005557d62d9 replace github.com/jfrog/jfrog-cli-core/v2 => github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0 -//replace github.com/jfrog/jfrog-cli-artifactory => github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250123060215-b15168492ff0 -replace github.com/jfrog/jfrog-cli-artifactory => github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250203093105-851ae4215a75 +replace github.com/jfrog/jfrog-cli-artifactory => github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204090032-1e09ca936b0b replace github.com/jfrog/jfrog-cli-security => github.com/jfrog/jfrog-cli-security v1.14.2-0.20250202122713-1525ceab5778 diff --git a/go.sum b/go.sum index 2c8197229..3f155dbfb 100644 --- a/go.sum +++ b/go.sum @@ -34,8 +34,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/beevik/etree v1.4.0 h1:oz1UedHRepuY3p4N5OjE0nK1WLCqtzHf25bxplKOHLs= github.com/beevik/etree v1.4.0/go.mod h1:cyWiXwGoasx60gHvtnEh5x8+uIjUVnjWqBvEnhnqKDA= -github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250203093105-851ae4215a75 h1:hJbLS9V9z8NMKLwJ64FCUNCnRQrkvBBhcl2ilw4mqnQ= -github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250203093105-851ae4215a75/go.mod h1:29aMu6pLrjpXVBhRlkt2fTp0I52IrfP53nCq+Lygbrs= +github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204090032-1e09ca936b0b h1:3B0cMCmexYKIaS3yXkafR8YAnm8o0DH7ACNuLUFoazM= +github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204090032-1e09ca936b0b/go.mod h1:29aMu6pLrjpXVBhRlkt2fTp0I52IrfP53nCq+Lygbrs= github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0 h1:8vIvDWathpxoHeQRadJ9Tm9dIGoikllbLwAH5la/sz4= github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0/go.mod h1:3vP0hv13zJYvhXlgKIXmWSN8ADvGUQgxVVCqcO8hOeM= github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M= From 84145efba812e23f120912d44ee686f4117da162 Mon Sep 17 00:00:00 2001 From: Bhanu Reddy Date: Tue, 4 Feb 2025 15:25:54 +0530 Subject: [PATCH 08/15] Updated dependencies --- go.mod | 2 +- go.sum | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index fab18b0dc..9b9c62ee6 100644 --- a/go.mod +++ b/go.mod @@ -193,7 +193,7 @@ require ( //replace github.com/jfrog/jfrog-cli-core/v2 => github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250123053843-d005557d62d9 replace github.com/jfrog/jfrog-cli-core/v2 => github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0 -replace github.com/jfrog/jfrog-cli-artifactory => github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204090032-1e09ca936b0b +replace github.com/jfrog/jfrog-cli-artifactory => github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204094746-9709cf6c989b replace github.com/jfrog/jfrog-cli-security => github.com/jfrog/jfrog-cli-security v1.14.2-0.20250202122713-1525ceab5778 diff --git a/go.sum b/go.sum index 6d37cc7ea..898a1f053 100644 --- a/go.sum +++ b/go.sum @@ -34,8 +34,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/beevik/etree v1.4.0 h1:oz1UedHRepuY3p4N5OjE0nK1WLCqtzHf25bxplKOHLs= github.com/beevik/etree v1.4.0/go.mod h1:cyWiXwGoasx60gHvtnEh5x8+uIjUVnjWqBvEnhnqKDA= -github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204090032-1e09ca936b0b h1:3B0cMCmexYKIaS3yXkafR8YAnm8o0DH7ACNuLUFoazM= -github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204090032-1e09ca936b0b/go.mod h1:29aMu6pLrjpXVBhRlkt2fTp0I52IrfP53nCq+Lygbrs= +github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204094746-9709cf6c989b h1:JHwANg1RR7DTnvMdbvPb/eQ+uKsgHsTHDNL9WvaLMNY= +github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204094746-9709cf6c989b/go.mod h1:29aMu6pLrjpXVBhRlkt2fTp0I52IrfP53nCq+Lygbrs= github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0 h1:8vIvDWathpxoHeQRadJ9Tm9dIGoikllbLwAH5la/sz4= github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0/go.mod h1:3vP0hv13zJYvhXlgKIXmWSN8ADvGUQgxVVCqcO8hOeM= github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M= @@ -188,10 +188,6 @@ 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.1.12-0.20250202151940-a839c7e96f0c h1:z5ZW/WxBXgW1KiUYjjtCXCDd3L34T7wzW7dMzCXQbBw= -github.com/jfrog/jfrog-cli-artifactory v0.1.12-0.20250202151940-a839c7e96f0c/go.mod h1:EMeIMynEg9T4ZY8ugzj76+fO/dR0cy8FNuvUfybL29w= -github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20250130104846-27e495de291e h1:cJJxXI45QLJsaCr5ChOTToCJpLoRTBGlXu/Z6DZB9jk= -github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20250130104846-27e495de291e/go.mod h1:3vP0hv13zJYvhXlgKIXmWSN8ADvGUQgxVVCqcO8hOeM= github.com/jfrog/jfrog-cli-platform-services v1.6.0 h1:2fBIDxnQaFWStZqMEUI2I3nkNjDmknxxHcmpeLxtocc= github.com/jfrog/jfrog-cli-platform-services v1.6.0/go.mod h1:u3lMRG7XC8MeUy/OPkHkZnsgCMIi0br4sjk2/W1Pm8I= github.com/jfrog/jfrog-cli-security v1.14.2-0.20250202122713-1525ceab5778 h1:eeC3XfB6O0LBDh2wLlGi8y2dIJQ8+cL5zUbNG4LlvCc= From 30bfe9e28771199e9523195763c54b474229ad57 Mon Sep 17 00:00:00 2001 From: Bhanu Reddy Date: Tue, 4 Feb 2025 16:19:04 +0530 Subject: [PATCH 09/15] Updated dependencies --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 9b9c62ee6..39fd2034d 100644 --- a/go.mod +++ b/go.mod @@ -193,7 +193,7 @@ require ( //replace github.com/jfrog/jfrog-cli-core/v2 => github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250123053843-d005557d62d9 replace github.com/jfrog/jfrog-cli-core/v2 => github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0 -replace github.com/jfrog/jfrog-cli-artifactory => github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204094746-9709cf6c989b +replace github.com/jfrog/jfrog-cli-artifactory => github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204104742-a8b1865d9ffd replace github.com/jfrog/jfrog-cli-security => github.com/jfrog/jfrog-cli-security v1.14.2-0.20250202122713-1525ceab5778 diff --git a/go.sum b/go.sum index 898a1f053..d5fb2115d 100644 --- a/go.sum +++ b/go.sum @@ -34,8 +34,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/beevik/etree v1.4.0 h1:oz1UedHRepuY3p4N5OjE0nK1WLCqtzHf25bxplKOHLs= github.com/beevik/etree v1.4.0/go.mod h1:cyWiXwGoasx60gHvtnEh5x8+uIjUVnjWqBvEnhnqKDA= -github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204094746-9709cf6c989b h1:JHwANg1RR7DTnvMdbvPb/eQ+uKsgHsTHDNL9WvaLMNY= -github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204094746-9709cf6c989b/go.mod h1:29aMu6pLrjpXVBhRlkt2fTp0I52IrfP53nCq+Lygbrs= +github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204104742-a8b1865d9ffd h1:tX3W2ulCppkIl5dAVSm6IbK7sEgZH4C7OI9gkoP6inE= +github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204104742-a8b1865d9ffd/go.mod h1:29aMu6pLrjpXVBhRlkt2fTp0I52IrfP53nCq+Lygbrs= github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0 h1:8vIvDWathpxoHeQRadJ9Tm9dIGoikllbLwAH5la/sz4= github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0/go.mod h1:3vP0hv13zJYvhXlgKIXmWSN8ADvGUQgxVVCqcO8hOeM= github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M= From 6a12c2fb60ec94eec8c43b4c1b2b060bd606dda9 Mon Sep 17 00:00:00 2001 From: Bhanu Reddy Date: Tue, 4 Feb 2025 16:39:12 +0530 Subject: [PATCH 10/15] Updated dependencies --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 39fd2034d..246e78275 100644 --- a/go.mod +++ b/go.mod @@ -193,7 +193,7 @@ require ( //replace github.com/jfrog/jfrog-cli-core/v2 => github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250123053843-d005557d62d9 replace github.com/jfrog/jfrog-cli-core/v2 => github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0 -replace github.com/jfrog/jfrog-cli-artifactory => github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204104742-a8b1865d9ffd +replace github.com/jfrog/jfrog-cli-artifactory => github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204110428-219224bf8bae replace github.com/jfrog/jfrog-cli-security => github.com/jfrog/jfrog-cli-security v1.14.2-0.20250202122713-1525ceab5778 diff --git a/go.sum b/go.sum index d5fb2115d..097f05537 100644 --- a/go.sum +++ b/go.sum @@ -34,8 +34,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/beevik/etree v1.4.0 h1:oz1UedHRepuY3p4N5OjE0nK1WLCqtzHf25bxplKOHLs= github.com/beevik/etree v1.4.0/go.mod h1:cyWiXwGoasx60gHvtnEh5x8+uIjUVnjWqBvEnhnqKDA= -github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204104742-a8b1865d9ffd h1:tX3W2ulCppkIl5dAVSm6IbK7sEgZH4C7OI9gkoP6inE= -github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204104742-a8b1865d9ffd/go.mod h1:29aMu6pLrjpXVBhRlkt2fTp0I52IrfP53nCq+Lygbrs= +github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204110428-219224bf8bae h1:naeMt0Yilgc8br8DPLnQ+AsrDNergetW0N5mIiyrlvo= +github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204110428-219224bf8bae/go.mod h1:29aMu6pLrjpXVBhRlkt2fTp0I52IrfP53nCq+Lygbrs= github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0 h1:8vIvDWathpxoHeQRadJ9Tm9dIGoikllbLwAH5la/sz4= github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0/go.mod h1:3vP0hv13zJYvhXlgKIXmWSN8ADvGUQgxVVCqcO8hOeM= github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M= From 67ea513994a8a3f58a26883728fe873d040cc734 Mon Sep 17 00:00:00 2001 From: Bhanu Reddy Date: Tue, 4 Feb 2025 17:13:46 +0530 Subject: [PATCH 11/15] Updated dependencies --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 246e78275..13f7f5bef 100644 --- a/go.mod +++ b/go.mod @@ -193,7 +193,7 @@ require ( //replace github.com/jfrog/jfrog-cli-core/v2 => github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250123053843-d005557d62d9 replace github.com/jfrog/jfrog-cli-core/v2 => github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0 -replace github.com/jfrog/jfrog-cli-artifactory => github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204110428-219224bf8bae +replace github.com/jfrog/jfrog-cli-artifactory => github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204113848-d196a41bb5ee replace github.com/jfrog/jfrog-cli-security => github.com/jfrog/jfrog-cli-security v1.14.2-0.20250202122713-1525ceab5778 diff --git a/go.sum b/go.sum index 097f05537..982ae11e2 100644 --- a/go.sum +++ b/go.sum @@ -34,8 +34,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/beevik/etree v1.4.0 h1:oz1UedHRepuY3p4N5OjE0nK1WLCqtzHf25bxplKOHLs= github.com/beevik/etree v1.4.0/go.mod h1:cyWiXwGoasx60gHvtnEh5x8+uIjUVnjWqBvEnhnqKDA= -github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204110428-219224bf8bae h1:naeMt0Yilgc8br8DPLnQ+AsrDNergetW0N5mIiyrlvo= -github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204110428-219224bf8bae/go.mod h1:29aMu6pLrjpXVBhRlkt2fTp0I52IrfP53nCq+Lygbrs= +github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204113848-d196a41bb5ee h1:3IcCZ92KbfzIIIogCAjWmIZslKcjyatD6YYd6XtlHkQ= +github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204113848-d196a41bb5ee/go.mod h1:29aMu6pLrjpXVBhRlkt2fTp0I52IrfP53nCq+Lygbrs= github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0 h1:8vIvDWathpxoHeQRadJ9Tm9dIGoikllbLwAH5la/sz4= github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0/go.mod h1:3vP0hv13zJYvhXlgKIXmWSN8ADvGUQgxVVCqcO8hOeM= github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M= From b78f3e36c6d39cd1e83ccead414d5dddfe9b6cf7 Mon Sep 17 00:00:00 2001 From: Bhanu Reddy Date: Tue, 4 Feb 2025 18:05:09 +0530 Subject: [PATCH 12/15] Updated dependencies --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 13f7f5bef..1272eea00 100644 --- a/go.mod +++ b/go.mod @@ -193,7 +193,7 @@ require ( //replace github.com/jfrog/jfrog-cli-core/v2 => github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250123053843-d005557d62d9 replace github.com/jfrog/jfrog-cli-core/v2 => github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0 -replace github.com/jfrog/jfrog-cli-artifactory => github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204113848-d196a41bb5ee +replace github.com/jfrog/jfrog-cli-artifactory => github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204123330-063c31023e4b replace github.com/jfrog/jfrog-cli-security => github.com/jfrog/jfrog-cli-security v1.14.2-0.20250202122713-1525ceab5778 diff --git a/go.sum b/go.sum index 982ae11e2..3b801cc6c 100644 --- a/go.sum +++ b/go.sum @@ -34,8 +34,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/beevik/etree v1.4.0 h1:oz1UedHRepuY3p4N5OjE0nK1WLCqtzHf25bxplKOHLs= github.com/beevik/etree v1.4.0/go.mod h1:cyWiXwGoasx60gHvtnEh5x8+uIjUVnjWqBvEnhnqKDA= -github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204113848-d196a41bb5ee h1:3IcCZ92KbfzIIIogCAjWmIZslKcjyatD6YYd6XtlHkQ= -github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204113848-d196a41bb5ee/go.mod h1:29aMu6pLrjpXVBhRlkt2fTp0I52IrfP53nCq+Lygbrs= +github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204123330-063c31023e4b h1:7LyFCIcSMv+k9FELLJ/SZXeH6wgiA852FMdH0JboiNI= +github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204123330-063c31023e4b/go.mod h1:29aMu6pLrjpXVBhRlkt2fTp0I52IrfP53nCq+Lygbrs= github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0 h1:8vIvDWathpxoHeQRadJ9Tm9dIGoikllbLwAH5la/sz4= github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0/go.mod h1:3vP0hv13zJYvhXlgKIXmWSN8ADvGUQgxVVCqcO8hOeM= github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M= From 6ec5015bd7c4b2af2c6f37797c2afd344c21f48e Mon Sep 17 00:00:00 2001 From: Bhanu Reddy Date: Tue, 4 Feb 2025 23:01:56 +0530 Subject: [PATCH 13/15] Updated dependencies --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 1272eea00..863538413 100644 --- a/go.mod +++ b/go.mod @@ -193,7 +193,7 @@ require ( //replace github.com/jfrog/jfrog-cli-core/v2 => github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250123053843-d005557d62d9 replace github.com/jfrog/jfrog-cli-core/v2 => github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0 -replace github.com/jfrog/jfrog-cli-artifactory => github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204123330-063c31023e4b +replace github.com/jfrog/jfrog-cli-artifactory => github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204172953-21c7d0dcb613 replace github.com/jfrog/jfrog-cli-security => github.com/jfrog/jfrog-cli-security v1.14.2-0.20250202122713-1525ceab5778 diff --git a/go.sum b/go.sum index 3b801cc6c..792100716 100644 --- a/go.sum +++ b/go.sum @@ -34,8 +34,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/beevik/etree v1.4.0 h1:oz1UedHRepuY3p4N5OjE0nK1WLCqtzHf25bxplKOHLs= github.com/beevik/etree v1.4.0/go.mod h1:cyWiXwGoasx60gHvtnEh5x8+uIjUVnjWqBvEnhnqKDA= -github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204123330-063c31023e4b h1:7LyFCIcSMv+k9FELLJ/SZXeH6wgiA852FMdH0JboiNI= -github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204123330-063c31023e4b/go.mod h1:29aMu6pLrjpXVBhRlkt2fTp0I52IrfP53nCq+Lygbrs= +github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204172953-21c7d0dcb613 h1:ZmvGHkBKw4Vm2MR+0VKydq1a3/sGsRIWn7eiFNrRQcI= +github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204172953-21c7d0dcb613/go.mod h1:29aMu6pLrjpXVBhRlkt2fTp0I52IrfP53nCq+Lygbrs= github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0 h1:8vIvDWathpxoHeQRadJ9Tm9dIGoikllbLwAH5la/sz4= github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0/go.mod h1:3vP0hv13zJYvhXlgKIXmWSN8ADvGUQgxVVCqcO8hOeM= github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M= From d399749dfde9c9d3f8b2ffe944e29647720d6068 Mon Sep 17 00:00:00 2001 From: Bhanu Reddy Date: Tue, 4 Feb 2025 23:48:18 +0530 Subject: [PATCH 14/15] Updated dependencies --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 863538413..bbdcf1cd8 100644 --- a/go.mod +++ b/go.mod @@ -193,7 +193,7 @@ require ( //replace github.com/jfrog/jfrog-cli-core/v2 => github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250123053843-d005557d62d9 replace github.com/jfrog/jfrog-cli-core/v2 => github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0 -replace github.com/jfrog/jfrog-cli-artifactory => github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204172953-21c7d0dcb613 +replace github.com/jfrog/jfrog-cli-artifactory => github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204181636-470c3f5b0dc5 replace github.com/jfrog/jfrog-cli-security => github.com/jfrog/jfrog-cli-security v1.14.2-0.20250202122713-1525ceab5778 diff --git a/go.sum b/go.sum index 792100716..2fc2326f1 100644 --- a/go.sum +++ b/go.sum @@ -34,8 +34,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/beevik/etree v1.4.0 h1:oz1UedHRepuY3p4N5OjE0nK1WLCqtzHf25bxplKOHLs= github.com/beevik/etree v1.4.0/go.mod h1:cyWiXwGoasx60gHvtnEh5x8+uIjUVnjWqBvEnhnqKDA= -github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204172953-21c7d0dcb613 h1:ZmvGHkBKw4Vm2MR+0VKydq1a3/sGsRIWn7eiFNrRQcI= -github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204172953-21c7d0dcb613/go.mod h1:29aMu6pLrjpXVBhRlkt2fTp0I52IrfP53nCq+Lygbrs= +github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204181636-470c3f5b0dc5 h1:oq8QxorHJ2F8Xomy6y+FrUZbltH5mk/+OI/7wH106sM= +github.com/bhanurp/jfrog-cli-artifactory v0.1.12-0.20250204181636-470c3f5b0dc5/go.mod h1:29aMu6pLrjpXVBhRlkt2fTp0I52IrfP53nCq+Lygbrs= github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0 h1:8vIvDWathpxoHeQRadJ9Tm9dIGoikllbLwAH5la/sz4= github.com/bhanurp/jfrog-cli-core/v2 v2.31.1-0.20250131063212-b5bed617f4d0/go.mod h1:3vP0hv13zJYvhXlgKIXmWSN8ADvGUQgxVVCqcO8hOeM= github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M= From d0e4d285faf9cbc3439c2aaecff3ef48d96b2e7b Mon Sep 17 00:00:00 2001 From: Bhanu Reddy Date: Wed, 5 Feb 2025 00:37:31 +0530 Subject: [PATCH 15/15] Removed distribution commands from jfrog-cli --- utils/cliutils/commandsflags.go | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/utils/cliutils/commandsflags.go b/utils/cliutils/commandsflags.go index 9a3fe4311..c237ffe60 100644 --- a/utils/cliutils/commandsflags.go +++ b/utils/cliutils/commandsflags.go @@ -91,13 +91,6 @@ const ( TransferConfigMerge = "transfer-config-merge" passphrase = "passphrase" - // Distribution's Command Keys - ReleaseBundleV1Create = "release-bundle-v1-create" - ReleaseBundleV1Update = "release-bundle-v1-update" - ReleaseBundleV1Sign = "release-bundle-v1-sign" - ReleaseBundleV1Distribute = "release-bundle-v1-distribute" - ReleaseBundleV1Delete = "release-bundle-v1-delete" - // MC's Commands Keys McConfig = "mc-config" LicenseAcquire = "license-acquire" @@ -1950,26 +1943,6 @@ var commandFlags = map[string][]string{ Poetry: { BuildName, BuildNumber, module, Project, }, - ReleaseBundleV1Create: { - distUrl, user, password, accessToken, serverId, specFlag, specVars, targetProps, - rbDryRun, sign, desc, exclusions, releaseNotesPath, releaseNotesSyntax, rbPassphrase, rbRepo, InsecureTls, distTarget, rbDetailedSummary, - }, - ReleaseBundleV1Update: { - distUrl, user, password, accessToken, serverId, specFlag, specVars, targetProps, - rbDryRun, sign, desc, exclusions, releaseNotesPath, releaseNotesSyntax, rbPassphrase, rbRepo, InsecureTls, distTarget, rbDetailedSummary, - }, - ReleaseBundleV1Sign: { - distUrl, user, password, accessToken, serverId, rbPassphrase, rbRepo, - InsecureTls, rbDetailedSummary, - }, - ReleaseBundleV1Distribute: { - distUrl, user, password, accessToken, serverId, rbDryRun, DistRules, - site, city, countryCodes, sync, maxWaitMinutes, InsecureTls, CreateRepo, - }, - ReleaseBundleV1Delete: { - distUrl, user, password, accessToken, serverId, rbDryRun, DistRules, - site, city, countryCodes, sync, maxWaitMinutes, InsecureTls, deleteFromDist, deleteQuiet, - }, TemplateConsumer: { url, user, password, accessToken, sshPassphrase, sshKeyPath, serverId, ClientCertPath, ClientCertKeyPath, vars,