socialcast-git-extensions 3.1.29 → 3.1.30
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/config/scgitx.yml +4 -0
- data/lib/socialcast-git-extensions/git.rb +2 -2
- data/lib/socialcast-git-extensions/version.rb +1 -1
- data/socialcast-git-extensions.gemspec +1 -1
- data/spec/cli_spec.rb +33 -68
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ee33b5c6b4680a49b08ed584e37b99eac0e0525
|
4
|
+
data.tar.gz: 332fc9991fe7c5bd3487e709ed5d3ae88e73ee73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 424a2c4f6bffd7feb7dc5318f40eb872129abe5275e176e472d9fd910e888409369057b319348e60299da29e7315d9fa39069092b95819efcfefcdfab28e03df
|
7
|
+
data.tar.gz: d809541caf8928acda45bb390db32e857f5ca6789c91b167ccd332021f57ccc27b9df25611fb4c6c31d3cac6c40736ecfe745199f41b26c503f1cd93b6facc40
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.
|
1
|
+
ruby-2.2.2
|
data/config/scgitx.yml
CHANGED
@@ -104,7 +104,7 @@ module Socialcast
|
|
104
104
|
end
|
105
105
|
|
106
106
|
def track_branch(branch)
|
107
|
-
run_cmd "git branch
|
107
|
+
run_cmd "git branch -u #{branch} origin/#{branch}"
|
108
108
|
end
|
109
109
|
|
110
110
|
# integrate a branch into a destination aggregate branch
|
@@ -225,7 +225,7 @@ module Socialcast
|
|
225
225
|
end
|
226
226
|
|
227
227
|
def aggregate_branches
|
228
|
-
@aggregate_branches ||= [staging_branch, prototype_branch]
|
228
|
+
@aggregate_branches ||= ((config['aggregate_branches'] || []) + [staging_branch, prototype_branch]).uniq
|
229
229
|
end
|
230
230
|
|
231
231
|
def reserved_branches
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.add_runtime_dependency 'rake', '~> 10.3'
|
23
23
|
s.add_development_dependency 'rspec', '~> 3.0.0'
|
24
24
|
s.add_development_dependency 'pry', '~> 0.9.12.6'
|
25
|
-
s.add_development_dependency 'webmock', '~> 1.
|
25
|
+
s.add_development_dependency 'webmock', '~> 1.21'
|
26
26
|
|
27
27
|
s.files = `git ls-files`.split("\n")
|
28
28
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
data/spec/cli_spec.rb
CHANGED
@@ -23,6 +23,7 @@ describe Socialcast::Gitx::CLI do
|
|
23
23
|
end
|
24
24
|
|
25
25
|
Socialcast::Gitx::CLI.stubbed_executed_commands = []
|
26
|
+
allow_any_instance_of(Socialcast::Gitx::CLI).to receive(:say)
|
26
27
|
allow_any_instance_of(Socialcast::Gitx::CLI).to receive(:current_branch).and_return('FOO')
|
27
28
|
allow_any_instance_of(Socialcast::Gitx::CLI).to receive(:current_user).and_return('wireframe')
|
28
29
|
allow(Socialcast::CommandLine).to receive(:credentials).and_return(:domain => 'testdomain', :user => 'testuser', :password => 'testpassword', :scgitx_token => 'faketoken')
|
@@ -370,40 +371,6 @@ describe Socialcast::Gitx::CLI do
|
|
370
371
|
end
|
371
372
|
|
372
373
|
describe '#nuke' do
|
373
|
-
context 'when target branch == prototype and --destination == master' do
|
374
|
-
before do
|
375
|
-
prototype_branches = %w( dev-foo dev-bar dev-baz )
|
376
|
-
master_branches = %w( dev-foo )
|
377
|
-
expect_any_instance_of(Socialcast::Gitx::CLI).to receive(:branches).and_return(prototype_branches, master_branches, prototype_branches, master_branches)
|
378
|
-
stub_message "#worklog resetting prototype branch to last_known_good_master in socialcast/socialcast-git-extensions #scgitx\n/cc @SocialcastDevelopers\n\nThe following branches were affected:\n* dev-bar\n* dev-baz"
|
379
|
-
Socialcast::Gitx::CLI.start ['nuke', 'prototype', '--destination', 'master']
|
380
|
-
end
|
381
|
-
it 'should publish message into socialcast' do end # see expectations
|
382
|
-
it 'should run expected commands' do
|
383
|
-
expect(Socialcast::Gitx::CLI.stubbed_executed_commands).to eq([
|
384
|
-
"git checkout master",
|
385
|
-
"git branch -D last_known_good_master",
|
386
|
-
"git fetch origin",
|
387
|
-
"git checkout last_known_good_master",
|
388
|
-
"git branch -D prototype",
|
389
|
-
"git push origin --delete prototype",
|
390
|
-
"git checkout -b prototype",
|
391
|
-
"git push origin prototype",
|
392
|
-
"git branch --set-upstream prototype origin/prototype",
|
393
|
-
"git checkout master",
|
394
|
-
"git checkout master",
|
395
|
-
"git branch -D last_known_good_master",
|
396
|
-
"git fetch origin",
|
397
|
-
"git checkout last_known_good_master",
|
398
|
-
"git branch -D last_known_good_prototype",
|
399
|
-
"git push origin --delete last_known_good_prototype",
|
400
|
-
"git checkout -b last_known_good_prototype",
|
401
|
-
"git push origin last_known_good_prototype",
|
402
|
-
"git branch --set-upstream last_known_good_prototype origin/last_known_good_prototype",
|
403
|
-
"git checkout master"
|
404
|
-
])
|
405
|
-
end
|
406
|
-
end
|
407
374
|
context 'when target branch == staging and --destination == last_known_good_staging' do
|
408
375
|
before do
|
409
376
|
stub_message "#worklog resetting staging branch to last_known_good_staging in socialcast/socialcast-git-extensions #scgitx\n/cc @SocialcastDevelopers"
|
@@ -420,39 +387,39 @@ describe Socialcast::Gitx::CLI do
|
|
420
387
|
"git push origin --delete staging",
|
421
388
|
"git checkout -b staging",
|
422
389
|
"git push origin staging",
|
423
|
-
"git branch
|
390
|
+
"git branch -u staging origin/staging",
|
424
391
|
"git checkout master"
|
425
392
|
])
|
426
393
|
end
|
427
394
|
end
|
428
|
-
context 'when target branch ==
|
395
|
+
context 'when target branch == qa and destination prompt == nil and using custom aggregate_branches config' do
|
429
396
|
before do
|
430
|
-
stub_message "#worklog resetting
|
431
|
-
|
397
|
+
stub_message "#worklog resetting qa branch to last_known_good_qa in socialcast/socialcast-git-extensions #scgitx\n/cc @SocialcastDevelopers"
|
398
|
+
allow_any_instance_of(Socialcast::Gitx::CLI).to receive(:config).and_return( { 'aggregate_branches' => ['staging', 'qa'] })
|
432
399
|
expect_any_instance_of(Socialcast::Gitx::CLI).to receive(:ask).and_return('')
|
433
|
-
Socialcast::Gitx::CLI.start ['nuke', '
|
400
|
+
Socialcast::Gitx::CLI.start ['nuke', 'qa']
|
434
401
|
end
|
435
|
-
it 'defaults to
|
402
|
+
it 'defaults to last_known_good_qa and should run expected commands' do
|
436
403
|
expect(Socialcast::Gitx::CLI.stubbed_executed_commands).to eq([
|
437
404
|
"git checkout master",
|
438
|
-
"git branch -D
|
405
|
+
"git branch -D last_known_good_qa",
|
439
406
|
"git fetch origin",
|
440
|
-
"git checkout
|
441
|
-
"git branch -D
|
442
|
-
"git push origin --delete
|
443
|
-
"git checkout -b
|
444
|
-
"git push origin
|
445
|
-
"git branch
|
407
|
+
"git checkout last_known_good_qa",
|
408
|
+
"git branch -D qa",
|
409
|
+
"git push origin --delete qa",
|
410
|
+
"git checkout -b qa",
|
411
|
+
"git push origin qa",
|
412
|
+
"git branch -u qa origin/qa",
|
446
413
|
"git checkout master"
|
447
414
|
])
|
448
415
|
end
|
449
416
|
end
|
450
|
-
context 'when target branch ==
|
417
|
+
context 'when target branch == qa and destination prompt = master and using custom aggregate_branches config' do
|
451
418
|
before do
|
452
|
-
stub_message "#worklog resetting
|
453
|
-
|
419
|
+
stub_message "#worklog resetting qa branch to last_known_good_master in socialcast/socialcast-git-extensions #scgitx\n/cc @SocialcastDevelopers"
|
420
|
+
allow_any_instance_of(Socialcast::Gitx::CLI).to receive(:config).and_return( { 'aggregate_branches' => ['staging', 'qa'] })
|
454
421
|
expect_any_instance_of(Socialcast::Gitx::CLI).to receive(:ask).and_return('master')
|
455
|
-
Socialcast::Gitx::CLI.start ['nuke', '
|
422
|
+
Socialcast::Gitx::CLI.start ['nuke', 'qa']
|
456
423
|
end
|
457
424
|
it 'should run expected commands' do
|
458
425
|
expect(Socialcast::Gitx::CLI.stubbed_executed_commands).to eq([
|
@@ -460,32 +427,30 @@ describe Socialcast::Gitx::CLI do
|
|
460
427
|
"git branch -D last_known_good_master",
|
461
428
|
"git fetch origin",
|
462
429
|
"git checkout last_known_good_master",
|
463
|
-
"git branch -D
|
464
|
-
"git push origin --delete
|
465
|
-
"git checkout -b
|
466
|
-
"git push origin
|
467
|
-
"git branch
|
430
|
+
"git branch -D qa",
|
431
|
+
"git push origin --delete qa",
|
432
|
+
"git checkout -b qa",
|
433
|
+
"git push origin qa",
|
434
|
+
"git branch -u qa origin/qa",
|
468
435
|
"git checkout master",
|
469
436
|
"git checkout master",
|
470
437
|
"git branch -D last_known_good_master",
|
471
438
|
"git fetch origin",
|
472
439
|
"git checkout last_known_good_master",
|
473
|
-
"git branch -D
|
474
|
-
"git push origin --delete
|
475
|
-
"git checkout -b
|
476
|
-
"git push origin
|
477
|
-
"git branch
|
440
|
+
"git branch -D last_known_good_qa",
|
441
|
+
"git push origin --delete last_known_good_qa",
|
442
|
+
"git checkout -b last_known_good_qa",
|
443
|
+
"git push origin last_known_good_qa",
|
444
|
+
"git branch -u last_known_good_qa origin/last_known_good_qa",
|
478
445
|
"git checkout master"
|
479
446
|
])
|
480
447
|
end
|
481
448
|
end
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
}.to raise_error(/Only aggregate branches are allowed to be reset/)
|
488
|
-
end
|
449
|
+
it 'raises an error when target branch is not an aggregate branch' do
|
450
|
+
expect {
|
451
|
+
expect_any_instance_of(Socialcast::Gitx::CLI).to receive(:ask).and_return('master')
|
452
|
+
Socialcast::Gitx::CLI.start ['nuke', 'asdfasdf']
|
453
|
+
}.to raise_error(/Only aggregate branches are allowed to be reset/)
|
489
454
|
end
|
490
455
|
end
|
491
456
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: socialcast-git-extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.30
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Sonnek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grit
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.
|
131
|
+
version: '1.21'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 1.
|
138
|
+
version: '1.21'
|
139
139
|
description: GIT it done!
|
140
140
|
email:
|
141
141
|
- ryan@socialcast.com
|
@@ -208,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
208
208
|
version: '0'
|
209
209
|
requirements: []
|
210
210
|
rubyforge_project: socialcast-git-extensions
|
211
|
-
rubygems_version: 2.
|
211
|
+
rubygems_version: 2.4.6
|
212
212
|
signing_key:
|
213
213
|
specification_version: 4
|
214
214
|
summary: git extension scripts for socialcast workflow
|