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

Resolve simultaneous deployments with rebase #1054

Merged
merged 14 commits into from Apr 4, 2022
Merged

Resolve simultaneous deployments with rebase #1054

merged 14 commits into from Apr 4, 2022

Commits on Mar 6, 2022

  1. Return early from dry run

    Determining whether to create a merge commit would elicit a nested
    conditional, which could be hard to parse for a human reader. This is
    avoided by returning early as soon as possible for a dry run.
    
    This also resolves the erroneous 'changes committed' message when no
    changes were actually committed because of the dry run. A message
    specific to dry-run is logged instead.
    rossjrw committed Mar 6, 2022
    Copy the full SHA
    2fd4ec1 View commit details
    Browse the repository at this point in the history

Commits on Mar 7, 2022

  1. Add force parameter to action interface

    Existing behaviour is equivalent to force=true, so the default value is
    true.
    rossjrw committed Mar 7, 2022
    Copy the full SHA
    195bb64 View commit details
    Browse the repository at this point in the history

Commits on Mar 8, 2022

  1. Copy the full SHA
    50ec836 View commit details
    Browse the repository at this point in the history

Commits on Mar 9, 2022

  1. Copy the full SHA
    1a57670 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    451d4b5 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    81ec18c View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    8fc8cde View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    bfda3cd View commit details
    Browse the repository at this point in the history
  6. Copy the full SHA
    37d5e1e View commit details
    Browse the repository at this point in the history
  7. Explicitly bind incoming branch

    I think the fetch will update the origin/gh-pages branch but not the
    gh-pages branch, despite requesting gh-pages. This means that when I
    later attempt to rebase the temp branch on top of the gh-pages branch,
    there will be nothing to do, because that's already where it is.
    rossjrw committed Mar 9, 2022
    Copy the full SHA
    f1e9c66 View commit details
    Browse the repository at this point in the history
  8. Implement attempt limit

    I don't expect this to ever require more than one attempt in production,
    but in theory it's possible that this procedure could loop forever.
    
    We would need to keep fetching and rebasing if changes keep being added
    to the remote. In practice, I believe this would only happen if there
    are lots of workflows simultaneously deploying to the same branch, all
    using this action. In this case only one would be able to secure a lock
    at a time, leading to the total number of attempts being equal to the
    number of simultaneous deployments, assuming each deployment makes each
    attempt at the exact same time.
    
    The limit may need to be increased or even be configurable, but 3 should
    cover most uses.
    rossjrw committed Mar 9, 2022
    Copy the full SHA
    4671cb9 View commit details
    Browse the repository at this point in the history

Commits on Mar 10, 2022

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

Commits on Mar 24, 2022

  1. Document 'force' parameter

    rossjrw committed Mar 24, 2022
    Copy the full SHA
    507eec6 View commit details
    Browse the repository at this point in the history
  2. Create integration test for rebase procedure

    This test is composed of 3 jobs.
    
    The first two jobs run simultaneously, and as such both depend on the
    previous integration test only. The final job cleans up afterwards, and
    depends on both of the prior jobs.
    
    The two jobs are identical except that they both create a temporary file
    in a different location. This is to ensure that they conflict. Correctly
    resolving this conflict by rebasing one deployment over the other,
    resulting in a deployment containing both files, indicates a successful
    test.
    rossjrw committed Mar 24, 2022
    Copy the full SHA
    a0fbdd6 View commit details
    Browse the repository at this point in the history