Description
From cms-sw/cmssw#47546 (comment)
Reconstruction:
- At 2025-03-10 15:22:50 (GMT), two commits were created: cms-sw/cmssw@e175131 and cms-sw/cmssw@37096f4.
- Bot marked cms-sw/cmssw@e175131 as latest one (based on the order in which github api returns commits).
- Signing comment was assigned to that commit.
- Later, when force-push happened, the order in which we iterate over commits (before sorting them by timestamp) changed, and cms-sw/cmssw@37096f4 was considered as happening later than cms-sw/cmssw@e175131, and thus signing comment was attributed to commit cms-sw/cmssw@37096f4 .
- This didn't match cached information and signature was ignored:
WARNING: Comment 2711782634, cached commit cms-sw/cmssw@e175131 doesn't match the present commit cms-sw/cmssw@37096f4. This comment will be ignored.
Why the order has changed:
When processing a PR, the bot first collects all commits (as returned by github, sorted by time descending) into a list, then appends any "missing" (squashed) commits from cache, then sorts that list by timestamp. The timestamps we get from GitHub API have a precision of 1s. Since commit cms-sw/cmssw@e175131 was squashed, it was added to the end of the list, so from bot's point of view it now happened earlier than cms-sw/cmssw@37096f4 .
Fix
To be discussed. We need a better sorting key than (or in addition to) timestamp - e.g. base64-decoded own internal counter (that must be saved to bot cache)?node_id
returned by github, or our