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

ci: fix checkout action to checkout branch at current state #55

Merged
merged 1 commit into from
Jul 1, 2020

Conversation

wschurman
Copy link
Member

Why

I just wasted ~2 hours on this, so I bet it'll affect others as well.

  1. Create branch A at base T, add some commits, create PR(A). See checkout passes and no conflicts.
  2. Create branch B at base T, add some commits that create logical conflict with branch A, create PR(B). See checkout passes and no conflicts.
  3. Land PR(B) into master.
  4. Push additional commit only changing comments to branch A to address comments on PR(A). See that the build is now failing in CI. Run the build locally on branch A and see that it is passing. Waste 2 hours only to find out that instead of running the build on branch A as is represented in PR(A), the "checkout" action doesn't actually "checkout" branch. Instead it creates a merge commit of all the commits on the branch into the current state of the destination branch, which is super non-obvious and not the matching behavior of CircleCI or other CI platforms which checkout the branch ref. The action should be called "checkout-base-and-create-merge-commit".

actions/checkout#27

Adding @nicknovitski as reviewer since he probably is most familiar with how this could affect us in other places that use GH actions.

How

https://github.com/actions/checkout#Checkout-pull-request-HEAD-commit-instead-of-merge-commit

Test Plan

Wait for build.

@codecov
Copy link

codecov bot commented Jun 30, 2020

Codecov Report

Merging #55 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #55   +/-   ##
=======================================
  Coverage   93.95%   93.95%           
=======================================
  Files          57       57           
  Lines        1357     1357           
  Branches      147      147           
=======================================
  Hits         1275     1275           
  Misses         81       81           
  Partials        1        1           
Flag Coverage Δ
#integration 93.95% <ø> (ø)
#unittest 93.95% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 89cfb3d...21380c6. Read the comment docs.

Copy link

@jkhales jkhales left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very weird and not obvious.

@wschurman wschurman merged commit ccbdbc4 into master Jul 1, 2020
@wschurman wschurman deleted the @wschurman/fix-checkout-action branch July 1, 2020 17:45
@mcg1969
Copy link

mcg1969 commented Aug 27, 2020

Glad to find this after some googling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants