bugsnag-api 2.0.1 → 2.1.1

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.
Files changed (89) hide show
  1. checksums.yaml +5 -5
  2. data/.buildkite/pipeline.yml +6 -0
  3. data/.github/ISSUE_TEMPLATE/A.md +14 -0
  4. data/.github/ISSUE_TEMPLATE/bug_report.md +47 -0
  5. data/.github/ISSUE_TEMPLATE/feature_request.md +24 -0
  6. data/.github/PULL_REQUEST_TEMPLATE.md +16 -0
  7. data/.github/support.md +19 -0
  8. data/.github/workflows/tests.yml +53 -0
  9. data/.rubocop.yml +4 -0
  10. data/.rubocop_todo.yml +271 -0
  11. data/CHANGELOG.md +34 -0
  12. data/CONTRIBUTING.md +1 -1
  13. data/Gemfile +9 -0
  14. data/README.md +77 -2
  15. data/bugsnag-api.gemspec +48 -6
  16. data/config/.gitignore +1 -0
  17. data/docker-compose.yml +9 -0
  18. data/dockerfiles/Dockerfile.audit +5 -0
  19. data/lib/bugsnag/api/client/collaborators.rb +1 -2
  20. data/lib/bugsnag/api/client/comments.rb +1 -1
  21. data/lib/bugsnag/api/client/currentuser.rb +0 -1
  22. data/lib/bugsnag/api/client/errors.rb +12 -11
  23. data/lib/bugsnag/api/client/eventfields.rb +1 -2
  24. data/lib/bugsnag/api/client/events.rb +1 -2
  25. data/lib/bugsnag/api/client/organizations.rb +1 -2
  26. data/lib/bugsnag/api/client/pivots.rb +1 -2
  27. data/lib/bugsnag/api/client/projects.rb +2 -3
  28. data/lib/bugsnag/api/client/releases.rb +38 -0
  29. data/lib/bugsnag/api/client/stability.rb +16 -0
  30. data/lib/bugsnag/api/client/trends.rb +8 -5
  31. data/lib/bugsnag/api/client.rb +23 -3
  32. data/lib/bugsnag/api/configuration.rb +1 -1
  33. data/lib/bugsnag/api/error.rb +1 -1
  34. data/lib/bugsnag/api/response/raise_error.rb +0 -2
  35. data/lib/bugsnag/api/version.rb +1 -1
  36. data/scripts/license_finder.sh +4 -0
  37. data/spec/bugsnag/api/client/releases_spec.rb +184 -0
  38. data/spec/bugsnag/api/client/stability_spec.rb +32 -0
  39. data/spec/bugsnag/api/client_spec.rb +69 -7
  40. data/spec/bugsnag/api_spec.rb +2 -0
  41. data/spec/cassettes/Bugsnag_Api_Client/_get/handles_query_params.yml +13 -21
  42. data/spec/cassettes/Bugsnag_Api_Client/_last_response/caches_the_last_agent_response.yml +13 -21
  43. data/spec/cassettes/Bugsnag_Api_Client_Collaborators/_invitecollaborator/creates_and_returns_a_collaborator.yml +14 -26
  44. data/spec/cassettes/Bugsnag_Api_Client_Collaborators/_invitecollaborator/invites_multiple_collaborators.yml +14 -26
  45. data/spec/cassettes/Bugsnag_Api_Client_Collaborators/given_a_collaborator_exists/_collaborator/returns_a_collaborator.yml +29 -53
  46. data/spec/cassettes/Bugsnag_Api_Client_Collaborators/given_a_collaborator_exists/_collaborators/returns_a_list_of_all_organization_collaborators.yml +30 -55
  47. data/spec/cassettes/Bugsnag_Api_Client_Collaborators/given_a_collaborator_exists/_collaborators/returns_a_list_of_all_project_collaborators.yml +30 -55
  48. data/spec/cassettes/Bugsnag_Api_Client_Collaborators/given_a_collaborator_exists/_collaborators/throws_an_argument_error_if_neither_org_id_or_project_id_are_provided.yml +14 -26
  49. data/spec/cassettes/Bugsnag_Api_Client_Collaborators/given_a_collaborator_exists/_delete_collaborator/deletes_a_collaborator.yml +14 -26
  50. data/spec/cassettes/Bugsnag_Api_Client_Collaborators/given_a_collaborator_exists/_update_collaborator_permissions/updates_and_returns_the_collaborator.yml +29 -53
  51. data/spec/cassettes/Bugsnag_Api_Client_Collaborators/given_a_collaborator_exists/_view_collaborator_projects/returns_a_list_of_projects_belonging_to_the_collaborator.yml +49 -55
  52. data/spec/cassettes/Bugsnag_Api_Client_Comments/_create_comment/creates_a_comment_on_the_error.yml +17 -29
  53. data/spec/cassettes/Bugsnag_Api_Client_Comments/given_a_comment_has_been_created/_comment/retrieves_the_comment_specified.yml +32 -56
  54. data/spec/cassettes/Bugsnag_Api_Client_Comments/given_a_comment_has_been_created/_comments/retrieves_all_comments_on_an_error.yml +33 -57
  55. data/spec/cassettes/Bugsnag_Api_Client_Comments/given_a_comment_has_been_created/_delete_comment/deletes_the_comment_and_returns_true.yml +17 -29
  56. data/spec/cassettes/Bugsnag_Api_Client_Comments/given_a_comment_has_been_created/_update_comment/updates_the_message_on_a_comment.yml +32 -56
  57. data/spec/cassettes/Bugsnag_Api_Client_CurrentUser/_list_organizations/when_using_auth_token/returns_the_organization_the_auth_token_belongs_to.yml +14 -27
  58. data/spec/cassettes/Bugsnag_Api_Client_CurrentUser/_list_organizations/when_using_user_credentials/returns_users_organizations.yml +17 -31
  59. data/spec/cassettes/Bugsnag_Api_Client_CurrentUser/_list_projects/when_using_auth_token/lists_current_user_s_projects_in_the_organization.yml +34 -28
  60. data/spec/cassettes/Bugsnag_Api_Client_CurrentUser/_list_projects/when_using_user_credentials/lists_current_user_s_projects_in_the_organization.yml +37 -32
  61. data/spec/cassettes/Bugsnag_Api_Client_Errors/_error/returns_a_single_error.yml +14 -28
  62. data/spec/cassettes/Bugsnag_Api_Client_Errors/_errors/returns_errors_on_the_project.yml +16 -30
  63. data/spec/cassettes/Bugsnag_Api_Client_Errors/_update_errors/updates_and_returns_the_updated_errors.yml +13 -25
  64. data/spec/cassettes/Bugsnag_Api_Client_Events/_error_events/lists_all_error_events.yml +19 -30
  65. data/spec/cassettes/Bugsnag_Api_Client_Events/_event/returns_the_specified_event.yml +16 -199
  66. data/spec/cassettes/Bugsnag_Api_Client_Events/_events/returns_the_a_list_of_project_errors.yml +19 -30
  67. data/spec/cassettes/Bugsnag_Api_Client_Events/_latest_event/returns_the_last_event_on_an_error.yml +16 -199
  68. data/spec/cassettes/Bugsnag_Api_Client_Organizations/_create_organization/creates_a_new_organization.yml +17 -30
  69. data/spec/cassettes/Bugsnag_Api_Client_Organizations/with_organization/_delete_organization/deletes_the_organization.yml +32 -58
  70. data/spec/cassettes/Bugsnag_Api_Client_Organizations/with_organization/_organization/returns_the_requested_organization.yml +35 -61
  71. data/spec/cassettes/Bugsnag_Api_Client_Organizations/with_organization/_update_organization/updates_and_returns_the_organization.yml +35 -61
  72. data/spec/cassettes/Bugsnag_Api_Client_Projects/_create_project/creates_a_new_project.yml +14 -26
  73. data/spec/cassettes/Bugsnag_Api_Client_Projects/given_a_project/_delete_project/deletes_the_project.yml +26 -50
  74. data/spec/cassettes/Bugsnag_Api_Client_Projects/given_a_project/_project/returns_the_requested_project.yml +29 -53
  75. data/spec/cassettes/Bugsnag_Api_Client_Projects/given_a_project/_regenerate_api_key/removes_the_current_api_key_and_replaces_it_with_a_new_api_key.yml +29 -53
  76. data/spec/cassettes/Bugsnag_Api_Client_Projects/given_a_project/_update_project/updates_and_returns_the_project.yml +29 -53
  77. data/spec/cassettes/Bugsnag_Api_Client_Releases/_release/gets_a_single_release.yml +87 -0
  78. data/spec/cassettes/Bugsnag_Api_Client_Releases/_release_groups/accepts_parameters.yml +90 -0
  79. data/spec/cassettes/Bugsnag_Api_Client_Releases/_release_groups/gets_releases_in_a_release_group.yml +87 -0
  80. data/spec/cassettes/Bugsnag_Api_Client_Releases/_releases/accepts_parameters.yml +92 -0
  81. data/spec/cassettes/Bugsnag_Api_Client_Releases/_releases/gets_as_list_of_releases.yml +91 -0
  82. data/spec/cassettes/Bugsnag_Api_Client_Stability/_stability_trend/gets_the_stability_trend.yml +87 -0
  83. data/spec/cassettes/Bugsnag_Api_Client_Trends/_trends_buckets/returns_a_list_of_error_trends_in_bucket_form.yml +14 -26
  84. data/spec/cassettes/Bugsnag_Api_Client_Trends/_trends_buckets/returns_a_list_of_project_trends_in_bucket_form.yml +14 -26
  85. data/spec/cassettes/Bugsnag_Api_Client_Trends/_trends_resolution/returns_a_list_of_project_trends_in_resolution_form.yml +14 -26
  86. data/spec/cassettes/Bugsnag_Api_Client_Trends/_trends_resolution/returns_a_list_of_trends_in_resolution_form.yml +14 -26
  87. data/spec/spec_helper.rb +35 -7
  88. metadata +67 -24
  89. data/.travis.yml +0 -17
