Skip to content

Add PR comment, reaction and user permission commands (superseded by #16) - #15

Closed
Andrey Hura (andrey-hura) wants to merge 1 commit into
mainfrom
andrey-hura/SUB-1084/pr-comment-commands
Closed

Andrey Hura (andrey-hura) wants to merge 1 commit into
mainfrom
andrey-hura/SUB-1084/pr-comment-commands

Conversation

@andrey-hura

@andrey-hura Andrey Hura (andrey-hura) commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

No description provided.

Add three commands so a pipeline triggered by a pull request comment can
talk back to the PR:

- upsertPrComment: create a PR comment, or with COMMENT_MARKER update the
  latest comment the token owner posted with the same hidden marker.
  The body can come from COMMENT_BODY or COMMENT_BODY_FILE.
- addReaction: add an emoji reaction to a PR/issue comment.
- getUserPermission: report a user's repository permission and whether
  it includes write access (unknown users are reported as none).

Add unit tests against a local fake GitHub API, a CI workflow that runs
gofmt, go vet and go test, and document every command in the README,
including the previously undocumented AddPullRequestLabels,
waitForStatus and getRef.
@andrey-hura Andrey Hura (andrey-hura) changed the title [SUB-1084] Add PR comment, reaction and user permission commands Add PR comment, reaction and user permission commands (superseded by #16) Nov 2, 2026
@andrey-hura
Andrey Hura (andrey-hura) deleted the andrey-hura/SUB-1084/pr-comment-commands branch November 2, 2026 14:51

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit d1f2852. Configure here.

Comment thread comments.go
func resolveCommentBody(body string, bodyFile string) string {
if bodyFile == "" {
return body
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Null settings treated as real values

Medium Severity

Unset Harness plugin settings can arrive as the string null, which createPullRequest already treats as empty for PR_LABELS. resolveCommentBody only treats an empty COMMENT_BODY_FILE as omitted, so a step that only sets COMMENT_BODY can try to read a file named null and fail. The same value for COMMENT_MARKER is treated as a real marker.

Suggested change
}
if bodyFile == "" || bodyFile == "null" {
return body
}
Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d1f2852. Configure here.

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