flash_flow 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fe6bb7d56503c667baeff6630b04a356c2c1959e
4
- data.tar.gz: cfb7c8792b7556c2bf54e4e47c8fd28d19af9aef
3
+ metadata.gz: 27e0ad4e0bdac4c870699435930fec56da8d1e6f
4
+ data.tar.gz: 81f782e7022f09c4814f6488f387767df0c7e042
5
5
  SHA512:
6
- metadata.gz: dbfe4f236e252efbc73a80607302945aeea1043a41de8fe35eecc10ceae14ec3933d6b6068067753a3f4c9d0b81083a4aac8fc90d885182a71073641c1f8b943
7
- data.tar.gz: 116c96cfea5b0977a52250740e3dafc27e576952b4926ccda14976dbee1c90d700a0e59f89ff08ab3c3ec4f6653af0312f49ae0aa959a8d98f6f90cbf09021de
6
+ metadata.gz: 7e7c38d6703b872e27d45202122a2e747a1fa9aca61ae80937c78cea2b932dee0587eaa963b8a09ac3a986f70aca121c6142970b67808c6bfbb335afddadc480
7
+ data.tar.gz: f83076ce192c2bb9987c883e10a6ea1e91be261bfc6c7b6b1f5cf78c3ad9b14433bd25a849ec5412a6ee70e7e9dfff9613ac4743f37ed84d7f443222fe2b7d9a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- flash_flow (1.1.1)
4
+ flash_flow (1.1.2)
5
5
  hipchat
6
6
  octokit
7
7
  pivotal-tracker
data/README.md CHANGED
@@ -36,14 +36,16 @@ What that will do (once your application is properly configured) is:
36
36
  3. Get your list of pull requests from github (or use the saved list, more on that later)
37
37
  4. Filter out any "removed" branches
38
38
  5. Merge the rest into the newly created `merge_branch`
39
- 6. Force push the `merge_branch` to the `merge_remote`
39
+ 6. Push the `merge_branch` to the `merge_remote`
40
+ 7. The `merge_branch` is now a merge of your master branch plus all of your pull requests.
40
41
 
41
42
  ### Notes
42
43
 
43
44
  1. Step 1 will not push your branch if you're on either the `merge_branch` or `master_branch`, but it will
44
45
  still merge all the other branches and push the result.
45
- 2. flash_flow uses your local git repo. It resets everything back to the branch you started in, but you should not do
46
- anything else in your repo while it's running because lots of mayhem will ensue.
46
+ 2. flash_flow creates a copy of your local git repo. The copy lives in /your/repo/dir/../.flash_flow/.
47
+ That's where it merges all the code and pushes to the remote from. This "shadow" directory is used so
48
+ that your local git repository is still available for your use while flash flow is running.
47
49
 
48
50
 
49
51
  ### Configuring a lock
@@ -60,20 +62,25 @@ In step 1 after your branch is pushed, a pull request into `master_branch` will
60
62
  add the "do not merge" label to a pull request, it will be excluded from the `merge_branch`. This is extremely
61
63
  useful whenever one of your co-workers breaks the build, you can either run `flash_flow --no-merge` from their
62
64
  branch, or go directly to github and add the "do not merge" label and then re-run flash_flow from your branch.
65
+
63
66
  To use github as your source of merge branches you have to configure it with the class name, github token and
64
67
  repo, your master branch name and both the unmergeable label and do not merge label, which must exist on github.
65
68
  The unmergeable label is added to a pull request that has a conflict that can't be resolved and is therefore
66
69
  excluded from the merge branch.
67
70
 
68
71
  ### Configuring an issue tracker
69
- We use Pivotal Tracker. Anytime flash_flow is run, all the branches that get merged, if they have any stories
70
- associated with them (added via the `--stories` option), those stories will transition to "finished" if they
71
- were previously "started". When code deploys to our review environment, our deploy script runs
72
- `flash_flow --review-deploy`, which transitions stories associated with merged branches from "finished" to
73
- "delivered". At the same time, for a branch that has been removed ("--no-merge"), if the story is "delivered"
74
- it will transition back to "finished". In addition, as part of our production deploy
75
- script, we run `flash_flow --prod-deploy`, which takes all the stories that are newly in the `master_branch`
76
- and adds a comment "Deployed to production on 12/25/2015 at 11:11pm". So using the story option can be handy.
72
+ We use Pivotal Tracker. When we have finished work for a story on a particular branch we run
73
+ `flash_flow --story <story_id>`, which will transition all of those stories to "finished" if they were previously
74
+ "started".
75
+
76
+ When code deploys to our review environment, our deploy script runs `flash_flow --review-deploy`, which transitions
77
+ stories associated with merged branches from "finished" to "delivered". At the same time, for a branch that has been
78
+ removed ("--no-merge"), if the story is "delivered" it will transition back to "finished". This means that the only
79
+ buttons that have to be manually clicked in tracker are "Start" and "Accept/Reject".
80
+
81
+ In addition, as part of our production deploy script, we run `flash_flow --prod-deploy`, which takes all the stories
82
+ that are newly in the `master_branch` and adds a comment "Deployed to production on 12/25/2015 at 11:11pm". Tracker
83
+ doesn't support a real state for "In production", so for us this comment serves as that state.
77
84
 
78
85
  ### Configuring hipchat
79
86
  When a branch other than the one you're on doesn't merge cleanly and can't be fixed by rerere (more on that later
