Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into v2
Browse files Browse the repository at this point in the history
  • Loading branch information
jfrog-ecosystem committed Feb 21, 2024
2 parents 41f4e5d + e1103d0 commit e33a99c
Show file tree
Hide file tree
Showing 37 changed files with 272 additions and 269 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pythonTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
go-version: 1.20.x
# Due to a bug in Python 3.12.0 we temporary use version 3.11.5
- name: Setup Python3
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11.5"
- name: Setup Pipenv
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ node("docker") {
repo = 'jfrog-cli'
sh 'rm -rf temp'
sh 'mkdir temp'
def goRoot = tool 'go-1.20.10'
def goRoot = tool 'go-1.20.14'
env.GOROOT="$goRoot"
env.PATH+=":${goRoot}/bin:/tmp/node-${nodeVersion}-linux-x64/bin"
env.GO111MODULE="on"
Expand Down
22 changes: 22 additions & 0 deletions artifactory/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ func GetCommands() []cli.Command {
},
{
Name: "build-scan",
Hidden: true,
Flags: cliutils.GetCommandFlags(cliutils.BuildScanLegacy),
Aliases: []string{"bs"},
Usage: buildscan.GetDescription(),
Expand Down Expand Up @@ -323,6 +324,7 @@ func GetCommands() []cli.Command {
},
{
Name: "mvn-config",
Hidden: true,
Aliases: []string{"mvnc"},
Flags: cliutils.GetCommandFlags(cliutils.MvnConfig),
Usage: mvnconfig.GetDescription(),
Expand All @@ -335,6 +337,7 @@ func GetCommands() []cli.Command {
},
{
Name: "mvn",
Hidden: true,
Flags: cliutils.GetCommandFlags(cliutils.Mvn),
Usage: mvndoc.GetDescription(),
HelpName: corecommon.CreateUsage("rt mvn", mvndoc.GetDescription(), mvndoc.Usage),
Expand All @@ -348,6 +351,7 @@ func GetCommands() []cli.Command {
},
{
Name: "gradle-config",
Hidden: true,
Aliases: []string{"gradlec"},
Flags: cliutils.GetCommandFlags(cliutils.GradleConfig),
Usage: gradleconfig.GetDescription(),
Expand All @@ -360,6 +364,7 @@ func GetCommands() []cli.Command {
},
{
Name: "gradle",
Hidden: true,
Flags: cliutils.GetCommandFlags(cliutils.Gradle),
Usage: gradledoc.GetDescription(),
HelpName: corecommon.CreateUsage("rt gradle", gradledoc.GetDescription(), gradledoc.Usage),
Expand All @@ -384,6 +389,7 @@ func GetCommands() []cli.Command {
},
{
Name: "docker-push",
Hidden: true,
Flags: cliutils.GetCommandFlags(cliutils.ContainerPush),
Aliases: []string{"dp"},
Usage: dockerpush.GetDescription(),
Expand All @@ -397,6 +403,7 @@ func GetCommands() []cli.Command {
},
{
Name: "docker-pull",
Hidden: true,
Flags: cliutils.GetCommandFlags(cliutils.ContainerPull),
Aliases: []string{"dpl"},
Usage: dockerpull.GetDescription(),
Expand Down Expand Up @@ -458,6 +465,7 @@ func GetCommands() []cli.Command {
},
{
Name: "npm-config",
Hidden: true,
Flags: cliutils.GetCommandFlags(cliutils.NpmConfig),
Aliases: []string{"npmc"},
Usage: npmconfig.GetDescription(),
Expand All @@ -470,6 +478,7 @@ func GetCommands() []cli.Command {
},
{
Name: "npm-install",
Hidden: true,
Flags: cliutils.GetCommandFlags(cliutils.NpmInstallCi),
Aliases: []string{"npmi"},
Usage: npminstall.GetDescription(),
Expand All @@ -484,6 +493,7 @@ func GetCommands() []cli.Command {
},
{
Name: "npm-ci",
Hidden: true,
Flags: cliutils.GetCommandFlags(cliutils.NpmInstallCi),
Aliases: []string{"npmci"},
Usage: npmci.GetDescription(),
Expand All @@ -498,6 +508,7 @@ func GetCommands() []cli.Command {
},
{
Name: "npm-publish",
Hidden: true,
Flags: cliutils.GetCommandFlags(cliutils.NpmPublish),
Aliases: []string{"npmp"},
Usage: npmpublish.GetDescription(),
Expand All @@ -511,6 +522,7 @@ func GetCommands() []cli.Command {
},
{
Name: "yarn-config",
Hidden: true,
Aliases: []string{"yarnc"},
Flags: cliutils.GetCommandFlags(cliutils.YarnConfig),
Usage: yarnconfig.GetDescription(),
Expand All @@ -523,6 +535,7 @@ func GetCommands() []cli.Command {
},
{
Name: "yarn",
Hidden: true,
Flags: cliutils.GetCommandFlags(cliutils.Yarn),
Usage: yarndocs.GetDescription(),
HelpName: corecommon.CreateUsage("rt yarn", yarndocs.GetDescription(), yarndocs.Usage),
Expand All @@ -535,6 +548,7 @@ func GetCommands() []cli.Command {
},
{
Name: "nuget-config",
Hidden: true,
Flags: cliutils.GetCommandFlags(cliutils.NugetConfig),
Aliases: []string{"nugetc"},
Usage: nugetconfig.GetDescription(),
Expand All @@ -547,6 +561,7 @@ func GetCommands() []cli.Command {
},
{
Name: "nuget",
Hidden: true,
Flags: cliutils.GetCommandFlags(cliutils.Nuget),
Usage: nugetdocs.GetDescription(),
HelpName: corecommon.CreateUsage("rt nuget", nugetdocs.GetDescription(), nugetdocs.Usage),
Expand All @@ -569,6 +584,7 @@ func GetCommands() []cli.Command {
},
{
Name: "dotnet-config",
Hidden: true,
Flags: cliutils.GetCommandFlags(cliutils.DotnetConfig),
Aliases: []string{"dotnetc"},
Usage: dotnetconfig.GetDescription(),
Expand All @@ -581,6 +597,7 @@ func GetCommands() []cli.Command {
},
{
Name: "dotnet",
Hidden: true,
Flags: cliutils.GetCommandFlags(cliutils.Dotnet),
Usage: dotnetdocs.GetDescription(),
HelpName: corecommon.CreateUsage("rt dotnet", dotnetdocs.GetDescription(), dotnetdocs.Usage),
Expand All @@ -594,6 +611,7 @@ func GetCommands() []cli.Command {
},
{
Name: "go-config",
Hidden: true,
Flags: cliutils.GetCommandFlags(cliutils.GoConfig),
Usage: goconfig.GetDescription(),
HelpName: corecommon.CreateUsage("rt go-config", goconfig.GetDescription(), goconfig.Usage),
Expand All @@ -605,6 +623,7 @@ func GetCommands() []cli.Command {
},
{
Name: "go-publish",
Hidden: true,
Flags: cliutils.GetCommandFlags(cliutils.GoPublish),
Aliases: []string{"gp"},
Usage: gopublish.GetDescription(),
Expand All @@ -618,6 +637,7 @@ func GetCommands() []cli.Command {
},
{
Name: "go",
Hidden: true,
Flags: cliutils.GetCommandFlags(cliutils.Go),
Aliases: []string{"go"},
Usage: gocommand.GetDescription(),
Expand Down Expand Up @@ -654,6 +674,7 @@ func GetCommands() []cli.Command {
},
{
Name: "pip-config",
Hidden: true,
Flags: cliutils.GetCommandFlags(cliutils.PipConfig),
Aliases: []string{"pipc"},
Usage: pipconfig.GetDescription(),
Expand All @@ -666,6 +687,7 @@ func GetCommands() []cli.Command {
},
{
Name: "pip-install",
Hidden: true,
Flags: cliutils.GetCommandFlags(cliutils.PipInstall),
Aliases: []string{"pipi"},
Usage: pipinstall.GetDescription(),
Expand Down
33 changes: 31 additions & 2 deletions artifactory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
biutils "github.com/jfrog/build-info-go/utils"

"github.com/buger/jsonparser"
"github.com/jfrog/archiver/v3"
gofrogio "github.com/jfrog/gofrog/io"
"github.com/jfrog/gofrog/version"
"github.com/jfrog/jfrog-cli-core/v2/artifactory/commands/generic"
Expand Down Expand Up @@ -59,7 +60,6 @@ import (
"github.com/jfrog/jfrog-client-go/utils/io/httputils"
"github.com/jfrog/jfrog-client-go/utils/log"
clientTestUtils "github.com/jfrog/jfrog-client-go/utils/tests"
"github.com/mholt/archiver/v3"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down Expand Up @@ -1805,7 +1805,7 @@ func checkIfServerIsUp(port, proxyScheme string, useClientCerts bool) error {

func TestXrayScanBuild(t *testing.T) {
initArtifactoryTest(t, "")
xrayServerPort := xray.StartXrayMockServer()
xrayServerPort := xray.StartXrayMockServer(t)
serverUrl := "--url=http://localhost:" + strconv.Itoa(xrayServerPort)
artifactoryCommandExecutor := coretests.NewJfrogCli(execMain, "jfrog rt", serverUrl+getArtifactoryTestCredentials())
assert.NoError(t, artifactoryCommandExecutor.Exec("build-scan", xray.CleanScanBuildName, "3"))
Expand Down Expand Up @@ -4204,6 +4204,35 @@ func TestUploadZipAndCheckDeploymentViewWithArchive(t *testing.T) {

}

func TestUploadEmptyArchiveWithEmptyArchiveEnv(t *testing.T) {
initArtifactoryTest(t, "")

// Create tmp dir
assert.NoError(t, os.Mkdir(tests.Out, 0755))
wd, err := os.Getwd()
assert.NoError(t, err)
defer cleanArtifactoryTest()
chdirCallback := clientTestUtils.ChangeDirWithCallback(t, wd, tests.Out)
defer chdirCallback()

// Create file and a zip
zipName := "test.zip"

setEnvCallBack := clientTestUtils.SetEnvWithCallbackAndAssert(t, services.JfrogCliUploadEmptyArchiveEnv, "true")
defer setEnvCallBack()

// Upload & download zip file
assert.NoError(t, artifactoryCli.Exec("upload", "*", path.Join(tests.RtRepo1, zipName), "--exclusions", "**", "--archive", "zip"))
assert.NoError(t, artifactoryCli.Exec("download", path.Join(tests.RtRepo1, zipName)))

// Check that the zip file uploaded and it's empty
assert.FileExists(t, zipName)
r, err := zip.OpenReader(zipName)
assert.NoError(t, err)
defer func() { assert.NoError(t, r.Close()) }()
assert.Empty(t, r.File)
}

func TestUploadDetailedSummary(t *testing.T) {
initArtifactoryTest(t, "")
uploadCmd := generic.NewUploadCommand()
Expand Down
2 changes: 1 addition & 1 deletion build/npm/v2-jf/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/npm/v2-jf/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jfrog-cli-v2-jf",
"version": "2.52.10",
"version": "2.53.0",
"description": "🐸 Command-line interface for JFrog Artifactory, Xray, Distribution, Pipelines and Mission Control 🐸",
"homepage": "https://github.com/jfrog/jfrog-cli",
"preferGlobal": true,
Expand Down
2 changes: 1 addition & 1 deletion build/npm/v2/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/npm/v2/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jfrog-cli-v2",
"version": "2.52.10",
"version": "2.53.0",
"description": "🐸 Command-line interface for JFrog Artifactory, Xray, Distribution, Pipelines and Mission Control 🐸",
"homepage": "https://github.com/jfrog/jfrog-cli",
"preferGlobal": true,
Expand Down
14 changes: 14 additions & 0 deletions buildtools/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import (
"github.com/jfrog/jfrog-cli/docs/buildtools/pipenvconfig"
"github.com/jfrog/jfrog-cli/docs/buildtools/pipenvinstall"
"github.com/jfrog/jfrog-cli/docs/buildtools/pipinstall"
"github.com/jfrog/jfrog-cli/docs/buildtools/pnpmconfig"
"github.com/jfrog/jfrog-cli/docs/buildtools/poetry"
"github.com/jfrog/jfrog-cli/docs/buildtools/poetryconfig"
yarndocs "github.com/jfrog/jfrog-cli/docs/buildtools/yarn"
Expand Down Expand Up @@ -330,6 +331,19 @@ func GetCommands() []cli.Command {
return npmGenericCmd(c, cmdName, false)
},
},
{
Name: "pnpm-config",
Flags: cliutils.GetCommandFlags(cliutils.PnpmConfig),
Aliases: []string{"pnpmc"},
Usage: pnpmconfig.GetDescription(),
HelpName: corecommon.CreateUsage("pnpm-config", pnpmconfig.GetDescription(), pnpmconfig.Usage),
ArgsUsage: common.CreateEnvVars(),
BashComplete: corecommon.CreateBashCompletionFunc(),
Category: buildToolsCategory,
Action: func(c *cli.Context) error {
return cliutils.CreateConfigCmd(c, project.Pnpm)
},
},
{
Name: "docker",
Flags: cliutils.GetCommandFlags(cliutils.Docker),
Expand Down
2 changes: 1 addition & 1 deletion docs/artifactory/upload/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "github.com/jfrog/jfrog-cli/docs/common"
var Usage = []string{"rt u [command options] <source pattern> <target pattern>",
"rt u --spec=<File Spec path> [command options]"}

var EnvVar = []string{common.JfrogCliMinChecksumDeploySizeKb, common.JfrogCliFailNoOp}
var EnvVar = []string{common.JfrogCliMinChecksumDeploySizeKb, common.JfrogCliFailNoOp, common.JfrogCliUploadEmptyArchive}

func GetDescription() string {
return "Upload files."
Expand Down
7 changes: 7 additions & 0 deletions docs/buildtools/pnpmconfig/help.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package pnpmconfig

var Usage = []string{"pnpm-config [command options]"}

func GetDescription() string {
return "Generate pnpm configuration."
}
6 changes: 6 additions & 0 deletions docs/common/env.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package common

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

"github.com/jfrog/jfrog-cli-core/v2/utils/coreutils"
Expand Down Expand Up @@ -80,6 +81,10 @@ const (
Set to true if you'd like the command to return exit code 2 in case of no files are affected.
Support by the following commands: copy, delete, delete-props, set-props, download, move, search and upload`

JfrogCliUploadEmptyArchive = ` ` + services.JfrogCliUploadEmptyArchiveEnv + `
[Default: false]
Set to true if you'd like to upload an empty archive when '--archive' is set but all files were excluded by exclusions pattern. `

JfrogCliEncryptionKey = ` JFROG_CLI_ENCRYPTION_KEY
If provided, encrypt the sensitive data stored in the config with the provided key. Must be exactly 32 characters.`

Expand Down Expand Up @@ -119,6 +124,7 @@ func GetGlobalEnvVars() string {
JfrogCliReleasesRepo,
JfrogCliDependenciesDir,
JfrogCliMinChecksumDeploySizeKb,
JfrogCliUploadEmptyArchive,
JfrogCliBuildUrl,
JfrogCliEnvExclude,
JfrogCliFailNoOp,
Expand Down
7 changes: 0 additions & 7 deletions docs/scan/audit/help.go

This file was deleted.

7 changes: 0 additions & 7 deletions docs/scan/auditgo/help.go

This file was deleted.

7 changes: 0 additions & 7 deletions docs/scan/auditgradle/help.go

This file was deleted.

7 changes: 0 additions & 7 deletions docs/scan/auditmvn/help.go

This file was deleted.

7 changes: 0 additions & 7 deletions docs/scan/auditnpm/help.go

This file was deleted.

Loading

0 comments on commit e33a99c

Please sign in to comment.