pagerduty 3.0.0 → 4.0.0

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
  SHA256:
3
- metadata.gz: 10e8332a28ba06cbed648d66d0ee4c367e9f179fe30ae4903846ab789070e596
4
- data.tar.gz: 56d30e6a7276dceff80df33748def18474204b58c4835d2fd2c59cccace8df2f
3
+ metadata.gz: 5a28c0400ef717442b4cb3acdab94f93ab4ebb3f84463379ed70677b681f384b
4
+ data.tar.gz: b958f49fd7a23616456aa0b1a83938967dd4fcb03ca815aee206c02550eb414b
5
5
  SHA512:
6
- metadata.gz: 4fc9193a4582aae06a8bbd6c886b99086142c7e9a57a4f09230e7152931f227d04c84007190629a9772a4c4e3a1d4a2f8a8f5fcb023f271c287f27c89f15c69d
7
- data.tar.gz: a10af69c0ea9fb5b8cb88bcde086e9abbba12fdade60e08255d2192e75450994527256d0bb47947bb05463871affc427874868c689ba9a87ececf671ec25a257
6
+ metadata.gz: 49fdf0151d0463187d060956fa47701ae5ef80a79bbda8b634e0996dc477927d5734c788ed4c533c0c7b94e24479733e9968aa75258506a1f9efd18f4c251065
7
+ data.tar.gz: 8673300cb3b8b1d1e1476df52dc7fa1493c480a3197e941b55a93fd4f81d72a316861f34e97c00f08eb21a4878185fe486e02e6805c01f3e6b5083797783f410
data/CHANGELOG.md CHANGED
@@ -10,7 +10,62 @@ The format is based on [Keep a Changelog], and this project adheres to
10
10
 
11
11
  ## [Unreleased]
12
12
 
