Skip to content

Commit

Permalink
Debug retrieved comments
Browse files Browse the repository at this point in the history
  • Loading branch information
EnricoMi committed Jun 12, 2023
1 parent dca99f4 commit d480e2a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ jobs:
json_suite_details: true
json_test_case_results: true
report_suite_logs: "any"
log_level: DEBUG

- name: JSON output
uses: ./misc/action/json-output
Expand Down
11 changes: 9 additions & 2 deletions python/publish/publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,13 +705,20 @@ def get_base_commit_sha(self, pull_request: PullRequest) -> Optional[str]:

def get_pull_request_comments(self, pull: PullRequest, order_by_updated: bool) -> List[PullRequestComment]:
if order_by_updated:
return list(pull.get_comments(sort="updated_at", direction="asc"))
comments = list(pull.get_comments(sort="updated_at", direction="asc"))
else:
return list(pull.get_comments())
comments = list(pull.get_comments())
logger.debug(f'Found {len(comments)} comments for pull request {pull.number}')
for comment in comments:
logger.debug(f'comment: {comment}')
return comments

def get_action_comments(self, comments: List[PullRequestComment]):
comment_body_start = f'## {self._settings.comment_title}\n'
comment_body_indicators = ['\nresults for commit ', '\nResults for commit ']
for comment in comments:
logger.debug(f'login={comment.user.login}')
logger.debug(f'body={comment.body}')
return list([comment for comment in comments
if comment.user.login == self._settings.actor
and comment.body.startswith(comment_body_start)
Expand Down

0 comments on commit d480e2a

Please sign in to comment.