flash_flow 1.4.13 → 1.4.14
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 -0
- data/lib/flash_flow/data/base.rb +4 -0
- data/lib/flash_flow/merge/base.rb +4 -0
- data/lib/flash_flow/merge/master.rb +43 -23
- data/lib/flash_flow/options.rb +1 -0
- data/lib/flash_flow/version.rb +1 -1
- 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: 66d16b9e43df289304d066479e3a46b650f0f9e5
|
4
|
+
data.tar.gz: e30417e519a29160954eada65ff131ddc342f059
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61e991d545bf08e34cabc752d95502dbe607edcac1979baba3d8c827b78062862d5d97153c1089a6573bd8484fdda727da9e5e4e7c85213ee91a418414d7d515
|
7
|
+
data.tar.gz: cb351083d67e184c6829f671e05ac4ee0df92c486e751cf582f349739ee96943ba4556a2a27485f7529188b8781112e402e53c52acb6d42b422e95877839bd36
|
data/Gemfile.lock
CHANGED
data/bin/flash_flow
CHANGED
@@ -34,6 +34,8 @@ case
|
|
34
34
|
FlashFlow::Merge::Release.new(options).run
|
35
35
|
when options[:gen_pdf_diffs]
|
36
36
|
FlashFlow::Release::Base.new(FlashFlow::Config.configuration.release).gen_pdf_diffs(*options[:gen_pdf_diffs])
|
37
|
+
when options[:merge_release_email]
|
38
|
+
FlashFlow::Merge::Master.new(options).send_mail
|
37
39
|
when options[:merge_release]
|
38
40
|
FlashFlow::Merge::Master.new(options).run
|
39
41
|
when options[:notify_compliance]
|
data/lib/flash_flow/data/base.rb
CHANGED
@@ -13,28 +13,39 @@ module FlashFlow
|
|
13
13
|
@data = Data::Base.new({}, Config.configuration.branch_info_file, @git, logger: logger)
|
14
14
|
end
|
15
15
|
|
16
|
+
def send_mail
|
17
|
+
check_version
|
18
|
+
puts "Checking #{@git.release_branch} QA approval"
|
19
|
+
logger.info "\n\n### Beginning check of #{@git.release_branch} QA ###\n\n"
|
20
|
+
|
21
|
+
@lock.with_lock do
|
22
|
+
release = pending_release
|
23
|
+
ready!(release)
|
24
|
+
|
25
|
+
send_release_ready_email(release)
|
26
|
+
end
|
27
|
+
|
28
|
+
logger.info "### Sent release email ###"
|
29
|
+
rescue Lock::Error, NothingToMergeError, FlashFlow::Release::QAError, VersionError => e
|
30
|
+
puts 'Failure!'
|
31
|
+
puts e.message
|
32
|
+
ensure
|
33
|
+
@local_git.run("checkout #{@local_git.working_branch}")
|
34
|
+
end
|
35
|
+
|
16
36
|
def run
|
17
37
|
begin
|
18
38
|
check_version
|
19
|
-
|
20
|
-
|
21
|
-
puts "Checking #{@git.release_branch} QA approval"
|
22
|
-
logger.info "\n\n### Beginning check of #{@git.release_branch} QA ###\n\n"
|
39
|
+
puts "Merging #{@git.release_branch} into #{@git.master_branch}"
|
40
|
+
logger.info "\n\n### Beginning merge of #{@git.release_branch} into #{@git.master_branch} ###\n\n"
|
23
41
|
|
24
|
-
|
42
|
+
errors = []
|
25
43
|
|
26
44
|
@lock.with_lock do
|
27
|
-
release = pending_release
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
raise NothingToMergeError.new("The release branch '#{@git.release_branch}' has no commits that are not in master")
|
32
|
-
elsif !release_qa_approved?
|
33
|
-
raise FlashFlow::Release::QAError.new("The release build '#{get_release_sha(short: true)}' has not been approved for release")
|
34
|
-
end
|
35
|
-
|
36
|
-
# errors = merge_master(release)
|
37
|
-
send_release_ready_email(release)
|
45
|
+
release = pending_release || ready_to_merge_release
|
46
|
+
ready!(release)
|
47
|
+
|
48
|
+
errors = merge_master(release)
|
38
49
|
end
|
39
50
|
|
40
51
|
if errors.empty?
|
@@ -57,6 +68,8 @@ module FlashFlow
|
|
57
68
|
@git.initialize_rerere
|
58
69
|
end
|
59
70
|
|
71
|
+
mergers = []
|
72
|
+
|
60
73
|
@git.in_branch(@git.master_branch) do
|
61
74
|
@git.run("reset --hard origin/master")
|
62
75
|
merge_branches([Data::Branch.new(@git.release_branch)]) do |branch, merger|
|
@@ -71,17 +84,22 @@ module FlashFlow
|
|
71
84
|
raise GitPushFailure.new("Unable to push to #{@git.master_branch}. See log for details.")
|
72
85
|
end
|
73
86
|
|
74
|
-
|
87
|
+
release['status'] = 'Success'
|
88
|
+
release['released_sha'] = @git.get_sha("#{@git.remote}/#{@git.master_branch}")
|
89
|
+
write_data('Release info updated [ci skip]')
|
75
90
|
end
|
76
91
|
|
77
92
|
errors
|
78
93
|
end
|
79
94
|
|
80
|
-
def
|
81
|
-
release
|
82
|
-
|
83
|
-
|
84
|
-
|
95
|
+
def ready!(release)
|
96
|
+
if !release
|
97
|
+
raise NothingToMergeError.new("There is no pending release.")
|
98
|
+
elsif !release_ahead_of_master?
|
99
|
+
raise NothingToMergeError.new("The release branch '#{@git.release_branch}' has no commits that are not in master")
|
100
|
+
elsif !release_qa_approved?
|
101
|
+
raise FlashFlow::Release::QAError.new("The release build '#{get_release_sha(short: true)}' has not been approved for release")
|
102
|
+
end
|
85
103
|
end
|
86
104
|
|
87
105
|
def release_qa_approved?
|
@@ -93,7 +111,9 @@ module FlashFlow
|
|
93
111
|
begin
|
94
112
|
mailer = FlashFlow::Mailer::Base.new(Config.configuration.smtp)
|
95
113
|
mailer.deliver!(:release_ready, { approved_sha: get_release_sha(short: true) })
|
96
|
-
|
114
|
+
|
115
|
+
release['status'] = 'Ready to merge'
|
116
|
+
write_data('Release info updated [ci skip]')
|
97
117
|
rescue ArgumentError => e
|
98
118
|
raise FlashFlow::Release::QAError.new("Cannot send the email: #{e}")
|
99
119
|
end
|
data/lib/flash_flow/options.rb
CHANGED
@@ -26,6 +26,7 @@ module FlashFlow
|
|
26
26
|
opts.on('--merge-status-html', 'Show status of all branches and their stories in html format and exit') { |v| options[:merge_status_html] = true }
|
27
27
|
opts.on('--make-release branch1,branch2', 'Comma-delimited list of branches to merge to the release branch. Run "--merge-release ready" to merge all ready to ship branches') { |v| options[:release_branches] = v.split(',') }
|
28
28
|
opts.on('--gen-pdf-diffs output_file,build_id,threshold', 'Generate a pdf file with screenshot differences for the specified (latest) build. output_file is required. build_id defaults to the latest build. threshold defaults to 0') { |v| options[:gen_pdf_diffs] = v.split(',') }
|
29
|
+
opts.on('--merge-release-email', 'Send an email if the release is ready to be merged to master') { |v| options[:merge_release_email] = true }
|
29
30
|
opts.on('--merge-release', 'Merge the release branch into the master branch and push') { |v| options[:merge_release] = true }
|
30
31
|
opts.on('--notify-compliance', 'Send the compliance notification email if everything is ready') { |v| options[:notify_compliance] = true }
|
31
32
|
|
data/lib/flash_flow/version.rb
CHANGED
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.4.
|
4
|
+
version: 1.4.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Flashfunders
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|