Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PullRequestCommenter provider trait #5188

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JAORMX
Copy link
Contributor

@JAORMX JAORMX commented Dec 12, 2024

Summary

This allows for providers to comment on pull requests

Change Type

Mark the type of change your PR introduces:

  • Bug fix (resolves an issue without affecting existing features)
  • Feature (adds new functionality without breaking changes)
  • Breaking change (may impact existing functionalities or require documentation updates)
  • Documentation (updates or additions to documentation)
  • Refactoring or test improvements (no bug fixes or new functionality)

Testing

Outline how the changes were tested, including steps to reproduce and any relevant configurations.
Attach screenshots if helpful.

Review Checklist:

  • Reviewed my own code for quality and clarity.
  • Added comments to complex or tricky code sections.
  • Updated any affected documentation.
  • Included tests that validate the fix or feature.
  • Checked that related changes are merged.

@JAORMX JAORMX requested a review from a team as a code owner December 12, 2024 13:18
@JAORMX JAORMX force-pushed the pr-commenter branch 2 times, most recently from 75ccc33 to 6cb2cd9 Compare December 13, 2024 12:18
rdimitrov
rdimitrov previously approved these changes Dec 13, 2024
Copy link
Member

@rdimitrov rdimitrov left a comment

Choose a reason for hiding this comment

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

looks good 👍

@rdimitrov
Copy link
Member

@JAORMX - oops, CI seems quite red

@JAORMX JAORMX force-pushed the pr-commenter branch 2 times, most recently from 71abfd7 to 386fb02 Compare December 16, 2024 12:58
@JAORMX JAORMX marked this pull request as draft December 16, 2024 12:58
ctx context.Context, owner, repoName string, prNum int64, authorizedUser int64,
) (magicCommentInfo, error) {
// TODO: overflow
comments, _, err := c.client.Issues.ListComments(ctx, owner, repoName, int(prNum),

Check failure

Code scanning / CodeQL

Incorrect conversion between integer types High

Incorrect conversion of a signed 64-bit integer from
strconv.ParseInt
to a lower bit size type int without an upper bound check.
Incorrect conversion of a signed 64-bit integer from
strconv.ParseInt
to a lower bit size type int without an upper bound check.
internal/providers/github/commenter.go Fixed Show fixed Hide fixed
internal/providers/github/commenter.go Fixed Show fixed Hide fixed
}

// TODO: overflow
_, err := c.DismissReview(ctx, owner, repoName, int(prNumber), mci.ReviewID, dismissReview)

Check failure

Code scanning / CodeQL

Incorrect conversion between integer types High

Incorrect conversion of a signed 64-bit integer from
strconv.ParseInt
to a lower bit size type int without an upper bound check.
Incorrect conversion of a signed 64-bit integer from
strconv.ParseInt
to a lower bit size type int without an upper bound check.
internal/providers/github/common.go Fixed Show fixed Hide fixed
This allows for providers to comment on pull requests

Signed-off-by: Juan Antonio Osorio <[email protected]>

ic, err := c.CreateIssueComment(ctx, owner, repoName,
// TODO: overflow
int(prNumber), body)

Check failure

Code scanning / CodeQL

Incorrect conversion between integer types High

Incorrect conversion of a signed 64-bit integer from
strconv.ParseInt
to a lower bit size type int without an upper bound check.
Incorrect conversion of a signed 64-bit integer from
strconv.ParseInt
to a lower bit size type int without an upper bound check.
}

// TODO: overflow
r, err := c.CreateReview(ctx, owner, repoName, int(prNumber), review)

Check failure

Code scanning / CodeQL

Incorrect conversion between integer types High

Incorrect conversion of a signed 64-bit integer from
strconv.ParseInt
to a lower bit size type int without an upper bound check.
Incorrect conversion of a signed 64-bit integer from
strconv.ParseInt
to a lower bit size type int without an upper bound check.
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.

2 participants