@@ -0,0 +1,87 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.bugsnag.com/projects/BUGSNAG_PROJECT_ID/stability_trend
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Bugsnag API Ruby Gem 2.0.3
12
+ Content-Type:
13
+ - application/json
14
+ X-Version:
15
+ - '2'
16
+ X-Bugsnag-Api:
17
+ - 'true'
18
+ Authorization:
19
+ - token BUGSNAG_AUTH_TOKEN
20
+ Accept-Encoding:
21
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
22
+ Accept:
23
+ - "*/*"
24
+ response:
25
+ status:
26
+ code: 200
27
+ message: OK
28
+ headers:
29
+ Server:
30
+ - nginx
31
+ Date:
32
+ - Tue, 20 Jul 2021 15:18:48 GMT
33
+ Content-Type:
34
+ - application/json; charset=utf-8
35
+ X-Ratelimit-Limit:
36
+ - '30'
37
+ X-Ratelimit-Remaining:
38
+ - '28'
39
+ Etag:
40
+ - W/"e187a5d89e7c6769b1733ac6f27b40c2"
41
+ Cache-Control:
42
+ - max-age=0, private, must-revalidate
43
+ X-Request-Id:
44
+ - 29002730-cc73-43bf-8e19-00d56b1fa14c
45
+ X-Runtime:
46
+ - '0.076007'
47
+ Vary:
48
+ - Origin
49
+ X-Frame-Options:
50
+ - DENY
51
+ X-Content-Type-Options:
52
+ - nosniff
53
+ X-Xss-Protection:
54
+ - 1; mode=block
55
+ X-Download-Options:
56
+ - noopen
57
+ X-Permitted-Cross-Domain-Policies:
58
+ - none
59
+ Content-Security-Policy:
60
+ - 'default-src ''self''; child-src https://*.stripe.com headway-widget.net https://*.youtube.com
61
+ https://www.google.com https://www.recaptcha.net; connect-src ''self'' https://api.bugsnag.com
62
+ https://notify.bugsnag.com https://sessions.bugsnag.com https://*.stripe.com
63
+ https://bugsnag.zendesk.com https://ekr.zdassets.com https://api.lever.co;
64
+ font-src ''self'' https://maxcdn.bootstrapcdn.com https://d2wy8f7a9ursnm.cloudfront.net;
65
+ img-src ''self'' data: https://notify.bugsnag.com https://*.stripe.com https://maxcdn.bootstrapcdn.com
66
+ https://d2wy8f7a9ursnm.cloudfront.net https://px.ads.linkedin.com; object-src
67
+ ''self''; script-src ''self'' https://d2wy8f7a9ursnm.cloudfront.net https://*.stripe.com
68
+ https://maxcdn.bootstrapcdn.com https://code.jquery.com https://static.zdassets.com
69
+ https://ekr.zdassets.com https://cdn.headwayapp.co https://www.recaptcha.net
70
+ https://www.gstatic.com; style-src ''self'' ''unsafe-inline'' https://maxcdn.bootstrapcdn.com
71
+ https://d2wy8f7a9ursnm.cloudfront.net'
72
+ X-Robots-Tag:
73
+ - noindex, nofollow
74
+ Strict-Transport-Security:
75
+ - max-age=31536000
76
+ Via:
77
+ - 1.1 google
78
+ Alt-Svc:
79
+ - clear
80
+ Transfer-Encoding:
81
+ - chunked
82
+ body:
83
+ encoding: ASCII-8BIT
84
+ string: '{"project_id":"BUGSNAG_PROJECT_ID","release_stage_name":"development","timeline_points":[{"bucket_start":"2021-06-21T00:00:00.000Z","bucket_end":"2021-06-22T00:00:00.000Z","total_sessions_count":25,"unhandled_sessions_count":0,"unhandled_rate":0.0,"users_seen":0,"users_with_unhandled":0,"unhandled_user_rate":0.0},{"bucket_start":"2021-06-22T00:00:00.000Z","bucket_end":"2021-06-23T00:00:00.000Z","total_sessions_count":0,"unhandled_sessions_count":0,"unhandled_rate":0.0,"users_seen":0,"users_with_unhandled":0,"unhandled_user_rate":0.0},{"bucket_start":"2021-06-23T00:00:00.000Z","bucket_end":"2021-06-24T00:00:00.000Z","total_sessions_count":0,"unhandled_sessions_count":0,"unhandled_rate":0.0,"users_seen":0,"users_with_unhandled":0,"unhandled_user_rate":0.0},{"bucket_start":"2021-06-24T00:00:00.000Z","bucket_end":"2021-06-25T00:00:00.000Z","total_sessions_count":0,"unhandled_sessions_count":0,"unhandled_rate":0.0,"users_seen":0,"users_with_unhandled":0,"unhandled_user_rate":0.0},{"bucket_start":"2021-06-25T00:00:00.000Z","bucket_end":"2021-06-26T00:00:00.000Z","total_sessions_count":0,"unhandled_sessions_count":0,"unhandled_rate":0.0,"users_seen":0,"users_with_unhandled":0,"unhandled_user_rate":0.0},{"bucket_start":"2021-06-26T00:00:00.000Z","bucket_end":"2021-06-27T00:00:00.000Z","total_sessions_count":0,"unhandled_sessions_count":0,"unhandled_rate":0.0,"users_seen":0,"users_with_unhandled":0,"unhandled_user_rate":0.0},{"bucket_start":"2021-06-27T00:00:00.000Z","bucket_end":"2021-06-28T00:00:00.000Z","total_sessions_count":0,"unhandled_sessions_count":0,"unhandled_rate":0.0,"users_seen":0,"users_with_unhandled":0,"unhandled_user_rate":0.0},{"bucket_start":"2021-06-28T00:00:00.000Z","bucket_end":"2021-06-29T00:00:00.000Z","total_sessions_count":0,"unhandled_sessions_count":0,"unhandled_rate":0.0,"users_seen":0,"users_with_unhandled":0,"unhandled_user_rate":0.0},{"bucket_start":"2021-06-29T00:00:00.000Z","bucket_end":"2021-06-30T00:00:00.000Z","total_sessions_count":0,"unhandled_sessions_count":0,"unhandled_rate":0.0,"users_seen":0,"users_with_unhandled":0,"unhandled_user_rate":0.0},{"bucket_start":"2021-06-30T00:00:00.000Z","bucket_end":"2021-07-01T00:00:00.000Z","total_sessions_count":0,"unhandled_sessions_count":0,"unhandled_rate":0.0,"users_seen":0,"users_with_unhandled":0,"unhandled_user_rate":0.0},{"bucket_start":"2021-07-01T00:00:00.000Z","bucket_end":"2021-07-02T00:00:00.000Z","total_sessions_count":5,"unhandled_sessions_count":3,"unhandled_rate":0.6,"users_seen":0,"users_with_unhandled":0,"unhandled_user_rate":0.0},{"bucket_start":"2021-07-02T00:00:00.000Z","bucket_end":"2021-07-03T00:00:00.000Z","total_sessions_count":0,"unhandled_sessions_count":0,"unhandled_rate":0.0,"users_seen":0,"users_with_unhandled":0,"unhandled_user_rate":0.0},{"bucket_start":"2021-07-03T00:00:00.000Z","bucket_end":"2021-07-04T00:00:00.000Z","total_sessions_count":0,"unhandled_sessions_count":0,"unhandled_rate":0.0,"users_seen":0,"users_with_unhandled":0,"unhandled_user_rate":0.0},{"bucket_start":"2021-07-04T00:00:00.000Z","bucket_end":"2021-07-05T00:00:00.000Z","total_sessions_count":0,"unhandled_sessions_count":0,"unhandled_rate":0.0,"users_seen":0,"users_with_unhandled":0,"unhandled_user_rate":0.0},{"bucket_start":"2021-07-05T00:00:00.000Z","bucket_end":"2021-07-06T00:00:00.000Z","total_sessions_count":0,"unhandled_sessions_count":0,"unhandled_rate":0.0,"users_seen":0,"users_with_unhandled":0,"unhandled_user_rate":0.0},{"bucket_start":"2021-07-06T00:00:00.000Z","bucket_end":"2021-07-07T00:00:00.000Z","total_sessions_count":0,"unhandled_sessions_count":0,"unhandled_rate":0.0,"users_seen":0,"users_with_unhandled":0,"unhandled_user_rate":0.0},{"bucket_start":"2021-07-07T00:00:00.000Z","bucket_end":"2021-07-08T00:00:00.000Z","total_sessions_count":0,"unhandled_sessions_count":0,"unhandled_rate":0.0,"users_seen":0,"users_with_unhandled":0,"unhandled_user_rate":0.0},{"bucket_start":"2021-07-08T00:00:00.000Z","bucket_end":"2021-07-09T00:00:00.000Z","total_sessions_count":0,"unhandled_sessions_count":0,"unhandled_rate":0.0,"users_seen":0,"users_with_unhandled":0,"unhandled_user_rate":0.0},{"bucket_start":"2021-07-09T00:00:00.000Z","bucket_end":"2021-07-10T00:00:00.000Z","total_sessions_count":0,"unhandled_sessions_count":0,"unhandled_rate":0.0,"users_seen":0,"users_with_unhandled":0,"unhandled_user_rate":0.0},{"bucket_start":"2021-07-10T00:00:00.000Z","bucket_end":"2021-07-11T00:00:00.000Z","total_sessions_count":0,"unhandled_sessions_count":0,"unhandled_rate":0.0,"users_seen":0,"users_with_unhandled":0,"unhandled_user_rate":0.0},{"bucket_start":"2021-07-11T00:00:00.000Z","bucket_end":"2021-07-12T00:00:00.000Z","total_sessions_count":0,"unhandled_sessions_count":0,"unhandled_rate":0.0,"users_seen":0,"users_with_unhandled":0,"unhandled_user_rate":0.0},{"bucket_start":"2021-07-12T00:00:00.000Z","bucket_end":"2021-07-13T00:00:00.000Z","total_sessions_count":0,"unhandled_sessions_count":0,"unhandled_rate":0.0,"users_seen":0,"users_with_unhandled":0,"unhandled_user_rate":0.0},{"bucket_start":"2021-07-13T00:00:00.000Z","bucket_end":"2021-07-14T00:00:00.000Z","total_sessions_count":4,"unhandled_sessions_count":2,"unhandled_rate":0.5,"users_seen":0,"users_with_unhandled":0,"unhandled_user_rate":0.0},{"bucket_start":"2021-07-14T00:00:00.000Z","bucket_end":"2021-07-15T00:00:00.000Z","total_sessions_count":26,"unhandled_sessions_count":2,"unhandled_rate":0.07692307692307693,"users_seen":0,"users_with_unhandled":0,"unhandled_user_rate":0.0},{"bucket_start":"2021-07-15T00:00:00.000Z","bucket_end":"2021-07-16T00:00:00.000Z","total_sessions_count":149,"unhandled_sessions_count":3,"unhandled_rate":0.020134228187919462,"users_seen":0,"users_with_unhandled":0,"unhandled_user_rate":0.0},{"bucket_start":"2021-07-16T00:00:00.000Z","bucket_end":"2021-07-17T00:00:00.000Z","total_sessions_count":0,"unhandled_sessions_count":0,"unhandled_rate":0.0,"users_seen":0,"users_with_unhandled":0,"unhandled_user_rate":0.0},{"bucket_start":"2021-07-17T00:00:00.000Z","bucket_end":"2021-07-18T00:00:00.000Z","total_sessions_count":0,"unhandled_sessions_count":0,"unhandled_rate":0.0,"users_seen":0,"users_with_unhandled":0,"unhandled_user_rate":0.0},{"bucket_start":"2021-07-18T00:00:00.000Z","bucket_end":"2021-07-19T00:00:00.000Z","total_sessions_count":0,"unhandled_sessions_count":0,"unhandled_rate":0.0,"users_seen":0,"users_with_unhandled":0,"unhandled_user_rate":0.0},{"bucket_start":"2021-07-19T00:00:00.000Z","bucket_end":"2021-07-20T00:00:00.000Z","total_sessions_count":0,"unhandled_sessions_count":0,"unhandled_rate":0.0,"users_seen":0,"users_with_unhandled":0,"unhandled_user_rate":0.0},{"bucket_start":"2021-07-20T00:00:00.000Z","bucket_end":"2021-07-21T00:00:00.000Z","total_sessions_count":16,"unhandled_sessions_count":20,"unhandled_rate":1.0,"users_seen":0,"users_with_unhandled":0,"unhandled_user_rate":0.0}]}'
85
+ http_version:
86
+ recorded_at: Tue, 20 Jul 2021 15:18:48 GMT
87
+ recorded_with: VCR 2.9.3
@@ -8,11 +8,13 @@ http_interactions:
8
8
  string: ''
