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

Implement get_commit_comment method and refactor CommitComment #865

Merged

Conversation

lbarcziova
Copy link
Member

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

Make the CommitComment inherit from Comment directly to
share the common functionality (e.g. adding emojis).
Copy link
Contributor

Returns:
Object representing the commit comment.
"""
raise NotImplementedError()
Copy link
Member

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,
Copy link
Member

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]:
Copy link
Member

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:
Copy link
Member

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.")
Copy link
Member

Choose a reason for hiding this comment

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

@lbarcziova lbarcziova added the mergeit When set, zuul wil gate and merge the PR. label Oct 22, 2024
Copy link
Contributor

Build succeeded (gate pipeline).
https://softwarefactory-project.io/zuul/t/packit-service/buildset/b7b6225edd544f8abe92795ee58766b0

✔️ pre-commit SUCCESS in 2m 44s

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit b589984 into packit:main Oct 22, 2024
30 checks passed
@lbarcziova lbarcziova deleted the get-commit-comment branch October 22, 2024 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mergeit When set, zuul wil gate and merge the PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants