flash_flow 1.1.0 → 1.1.1

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: 8006bd8e5430d1b82498e75a5ee3d0990804d19f
4
- data.tar.gz: 168531a6539335bf8a5b5bc8bf00e3097ca1c134
3
+ metadata.gz: fe6bb7d56503c667baeff6630b04a356c2c1959e
4
+ data.tar.gz: cfb7c8792b7556c2bf54e4e47c8fd28d19af9aef
5
5
  SHA512:
6
- metadata.gz: c3349383a3fe10ef4924c2c99273922408572b18ec2169b853a630f19649d43ef0ecdfd5ac3150901c7c241c1b923f180d1775aef61d6bd3336da1a29620a93c
7
- data.tar.gz: 8630a2e23c234677f2379d90376bac227099f0c9cddde3c72a4f4f50f3c74ab33275a2496c6d1d2844d399f14a090100ab003075a0f24f5948446604b5e4aee5
6
+ metadata.gz: dbfe4f236e252efbc73a80607302945aeea1043a41de8fe35eecc10ceae14ec3933d6b6068067753a3f4c9d0b81083a4aac8fc90d885182a71073641c1f8b943
7
+ data.tar.gz: 116c96cfea5b0977a52250740e3dafc27e576952b4926ccda14976dbee1c90d700a0e59f89ff08ab3c3ec4f6653af0312f49ae0aa959a8d98f6f90cbf09021de
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- flash_flow (1.0.0)
4
+ flash_flow (1.1.1)
5
5
  hipchat
6
6
  octokit
7
7
  pivotal-tracker
data/bin/flash_flow CHANGED
@@ -18,9 +18,9 @@ case
18
18
  when options[:release_notes]
19
19
  FlashFlow::IssueTracker::Base.new(FlashFlow::Config.configuration.issue_tracker).release_notes(options[:release_notes])
20
20
  when options[:resolve]
21
- FlashFlow::Resolve.new(Config.configuration.git, Config.configuration.branch_info_file, logger: Config.configuration.logger).start
21
+ FlashFlow::Resolve.new(FlashFlow::Config.configuration.git, FlashFlow::Config.configuration.branch_info_file, logger: FlashFlow::Config.configuration.logger).start
22
22
  when options[:resolve_manual]
23
- FlashFlow::Resolve.new(Config.configuration.git, Config.configuration.branch_info_file, logger: Config.configuration.logger).manual_instructions
23
+ FlashFlow::Resolve.new(FlashFlow::Config.configuration.git, FlashFlow::Config.configuration.branch_info_file, logger: FlashFlow::Config.configuration.logger).manual_instructions
24
24
  else
25
25
  FlashFlow::Deploy.new(options).run
26
26
  FlashFlow::IssueTracker::Base.new(FlashFlow::Config.configuration.issue_tracker).stories_pushed
@@ -4,7 +4,7 @@ module FlashFlow
4
4
  module Data
5
5
 
6
6
  class Branch
7
- attr_accessor :remote, :remote_url, :ref, :sha, :status, :resolutions, :stories, :metadata, :updated_at, :created_at
7
+ attr_accessor :remote, :remote_url, :ref, :sha, :status, :resolutions, :stories, :conflict_sha, :metadata, :updated_at, :created_at
8
8
 
9
9
  def initialize(_remote, _remote_url, _ref)
10
10
  @remote = _remote
@@ -23,6 +23,7 @@ module FlashFlow
23
23
  branch.resolutions = hash['resolutions']
24
24
  branch.stories = hash['stories']
25
25
  branch.metadata = hash['metadata']
26
+ branch.conflict_sha = hash['conflict_sha'] || hash['metadata'].to_h['conflict_sha']
26
27
  branch.updated_at = massage_time(hash['updated_at'])
27
28
  branch.created_at = massage_time(hash['created_at'])
28
29
  branch
@@ -52,6 +53,7 @@ module FlashFlow
52
53
  'status' => status,
53
54
  'resolutions' => resolutions,
54
55
  'stories' => stories,
56
+ 'conflict_sha' => conflict_sha,
55
57
  'metadata' => metadata,
56
58
  'updated_at' => updated_at,
57
59
  'created_at' => created_at,
@@ -94,7 +96,7 @@ module FlashFlow
94
96
  end
95
97
 
96
98
  def fail!(conflict_sha=nil)
97
- add_metadata('conflict_sha' => conflict_sha) if conflict_sha
99
+ self.conflict_sha = conflict_sha
98
100
  self.status = 'fail'
99
101
  end
100
102
 
@@ -64,6 +64,9 @@ module FlashFlow
64
64
  branch.created_at = info.created_at