9
9
  headers:
10
10
  User-Agent:
11
- - Bugsnag API Ruby Gem 1.0.3
11
+ - Bugsnag API Ruby Gem 2.0.1
12
12
  Content-Type:
13
13
  - application/json
14
14
  X-Version:
15
15
  - '2'
16
+ X-Bugsnag-Api:
17
+ - 'true'
16
18
  Authorization:
17
19
  - token BUGSNAG_AUTH_TOKEN
18
20
  Accept-Encoding:
@@ -24,31 +26,25 @@ http_interactions:
24
26
  code: 200
25
27
  message: OK
26
28
  headers:
27
- Server:
28
- - nginx
29
- Date:
30
- - Mon, 09 Oct 2017 14:19:56 GMT
31
29
  Content-Type:
32
30
  - application/json; charset=utf-8
33
31
  Etag:
34
- - W/"f0f507c922f0ec44182c7267e527bb78"
32
+ - W/"b9eabf97ace2e4fdf949bafcea30f1d9"
35
33
  Cache-Control:
36
34
  - max-age=0, private, must-revalidate
37
35
  X-Request-Id:
38
- - da621a3c-b6db-41d6-96d3-34c543f7d05b
36
+ - e37452c4-e7d1-4cbc-8d46-727ae5a04fd4
39
37
  X-Runtime:
