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 +4 -4
- data/Gemfile.lock +1 -1
- data/bin/flash_flow +2 -2
- data/lib/flash_flow/data/branch.rb +4 -2
- data/lib/flash_flow/data/collection.rb +3 -0
- data/lib/flash_flow/deploy.rb +6 -2
- data/lib/flash_flow/resolve.rb +6 -4
- data/lib/flash_flow/version.rb +1 -1
- data/test/lib/data/test_branch.rb +14 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe6bb7d56503c667baeff6630b04a356c2c1959e
|
4
|
+
data.tar.gz: cfb7c8792b7556c2bf54e4e47c8fd28d19af9aef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbfe4f236e252efbc73a80607302945aeea1043a41de8fe35eecc10ceae14ec3933d6b6068067753a3f4c9d0b81083a4aac8fc90d885182a71073641c1f8b943
|
7
|
+
data.tar.gz: 116c96cfea5b0977a52250740e3dafc27e576952b4926ccda14976dbee1c90d700a0e59f89ff08ab3c3ec4f6653af0312f49ae0aa959a8d98f6f90cbf09021de
|
data/Gemfile.lock
CHANGED
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
|
-
|
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
|
data/lib/flash_flow/deploy.rb
CHANGED
@@ -132,8 +132,12 @@ module FlashFlow
|
|
132
132
|
@data.set_resolutions(branch, merger.resolutions)
|
133
133
|
|
134
134
|
when :conflict
|
135
|
-
|
136
|
-
|
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
|
|
data/lib/flash_flow/resolve.rb
CHANGED
@@ -49,7 +49,7 @@ module FlashFlow
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def merge_conflicted
|
52
|
-
@git.run("checkout #{branch.
|
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.
|
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.
|
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
|
data/lib/flash_flow/version.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2015-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|