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

fix(checkout-strategy): On merge strategy, reclone when necessary on base update #3187

Merged
merged 8 commits into from
Mar 25, 2023

Commits on Mar 3, 2023

  1. merge again if base branch has been updated

    The current "merge" checkout strategy is unsafe. It merges the PR and the base
    branch without holding the directory lock(s), so there is a potentially
    very long window where another PR can be applied and be unexpectedly reverted
    later.
    
    This happens occasionally if a PR causes plans in multiple directories, but
    is almost _guaranteed_ to happen if the initial plan has to wait until a
    lock is freed up and a manual "atlantis plan" command is given.
    
    Instead of printing a warning when this happens, we now merge again
    if necessary while holding the lock. Plans are then guaranteed to only
    be made when merged with the base branch for each directory being planned,
    and applying later should be safe even if the base branch sees further
    updates.
    
    This fixes/affects runatlantis#804, runatlantis#867, runatlantis#979
    finnag committed Mar 3, 2023
    Configuration menu
    Copy the full SHA
    2bb1442 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    66a6771 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3bdbf25 View commit details
    Browse the repository at this point in the history

Commits on Mar 11, 2023

  1. Configuration menu
    Copy the full SHA
    7fad72e View commit details
    Browse the repository at this point in the history

Commits on Mar 20, 2023

  1. Configuration menu
    Copy the full SHA
    e40cc54 View commit details
    Browse the repository at this point in the history

Commits on Mar 23, 2023

  1. Configuration menu
    Copy the full SHA
    2094383 View commit details
    Browse the repository at this point in the history

Commits on Mar 24, 2023

  1. Configuration menu
    Copy the full SHA
    f4c0f2c View commit details
    Browse the repository at this point in the history
  2. Extend TestClone_MasterHasDiverged to test new merging functionality

    We now verify that the first Clone with CheckoutMerge=true with
    a diverged base branch atually clones and merges again.
    finnag committed Mar 24, 2023
    Configuration menu
    Copy the full SHA
    50b3388 View commit details
    Browse the repository at this point in the history