40
- - '0.378838'
38
+ - '0.623912'
41
39
  Vary:
42
40
  - Origin
43
- X-Ratelimit-Limit:
44
- - '10'
45
- X-Ratelimit-Remaining:
46
- - '5'
41
+ X-Rack-Cors:
42
+ - miss; no-origin
47
43
  Content-Security-Policy:
48
44
  - 'default-src ''self''; child-src https://*.stripe.com headway-widget.net;
49
- connect-src ''self'' https://api.bugsnag.com https://*.stripe.com https://bugsnag.zendesk.com
50
- https://api.lever.co; font-src ''self'' https://maxcdn.bootstrapcdn.com; img-src
51
- ''self'' data: https://notify.bugsnag.com https://*.stripe.com https://maxcdn.bootstrapcdn.com;
45
+ connect-src ''self'' https://api.bugsnag.com https://notify.bugsnag.com https://*.stripe.com
46
+ https://bugsnag.zendesk.com https://api.lever.co; font-src ''self'' https://maxcdn.bootstrapcdn.com;
47
+ img-src ''self'' data: https://notify.bugsnag.com https://*.stripe.com https://maxcdn.bootstrapcdn.com;
52
48
  script-src ''self'' https://d2wy8f7a9ursnm.cloudfront.net https://*.stripe.com