@@ -123,14 +130,22 @@ If you have Pivotal Tracker configured it will look at all stories associated wi
123
130
  deployed to `acceptance_branch` it will mark any finished stories as delivered. This is best used right after every
124
131
  deploy to your acceptance environment. The acceptance branch will not be re-built in this case.
125
132
 
126
- ### Merge conflicts
133
+ #### --resolve
134
+ Launch a bash shell to save your conflict resolutions. If your branch didn't merge the last time you ran flash flow
135
+ you'll run this command. This drops you into bash where you can save your resolved conflicts, then those resolutions
136
+ will be remembered the next time you run flash flow.
137
+
138
+ #### --resolve-manual
139
+ Print instructions that will show you how to resolve your merge conflicts without using flash flow's version of the
140
+ shell. If you don't use bash, or flash flow does odd things to your bash config, this is the way to go.
141
+
142
+ ### A note about merge conflicts
127
143
  When we first started using flash_flow, if your branch had a merge conflict you were out of luck. You had to wait for
128
144
  the branch that you were conflicting with to be merged to master, merge master into your branch, and then try again to
129
145
  get your code into the merge branch.
130
146
 
131
- Then we discovered git rerere, which is the coolest feature of git that almost no one seems to have heard of. Googling
132
- it turns up a few really good resources on how it works, but in one sentence or less what it does is remember how you
133
- resolved conflicts and apply those patches.
147
+ Then we discovered git rerere, which is the coolest feature of git that almost no one seems to have heard of. Basically
148
+ what rerere does is remember how you resolved conflicts and auto-apply those patches when it notices the same conflicts.
134
149
 
135
150
  If your branch has a conflict with the `merge_branch` flash_flow will look for a rerere patch and apply that if it
136
151
  exists. If it doesn't, flash_flow will not merge your branch (but will continue merging all the others), and it will
@@ -44,7 +44,10 @@ module FlashFlow
44
44
 
45
45
  def backwards_compatible_store
46
46
  @backwards_compatible_store ||= begin
47
- hash = @store.get
47
+ hash = in_shadow_repo do
48
+ @store.get
49
+ end
50
+
48
51
  hash.has_key?('branches') ? hash : { 'branches' => hash }
49
52
  end
50
53
  end
@@ -53,6 +56,13 @@ module FlashFlow
53
56
  Collection.from_hash(@git.remotes, backwards_compatible_store['branches']).to_a
54
57
  end
55
58
 
59
+ private
60
+
61
+ def in_shadow_repo
62
+ ShadowRepo.new(@git).in_dir do
63
+ yield
64
+ end
65
+ end
56
66
  end
57
67
  end
58
68
  end
@@ -29,12 +29,17 @@ module FlashFlow
29
29
  end
30
30
  end
31
31
 
32
+ FLASH_FLOW_BASE = '.flash_flow'
32
33
  def flash_flow_base_dir
33
- @flash_flow_base_dir ||= current_dir + "/../.flash_flow"
34
+ if current_dir =~ /\.flash_flow/
35
+ "#{current_dir.split(FLASH_FLOW_BASE).first}#{FLASH_FLOW_BASE}"
36
+ else
37
+ "#{current_dir}/../#{FLASH_FLOW_BASE}"
38
+ end
34
39
  end
35
40
 
36
41
  def current_dir
37
- @current_dir ||= Dir.getwd
42
+ Dir.getwd
38
43
  end
39
44
 
40
45
  def flash_flow_dir
@@ -1,3 +1,3 @@
1
1
  module FlashFlow
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.2"
3
3
  end
data/log/.keep ADDED
File without changes
@@ -75,8 +75,10 @@ module FlashFlow
75
75
  def test_check_out_to_working_branch
76
76
  @deploy.stub(:in_shadow_repo, true) do
77
77
  @deploy.stub(:check_repo, true) do
78
- Lock::Base.stub_any_instance(:with_lock, -> { raise Lock::Error }) do
79
- assert_output(/Failure!/) { @deploy.run }
78
+ @deploy.stub(:check_version, true) do
79
+ Lock::Base.stub_any_instance(:with_lock, -> { raise Lock::Error }) do
80
+ assert_output(/Failure!/) { @deploy.run }
81
+ end
80
82
  end
81
83
  end
82
84
  end
@@ -99,13 +101,12 @@ module FlashFlow
99
101
  end
100
102
 
101
103
  def test_merge_conflict
102
- data.expect(:mark_failure, true, [@branch, 'some_sha'])
104
+ data.expect(:mark_failure, true, [@branch, nil])
103
105
 
104
106
  notifier.expect(:merge_conflict, true, [@branch])
105
107
 
106
108
  merger
107
109
  .expect(:do_merge, :conflict, [ false ])
108
- .expect(:conflict_sha, 'some_sha')
109
110
 
110
111
  BranchMerger.stub(:new, merger) do
111
112
  @deploy.git_merge(@branch, false)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flash_flow
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flashfunders
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-28 00:00:00.000000000 Z
11
+ date: 2015-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit
@@ -164,6 +164,7 @@ files:
164
164
  - lib/flash_flow/shadow_repo.rb
165
165
  - lib/flash_flow/time_helper.rb
166
166
  - lib/flash_flow/version.rb
167
+ - log/.keep
167
168
  - test/lib/data/test_base.rb
168
169
  - test/lib/data/test_branch.rb
169
170
  - test/lib/data/test_collection.rb