65
65
  branch.resolutions = branch.resolutions.to_h.merge(info.resolutions.to_h)
66
66
  branch.stories = info.stories.to_a | merged_branches[full_ref].stories.to_a
67
+ if branch.fail?
68
+ branch.conflict_sha ||= info.conflict_sha
69
+ end
67
70
  else
68
71
  merged_branches[full_ref] = info
69
72
  merged_branches[full_ref].status = nil
@@ -132,8 +132,12 @@ module FlashFlow
132
132
  @data.set_resolutions(branch, merger.resolutions)
133
133
 
134
134
  when :conflict
135
- @data.mark_failure(branch, merger.conflict_sha)
136
- @notifier.merge_conflict(branch) unless is_working_branch
135
+ if is_working_branch
136
+ @data.mark_failure(branch, merger.conflict_sha)
137
+ else
138
+ @data.mark_failure(branch, nil)
139
+ @notifier.merge_conflict(branch)
140
+ end
137
141
  end
138
142
  end
139
143
 
@@ -49,7 +49,7 @@ module FlashFlow
49
49
  end
50
50
 
51
51
  def merge_conflicted
52
- @git.run("checkout #{branch.metadata['conflict_sha']}")
52
+ @git.run("checkout #{branch.conflict_sha}")
53
53
  @git.run("merge origin/#{working_branch}")
54
54
  end
55
55
 
@@ -66,6 +66,8 @@ module FlashFlow
66
66
  end
67
67
 
68
68
  def launch_bash
69
+ bash_message
70
+
69
71
  with_init_file do |file|
70
72
  system("bash --init-file #{file} -i")
71
73
  end
@@ -87,7 +89,7 @@ module FlashFlow
87
89
 
88
90
  Run the following commands to fix the merge conflict and then re-run flash_flow:
89
91
  pushd #{flash_flow_directory}
90
- git checkout #{branch.metadata['conflict_sha']}
92
+ git checkout #{branch.conflict_sha}
91
93
  git merge #{working_branch}
92
94
  # Resolve the conflicts
93
95
  git add <conflicted files>
@@ -103,7 +105,7 @@ Run the following commands to fix the merge conflict and then re-run flash_flow:
103
105
  return @data if @data
104
106
 
105
107
  in_shadow_repo do
106
- @data = Data::Base.new({}, @branch_info_file, @git, logger: logger)
108
+ @data = Data::Base.new({}, @branch_info_file, @git, logger: @logger)
107
109
  end
108
110
 
109
111
  @data
@@ -152,7 +154,7 @@ Run the following commands to fix the merge conflict and then re-run flash_flow:
152
154
  end
153
155
 
154
156
  def check_for_conflict
155
- raise NothingToResolve.new("The current branch (#{working_branch}) does not appear to be in conflict.") unless branch.metadata['conflict_sha']
157
+ raise NothingToResolve.new("The current branch (#{working_branch}) does not appear to be in conflict.") unless branch.conflict_sha
156
158
  end
157
159
  end
158
160
  end
@@ -1,3 +1,3 @@
1
1
  module FlashFlow
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
@@ -80,6 +80,19 @@ module FlashFlow
80
80
  assert_equal(branch.metadata, branch_hash['metadata'])
81
81
  end
82
82
 
83
+ def test_from_hash_conflict_sha
84
+ branch = Branch.from_hash(branch_hash)
85
+ assert_equal(branch.conflict_sha, 'conflict_sha')
86
+
87
+ hash = branch_hash.merge({ 'conflict_sha' => nil, 'metadata' => { 'conflict_sha' => 'another_sha' } })
88
+ branch = Branch.from_hash(hash)
89
+ assert_equal(branch.conflict_sha, 'another_sha')
90
+
91
+ hash = branch_hash.merge({ 'conflict_sha' => nil})
92
+ branch = Branch.from_hash(hash)
93
+ assert_equal(branch.conflict_sha, nil)
94
+ end
95
+
83
96
  def test_from_hash_with_time_objects
84
97
  branch_hash['updated_at'] = Time.now - 200
85
98
  branch_hash['created_at'] = Time.now - 200
@@ -191,6 +204,7 @@ module FlashFlow
191
204
  'status' => 'success',
192
205
  'resolutions' => {},
193
206
  'stories' => ['123'],
207
+ 'conflict_sha' => 'conflict_sha',
194
208
  'metadata' => {
195
209
  'some' => 'data'
196
210
  },
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.0
4
+ version: 1.1.1
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-27 00:00:00.000000000 Z
11
+ date: 2015-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit