Skip to content

Allow Build Publish with overwrite Flag When Build Number is New#2926

Merged
bhanurp merged 5 commits intojfrog:devfrom
bhanurp:fix-build-number-not-found
Apr 14, 2025
Merged

Allow Build Publish with overwrite Flag When Build Number is New#2926
bhanurp merged 5 commits intojfrog:devfrom
bhanurp:fix-build-number-not-found

Conversation

@bhanurp
Copy link
Contributor

@bhanurp bhanurp commented Mar 17, 2025

  • All tests have passed. If this feature is not already covered by the tests, new tests have been added.
  • The pull request is targeting the dev branch.
  • The code has been validated to compile successfully by running go vet ./....
  • The code has been formatted properly using go fmt ./....

Depends On

jfrog/jfrog-cli-artifactory#55

Fix: Allow Build Publish with overwrite Flag When Build Number is New

Issue

When attempting to publish a build with the overwrite flag, the process fails if the buildName already exists in Artifactory but the buildNumber is new. The failure occurs due to a missing build number in Artifactory.

Current Behavior

  • Publishing fails with an error stating that the build number is not available.

Solution

  • Ensure that the build info is pushed even if the specified buildNumber is not yet available in Artifactory.

This PR adds functional tests to above case.

@bhanurp bhanurp changed the base branch from v2 to dev March 17, 2025 17:30
@bhanurp bhanurp added the safe to test Approve running integration tests on a pull request label Mar 17, 2025
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Mar 17, 2025
@bhanurp bhanurp added the safe to test Approve running integration tests on a pull request label Mar 19, 2025
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Mar 19, 2025
@bhanurp bhanurp added ignore for release Automatically generated release notes safe to test Approve running integration tests on a pull request labels Apr 14, 2025
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Apr 14, 2025
@github-actions
Copy link
Contributor

👍 Frogbot scanned this pull request and did not find any new security issues.


@bhanurp bhanurp marked this pull request as ready for review April 14, 2025 06:35

// Run build-publish with overwrite flag and build should be published
runRt(t, "bp", buildName, nonExistingBuildNumber, "--overwrite=true")
publishedBuildInfo, found, err = tests.GetBuildRuns(serverDetails, buildName)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we have a test already that is testing same scenario but flag value is false (I mean without flag)?

I suggest to add one as we are here anyway

Copy link
Contributor Author

Choose a reason for hiding this comment

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

by default all other tests doesn't include flag(--overwrite) which makes default (--overwrite=false)

@bhanurp bhanurp merged commit 4d5a58e into jfrog:dev Apr 14, 2025
83 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ignore for release Automatically generated release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants