Function
hide_comment
(
github: GithubApi,
comment: TerraformComment,
classifier: str
)
Source from the content-addressed store, hash-verified
| 385 | return new_comment |
| 386 | |
| 387 | def hide_comment( |
| 388 | github: GithubApi, |
| 389 | comment: TerraformComment, |
| 390 | classifier: str |
| 391 | ) -> None: |
| 392 | |
| 393 | if comment.node_id is None: |
| 394 | debug('Comment has unknown node_id - not hiding') |
| 395 | return |
| 396 | |
| 397 | graphql_url = os.environ.get('GITHUB_GRAPHQL_URL', f'{os.environ["GITHUB_API_URL"]}/graphql') |
| 398 | |
| 399 | response = github.post( |
| 400 | graphql_url, json={ |
| 401 | 'query': ''' |
| 402 | mutation { |
| 403 | minimizeComment(input: {subjectId: "''' + comment.node_id + '''", classifier: ''' + classifier + '''}) { |
| 404 | clientMutationId |
| 405 | } |
| 406 | } |
| 407 | ''' |
| 408 | } |
| 409 | ) |
| 410 | debug(f'graphql response: {response.content}') |
Tested by
no test coverage detected