Skip to content

Pick correct diff baseline when multiple technologies share a path Summary#724

Open
attiasas wants to merge 3 commits intojfrog:devfrom
attiasas:fix_dif_multi_target_same_path
Open

Pick correct diff baseline when multiple technologies share a path Summary#724
attiasas wants to merge 3 commits intojfrog:devfrom
attiasas:fix_dif_multi_target_same_path

Conversation

@attiasas
Copy link
Copy Markdown
Collaborator

  • 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 ./....
  • All static analysis checks passed.
  • All tests have passed. If this feature is not already covered by the tests, new tests have been added.
  • Updated the Contributing page / ReadMe page / CI Workflow files if needed.
  • All changes are detailed at the description. if not already covered at JFrog Documentation, new documentation have been added.

fix(audit): pick correct diff baseline when multiple technologies share a path

Summary

In audit diff mode, baseline scan results were matched by relative path only. When two technologies scanned the same directory (same absolute path, empty relative key), the wrong baseline could be chosen depending on iteration order. Matching now also considers the current target’s technology (with legacy behavior preserved when technology is unset).

Changes

  • Extend SearchTargetResultsByRelativePath to accept technology and filter candidates via targetMatchesTechnologyForDiffCompare (utils/results/common.go).
  • Thread targetResult.Technology through audit diff comparison and JAS GetResultsToCompareByRelativePath (commands/audit/audit.go, jas/common.go).
  • Tests: same-directory npm vs poetry disambiguation, reversed slice order, and NoTech baseline compatibility (utils/results/common_test.go, jas/common_test.go).

Notes

  • When technology is NoTech, behavior matches the previous path-only matching.

@attiasas attiasas requested a review from a team April 12, 2026 08:35
@attiasas attiasas added bug Something isn't working safe to test Approve running integration tests on a pull request labels Apr 12, 2026
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Apr 12, 2026
@attiasas attiasas added the safe to test Approve running integration tests on a pull request label Apr 12, 2026
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Apr 12, 2026
@attiasas attiasas changed the title Pick right target in Diff mode where multi target on same path pick correct diff baseline when multiple technologies share a path Summary Apr 12, 2026
@attiasas attiasas changed the title pick correct diff baseline when multiple technologies share a path Summary Pick correct diff baseline when multiple technologies share a path Summary Apr 12, 2026
@attiasas attiasas added the safe to test Approve running integration tests on a pull request label Apr 13, 2026
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Apr 13, 2026
@github-actions
Copy link
Copy Markdown

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


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.

1 participant