Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Size reports: Fix stale-commit determination #11483

Merged
merged 1 commit into from
Nov 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions scripts/tools/memory/gh_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,9 +491,10 @@ def gh_send_change_report(db: SizeDatabase, df: pd.DataFrame) -> bool:
# Check the most recent commit on the PR, so that we don't comment on
# builds that are already outdated.
commit = df.attrs['commit']
commits = sorted(gh_get_commits_for_pr(db.gh, pr),
key=lambda c: c.commit.committer.date,
reverse=True)
commits = sorted(
gh_get_commits_for_pr(db.gh, pr),
key=lambda c: f'{c.commit.committer.date}{c.commit.author.date}',
reverse=True)
if commits and commit != commits[0].sha:
logging.info('SCS: PR #%s: not commenting for stale %s; newest is %s',
pr, commit, commits[0].sha)
Expand Down