hubstats 0.5.9 → 0.5.10

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: 28ac691a2eef5173765eff6de2e617a2a92db3a2
4
- data.tar.gz: 04fbcaa356ca69934d6ba6c9d5508188bf536e16
3
+ metadata.gz: 9407dea2556d0f7640e102654850da08473483ac
4
+ data.tar.gz: ce864b54f2b60bc227cfac653be1508b78e3b000
5
5
  SHA512:
6
- metadata.gz: a233f831c1e00ddabe10c5e5d782a6af9ffa135cfb856ed0a1ca6f247b0a28d0e6bfc46a8bb042bb8c3bb52a30104e1816a1e91a3bbc43bc904d63a306f3ca99
7
- data.tar.gz: da299e668685fda5532ff04f654c0777c3a8cc7fc51ce0aa01604e5bdfaba33992f53a27c4d641c605c26e96f936640da45df41e60df6c5f101501a36fbe087c
6
+ metadata.gz: 5c6304762c14ec9528011961391b84d35bf0d1cfd12b99ecbc6d0f0386dddf37a28405c3c58f1028c1eba8232d86de2248e7309ba34da3d86a563b48c9726e83
7
+ data.tar.gz: 2095ba48372a0eb5610fcf6f153b83d3224ef84e04e9c0912c57afa6bf5e3ffa4951069743d7480b56277fe2659b3c528cd76c23e36cfe4bc88954340a656f2a
@@ -8,8 +8,8 @@ env:
8
8
  - RAILS_VERSION=4.0
9
9
  - RAILS_VERSION=3.2
10
10
  rvm:
11
- - 1.9.3
12
11
  - 2.1.2
12
+ - 2.2.2
13
13
 
14
14
  script: bundle exec rspec
15
15
  before_script:
@@ -1,3 +1,8 @@
1
+ #### v0.5.10
2
+ * Trying once more to fix webhook bug by grabbing raw payload
3
+
4
+ > Emma Sax: Brian Bergstrom: https://github.com/sportngin/hubstats/pull/86
5
+
1
6
  #### v0.5.9
2
7
  #### v0.5.8
3
8
  * Fixing bug that resulted in no data being updated from org webhooks
@@ -11,9 +11,14 @@ module Hubstats
11
11
  # Returns - nothing, but makes a new event
12
12
  def handler
13
13
  verify_signature(request)
14
-
14
+
15
15
  kind = request.headers['X-Github-Event']
16
16
  event = params.with_indifferent_access
17
+
18
+ raw_payload = request.raw_post
19
+ original_payload = JSON.parse(raw_payload)
20
+ event[:github_action] = original_payload["action"]
21
+
17
22
  eventsHandler = Hubstats::EventsHandler.new()
18
23
  eventsHandler.route(event,kind)
19
24
 
@@ -55,13 +55,13 @@ module Hubstats
55
55
  #
56
56
  # Returns - nothing, but updates or makes the team
57
57
  def team_processor(payload)
58
- team = payload[:event][:team]
58
+ team = payload[:team]
59
59
  team_list = Hubstats.config.github_config["team_list"] || []
60
60
  if team_list.include? team[:name]
61
61
  Hubstats::Team.create_or_update(team.with_indifferent_access)
62
62
  hubstats_team = Hubstats::Team.where(name: team[:name]).first
63
- hubstats_user = Hubstats::User.create_or_update(payload[:event][:member])
64
- Hubstats::Team.update_users_in_team(hubstats_team, hubstats_user, payload[:event][:action])
63
+ hubstats_user = Hubstats::User.create_or_update(payload[:member])
64
+ Hubstats::Team.update_users_in_team(hubstats_team, hubstats_user, payload[:github_action])
65
65
  end
66
66
  end
67
67
 
@@ -1,3 +1,3 @@
1
1
  module Hubstats
2
- VERSION = "0.5.9"
2
+ VERSION = "0.5.10"
3
3
  end
@@ -67,7 +67,7 @@ module Hubstats
67
67
  allow(payload).to receive(:[]).with(:event).and_return(payload)
68
68
  allow(payload).to receive(:[]).with(:team).and_return({:name => "Team One"})
69
69
  allow(payload).to receive(:[]).with(:member).and_return(user)
70
- allow(payload).to receive(:[]).with(:action).and_return("added")
70
+ allow(payload).to receive(:[]).with(:github_action).and_return("added")
71
71
  allow(Hubstats::User).to receive(:create_or_update).and_return(user)
72
72
  expect(Hubstats::Team).to receive(:create_or_update)
73
73
  expect(Hubstats::Team).to receive(:update_users_in_team)
@@ -84,7 +84,7 @@ module Hubstats
84
84
  allow(payload).to receive(:[]).with(:event).and_return(payload)
85
85
  allow(payload).to receive(:[]).with(:team).and_return({:name => "Team One"})
86
86
  allow(payload).to receive(:[]).with(:member).and_return(user)
87
- allow(payload).to receive(:[]).with(:action).and_return("added")
87
+ allow(payload).to receive(:[]).with(:github_action).and_return("added")
88
88
  expect(Hubstats::Team).to receive(:update_users_in_team)
89
89
  expect(Hubstats::Team).to receive(:create_or_update).and_return(team)
90
90
  ehandler.route(payload, "MembershipEvent")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hubstats
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.9
4
+ version: 0.5.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elliot Hursh