socialcast-git-extensions 3.1.28 → 3.1.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c1516e606c16241ca86c4596ad1bf93feac9ea33
4
- data.tar.gz: c87c317647a112f2e2bf1987a320dcb1b0119147
3
+ metadata.gz: 7a79f2c472e34c9de110dc2c4c5b3de219b28c61
4
+ data.tar.gz: b6bd3bbc36b8b27190d24ca79083cf902baeb4f6
5
5
  SHA512:
6
- metadata.gz: 51c932ce23424136d20bf8ba0f97f05983db9f0f22b07b792e4bf9be72990349c096deb624d59c9292049495efae5b82cbc61af385a642fbcb9495691101e4ea
7
- data.tar.gz: 7928655b4e3ec2846e30c0c3e6b4404df535197a7d9f43d1562b9cedf93dc21652de785a326227d7d049b5846bb1ac757a83e6d3043ed486b4f1ffdbf2a08cc4
6
+ metadata.gz: 2a4a5a14c98877756c9dde689cb23ae87657ae2ad272756d554e04f45bc7be1afb0282535cf34432c8d69e014a9a3c6afa2465621bf3a1b78a2d085b2513b159
7
+ data.tar.gz: ef03eaae3f57a4235d9ad3d69c3c42cab64797f6f3b341ec4706d4f6c862f4ba5eb0e38ddd012bd43199ca1e8e1df369dde1543a81be349ca7790c5fe001e1dd
@@ -36,10 +36,11 @@ module Socialcast
36
36
  def reviewrequest(*additional_reviewers)
37
37
  update
38
38
 
39
- review_mention = if buddy = socialcast_review_buddy(current_user)
40
- "Assigned to @#{buddy}"
39
+ primary_mention = if buddy = socialcast_review_buddy(current_user)
40
+ "assigned to @#{buddy}"
41
41
  end
42
42
 
43
+ secondary_mention = nil
43
44
  if !specialty_reviewers.empty? && !options.key?('skip_additional_reviewers')
44
45
  additional_reviewers = options[:additional_reviewers] || additional_reviewers
45
46
 
@@ -52,8 +53,8 @@ module Socialcast
52
53
 
53
54
  (specialty_reviewers.keys & additional_reviewers).each do |command|
54
55
  reviewer = specialty_reviewers[command]
55
- review_mention = review_mention || ''
56
- review_mention += "\nAssigned additionally to @#{reviewer['socialcast_username']} for #{reviewer['label']} review"
56
+ secondary_mention ||= ''
57
+ secondary_mention += "\nAssigned additionally to @#{reviewer['socialcast_username']} for #{reviewer['label']} review"
57
58
  end
58
59
  end
59
60
 
@@ -65,8 +66,8 @@ module Socialcast
65
66
  url = create_pull_request branch, repo, description, assignee
66
67
  say "Pull request created: #{url}"
67
68
 
68
- review_message = ["#reviewrequest for #{branch} in #{current_repo} #scgitx", "/cc @#{developer_group}", review_mention, description, changelog_summary(branch)].compact.join("\n\n")
69
- post review_message, :url => url, :message_type => 'review_request'
69
+ review_message = ["#reviewrequest for #{branch} in #{current_repo}", "PR #{url} #{primary_mention}", '', description, '', secondary_mention, "/cc @#{developer_group} #scgitx", '', changelog_summary(branch)].compact.join("\n").gsub(/\n{2,}/, "\n\n")
70
+ post review_message, :message_type => 'review_request'
70
71
  end
71
72
 
72
73
  desc "findpr", "Find pull requests including a given commit"
@@ -1,5 +1,5 @@
1
1
  module Socialcast
2
2
  module Gitx
3
- VERSION = "3.1.28"
3
+ VERSION = "3.1.29"
4
4
  end
5
5
  end
@@ -959,7 +959,7 @@ describe Socialcast::Gitx::CLI do
959
959
  stub_request(:post, "https://api.github.com/repos/socialcast/socialcast-git-extensions/pulls").
960
960
  to_return(:status => 200, :body => %q({"html_url": "http://github.com/repo/project/pulls/1"}), :headers => {})
961
961
 
962
- stub_message "#reviewrequest for FOO in socialcast/socialcast-git-extensions #scgitx\n\n/cc @SocialcastDevelopers\n\ntesting\n\n1 file changed", :url => 'http://github.com/repo/project/pulls/1', :message_type => 'review_request'
962
+ stub_message "#reviewrequest for FOO in socialcast/socialcast-git-extensions\nPR http://github.com/repo/project/pulls/1 \n\ntesting\n\n/cc @SocialcastDevelopers #scgitx\n\n1 file changed", :message_type => 'review_request'
963
963
  allow_any_instance_of(Socialcast::Gitx::CLI).to receive(:changelog_summary).and_return('1 file changed')
964
964
  Socialcast::Gitx::CLI.start ['reviewrequest', '--description', 'testing', '-s']
