Skip to content

XRAY-139364 - Automatically set VSC properties on uploaded artifacts#467

Closed
attiasas wants to merge 12 commits into
jfrog:mainfrom
attiasas:add_artifacts_git_info
Closed

XRAY-139364 - Automatically set VSC properties on uploaded artifacts#467
attiasas wants to merge 12 commits into
jfrog:mainfrom
attiasas:add_artifacts_git_info

Conversation

@attiasas
Copy link
Copy Markdown

@attiasas attiasas commented May 31, 2026

feat(artifactory): attach local git VCS properties to published artifacts (XRAY-139364)

Following:

Summary

Extends artifact VCS property collection beyond CI environment variables. When CI VCS props are missing or incomplete, the CLI now discovers local git metadata (vcs.url, vcs.revision, vcs.branch) from the working directory and attaches it to artifacts during upload/publish flows. User-provided properties still take precedence over both CI and local git values.

Changes

  • Core VCS utilities (artifactory/utils/civcs/):
    • Add localvcs.go with local git discovery via upstream .git search
    • Add MergeWithUserAndDetectedProps and SetVcsPropsToConfig with precedence: user props > CI props > local git props
    • Refactor VCS property keys to shared constants; add DeriveSearchDirFromUploadPattern for upload pattern resolution
  • artifactory/utils/vcs.go: Add GetDotGitFromDir to locate a git repo root from a given directory
  • Publish/upload commands wired to local VCS fallback:
    • rt upload (generic upload)
    • rt bp (buildinfo publish)
    • Docker push/publish (OCI container)
    • Helm push, Conan upload, Python twine/uv, Hugging Face upload, Nix copy
    • Flexpack (Gradle/Maven), npm/pnpm publish, Go publish, Terraform publish
    • Gradle/Maven extractors via SetVcsPropsToConfig
  • Tests: New/updated unit tests across civcs, generic upload, buildinfo publish, npm, pnpm, terraform, conan, and per-command VCS smoke tests (helm, nix, flexpack, huggingface, python twine, docker build)

Testing

  • All tests passed for affected packages:
    go test ./artifactory/utils/... ./artifactory/commands/buildinfo/... \
      ./artifactory/commands/conan/... ./artifactory/commands/flexpack/... \
      ./artifactory/commands/helm/... ./artifactory/commands/huggingface/... \
      ./artifactory/commands/nix/... ./artifactory/commands/npm/... \
      ./artifactory/commands/ocicontainer/... ./artifactory/commands/pnpm/... \
      ./artifactory/commands/python/... ./artifactory/commands/terraform/... -count=1

@attiasas attiasas changed the title Add artifacts git info XRAY-139364 - Attach local git VCS properties to published artifacts May 31, 2026
@attiasas attiasas changed the title XRAY-139364 - Attach local git VCS properties to published artifacts XRAY-139364 - Automatically set VSC properties on uploaded artifacts May 31, 2026
@attiasas
Copy link
Copy Markdown
Author

attiasas commented Jun 7, 2026

continue at: #484

@attiasas attiasas closed this Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant