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

Add new --checkout-strategy flag #427

Merged
merged 4 commits into from
Jan 17, 2019
Merged

Add new --checkout-strategy flag #427

merged 4 commits into from
Jan 17, 2019

Conversation

lkysow
Copy link
Member

@lkysow lkysow commented Jan 15, 2019

This flag can be set to either branch (default) or merge. If set to
branch, we will check out the head branch of the pull request (the
source). If set to merge, we will check out the base branch of the pull
request (the destination) and then attempt to perform a git merge of the
pull request branch. This simulates what will happen if the pull request
is merged.

This allows us to perform terraform commands on what the state of the
repo will be after the pull request is merged. This is useful if users
are often opening up pull requests from branches that aren't up to date
with master. With the branch strategy, the terraform plan might be
deleting resources that have been created in the master branch but with
the merge strategy, we merge the branch's changes into the master branch
and so don't have this problem.

Notes:

This is needed in order to support the ability to check out the repo as
it would appear after the pull request is merged into the base branch.
@lkysow lkysow force-pushed the checkout-strategy branch from 10d3eac to 883aa79 Compare January 15, 2019 20:29
@codecov
Copy link

codecov bot commented Jan 15, 2019

Codecov Report

Merging #427 into master will increase coverage by 0.4%.
The diff coverage is 98.5%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #427     +/-   ##
=========================================
+ Coverage   70.32%   70.72%   +0.4%     
=========================================
  Files          63       63             
  Lines        3943     3987     +44     
=========================================
+ Hits         2773     2820     +47     
+ Misses        973      971      -2     
+ Partials      197      196      -1
Impacted Files Coverage Δ
server/events/models/models.go 89.61% <ø> (ø) ⬆️
server/user_config.go 100% <ø> (ø) ⬆️
server/events/runtime/run_step_runner.go 100% <100%> (ø) ⬆️
cmd/server.go 78.94% <100%> (+0.71%) ⬆️
server/server.go 66.4% <100%> (+0.13%) ⬆️
server/events/event_parser.go 87.97% <100%> (+0.35%) ⬆️
server/events/working_dir.go 84.14% <97.61%> (+17.47%) ⬆️
server/events/project_finder.go 91.35% <0%> (-2.47%) ⬇️

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 3b7542b...16a4946. Read the comment docs.

This flag can be set to either branch (default) or merge. If set to
branch, we will check out the head branch of the pull request (the
source). If set to merge, we will check out the base branch of the pull
request (the destination) and then attempt to perform a git merge of the
pull request branch. This simulates what will happen if the pull request
is merged.

This allows us to perform terraform commands on what the state of the
repo will be *after* the pull request is merged. This is useful if users
are often opening up pull requests from branches that aren't up to date
with master. With the branch strategy, the terraform plan might be
deleting resources that have been created in the master branch but with
the merge strategy, we merge the branch's changes into the master branch
and so don't have this problem.
Also disable test linters since we already run tests.
@lkysow lkysow force-pushed the checkout-strategy branch 2 times, most recently from 47aed11 to 3d1a7dd Compare January 16, 2019 23:27
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.

2 participants