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

git v2 client: keep the primary clone up to date #30520

Merged
merged 2 commits into from
Aug 26, 2023

Commits on Aug 26, 2023

  1. git v2 client: teach git interactor to fetch exact commit SHAs

    Move the low-level git logic in ensureCommits() into a new
    FetchCommits() method in the git interactor, because that's where
    low-level git interactions belong.
    Linus Arver committed Aug 26, 2023
    Configuration menu
    Copy the full SHA
    df1280a View commit details
    Browse the repository at this point in the history
  2. git v2 client: keep the primary clone up to date

    The primary clone can get "stale" if it doesn't keep up with the changes
    going into the upstream remote. Staleness can result in a performance
    penalty for EnsureFreshSecondary(), because it would need to fetch more
    objects to get to the commit SHAs specified in repoOpts.FetchCommits.
    
    Git clients that are not using `repoOpts.FetchCommits` cannot get
    stale, because they invoke the (expensive) RemoteUpdate() call on the
    primary clone which fetches all refs. However, the primary clones for
    inrepoconfigs can indeed get stale because it uses
    `repoOpts.FetchCommits` to do targeted fetches only for the secondary
    clone since bdd601c (git v2 client for inrepoconfig: allow targeted
    fetches (2nd attempt), 2023-08-22).
    
    Allow updating the primary clone with a new PrimaryCloneUpdateCommits
    field to periodically update the primary clone with new commits. For
    inrepoconfigs, we only specify the baseSHA because it may be that the
    headSHAs never get merged into the base (perhaps the PR gets rejected or
    abandoned).
    Linus Arver committed Aug 26, 2023
    Configuration menu
    Copy the full SHA
    e46df0a View commit details
    Browse the repository at this point in the history