Skip to content

Commit 4d5a58e

Browse files
authored
Allow Build Publish with overwrite Flag When Build Number is New (#2926)
1 parent 4d7f18f commit 4d5a58e

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

buildinfo_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,7 @@ func TestBuildPublishWithOverwrite(t *testing.T) {
678678
buildNumber := "1"
679679
preReleaseBuildNumber := "1-rc"
680680
defaultNumberOfBuilds := 5
681+
nonExistingBuildNumber := "1-x-rc"
681682

682683
// Clean old build tests if exists
683684
inttestutils.DeleteBuild(serverDetails.ArtifactoryUrl, buildName, artHttpDetails)
@@ -728,6 +729,12 @@ func TestBuildPublishWithOverwrite(t *testing.T) {
728729
// Verify even though overwrite is used when no build infos are available build info should be published
729730
assertBuildNumberOccurrencesForGivenBuildNameAndNumber(t, publishedBuildInfo, 1, found, buildNumber, err)
730731

732+
// Run build-publish with overwrite flag and build should be published
733+
runRt(t, "bp", buildName, nonExistingBuildNumber, "--overwrite=true")
734+
publishedBuildInfo, found, err = tests.GetBuildRuns(serverDetails, buildName)
735+
// Verify even though overwrite is used when no build infos are available build info should be published
736+
assertBuildNumberOccurrencesForGivenBuildNameAndNumber(t, publishedBuildInfo, 1, found, nonExistingBuildNumber, err)
737+
731738
// Cleanup
732739
inttestutils.DeleteBuild(serverDetails.ArtifactoryUrl, buildName, artHttpDetails)
733740
cleanArtifactoryTest()

go.mod

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,14 +189,10 @@ require (
189189
sigs.k8s.io/yaml v1.4.0 // indirect
190190
)
191191

192-
replace github.com/jfrog/jfrog-cli-artifactory => github.com/jfrog/jfrog-cli-artifactory v0.2.2-0.20250410102841-59bd5d8732de
193-
194192
replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20250410085750-f34f5feea93e
195193

196194
replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.28.1-0.20250406105605-ee90d11546f9
197195

198-
replace github.com/jfrog/jfrog-cli-security => github.com/jfrog/jfrog-cli-security v1.16.3-0.20250402121228-12cce9f88504
199-
200-
// replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go v1.8.9-0.20241220065541-91828d43d8b9
196+
replace github.com/jfrog/jfrog-cli-artifactory => github.com/jfrog/jfrog-cli-artifactory v0.2.2-0.20250414045808-41544959f9b9
201197

202-
// replace github.com/jfrog/gofrog => github.com/jfrog/gofrog dev
198+
replace github.com/jfrog/jfrog-cli-security => github.com/jfrog/jfrog-cli-security v1.16.3-0.20250402121228-12cce9f88504

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ github.com/jfrog/gofrog v1.7.6 h1:QmfAiRzVyaI7JYGsB7cxfAJePAZTzFz0gRWZSE27c6s=
186186
github.com/jfrog/gofrog v1.7.6/go.mod h1:ntr1txqNOZtHplmaNd7rS4f8jpA5Apx8em70oYEe7+4=
187187
github.com/jfrog/jfrog-apps-config v1.0.1 h1:mtv6k7g8A8BVhlHGlSveapqf4mJfonwvXYLipdsOFMY=
188188
github.com/jfrog/jfrog-apps-config v1.0.1/go.mod h1:8AIIr1oY9JuH5dylz2S6f8Ym2MaadPLR6noCBO4C22w=
189-
github.com/jfrog/jfrog-cli-artifactory v0.2.2-0.20250410102841-59bd5d8732de h1:D4MGEbZkGie9HfmClRlvp3iqWX7LQRWGhgvRj5f462Q=
190-
github.com/jfrog/jfrog-cli-artifactory v0.2.2-0.20250410102841-59bd5d8732de/go.mod h1:8qrGaRb162a4NWGr7R1rj8P80s8NU8KRTs69NMkQENA=
189+
github.com/jfrog/jfrog-cli-artifactory v0.2.2-0.20250414045808-41544959f9b9 h1:j9bepUA23952AdytsBqGbsl4QMScksbCFXulqWvj0eY=
190+
github.com/jfrog/jfrog-cli-artifactory v0.2.2-0.20250414045808-41544959f9b9/go.mod h1:8qrGaRb162a4NWGr7R1rj8P80s8NU8KRTs69NMkQENA=
191191
github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20250410085750-f34f5feea93e h1:N+7gJdZmwggKqrTbrEvAFxxXQziFbJ4zHI/sXa8vR1A=
192192
github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20250410085750-f34f5feea93e/go.mod h1:4S7yztLwWq4yA+k9j9s5gvIqr7xC/6EjJQ+0ENCHTFc=
193193
github.com/jfrog/jfrog-cli-platform-services v1.9.0 h1:r/ETgJuMUOUu12w20ydsF6paqEaj0khH6bxMRsdNz1Y=

0 commit comments

Comments
 (0)