Skip to content

Do not throw error on review comments#48

Merged
orta merged 1 commit intoOSS-Docs-Tools:masterfrom
hyperupcall:hyperupcall-hyperupcall-review-comments-errors
Mar 23, 2025
Merged

Do not throw error on review comments#48
orta merged 1 commit intoOSS-Docs-Tools:masterfrom
hyperupcall:hyperupcall-hyperupcall-review-comments-errors

Conversation

@hyperupcall
Copy link
Copy Markdown
Contributor

When adding comments under a review, the action would previously throw an error due to a null body.

Tried looking for the body, but as mentioned in #35, the body of pull request review comments doesn't seem to be documented. The event payload seems to have a review property, but it seems to be associated with the overall review rather than a particular review comment.

review: {
    _links: { html: [Object], pull_request: [Object] },
    author_association: 'MEMBER',
    body: null,
    commit_id: '58e4709c661af8de19e52af500d6808ff0a0504f',
    html_url: 'https://github.com/SchemaStore/schemastore/pull/4587#pullrequestreview-2705553345',
    id: 2705553345,
    node_id: 'PRR_kwDOAZi2O86hQ3fB',
    pull_request_url: 'https://api.github.com/repos/SchemaStore/schemastore/pulls/4587',
    state: 'commented',
    submitted_at: '2025-03-21T11:09:40Z',
    user: {

If one truly needed this feature, somebody could iterate through pulls.listReviewComments for the current PR, and compare it's update_at property with the current review comment's submitted_at property. Although, of course it would lead to bad results if two people comment within the same second. Property values may also be unexpected when updating comments.

For now, simply set body so that no crashes occur.

@orta
Copy link
Copy Markdown
Collaborator

orta commented Mar 23, 2025

Yeah, this looks good to me 👍🏻

@orta orta merged commit 6b14e5e into OSS-Docs-Tools:master Mar 23, 2025
2 checks passed
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