53
49
  https://maxcdn.bootstrapcdn.com https://code.jquery.com https://assets.zendesk.com
54
50
  https://cdn.headwayapp.co; style-src ''self'' ''unsafe-inline'' https://maxcdn.bootstrapcdn.com'
@@ -62,19 +58,11 @@ http_interactions:
62
58
  - none
63
59
  X-Xss-Protection:
64
60
  - 1; mode=block
65
- X-Robots-Tag:
66
- - noindex, nofollow
67
- Strict-Transport-Security:
68
- - max-age=31536000
69
- Via:
70
- - 1.1 google
71
- Alt-Svc:
72
- - clear
73
61
  Transfer-Encoding:
74
62
  - chunked
75
63
  body:
76
- encoding: ASCII-8BIT
77
- string: '[{"from":"2017-10-09T14:18:24Z","to":"2017-10-09T14:18:43Z","events_count":1},{"from":"2017-10-09T14:18:43Z","to":"2017-10-09T14:19:02Z","events_count":0},{"from":"2017-10-09T14:19:02Z","to":"2017-10-09T14:19:21Z","events_count":0},{"from":"2017-10-09T14:19:21Z","to":"2017-10-09T14:19:40Z","events_count":0},{"from":"2017-10-09T14:19:40Z","to":"2017-10-09T14:19:59Z","events_count":0}]'
64
+ encoding: UTF-8
65
+ string: '[{"from":"2017-12-12T10:58:49Z","to":"2017-12-12T11:10:12Z","events_count":475},{"from":"2017-12-12T11:10:12Z","to":"2017-12-12T11:21:35Z","events_count":0},{"from":"2017-12-12T11:21:35Z","to":"2017-12-12T11:32:58Z","events_count":0},{"from":"2017-12-12T11:32:58Z","to":"2017-12-12T11:44:21Z","events_count":0},{"from":"2017-12-12T11:44:21Z","to":"2017-12-12T11:55:44Z","events_count":0}]'
78
66
  http_version:
79
- recorded_at: Mon, 09 Oct 2017 14:19:55 GMT
67
+ recorded_at: Tue, 12 Dec 2017 11:55:31 GMT
80
68
  recorded_with: VCR 2.9.3
@@ -8,11 +8,13 @@ http_interactions:
8
8
  string: ''
9
9
  headers:
10
10
  User-Agent:
11
- - Bugsnag API Ruby Gem 1.0.3
11
+ - Bugsnag API Ruby Gem 2.0.1
12
12
  Content-Type:
