Skip to content

RTECO-992 - Restore build-info for jf uv build, clear artifacts only#449

Merged
agrasth merged 3 commits into
jfrog:mainfrom
agrasth:fix/uv-build-command-buildinfo
May 14, 2026
Merged

RTECO-992 - Restore build-info for jf uv build, clear artifacts only#449
agrasth merged 3 commits into
jfrog:mainfrom
agrasth:fix/uv-build-command-buildinfo

Conversation

@agrasth
Copy link
Copy Markdown
Collaborator

@agrasth agrasth commented May 13, 2026

Problem

PR #438 fixed duplicate dependency entries by skipping build-info entirely for jf uv build. This was too aggressive — it broke three tests that expected at least a module to exist:

  • TestUvBuild — expects 1 module, 0 artifacts
  • TestUvArtifactTypeIsExtension — expects module exists
  • TestUvCustomModule — expects module with custom ID

Fix

Restore build-info collection for jf uv build, following Maven's behavior for non-deploy goals:

  • Module: recorded (enables --module, jf rt bp, custom naming)
  • Dependencies: recorded (what was resolved to produce the wheel/sdist)
  • Artifacts: cleared — uv build uploads nothing to Artifactory; artifacts are captured by jf uv publish

This matches how jf mvn compile/package works: dependencies are tracked, artifacts are only recorded when something is actually deployed.

Changes

  • native_uv.go Run(): removed the != "build" guard so uvGetBuildInfo is called for build
  • native_uv.go uvGetBuildInfo(): added case "build" block that clears Artifacts (keeps dependencies)

Related

jf uv build creates local dist/ files but uploads nothing to Artifactory.
PR jfrog#438 skipped build-info entirely which broke TestUvBuild, TestUvArtifactTypeIsExtension
and TestUvCustomModule — all expected at least a module to exist.

Following Maven's behavior for non-deploy goals: record dependencies (what was
resolved to produce the wheel/sdist) but no artifacts (nothing in Artifactory yet).
Artifacts are captured later by jf uv publish.
@agrasth agrasth added bug Something isn't working labels May 13, 2026
bhanurp
bhanurp previously approved these changes May 14, 2026
// "build" only creates local dist/ files — nothing is uploaded to Artifactory,
// so it must not save a partial build-info. Saving unenriched deps from "build"
// would create duplicate dependency entries when merged with a prior "sync" partial.
} else {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The removed comment flagged a dep-duplication risk for workflows that run jf uv sync then jf uv build under the same build name. Now that build enters the collection path, does jf rt bp deduplicate deps across partials? If yes, this is fine - please add a comment confirming. If no, we may want bi.Modules[0].Dependencies = nil in the build case too (same as publish clears deps, build would clear artifacts and deps).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

jf rt bp does NOT deduplicate — it keys by Id+Sha1+Md5+Scopes, so enriched (from sync) and unenriched (from build) deps are treated as different entries. Added Dependencies = nil to the build block to prevent duplicates.

// for non-deploy goals.
if cmdName == "build" && len(bi.Modules) > 0 {
bi.Modules[0].Artifacts = nil
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same [0] pattern as the publish case above, fine for now since UV produces a single module, but if we ever support workspace builds this will need a range loop. Consider a // TODO: loop over all modules if workspace support is added comment to match the implicit contract of the publish block.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Added // TODO: loop over all modules if workspace support is added, will create a ticket for this.

…omments

- Clear dependencies for build command: jf rt bp deduplicates via
  key(Id+Sha1+Md5+Scopes), so an unenriched build dep and an enriched
  sync dep produce two separate entries for the same package — duplicates.
  Nil-ing deps in build avoids this when sync ran first under same build name.
- Add TODO comments on both publish and build [0] blocks noting they need
  a range loop if UV workspace support is ever added.
Copy link
Copy Markdown
Collaborator

@naveenku-jfrog naveenku-jfrog left a comment

Choose a reason for hiding this comment

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

Please address comments.

@agrasth agrasth requested a review from itsmeleela May 14, 2026 07:42
@agrasth agrasth merged commit aef923f into jfrog:main May 14, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants