-
Notifications
You must be signed in to change notification settings - Fork 55
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
Implement get_commit_comment method and refactor CommitComment #865
Implement get_commit_comment method and refactor CommitComment #865
Conversation
Make the CommitComment inherit from Comment directly to share the common functionality (e.g. adding emojis).
Build succeeded. ✔️ pre-commit SUCCESS in 2m 33s |
Returns: | ||
Object representing the commit comment. | ||
""" | ||
raise NotImplementedError() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ya… this should be an abstract class, it would've been much easier to see unimplemented methods and missing functionality (e.g., on Pagure' side), but that sounds more like a Friday thing than including this in here…
raw_comment: Union[ | ||
_GithubIssueComment, | ||
_GithubPullRequestComment, | ||
_GithubCommitComment, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so the properties will work as they should? 👀 nice!
self._raw_comment.body = new_body | ||
self._raw_comment.save() | ||
|
||
def get_reactions(self) -> list[Reaction]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh shoot
@@ -313,6 +313,38 @@ def get_commit_comments(self, commit: str) -> list[CommitComment]: | |||
for comment in commit_object.comments.list() | |||
] | |||
|
|||
def get_commit_comment(self, commit_sha: str, comment_id: int) -> CommitComment: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what's the library for, if we need to do all the dirty work anyways…
@@ -482,6 +482,9 @@ def commit_comment( | |||
def get_commit_comments(self, commit: str) -> list[CommitComment]: | |||
raise OperationNotSupported("Commit comments are not supported on Pagure.") | |||
|
|||
def get_commit_comment(self, commit_sha: str, comment_id: int) -> CommitComment: | |||
raise OperationNotSupported("Commit comments are not supported on Pagure.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…
Build succeeded (gate pipeline). ✔️ pre-commit SUCCESS in 2m 44s |
b589984
into
packit:main
Make the CommitComment inherit from Comment directly to share the common functionality (e.g. adding emojis).
Needed for packit/packit-service#2589
RELEASE NOTES BEGIN
There is a new method for getting a single commit comment, supporting also retrieval and adding reactions in GitHub.
RELEASE NOTES END