13
13
  - application/json
14
14
  X-Version:
15
15
  - '2'
16
+ X-Bugsnag-Api:
17
+ - 'true'
16
18
  Authorization:
17
19
  - token BUGSNAG_AUTH_TOKEN
18
20
  Accept-Encoding:
@@ -24,31 +26,25 @@ http_interactions:
24
26
  code: 200
25
27
  message: OK
26
28
  headers:
27
- Server:
28
- - nginx
29
- Date:
30
- - Mon, 09 Oct 2017 14:19:56 GMT
31
29
  Content-Type:
32
30
  - application/json; charset=utf-8
33
31
  Etag:
34
- - W/"f0f507c922f0ec44182c7267e527bb78"
32
+ - W/"b9eabf97ace2e4fdf949bafcea30f1d9"
35
33
  Cache-Control:
36
34
  - max-age=0, private, must-revalidate
37
35
  X-Request-Id:
38
- - b5955090-0d86-45fb-9aef-ad4b28556cb9
36
+ - a8d39325-e71e-49bc-8417-a17b88d57e3e
39
37
  X-Runtime:
40
- - '0.320538'
38
+ - '0.476384'
41
39
  Vary:
42
40
  - Origin
43
- X-Ratelimit-Limit:
44
- - '10'
45
- X-Ratelimit-Remaining:
46
- - '6'
41
+ X-Rack-Cors:
42
+ - miss; no-origin
47
43
  Content-Security-Policy:
48
44
  - 'default-src ''self''; child-src https://*.stripe.com headway-widget.net;
49
- connect-src ''self'' https://api.bugsnag.com https://*.stripe.com https://bugsnag.zendesk.com
50
- https://api.lever.co; font-src ''self'' https://maxcdn.bootstrapcdn.com; img-src
51
- ''self'' data: https://notify.bugsnag.com https://*.stripe.com https://maxcdn.bootstrapcdn.com;
45
+ connect-src ''self'' https://api.bugsnag.com https://notify.bugsnag.com https://*.stripe.com
46
+ https://bugsnag.zendesk.com https://api.lever.co; font-src ''self'' https://maxcdn.bootstrapcdn.com;
47
+ img-src ''self'' data: https://notify.bugsnag.com https://*.stripe.com https://maxcdn.bootstrapcdn.com;
52
48
  script-src ''self'' https://d2wy8f7a9ursnm.cloudfront.net https://*.stripe.com
53
49
  https://maxcdn.bootstrapcdn.com https://code.jquery.com https://assets.zendesk.com
54
50
  https://cdn.headwayapp.co; style-src ''self'' ''unsafe-inline'' https://maxcdn.bootstrapcdn.com'
@@ -62,19 +58,11 @@ http_interactions:
62
58
  - none
63
59
  X-Xss-Protection:
64
60
  - 1; mode=block
65
- X-Robots-Tag:
66
- - noindex, nofollow
67
- Strict-Transport-Security:
68
- - max-age=31536000
69
- Via:
70
- - 1.1 google
71
- Alt-Svc:
72
- - clear
73
61
  Transfer-Encoding:
74
62
  - chunked
75
63
  body:
76
- encoding: ASCII-8BIT
77
- string: '[{"from":"2017-10-09T14:18:24Z","to":"2017-10-09T14:18:43Z","events_count":1},{"from":"2017-10-09T14:18:43Z","to":"2017-10-09T14:19:02Z","events_count":0},{"from":"2017-10-09T14:19:02Z","to":"2017-10-09T14:19:21Z","events_count":0},{"from":"2017-10-09T14:19:21Z","to":"2017-10-09T14:19:40Z","events_count":0},{"from":"2017-10-09T14:19:40Z","to":"2017-10-09T14:19:59Z","events_count":0}]'
64
+ encoding: UTF-8
65
+ string: '[{"from":"2017-12-12T10:58:49Z","to":"2017-12-12T11:10:12Z","events_count":475},{"from":"2017-12-12T11:10:12Z","to":"2017-12-12T11:21:35Z","events_count":0},{"from":"2017-12-12T11:21:35Z","to":"2017-12-12T11:32:58Z","events_count":0},{"from":"2017-12-12T11:32:58Z","to":"2017-12-12T11:44:21Z","events_count":0},{"from":"2017-12-12T11:44:21Z","to":"2017-12-12T11:55:44Z","events_count":0}]'
78
66
  http_version:
79
- recorded_at: Mon, 09 Oct 2017 14:19:55 GMT
67
+ recorded_at: Tue, 12 Dec 2017 11:55:32 GMT
80
68
  recorded_with: VCR 2.9.3
@@ -8,11 +8,13 @@ http_interactions:
8
8
  string: ''
9
9
  headers:
10
10
  User-Agent:
11
- - Bugsnag API Ruby Gem 1.0.3
11
+ - Bugsnag API Ruby Gem 2.0.1
12
12
  Content-Type:
13
13
  - application/json
14
14
  X-Version:
15
15
  - '2'
16
+ X-Bugsnag-Api:
17
+ - 'true'
16
18
  Authorization:
17
19
  - token BUGSNAG_AUTH_TOKEN
18
20
  Accept-Encoding:
@@ -24,31 +26,25 @@ http_interactions:
24
26
  code: 200
25
27
  message: OK
26
28
  headers:
27
- Server:
28
- - nginx
29
- Date:
30
- - Mon, 09 Oct 2017 14:19:55 GMT
31
29
  Content-Type:
32
30
  - application/json; charset=utf-8
33
31
  Etag:
