⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 280967 in webkit


Ignore:
Timestamp:
Aug 12, 2021, 8:23:37 AM (5 years ago)
Author:
Jonathan Bedard
Message:

[check-github-mirror-integrity] Differentiate between slow sync and collapsed commits
https://bugs.webkit.org/show_bug.cgi?id=229004
<rdar://problem/81795644>

Reviewed by Aakash Jain.

  • Scripts/check-github-mirror-integrity: Use commit timestamps to differentiate between a slow sync between svn.webkit.org

and GitHub and git-svn combining commits

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r280966 r280967  
     12021-08-12  Jonathan Bedard  <jbedard@apple.com>
     2
     3        [check-github-mirror-integrity] Differentiate between slow sync and collapsed commits
     4        https://bugs.webkit.org/show_bug.cgi?id=229004
     5        <rdar://problem/81795644>
     6
     7        Reviewed by Aakash Jain.
     8
     9        * Scripts/check-github-mirror-integrity: Use commit timestamps to differentiate between a slow sync between svn.webkit.org
     10        and GitHub and git-svn combining commits
     11
    1122021-08-12  Carlos Garcia Campos  <cgarcia@igalia.com>
    213
  • trunk/Tools/Scripts/check-github-mirror-integrity

    r280663 r280967  
    2828
    2929from webkitpy import webkitscmpy
     30from webkitcorepy.string_utils import pluralize
    3031from webkitscmpy import local, remote
     32
     33
     34SYNC_TIME_LIMIT = 5 * 60  # 5 minutes
    3135
    3236
     
    4549    canonical_tip = repository.commit(branch='trunk')
    4650
    47     if mirror_tip.identifier == canonical_tip.identifier:
     51    timestamps_equal = mirror_tip.timestamp == canonical_tip.timestamp
     52
     53    if timestamps_equal and mirror_tip.identifier == canonical_tip.identifier:
    4854        print('GitHub and svn.webkit.org are in sync')
    4955        print(f'HEAD commit on GitHub {mirror_tip} matches HEAD commit on svn.webkit.org {canonical_tip}')
    5056        return 0
    5157
    52     if time.time() >= canonical_tip.timestamp - 5 * 60 and mirror_tip.identifier == canonical_tip.identifier - 1:
    53         print('GitHub is 1 commit behind svn.webkit.org. This is ok.')
     58    if timestamps_equal and mirror_tip.identifier != canonical_tip.identifier:
     59        print('ERROR: GitHub and svn.webkit.org are out of sync')
     60        print(f'HEAD commit on GitHub {mirror_tip} out of sync with HEAD commit on svn.webkit.org {canonical_tip}')
     61        return 1
     62
     63    difference = canonical_tip.identifier - mirror_tip.identifier
     64    if time.time() < canonical_tip.timestamp + SYNC_TIME_LIMIT:
     65        print('GitHub is {} behind svn.webkit.org, but might be updating, This is ok.'.format(pluralize(difference, 'commit')))
    5466        print(f'HEAD commit on GitHub {mirror_tip} slightly behind HEAD commit on svn.webkit.org {canonical_tip}')
    5567        return 0
    5668
    57     print('ERROR: GitHub and svn.webkit.org are out of sync')
     69    print('ERROR: GitHub is not syncing from svn.webkit.org and is {} behind'.format(pluralize(difference, 'commit')))
    5870    print(f'HEAD commit on GitHub {mirror_tip} out of sync with HEAD commit on svn.webkit.org {canonical_tip}')
    59     print('This indicates a serious error with the repository, please inform admin@webkit.org urgently')
    6071    return 1
    6172
Note: See TracChangeset for help on using the changeset viewer.