Skip to content

Add support for handling of snippet code#1054

Merged
attiasas merged 11 commits intojfrog:v3_erfrom
talz:feature/snippet-code-decoration
Mar 4, 2026
Merged

Add support for handling of snippet code#1054
attiasas merged 11 commits intojfrog:v3_erfrom
talz:feature/snippet-code-decoration

Conversation

@talz
Copy link

@talz talz commented Feb 12, 2026

Depends on:

Add snippet code decoration to PR review comments

Summary

Add support for displaying public code snippet detections as inline review comments on pull requests. When license violations are identified as originating from copied public code snippets, Frogbot now generates review comments highlighting the affected lines with links to the original source and a table of associated license violations.

Changes

  • New SnippetComment review comment type (utils/comment.go): Processes license violations where ImpactedDependencyVersion == "snippet", groups them by file and line, parses GitHub-style #L<start>-L<end> fragments from external reference URLs to determine the snippet span, and generates positioned review comments.
  • Snippet review content generation (utils/outputwriter/outputcontent.go): New SnippetReviewContent() produces markdown content with a title, links to external source references, and a severity/license/watch/policies table.
  • Environment-gated snippet detection (utils/scandetails.go): Reads SnippetDetectionEnvVariable to conditionally enable snippet detection and passes the flag to CreateAuditResultsContext().
  • Dependency update (go.mod, go.sum): Bumped jfrog-cli-security to v1.26.3; moved jfrog-cli-artifactory to indirect.

Checklist

  • All tests passed. If this feature is not already covered by the tests, I added new tests.
  • This pull request is on the dev branch.
  • I used gofmt for formatting the code before submitting the pull request.
  • Update documentation about new features / new supported technologies

Notes

  • Snippet detection is opt-in via the JFROG_XRAY_SNIPPET_SCAN_ENABLE environment variable.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 12, 2026


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


1 out of 2 committers have signed the CLA.
✅ (attiasas)[https://github.com/attiasas]
@tal Zarfati
Tal Zarfati seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@attiasas attiasas added safe to test Approve running integration tests on a pull request new feature Automatically generated release notes labels Feb 26, 2026
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Feb 26, 2026
@attiasas attiasas requested a review from a team March 4, 2026 07:53
@attiasas attiasas added safe to test Approve running integration tests on a pull request ignore for release Automatically generated release notes and removed new feature Automatically generated release notes labels Mar 4, 2026
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Mar 4, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

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


Copy link
Contributor

@attiasas attiasas left a comment

Choose a reason for hiding this comment

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

LGTM

@attiasas attiasas merged commit f0ec429 into jfrog:v3_er Mar 4, 2026
26 of 45 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