Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoblee93 committed Feb 20, 2024
1 parent d92e536 commit 2c551f8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/actions/people/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,10 @@ def get_graphql_response(


def get_graphql_pr_edges(*, settings: Settings, after: Union[str, None] = None):
if after is None:
print("Querying PRs...")
else:
print(f"Querying PRs with cursor {after}...")
data = get_graphql_response(
settings=settings,
query=prs_query,
Expand Down Expand Up @@ -471,8 +475,8 @@ def get_contributors(settings: Settings):
lines_changed = pr.additions + pr.deletions
score = _logistic(files_changed, 20) + _logistic(lines_changed, 100)
contributor_scores[pr.author.login] += score
three_months_ago = (datetime.now(timezone.utc) - timedelta(days=6*30))
if datetime.fromisoformat(pr.createdAt) > three_months_ago:
three_months_ago = (datetime.now(timezone.utc) - timedelta(days=3*30))
if pr.createdAt is not None and datetime.fromisoformat(pr.createdAt) > three_months_ago:
recent_contributor_scores[pr.author.login] += score
return contributors, contributor_scores, recent_contributor_scores, reviewers, authors

Expand Down

0 comments on commit 2c551f8

Please sign in to comment.