34
- - W/"1c511dc80332636ea6a95847ec8e50c3"
32
+ - W/"be3e4e83c25536aebcf78248c64806aa"
35
33
  Cache-Control:
36
34
  - max-age=0, private, must-revalidate
37
35
  X-Request-Id:
38
- - b8e9fb17-41e1-4b06-a712-9bd9b2e678c9
36
+ - e6e0f54b-7526-4db9-bff2-7bc80ed05e28
39
37
  X-Runtime:
40
- - '0.273818'
38
+ - '0.494850'
41
39
  Vary:
42
40
  - Origin
43
- X-Ratelimit-Limit:
44
- - '10'
45
- X-Ratelimit-Remaining:
46
- - '7'
41
+ X-Rack-Cors:
42
+ - miss; no-origin
47
43
  Content-Security-Policy:
48
44
  - 'default-src ''self''; child-src https://*.stripe.com headway-widget.net;
49
- connect-src ''self'' https://api.bugsnag.com https://*.stripe.com https://bugsnag.zendesk.com
50
- https://api.lever.co; font-src ''self'' https://maxcdn.bootstrapcdn.com; img-src
51
- ''self'' data: https://notify.bugsnag.com https://*.stripe.com https://maxcdn.bootstrapcdn.com;
45
+ connect-src ''self'' https://api.bugsnag.com https://notify.bugsnag.com https://*.stripe.com
46
+ https://bugsnag.zendesk.com https://api.lever.co; font-src ''self'' https://maxcdn.bootstrapcdn.com;
47
+ img-src ''self'' data: https://notify.bugsnag.com https://*.stripe.com https://maxcdn.bootstrapcdn.com;
52
48
  script-src ''self'' https://d2wy8f7a9ursnm.cloudfront.net https://*.stripe.com
53
49
  https://maxcdn.bootstrapcdn.com https://code.jquery.com https://assets.zendesk.com
54
50
  https://cdn.headwayapp.co; style-src ''self'' ''unsafe-inline'' https://maxcdn.bootstrapcdn.com'
@@ -62,19 +58,11 @@ http_interactions:
62
58
  - none
63
59
  X-Xss-Protection:
64
60
  - 1; mode=block
65
- X-Robots-Tag:
66
- - noindex, nofollow
67
- Strict-Transport-Security:
68
- - max-age=31536000
69
- Via:
70
- - 1.1 google
71
- Alt-Svc:
72
- - clear
73
61
  Transfer-Encoding:
74
62
  - chunked
75
63
  body:
76
- encoding: ASCII-8BIT
77
- string: '[{"from":"2017-10-09T12:00:00Z","to":"2017-10-10T00:00:00Z","events_count":1}]'
64
+ encoding: UTF-8
65
+ string: '[{"from":"2017-12-12T00:00:00Z","to":"2017-12-12T12:00:00Z","events_count":475}]'
78
66
  http_version:
79
- recorded_at: Mon, 09 Oct 2017 14:19:54 GMT
67
+ recorded_at: Tue, 12 Dec 2017 11:55:33 GMT
80
68
  recorded_with: VCR 2.9.3
@@ -8,11 +8,13 @@ http_interactions:
8
8
  string: ''
9
9
  headers:
10
10
  User-Agent:
11
- - Bugsnag API Ruby Gem 1.0.3
11
+ - Bugsnag API Ruby Gem 2.0.1
12
12
  Content-Type:
13
13
  - application/json
14
14
  X-Version:
15
15
  - '2'
16
+ X-Bugsnag-Api:
17
+ - 'true'
16
18
  Authorization:
17
19
  - token BUGSNAG_AUTH_TOKEN
18
20
  Accept-Encoding:
@@ -24,31 +26,25 @@ http_interactions:
24
26
  code: 200
25
27
  message: OK
26
28
  headers:
27
- Server:
28
- - nginx
29
- Date:
30
- - Mon, 09 Oct 2017 14:19:54 GMT
31
29
  Content-Type:
32
30
  - application/json; charset=utf-8
33
31
  Etag:
34
- - W/"1c511dc80332636ea6a95847ec8e50c3"
32
+ - W/"be3e4e83c25536aebcf78248c64806aa"
35
33
  Cache-Control:
36
34
  - max-age=0, private, must-revalidate
37
35
  X-Request-Id:
38
- - 3af63a69-b7d5-4316-a428-bd00dca5c964
36
+ - 8131ca4e-080d-4b01-a60c-133f7a7fed71
39
37
  X-Runtime:
40
- - '0.256350'
38
+ - '0.624348'
41
39
  Vary:
42
40
  - Origin
43
- X-Ratelimit-Limit:
44
- - '10'
45
- X-Ratelimit-Remaining:
46
- - '8'
41
+ X-Rack-Cors:
42
+ - miss; no-origin
47
43
  Content-Security-Policy:
48
44
  - 'default-src ''self''; child-src https://*.stripe.com headway-widget.net;
49
- connect-src ''self'' https://api.bugsnag.com https://*.stripe.com https://bugsnag.zendesk.com
50
- https://api.lever.co; font-src ''self'' https://maxcdn.bootstrapcdn.com; img-src
51
- ''self'' data: https://notify.bugsnag.com https://*.stripe.com https://maxcdn.bootstrapcdn.com;
45
+ connect-src ''self'' https://api.bugsnag.com https://notify.bugsnag.com https://*.stripe.com
46
+ https://bugsnag.zendesk.com https://api.lever.co; font-src ''self'' https://maxcdn.bootstrapcdn.com;
47
+ img-src ''self'' data: https://notify.bugsnag.com https://*.stripe.com https://maxcdn.bootstrapcdn.com;
52
48
  script-src ''self'' https://d2wy8f7a9ursnm.cloudfront.net https://*.stripe.com