13
- [Unreleased]: https://github.com/envato/pagerduty/compare/v3.0.0...HEAD
13
+ [Unreleased]: https://github.com/envato/pagerduty/compare/v4.0.0...HEAD
14
+
15
+ ## [4.0.0] - 2022-02-14
16
+
17
+ ### Removed
18
+
19
+ - Remove support for Ruby versions lower than 2.3 ([#78]).
20
+
21
+ - Removed the deprecated way of creating a Pagerduty instance ([#79]).
22
+
23
+ ```diff
24
+ - pagerduty = Pagerduty.new("<integration-key>")
25
+ + pagerduty = Pagerduty.build(integration_key: "<integration-key>", api_version: 1)
26
+ pagerduty.trigger("<incident description>")
27
+ incident.acknowledge
28
+ incident.resolve
29
+ ```
30
+
31
+ - Removed the deprecated `get_incident` and `service_key` methods from the
32
+ `Pagerduty::EventsApiV1::Incident` class ([#79]). `incident` provides a replacement
33
+ for the `get_incident` method. The `service_key` method has no replacement.
34
+
35
+ ```diff
36
+ pagerduty = Pagerduty.build(integration_key: "<integration-key>", api_version: 1)
37
+ - incident = pagerduty.get_incident("<incident-key>")
38
+ + incident = pagerduty.incident("<incident-key>")
39
+ incident.trigger("<incident description>")
40
+ incident.acknowledge
41
+ incident.resolve
42
+ ```
43
+
44
+ - Removed the `PagerdutyIncident` class. Instead, use the
45
+ `Pagerduty::EventsApiV1::Incident` class ([#79]).
46
+
47
+ ### Added
48
+
49
+ - Test on Ruby 3.0 and 3.1 in CI build ([#74], [#80]).
50
+
51
+ ### Changed
52
+
53
+ - The explicit `json` gem runtime dependency has been removed ([#78]).
54
+ - Use GitHub Actions for CI build instead of TravisCI ([#73]).
55
+ - The default git branch has been renamed to `main` ([#77]).
56
+
57
+ ### Fixed
58
+
59
+ - Resolved `Net::HTTPServerException` deprecation warning in test suite([#75]).
60
+
61
+ [4.0.0]: https://github.com/envato/pagerduty/compare/v3.0.0...v4.0.0
62
+ [#73]: https://github.com/envato/pagerduty/pull/73
63
+ [#74]: https://github.com/envato/pagerduty/pull/74
64
+ [#75]: https://github.com/envato/pagerduty/pull/75
65
+ [#78]: https://github.com/envato/pagerduty/pull/77
66
+ [#78]: https://github.com/envato/pagerduty/pull/78
67
+ [#79]: https://github.com/envato/pagerduty/pull/79
68
+ [#80]: https://github.com/envato/pagerduty/pull/80
14
69
 
15
70
  ## [3.0.0] - 2020-04-20
16
71
 
@@ -123,7 +178,7 @@ The format is based on [Keep a Changelog], and this project adheres to
123
178
  ```
124
179
 
125
180
  [3.0.0]: https://github.com/envato/pagerduty/compare/v2.1.3...v3.0.0
126
- [events-v2-docs]: https://v2.developer.pagerduty.com/docs/send-an-event-events-api-v2
181
+ [events-v2-docs]: https://developer.pagerduty.com/docs/ZG9jOjExMDI5NTgw-events-api-v2-overview
127
182
  [#64]: https://github.com/envato/pagerduty/pull/64
128
183
  [#66]: https://github.com/envato/pagerduty/pull/66
129
184
  [#67]: https://github.com/envato/pagerduty/pull/67
data/README.md CHANGED
@@ -1,14 +1,14 @@
1
1
  # pagerduty
2
2
 
3
- [![License MIT](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://github.com/envato/pagerduty/blob/master/LICENSE.txt)
3
+ [![License MIT](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://github.com/envato/pagerduty/blob/HEAD/LICENSE.txt)
4
4
  [![Gem Version](https://img.shields.io/gem/v/pagerduty.svg?maxAge=2592000)](https://rubygems.org/gems/pagerduty)
5
5
  [![Gem Downloads](https://img.shields.io/gem/dt/pagerduty.svg?maxAge=2592000)](https://rubygems.org/gems/pagerduty)
6
- [![Build Status](https://travis-ci.org/envato/pagerduty.svg?branch=master)](https://travis-ci.org/envato/pagerduty)
6
+ [![Build Status](https://github.com/envato/pagerduty/workflows/build/badge.svg?branch=main)](https://github.com/envato/pagerduty/actions?query=workflow%3Abuild+branch%3Amain)
7
7
 
8
8
  Provides a lightweight Ruby interface for calling the [PagerDuty Events
9
9
  API][events-v2-docs].
10
10
 
11
- [events-v2-docs]: https://v2.developer.pagerduty.com/docs/send-an-event-events-api-v2
11
+ [events-v2-docs]: https://developer.pagerduty.com/docs/ZG9jOjExMDI5NTgw-events-api-v2-overview
12
12
 
13
13
  ## Installation
14
14
 
@@ -28,6 +28,13 @@ Or install it yourself as:
28
28
 
29
29
  ## Usage
30
30
 
31
+ First, obtain an Events API integration key from PagerDuty. Follow the
32
+ [instructions][integration-key-documentation] in PagerDuty's documentation to
33
+ procure one.
34
+
35
+ [integration-key-documentation]: https://support.pagerduty.com/docs/services-and-integrations#create-a-generic-events-api-integration
36
+
37
+
31
38
  ### Events API V2
32
39
 
33
40
  ```ruby
@@ -207,30 +214,13 @@ begin
207
214
  source: "source",
208
215
  severity: "critical"
209
216
  )
210
- rescue Net::HTTPServerException => error
217
+ rescue Net::HTTPClientException => error
211
218
  error.response.code #=> "400"
212
219
  error.response.message #=> "Bad Request"
213
220
  error.response.body #=> "{\"status\":\"invalid event\",\"message\":\"Event object is invalid\",\"errors\":[\"Service key is the wrong length (should be 32 characters)\"]}"
214
221
  end
215
222
  ```
216
223
 
217
- ### Legacy Interface
218
-
219
- The older Ruby interface from version 2 of the gem is still available.
220
- However, this is deprecated and will be removed in the next major release.
221
-
222
- ```ruby
223
- # Instantiate a Pagerduty with your specific service key
224
- pagerduty = Pagerduty.new("<my-integration-key>")
225
-
226
- # Trigger an incident
227
- incident = pagerduty.trigger("incident description")
228
-
229
- # Acknowledge and resolve the incident
230
- incident.acknowledge
231
- incident.resolve
232
- ```
233
-
234
224
  ## Contributing
235
225
 
236
226
  1. Fork it ( https://github.com/envato/pagerduty/fork )
@@ -5,8 +5,8 @@ require "time"
5
5
  module Pagerduty
6
6
  # Trigger incidents via the PagerDuty Events API version 2.
7
7
  #
8
- # @see https://v2.developer.pagerduty.com/docs/events-api-v2 PagerDuty Events
9
- # API V2 documentation
8
+ # @see https://developer.pagerduty.com/docs/ZG9jOjExMDI5NTgw-events-api-v2-overview
9
+ # PagerDuty Events API V2 documentation
10
10
  #
11
11
  # @see Pagerduty.build
12
12
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pagerduty
4
- VERSION = "3.0.0"
4
+ VERSION = "4.0.0"
5
5
  end
data/lib/pagerduty.rb CHANGED
@@ -4,7 +4,6 @@ require "pagerduty/version"
4
4
  require "pagerduty/http_transport"
5
5
  require "pagerduty/events_api_v1"
6
6
  require "pagerduty/events_api_v2"
7
- require "pagerduty/legacy"
8
7
 
9
8
  class PagerdutyException < StandardError
10
9
  attr_reader :pagerduty_instance, :api_response
metadata CHANGED
@@ -1,30 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pagerduty
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charlie Somerville
8
8
  - Orien Madgwick
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-04-20 00:00:00.000000000 Z
12
+ date: 2022-02-14 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: json
16
- requirement: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - ">="
19
- - !ruby/object:Gem::Version
20
- version: 1.7.7
21
- type: :runtime
22
- prerelease: false
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- version: 1.7.7
28
14
  - !ruby/object:Gem::Dependency
29
15
  name: bundler
30
16
  requirement: !ruby/object:Gem::Requirement
@@ -81,8 +67,7 @@ dependencies:
81
67
  - - "<"
82
68
  - !ruby/object:Gem::Version
83
69
  version: '0.77'
84
- description: Provides a lightweight interface for calling the PagerDuty Integration
85
- API
70
+ description: Provides a lightweight interface for calling the PagerDuty Events API
86
71
  email:
87
72
  - charlie@charliesomerville.com
88
73
  - _@orien.io
@@ -97,17 +82,17 @@ files:
97
82
  - lib/pagerduty/events_api_v1.rb
98
83
  - lib/pagerduty/events_api_v2.rb
99
84
  - lib/pagerduty/http_transport.rb
100
- - lib/pagerduty/legacy.rb
101
85
  - lib/pagerduty/version.rb
102
- homepage: http://github.com/envato/pagerduty
86
+ homepage: https://github.com/envato/pagerduty
103
87
  licenses:
104
88
  - MIT
105
89
  metadata:
106
90
  bug_tracker_uri: https://github.com/envato/pagerduty/issues
107
- changelog_uri: https://github.com/envato/pagerduty/blob/v3.0.0/CHANGELOG.md
108
- documentation_uri: https://www.rubydoc.info/gems/pagerduty/3.0.0
109
- source_code_uri: https://github.com/envato/pagerduty/tree/v3.0.0
110
- post_install_message:
91
+ changelog_uri: https://github.com/envato/pagerduty/blob/v4.0.0/CHANGELOG.md
92
+ documentation_uri: https://www.rubydoc.info/gems/pagerduty/4.0.0
93
+ homepage_uri: https://github.com/envato/pagerduty
94
+ source_code_uri: https://github.com/envato/pagerduty/tree/v4.0.0
95
+ post_install_message:
111
96
  rdoc_options: []
112
97
  require_paths:
113
98
  - lib
@@ -115,15 +100,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
115
100
  requirements:
116
101
  - - ">="
117
102
  - !ruby/object:Gem::Version
118
- version: '0'
103
+ version: '2.3'
119
104
  required_rubygems_version: !ruby/object:Gem::Requirement
120
105
  requirements:
121
106
  - - ">="
122
107
  - !ruby/object:Gem::Version
123
108
  version: '0'
124
109
  requirements: []
125
- rubygems_version: 3.1.2
126
- signing_key:
110
+ rubygems_version: 3.3.7
111
+ signing_key:
127
112
  specification_version: 4
128
- summary: Pagerduty Integration API client library
113
+ summary: PagerDuty Events API client library
129
114
  test_files: []
@@ -1,36 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # This file contains patches to provide backwards compatibility with version 2
4
- # of the pagerduty gem. On the release of the next major version (4.0) it will
5
- # be deleted, thus breaking backwards compatibility.
6
-
7
- PagerdutyIncident = Pagerduty::EventsApiV1::Incident
8
-
9
- Pagerduty::EventsApiV1::Incident.class_eval do
10
- def service_key
11
- @integration_key
12
- end
13
- end
14
-
15
- Pagerduty::EventsApiV1.class_eval do
16
- alias_method :get_incident, :incident
17
-
18
- def service_key
19
- @config[:integration_key]
20
- end
21
- end
22
-
23
- Pagerduty.class_eval do
24
- def self.new(service_key, options = {})
25
- build(
26
- integration_key: service_key,
27
- api_version: 1,
28
- http_proxy: {
29
- host: options[:proxy_host],
30
- port: options[:proxy_port],
31
- username: options[:proxy_username],
32
- password: options[:proxy_password],
33
- },
34
- )
35
- end
36
- end