XRAY-155957 - Print the violation link in the failing-policy logs - #1380
Open
Jordanh1996 wants to merge 1 commit into
Open
XRAY-155957 - Print the violation link in the failing-policy logs#1380Jordanh1996 wants to merge 1 commit into
Jordanh1996 wants to merge 1 commit into
Conversation
Jordanh1996
marked this pull request as draft
July 20, 2026 06:51
Jordanh1996
force-pushed
the
feature/XRAY-155957-log-violation-link
branch
from
July 20, 2026 07:01
b55c703 to
cc5cd08
Compare
Jordanh1996
force-pushed
the
feature/XRAY-155957-log-violation-link
branch
from
July 20, 2026 07:04
cc5cd08 to
87109f1
Compare
Frogbot logs the watch/policy/rule that failed a PR/build (XRAY-146332). This adds the violation link so a developer can click through from the log instead of searching for it in the UI. The link is the XRAY-147005 permalink. Its id is Violation.ViolationId, which already is the user_issue_id the endpoint resolves, so no extra call is needed. Nothing is printed when the violation id is missing or the Xray version predates the endpoint. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Jordanh1996
force-pushed
the
feature/XRAY-155957-log-violation-link
branch
from
July 20, 2026 07:19
87109f1 to
53dc7f5
Compare
Jordanh1996
marked this pull request as ready for review
July 20, 2026 12:28
| if baseUrl == "" || violationId == "" { | ||
| return "" | ||
| } | ||
| return baseUrl + "/ui/violations/" + violationId |
Collaborator
There was a problem hiding this comment.
please set "/ui/violations/" as a const
| for _, issue := range issuesFound { | ||
| lines = append(lines, " - "+issue.description) | ||
| if link := violationUiLink(baseUrl, issue.violationId); link != "" { | ||
| lines = append(lines, " Violation: "+link) |
Collaborator
There was a problem hiding this comment.
Suggested change
| lines = append(lines, " Violation: "+link) | |
| lines = append(lines, fmt.Sprintf(" Violation: ",link)) |
eranturgeman
approved these changes
Jul 21, 2026
eranturgeman
left a comment
Collaborator
There was a problem hiding this comment.
LGTM!
please make sure to revisit the issue of masked URL when kept as a secret (maybe we need to decide that when the URL is kept as a secret this feature is not available)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Frogbot logs the watch/policy/rule that failed a PR/build (XRAY-146332). This adds the violation link, so a developer can click through from the log instead of searching for it in the UI.
Violation.ViolationId, which already is theuser_issue_idthat endpoint resolves — no extra call.3.150.4(the endpoint's fix version); below it no link is printed.Test plan
go test ./utils/ ./utils/issues/scan-pull-requeston a PR with a fail-PR watch — links printed, both resolve 200 to their own violation🤖 Generated with Claude Code