53
49
  https://maxcdn.bootstrapcdn.com https://code.jquery.com https://assets.zendesk.com
54
50
  https://cdn.headwayapp.co; style-src ''self'' ''unsafe-inline'' https://maxcdn.bootstrapcdn.com'
@@ -62,19 +58,11 @@ http_interactions:
62
58
  - none
63
59
  X-Xss-Protection:
64
60
  - 1; mode=block
65
- X-Robots-Tag:
66
- - noindex, nofollow
67
- Strict-Transport-Security:
68
- - max-age=31536000
69
- Via:
70
- - 1.1 google
71
- Alt-Svc:
72
- - clear
73
61
  Transfer-Encoding:
74
62
  - chunked
75
63
  body:
76
- encoding: ASCII-8BIT
77
- string: '[{"from":"2017-10-09T12:00:00Z","to":"2017-10-10T00:00:00Z","events_count":1}]'
64
+ encoding: UTF-8
65
+ string: '[{"from":"2017-12-12T00:00:00Z","to":"2017-12-12T12:00:00Z","events_count":475}]'
78
66
  http_version:
79
- recorded_at: Mon, 09 Oct 2017 14:19:54 GMT
67
+ recorded_at: Tue, 12 Dec 2017 11:55:33 GMT
80
68
  recorded_with: VCR 2.9.3
data/spec/spec_helper.rb CHANGED
@@ -23,12 +23,31 @@ VCR.configure do |c|
23
23
  c.cassette_library_dir = "spec/cassettes"
24
24
  c.hook_into :webmock
25
25
  c.configure_rspec_metadata!
26
+
27
+ USER_AGENT_REGEX = /\ABugsnag API Ruby Gem \d+\.\d+\.\d+\z/
28
+ HEADERS_SET_BY_BUGSNAG = ["Content-Type", "X-Version", "X-Bugsnag-Api", "Authorization"]
29
+
30
+ user_agent_valid = lambda do |values|
31
+ return false if values.length != 1
32
+
33
+ values.first.match(USER_AGENT_REGEX)
34
+ end
35
+
36
+ header_matcher = lambda do |request_a, request_b|
37
+ return false unless user_agent_valid.(request_a.headers["User-Agent"])
38
+ return false unless user_agent_valid.(request_b.headers["User-Agent"])
39
+
40
+ HEADERS_SET_BY_BUGSNAG.all? do |header|
41
+ request_a.headers[header] == request_b.headers[header]
42
+ end
43
+ end
44
+
26
45
  c.default_cassette_options = {
27
- :record => ENV['TRAVIS'] ? :none : :once,
28
- :match_requests_on => [:method, :path]
46
+ :record => ENV['CI'] ? :none : :once,
47
+ :match_requests_on => [:method, :path, header_matcher]
29
48
  }
30
49
 
31
- c.filter_sensitive_data("https://api.bugsnag.com") { Bugsnag::Api.configuration.endpoint }
50
+ c.filter_sensitive_data("https://api.bugsnag.com") { test_bugsnag_endpoint }
32
51
  c.filter_sensitive_data("api.bugsnag.com") { URI.parse(Bugsnag::Api.configuration.endpoint).host }
33
52
  c.filter_sensitive_data("BUGSNAG_AUTH_TOKEN") { test_bugsnag_auth_token }
34
53
  c.filter_sensitive_data("BUGSNAG_LOGIN") { CGI::escape(test_bugsnag_email) }
@@ -39,7 +58,8 @@ VCR.configure do |c|
39
58
  c.filter_sensitive_data("BUGSNAG_COLLABORATOR_EMAIL") { test_bugsnag_collaborator }
40
59
  c.filter_sensitive_data("BUGSNAG_ERROR_ID") { test_bugsnag_error_id }
41
60
  c.filter_sensitive_data("BUGSNAG_EVENT_ID") { test_bugsnag_event_id }
42
-
61
+ c.filter_sensitive_data("BUGSNAG_RELEASE_ID") { test_bugsnag_release_id }
62
+ c.filter_sensitive_data("BUGSNAG_RELEASE_GROUP_ID") { test_bugsnag_release_group_id }
43
63
  end
44
64
 
45
65
  def auth_token_client
@@ -66,11 +86,11 @@ def basic_auth_client
66
86
  end
67
87
 
68
88
  def bugsnag_url(path)
69
- URI.join(Bugsnag::Api.configuration.endpoint, path).to_s
89
+ URI.join(test_bugsnag_endpoint, path).to_s
70
90
  end
71
91
 
72
92
  def basic_bugsnag_url(path, options = {})
73
- url = File.join(Bugsnag::Api.configuration.endpoint, path)
93
+ url = File.join(test_bugsnag_endpoint, path)
74
94
  uri = Addressable::URI.parse(url)
75
95
 
76
96
  uri.user = options.fetch(:login, test_bugsnag_email)
@@ -121,4 +141,12 @@ end
121
141
 
122
142
  def test_bugsnag_collaborator
123
143
  ENV["BUGSNAG_TEST_COLLABORATOR_EMAIL"] || "BUGSNAG_COLLABORATOR_EMAIL"
124
- end
144
+ end
145
+
146
+ def test_bugsnag_release_id
147
+ ENV["BUGSNAG_TEST_RELEASE_ID"] || "BUGSNAG_RELEASE_ID"
148
+ end
149
+
150
+ def test_bugsnag_release_group_id
151
+ ENV["BUGSNAG_TEST_RELEASE_GROUP_ID"] || "BUGSNAG_RELEASE_GROUP_ID"
152
+ end