Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion scripts/lib/review-ops.lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ forge_get_human_dismissals() {
| {
path: $thread.path,
line: $thread.line,
original_line: $thread.original_line,
resolved_by: $thread.resolved_by,
resolved_by_type: $thread.resolved_by_type,
resolved_by_role: $thread.resolved_by_role,
Expand Down
6 changes: 3 additions & 3 deletions scripts/post-review-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2852,8 +2852,8 @@ run_disposition_case "projection-dismissal-unverified-thread-mints" \
unset MOCK_REVIEW_THREADS_JSON MOCK_PR_AUTHOR

# GitLab dismissals use the authenticated review-token identity. A normal
# User author type is valid for PAT-backed review comments.
GITLAB_HUMAN_DISMISSAL_RESPONSE='{"threads":[{"is_resolved":true,"path":"src/foo.go","line":4,"original_line":3,"resolved_by":"alice","resolved_by_type":"User","resolved_by_role":"maintain","resolved_by_role_verified":true,"comments_truncated":false,"comments":[{"author":"review-bot","author_type":"User","body":"<!-- finding:f_human1 --> Logic issue."}]}],"truncated":false}'
# User author type is valid for PAT-backed removed-line review comments.
GITLAB_HUMAN_DISMISSAL_RESPONSE='{"threads":[{"is_resolved":true,"path":"src/foo.go","side":"left","line":4,"start_side":null,"start_line":null,"original_line":null,"original_start_line":null,"old_line":4,"new_line":null,"is_outdated":null,"resolved_by":"alice","resolved_by_type":"User","resolved_by_role":"maintain","resolved_by_role_verified":true,"comments_truncated":false,"comments":[{"author":"review-bot","author_type":"User","body":"<!-- finding:f_human1 --> Logic issue."}]}],"truncated":false}'
Comment thread
csoceanu marked this conversation as resolved.
Resolved
export MOCK_REVIEW_THREADS_RESPONSE="${GITLAB_HUMAN_DISMISSAL_RESPONSE}"
export MOCK_GITLAB_REVIEW_ACTOR="review-bot"
run_gitlab_disposition_case() {
Expand Down Expand Up @@ -2899,7 +2899,7 @@ run_gitlab_disposition_case "gitlab-dismissed-by-human-closes-by-id" \

# GitLab keeps the line a note was written on, so it cannot show the
# dismissed line is unchanged: a category rename there still mints.
MOCK_REVIEW_THREADS_RESPONSE="$(jq -c '.threads[0] |= (.path = "a.go" | .line = 10 | .comments[0].body = "<!-- finding:f_old --> Logic issue.")' <<< "${GITLAB_HUMAN_DISMISSAL_RESPONSE}")"
MOCK_REVIEW_THREADS_RESPONSE="$(jq -c '.threads[0] |= (.path = "a.go" | .line = 10 | .old_line = 10 | .comments[0].body = "<!-- finding:f_old --> Logic issue.")' <<< "${GITLAB_HUMAN_DISMISSAL_RESPONSE}")"
export MOCK_REVIEW_THREADS_RESPONSE
run_gitlab_disposition_case "gitlab-dismissal-category-change-mints" \
"$(redismiss_review a.go low)" "${REDISMISS_PRIOR}" "$(redismiss_minted a.go)"
Expand Down
1 change: 0 additions & 1 deletion scripts/post-review.sh
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,6 @@ forge_get_human_dismissals() {
| {
path: $thread.path,
line: $thread.line,
original_line: $thread.original_line,
resolved_by: $thread.resolved_by,
resolved_by_type: $thread.resolved_by_type,
resolved_by_role: $thread.resolved_by_role,
Expand Down
6 changes: 3 additions & 3 deletions scripts/pre-review-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ done
# GitLab uses the authenticated review-token identity as its trusted bot
# provider and the normalized resolver role from fullsend#7907.
GITLAB_HUMAN_PRIOR='{"version":2,"findings":[{"severity":"low","category":"logic-error","file":"src/foo.go","line":4,"id":"f_gitlab1"}],"dispositions":[{"id":"f_gitlab1","status":"open"}]}'
GITLAB_HUMAN_THREADS='{"threads":[{"is_resolved":true,"path":"src/foo.go","line":4,"original_line":3,"resolved_by":"alice","resolved_by_type":"User","resolved_by_role":"maintain","resolved_by_role_verified":true,"comments_truncated":false,"comments":[{"author":"review-bot","author_type":"Bot","author_role":"none","author_role_verified":false,"body":"<!-- finding:f_gitlab1 --> Logic issue.","created_at":"2026-10-08T10:00:00Z"}]}],"truncated":false}'
GITLAB_HUMAN_THREADS='{"threads":[{"is_resolved":true,"path":"src/foo.go","side":"right","line":4,"start_side":null,"start_line":null,"original_line":null,"original_start_line":null,"old_line":3,"new_line":4,"is_outdated":null,"resolved_by":"alice","resolved_by_type":"User","resolved_by_role":"maintain","resolved_by_role_verified":true,"comments_truncated":false,"comments":[{"author":"review-bot","author_type":"Bot","author_role":"none","author_role_verified":false,"body":"<!-- finding:f_gitlab1 --> Logic issue.","created_at":"2026-10-08T10:00:00Z"}]}],"truncated":false}'
gitlab_prior_file="${TMPDIR}/gitlab-human-prior.txt"
printf '%s\n' "$(projection_marker "${GITLAB_HUMAN_PRIOR}")" > "${gitlab_prior_file}"
gitlab_mock_bin="$(build_gitlab_mock "opened" "prauthor")"
Expand All @@ -1141,8 +1141,8 @@ else
fi

# GitLab PATs may belong to a normal User account. The authenticated /user
# identity is trusted on GitLab even when the discussion author type is User.
GITLAB_HUMAN_USER_THREADS="$(jq -c '.threads[0].comments[0].author_type = "User"' <<< "${GITLAB_HUMAN_THREADS}")"
# identity is trusted even for a removed-line discussion authored by a User.
GITLAB_HUMAN_USER_THREADS="$(jq -c '.threads[0] |= (.side = "left" | .old_line = 4 | .new_line = null | .comments[0].author_type = "User")' <<< "${GITLAB_HUMAN_THREADS}")"
gitlab_user_prior_file="${TMPDIR}/gitlab-human-user-prior.txt"
printf '%s\n' "$(projection_marker "${GITLAB_HUMAN_PRIOR}")" > "${gitlab_user_prior_file}"
if ! env \
Expand Down
1 change: 0 additions & 1 deletion scripts/pre-review.sh
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,6 @@ forge_get_human_dismissals() {
| {
path: $thread.path,
line: $thread.line,
original_line: $thread.original_line,
resolved_by: $thread.resolved_by,
resolved_by_type: $thread.resolved_by_type,
resolved_by_role: $thread.resolved_by_role,
Expand Down
Loading