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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions buildtools/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ func GetCommands() []cli.Command {
},
{
Name: "conan",
Hidden: true,
Flags: cliutils.GetCommandFlags(cliutils.Conan),
Usage: conan.GetDescription(),
HelpName: corecommon.CreateUsage("conan", conan.GetDescription(), conan.Usage),
Expand Down
91 changes: 90 additions & 1 deletion docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ func TestDockerLoginWithServer(t *testing.T) {
} else {
credentials = "--user=" + *tests.JfrogUser + " --password=" + *tests.JfrogPassword
}
err := coreTests.NewJfrogCli(execMain, "jfrog config", credentials).Exec("add", "artDocker", "--interactive=false", "--url="+"http://localhost:8082", "--enc-password="+strconv.FormatBool(true))
err := coreTests.NewJfrogCli(execMain, "jfrog config", credentials).Exec("add", "artDocker", "--interactive=false", "--url="+"http://localhost:8082", "--enc-password="+strconv.FormatBool(true), "--overwrite")
assert.NoError(t, err)

imageName := path.Join(*tests.ContainerRegistry, tests.DockerRemoteRepo, "alpine:latest")
Expand Down Expand Up @@ -1158,3 +1158,92 @@ CMD ["sh"]`, baseImage)

inttestutils.DeleteBuild(serverDetails.ArtifactoryUrl, buildName, artHttpDetails)
}

func TestContainerPullWithSha(t *testing.T) {
cleanup := initNativeDockerWithArtTest(t)
defer cleanup()
var credentials string
if *tests.JfrogAccessToken != "" {
credentials = "--access-token=" + *tests.JfrogAccessToken
} else {
credentials = "--user=" + *tests.JfrogUser + " --password=" + *tests.JfrogPassword
}
err := coreTests.NewJfrogCli(execMain, "jfrog config", credentials).Exec("add", "artDocker", "--interactive=false", "--url="+"http://localhost:8082", "--enc-password="+strconv.FormatBool(true), "--overwrite")
assert.NoError(t, err)
runJfrogCli(t, "config", "use", "artDocker")
imageName, err := inttestutils.BuildTestImage(tests.DockerImageName+":1", "", tests.DockerLocalRepo, container.DockerClient)
assert.NoError(t, err)
defer tests2.DeleteTestImage(t, imageName, container.DockerClient)

// Push container image
runCmdWithRetries(t, jfrogRtCliTask(container.DockerClient.String()+"-push", imageName, tests.DockerVirtualRepo))
buildNumber := "1"

dockerImage := container.DockerImage{
Image: imageName,
}
manifestSha, err := dockerImage.GetManifestDetails()
assert.NoError(t, err)
imageTag := strings.ReplaceAll(imageName, ":1", "@"+manifestSha)

// pull image with SHA
runJfrogCli(t, "docker", "pull", imageTag, "--build-name="+tests.DockerBuildName, "--build-number="+buildNumber)
runRt(t, "build-publish", tests.DockerBuildName, buildNumber)

imagePath := path.Join(tests.DockerVirtualRepo, tests.DockerImageName, "1") + "/"
module := tests.DockerImageName + "@" + manifestSha
validateContainerBuild(tests.DockerBuildName, buildNumber, imagePath, module, 0, 7, t)

inttestutils.ContainerTestCleanup(t, serverDetails, artHttpDetails, tests.DockerImageName, tests.DockerBuildName, tests.DockerVirtualRepo)

}

func TestContainerFatManifestPullWithSha(t *testing.T) {
cleanup := initNativeDockerWithArtTest(t)
defer cleanup()
var credentials string
if *tests.JfrogAccessToken != "" {
credentials = "--access-token=" + *tests.JfrogAccessToken
} else {
credentials = "--user=" + *tests.JfrogUser + " --password=" + *tests.JfrogPassword
}
err := coreTests.NewJfrogCli(execMain, "jfrog config", credentials).Exec("add", "artDocker", "--interactive=false", "--url="+"http://localhost:8082", "--enc-password="+strconv.FormatBool(true), "--overwrite")
assert.NoError(t, err)
runJfrogCli(t, "config", "use", "artDocker")
imageName := "traefik"
buildNumber := "1"
for _, dockerRepo := range [...]string{tests.DockerRemoteRepo, tests.DockerVirtualRepo} {
func() {
// calculate the sha of the image provided above
dockerImage := container.DockerImage{
Image: imageName,
}
manifestSha, err := dockerImage.GetManifestDetails()
assert.NoError(t, err)

imageTag := path.Join(*tests.ContainerRegistry, dockerRepo, imageName+"@"+manifestSha)
// Pull container image
defer tests2.DeleteTestImage(t, imageTag, container.DockerClient)
// pull image with SHA
runJfrogCli(t, "docker", "pull", imageTag, "--build-name="+tests.DockerBuildName, "--build-number="+buildNumber)
runRt(t, "build-publish", tests.DockerBuildName, buildNumber)

// Validate
publishedBuildInfo, found, err := tests.GetBuildInfo(serverDetails, tests.DockerBuildName, buildNumber)
if err != nil {
assert.NoError(t, err)
return
}
if !found {
assert.True(t, found, "build info was expected to be found")
return
}
buildInfo := publishedBuildInfo.BuildInfo
module := imageName + "@" + manifestSha
validateBuildInfo(buildInfo, t, 6, 0, module, entities.Docker)

inttestutils.DeleteBuild(serverDetails.ArtifactoryUrl, tests.DockerBuildName, artHttpDetails)
}()
}

}
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ require (
github.com/jfrog/build-info-go v1.12.5-0.20251209171349-eb030db986f9
github.com/jfrog/gofrog v1.7.6
github.com/jfrog/jfrog-cli-application v1.0.2-0.20251210075951-519050602a7f
github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20251218044417-5113b260e416
github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20251222102341-20b9565387e0
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20251219102726-2cbe70d57403
github.com/jfrog/jfrog-cli-evidence v0.8.3-0.20251204144808-73fa744851c0
github.com/jfrog/jfrog-cli-platform-services v1.10.1-0.20251205121610-171eb9b0000e
github.com/jfrog/jfrog-cli-security v1.24.1
github.com/jfrog/jfrog-client-go v1.55.1-0.20251212095223-711b02c53736
github.com/jfrog/jfrog-client-go v1.55.1-0.20251218135123-ebfdf494c72d
github.com/jszwec/csvutil v1.10.0
github.com/manifoldco/promptui v0.9.0
github.com/spf13/viper v1.21.0
Expand Down
10 changes: 4 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1216,10 +1216,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-application v1.0.2-0.20251210075951-519050602a7f h1:YHwPNF13Gmt65J618kEGn/4SGewXqyYuAdcyYWYdrBA=
github.com/jfrog/jfrog-cli-application v1.0.2-0.20251210075951-519050602a7f/go.mod h1:xum2HquWO5uExa/A7MQs3TgJJVEeoqTR+6Z4mfBr1Xw=
github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20251218044417-5113b260e416 h1:bCCsZ/2oVgcxeWVgUG8K0bE1I7JFZ+O6CISzwwEfrV8=
github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20251218044417-5113b260e416/go.mod h1:7cCaRhXorlbyXZgiW5bplCExFxlnROaG21K12d8inpQ=
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20251210085744-f8481d179ac5 h1:GYE67ubwl+ZRw3CcXFUi49EwwQp6k+qS8sX0QuHDHO8=
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20251210085744-f8481d179ac5/go.mod h1:BMoGi2rG0udCCeaghqlNgiW3fTmT+TNnfTnBoWFYgcg=
github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20251222102341-20b9565387e0 h1:hQscFu/t9G5A/2PuL4G4t8K5VUIxBubcB9+iYenATDE=
github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20251222102341-20b9565387e0/go.mod h1:oIq7MEnqzAjA9ZbamJPvdgTpHcmlPBMo05KBxZ3fykE=
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20251219102726-2cbe70d57403 h1:Hnw9eOCdybMBAh1pUt9FCs74CTDOUh0M79ZCQ3VKPc4=
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20251219102726-2cbe70d57403/go.mod h1:BMoGi2rG0udCCeaghqlNgiW3fTmT+TNnfTnBoWFYgcg=
github.com/jfrog/jfrog-cli-evidence v0.8.3-0.20251204144808-73fa744851c0 h1:8S1vE1PeVtrzWkKL0N39cX6XLLNV0It+f6xjRKjw7Ug=
Expand All @@ -1228,8 +1226,8 @@ github.com/jfrog/jfrog-cli-platform-services v1.10.1-0.20251205121610-171eb9b000
github.com/jfrog/jfrog-cli-platform-services v1.10.1-0.20251205121610-171eb9b0000e/go.mod h1:qbu4iqBST9x8LgD8HhzUm91iOB3vHqtoGmaxOnmw0ok=
github.com/jfrog/jfrog-cli-security v1.24.1 h1:NF8SE9uzUgqvqYjuuqbduXBqj+fwE4CmkMeVKtcLkyI=
github.com/jfrog/jfrog-cli-security v1.24.1/go.mod h1:3FXD5IkKtdQOm9CZk6cR7q0iC6PaGMnjqzZqRcQp2r0=
github.com/jfrog/jfrog-client-go v1.55.1-0.20251212095223-711b02c53736 h1:sPAQHxVaV9QQ2TpfLM5y9VY+Fgva/5o7UZYlhNKouvw=
github.com/jfrog/jfrog-client-go v1.55.1-0.20251212095223-711b02c53736/go.mod h1:WQ5Y+oKYyHFAlCbHN925bWhnShTd2ruxZ6YTpb76fpU=
github.com/jfrog/jfrog-client-go v1.55.1-0.20251218135123-ebfdf494c72d h1:AUavZ6icGpYiUXpTeya+3QhoG1Ja74pO71CtPr2h8iI=
github.com/jfrog/jfrog-client-go v1.55.1-0.20251218135123-ebfdf494c72d/go.mod h1:WQ5Y+oKYyHFAlCbHN925bWhnShTd2ruxZ6YTpb76fpU=
github.com/jhump/protoreflect v1.17.0 h1:qOEr613fac2lOuTgWN4tPAtLL7fUSbuJL5X5XumQh94=
github.com/jhump/protoreflect v1.17.0/go.mod h1:h9+vUUL38jiBzck8ck+6G/aeMX8Z4QUY/NiJPwPNi+8=
github.com/jmespath/go-jmespath v0.4.1-0.20220621161143-b0104c826a24 h1:liMMTbpW34dhU4az1GN0pTPADwNmvoRSeoZ6PItiqnY=
Expand Down
1 change: 1 addition & 0 deletions nuget_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ func prepareSetupTest(t *testing.T, packageManager project.ProjectType) func() {
// dep of NuGet.Core). This creates multiple RequestedBy paths that must be
// consistently sorted across runs.
func TestDotnetRequestedByDeterminism(t *testing.T) {
t.Skip("Skipping test temporarily")
initNugetTest(t)
const numRuns = 5
buildName := tests.DotnetBuildName + "-determinism"
Expand Down
Loading