965
965
  end
@@ -980,13 +980,13 @@ describe Socialcast::Gitx::CLI do
980
980
  stub_request(:post, "https://api.github.com/repos/socialcast/socialcast-git-extensions/pulls").
981
981
  to_return(:status => 200, :body => %q({"html_url": "http://github.com/repo/project/pulls/1", "issue_url": "http://github.com/repos/repo/project/issues/1"}), :headers => {})
982
982
  stub_request(:patch, "http://github.com/repos/repo/project/issues/1").to_return(:status => 200)
983
- end
983
+ allow_any_instance_of(Socialcast::Gitx::CLI).to receive(:socialcast_review_buddy).and_return('JaneDoe')
984
+ end
984
985
  context 'and additional reviewers are specified' do
985
- let(:message_body) { "#reviewrequest for FOO in socialcast/socialcast-git-extensions #scgitx\n\n/cc @SocialcastDevelopers\n\n\nAssigned additionally to @JohnSmith for API review\n\ntesting\n\n1 file changed" }
986
+ let(:message_body) { "#reviewrequest for FOO in socialcast/socialcast-git-extensions\nPR http://github.com/repo/project/pulls/1 assigned to @JaneDoe\n\ntesting\n\nAssigned additionally to @JohnSmith for API review\n/cc @SocialcastDevelopers #scgitx\n\n1 file changed" }
986
987
  before do
987
988
  allow_any_instance_of(Socialcast::Gitx::CLI).to receive(:changelog_summary).and_return('1 file changed')
988
- # The Review Buddy should be @mentioned in the message
989
- stub_message message_body, :url => 'http://github.com/repo/project/pulls/1', :message_type => 'review_request'
989
+ stub_message message_body, :message_type => 'review_request'
990
990
  Socialcast::Gitx::CLI.start ['reviewrequest', '--description', 'testing', '-a', 'a']
991
991
  end
992
992
  it 'should create github pull request' do end # see expectations
@@ -1000,23 +1000,21 @@ describe Socialcast::Gitx::CLI do
1000
1000
  end
1001
1001
  end
1002
1002
  context 'and a developer group is specified' do
1003
- let(:message_body) { "#reviewrequest for FOO in socialcast/socialcast-git-extensions #scgitx\n\n/cc @#{another_group}\n\ntesting\n\n1 file changed" }
1003
+ let(:message_body) { "#reviewrequest for FOO in socialcast/socialcast-git-extensions\nPR http://github.com/repo/project/pulls/1 assigned to @JaneDoe\n\ntesting\n\n/cc @#{another_group} #scgitx\n\n1 file changed" }
1004
1004
  let(:another_group) { 'AnotherDeveloperGroup' }
1005
1005
  before do
1006
1006
  allow_any_instance_of(Socialcast::Gitx::CLI).to receive(:changelog_summary).and_return('1 file changed')
1007
1007
  allow_any_instance_of(Socialcast::Gitx::CLI).to receive(:config).and_return({'developer_group' => another_group})
1008
- # The Review Buddy should be @mentioned in the message
1009
- stub_message message_body, :url => 'http://github.com/repo/project/pulls/1', :message_type => 'review_request'
1008
+ stub_message message_body, :message_type => 'review_request'
1010
1009
  Socialcast::Gitx::CLI.start ['reviewrequest', '--description', 'testing', '-s']
1011
1010
  end
1012
1011
  it 'should create github pull request with a different group mentioned' do end # see expectations
1013
1012
  end
1014
1013
  context 'and additional reviewers are not specified' do
1015
- let(:message_body) { "#reviewrequest for FOO in socialcast/socialcast-git-extensions #scgitx\n\n/cc @SocialcastDevelopers\n\ntesting\n\n1 file changed" }
1014
+ let(:message_body) { "#reviewrequest for FOO in socialcast/socialcast-git-extensions\nPR http://github.com/repo/project/pulls/1 assigned to @JaneDoe\n\ntesting\n\n/cc @SocialcastDevelopers #scgitx\n\n1 file changed" }
1016
1015
  before do
1017
1016
  allow_any_instance_of(Socialcast::Gitx::CLI).to receive(:changelog_summary).and_return('1 file changed')
1018
- # The Review Buddy should be @mentioned in the message
1019
- stub_message message_body, :url => 'http://github.com/repo/project/pulls/1', :message_type => 'review_request'
1017
+ stub_message message_body, :message_type => 'review_request'
1020
1018
  Socialcast::Gitx::CLI.start ['reviewrequest', '--description', 'testing', '-s']
1021
1019
  end
1022
1020
  it 'should create github pull request' do end # see expectations
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.28
4
+ version: 3.1.29
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-04-27 00:00:00.000000000 Z
11
+ date: 2015-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grit
@@ -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.4.4
211
+ rubygems_version: 2.2.2
212
212
  signing_key:
213
213
  specification_version: 4
214
214
  summary: git extension scripts for socialcast workflow