Lines Matching full:pr

5 # Script that operates on a merged PR and sends data to elasticsearch for
6 # further insepctions using the PR dashboard at
40 def process_pr(pr): argument
41 reviews = pr.get_reviews()
42 …print(f'#{pr.number}: {pr.title} - {pr.comments} Comments, reviews: {reviews.totalCount}, {len(pr.…
48 for label in pr.labels:
57 for assignee in pr.assignees:
63 if assignee_reviews > 0 or pr.merged_by.login in assignees:
64 # in case of assignee reviews or if PR was merged by an assignee
66 elif not pr.assignees or \
67 (pr.user.login in assignees and len(assignees) == 1) or \
77 created = pr.created_at
78 # if a PR was made ready for review from draft, calculate based on when it
80 for event in pr.get_issue_events():
84 # calculate time the PR was in review, hours and business days.
85 delta = pr.closed_at - created
89 dates = (created + timedelta(idx + 1) for idx in range((pr.closed_at - created).days))
109 prj['nr'] = pr.number
110 prj['url'] = pr.url
111 prj['title'] = pr.title
112 prj['comments'] = pr.comments
115 prj['updated'] = pr.updated_at.strftime("%Y-%m-%d %H:%M:%S")
116 prj['created'] = pr.created_at.strftime("%Y-%m-%d %H:%M:%S")
117 prj['closed'] = pr.closed_at.strftime("%Y-%m-%d %H:%M:%S")
118 prj['merged_by'] = pr.merged_by.login
119 prj['submitted_by'] = pr.user.login
120 prj['changed_files'] = pr.changed_files
121 prj['additions'] = pr.additions
122 prj['deletions'] = pr.deletions
123 prj['commits'] = pr.commits
125 prj['base'] = pr.base.ref
145 pr = gh_repo.get_pull(args.pull_request)
146 prj = process_pr(pr)
149 query = f'repo:{args.repo} merged:{args.range} is:pr is:closed sort:updated-desc base:main'
152 pr = gh_repo.get_pull(_pr.number)
153 prj = process_pr(pr)