From 46cb65a25b62df3a96418ecaec8ef14bcdacdaf4 Mon Sep 17 00:00:00 2001 From: Laura Paredes Date: Thu, 9 May 2019 20:11:51 +0200 Subject: [PATCH 1/3] Replace deprecated status.github.com with the new githubstatus.com --- lib/octokit/client/service_status.rb | 15 ++++++++------- .../returns_the_current_system_status.json | 2 +- .../returns_the_most_recent_status_messages.json | 2 +- .../returns_the_last_human_message.json | 2 +- spec/octokit/client/service_status_spec.rb | 11 ++++------- 5 files changed, 15 insertions(+), 17 deletions(-) diff --git a/lib/octokit/client/service_status.rb b/lib/octokit/client/service_status.rb index 65a1f84b6..f1e7ae4c9 100644 --- a/lib/octokit/client/service_status.rb +++ b/lib/octokit/client/service_status.rb @@ -8,30 +8,31 @@ module ServiceStatus # Root for status API # @private - STATUS_ROOT = 'https://status.github.com/api.json' + STATUS_ROOT = 'https://www.githubstatus.com/api/v2/status.json' + COMPONENTS_ROOT = 'https://www.githubstatus.com/api/v2/components.json' # Returns the current system status # # @return [Sawyer::Resource] GitHub status - # @see https://status.github.com/api#api-current-status + # @see https://www.githubstatus.com/api#status def github_status - get(STATUS_ROOT).rels[:status].get.data + get(STATUS_ROOT) end # Returns the last human communication, status, and timestamp. # # @return [Sawyer::Resource] GitHub status last message - # @see https://status.github.com/api#api-last-message + # @see https://www.githubstatus.com/api/#components def github_status_last_message - get(STATUS_ROOT).rels[:last_message].get.data + get(COMPONENTS_ROOT).components.first end # Returns the most recent human communications with status and timestamp. # # @return [Array] GitHub status messages - # @see https://status.github.com/api#api-recent-messages + # @see https://www.githubstatus.com/api#components def github_status_messages - get(STATUS_ROOT).rels[:messages].get.data + get(COMPONENTS_ROOT).components end end end diff --git a/spec/cassettes/Octokit_Client_ServiceStatus/_github_status/returns_the_current_system_status.json b/spec/cassettes/Octokit_Client_ServiceStatus/_github_status/returns_the_current_system_status.json index b2d4a5353..4c978faa5 100644 --- a/spec/cassettes/Octokit_Client_ServiceStatus/_github_status/returns_the_current_system_status.json +++ b/spec/cassettes/Octokit_Client_ServiceStatus/_github_status/returns_the_current_system_status.json @@ -1 +1 @@ -{"http_interactions":[{"request":{"method":"get","uri":"https://status.github.com/api.json","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"Accept":["application/vnd.github.beta+json"],"User-Agent":["Octokit Ruby Gem 2.0.0.pre"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Server":["GitHub.com"],"Date":["Mon, 24 Jun 2013 01:17:50 GMT"],"Content-Type":["application/json;charset=utf-8"],"Connection":["keep-alive"],"Status":["200 OK"],"Content-Length":["188"],"Vary":["Accept-Encoding"]},"body":{"encoding":"UTF-8","base64_string":"eyJzdGF0dXNfdXJsIjoiaHR0cHM6Ly9zdGF0dXMuZ2l0aHViLmNvbS9hcGkv\nc3RhdHVzLmpzb24iLCJtZXNzYWdlc191cmwiOiJodHRwczovL3N0YXR1cy5n\naXRodWIuY29tL2FwaS9tZXNzYWdlcy5qc29uIiwibGFzdF9tZXNzYWdlX3Vy\nbCI6Imh0dHBzOi8vc3RhdHVzLmdpdGh1Yi5jb20vYXBpL2xhc3QtbWVzc2Fn\nZS5qc29uIn0=\n"},"http_version":null},"recorded_at":"Mon, 24 Jun 2013 01:17:50 GMT"},{"request":{"method":"get","uri":"https://status.github.com/api/status.json","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"Accept":["application/vnd.github.beta+json"],"User-Agent":["Octokit Ruby Gem 2.0.0.pre"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Server":["GitHub.com"],"Date":["Mon, 24 Jun 2013 01:17:50 GMT"],"Content-Type":["application/json;charset=utf-8"],"Connection":["keep-alive"],"Status":["200 OK"],"Content-Length":["55"],"Vary":["Accept-Encoding"]},"body":{"encoding":"UTF-8","base64_string":"eyJzdGF0dXMiOiJnb29kIiwibGFzdF91cGRhdGVkIjoiMjAxMy0wNi0yNFQw\nMToxNzozN1oifQ==\n"},"http_version":null},"recorded_at":"Mon, 24 Jun 2013 01:17:50 GMT"}],"recorded_with":"VCR 2.4.0"} \ No newline at end of file +{"http_interactions":[{"request":{"method":"get","uri":"https://www.githubstatus.com/api/v2/status.json","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"Accept":["application/vnd.github.v3+json"],"User-Agent":["Octokit Ruby Gem 4.14.0"],"Content-Type":["application/json"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"X-Xss-Protection":["1; mode=block"],"X-Content-Type-Options":["nosniff"],"X-Download-Options":["noopen"],"X-Permitted-Cross-Domain-Policies":["none"],"Referrer-Policy":["strict-origin-when-cross-origin"],"X-Statuspage-Version":["96ad7c53a1850f20f0fcbd7ef7a8117d5f510b4a"],"Vary":["Accept,Accept-Encoding,X-Forwarded-Host,X-Forwarded-Scheme,X-Forwarded-Proto,Fastly-SSL"],"Strict-Transport-Security":["max-age=259200"],"X-Statuspage-Skip-Logging":["true"],"Access-Control-Allow-Origin":["*"],"Content-Type":["application/json; charset=utf-8"],"Etag":["W/\"f23e6e1f8da895ff1308d4e94223a68a\""],"Cache-Control":["max-age=0, private, must-revalidate"],"X-Request-Id":["475128f5-0690-464f-b8a5-f1c0a427a40c"],"X-Runtime":["0.044704"],"Date":["Thu, 09 May 2019 18:03:51 GMT"],"Age":["35"],"X-Cache":["HIT"],"Accept-Ranges":["bytes"],"Content-Length":["215"],"Connection":["keep-alive"]},"body":{"encoding":"UTF-8","base64_string":"eyJwYWdlIjp7ImlkIjoia2N0Ymg5dnJ0ZHdkIiwibmFtZSI6IkdpdEh1YiIs\nInVybCI6Imh0dHBzOi8vd3d3LmdpdGh1YnN0YXR1cy5jb20iLCJ0aW1lX3pv\nbmUiOiJFdGMvVVRDIiwidXBkYXRlZF9hdCI6IjIwMTktMDUtMDlUMTg6MDI6\nNDAuMTI4WiJ9LCJzdGF0dXMiOnsiaW5kaWNhdG9yIjoibm9uZSIsImRlc2Ny\naXB0aW9uIjoiQWxsIFN5c3RlbXMgT3BlcmF0aW9uYWwifX0=\n"},"http_version":null},"recorded_at":"Thu, 09 May 2019 18:04:26 GMT"}],"recorded_with":"VCR 4.0.0"} \ No newline at end of file diff --git a/spec/cassettes/Octokit_Client_ServiceStatus/_github_status/returns_the_most_recent_status_messages.json b/spec/cassettes/Octokit_Client_ServiceStatus/_github_status/returns_the_most_recent_status_messages.json index e53ee5ff5..07b24cf1a 100644 --- a/spec/cassettes/Octokit_Client_ServiceStatus/_github_status/returns_the_most_recent_status_messages.json +++ b/spec/cassettes/Octokit_Client_ServiceStatus/_github_status/returns_the_most_recent_status_messages.json @@ -1 +1 @@ -{"http_interactions":[{"request":{"method":"get","uri":"https://status.github.com/api.json","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"Accept":["application/vnd.github.beta+json"],"User-Agent":["Octokit Ruby Gem 2.0.0.pre"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Server":["GitHub.com"],"Date":["Mon, 24 Jun 2013 01:17:51 GMT"],"Content-Type":["application/json;charset=utf-8"],"Connection":["keep-alive"],"Status":["200 OK"],"Content-Length":["188"],"Vary":["Accept-Encoding"]},"body":{"encoding":"UTF-8","base64_string":"eyJzdGF0dXNfdXJsIjoiaHR0cHM6Ly9zdGF0dXMuZ2l0aHViLmNvbS9hcGkv\nc3RhdHVzLmpzb24iLCJtZXNzYWdlc191cmwiOiJodHRwczovL3N0YXR1cy5n\naXRodWIuY29tL2FwaS9tZXNzYWdlcy5qc29uIiwibGFzdF9tZXNzYWdlX3Vy\nbCI6Imh0dHBzOi8vc3RhdHVzLmdpdGh1Yi5jb20vYXBpL2xhc3QtbWVzc2Fn\nZS5qc29uIn0=\n"},"http_version":null},"recorded_at":"Mon, 24 Jun 2013 01:17:51 GMT"},{"request":{"method":"get","uri":"https://status.github.com/api/messages.json","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"Accept":["application/vnd.github.beta+json"],"User-Agent":["Octokit Ruby Gem 2.0.0.pre"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Server":["GitHub.com"],"Date":["Mon, 24 Jun 2013 01:17:51 GMT"],"Content-Type":["application/json;charset=utf-8"],"Connection":["keep-alive"],"Status":["200 OK"],"Content-Length":["489"],"Vary":["Accept-Encoding"]},"body":{"encoding":"UTF-8","base64_string":"W3sic3RhdHVzIjoiZ29vZCIsImJvZHkiOiJFdmVyeXRoaW5nIG9wZXJhdGlu\nZyBub3JtYWxseS4iLCJjcmVhdGVkX29uIjoiMjAxMy0wNi0yMFQxMDowOToy\nM1oifSx7InN0YXR1cyI6Im1pbm9yIiwiYm9keSI6IkEgc21hbGwgcGVyY2Vu\ndGFnZSBvZiByZXBvc2l0b3JpZXMgYXJlIGN1cnJlbnRseSB1bmF2YWlsYWJs\nZSB3aGlsZSB3ZSBwZXJmb3JtIG1haW50ZW5hbmNlLiIsImNyZWF0ZWRfb24i\nOiIyMDEzLTA2LTIwVDA5OjUwOjA3WiJ9LHsic3RhdHVzIjoiZ29vZCIsImJv\nZHkiOiJFdmVyeXRoaW5nIG9wZXJhdGluZyBub3JtYWxseS4iLCJjcmVhdGVk\nX29uIjoiMjAxMy0wNi0yMFQwNjoyMToxOVoifSx7InN0YXR1cyI6Im1ham9y\nIiwiYm9keSI6IldlIGFyZSBzdGFydGluZyBhIGJyaWVmIHVuc2NoZWR1bGVk\nIG1haW50ZW5hbmNlIHdpbmRvdywgYW5kIHdpbGwgcmV0dXJuIHNob3J0bHku\nIiwiY3JlYXRlZF9vbiI6IjIwMTMtMDYtMjBUMDY6MTU6MDZaIn1d\n"},"http_version":null},"recorded_at":"Mon, 24 Jun 2013 01:17:51 GMT"}],"recorded_with":"VCR 2.4.0"} \ No newline at end of file +{"http_interactions":[{"request":{"method":"get","uri":"https://www.githubstatus.com/api/v2/components.json","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"Accept":["application/vnd.github.v3+json"],"User-Agent":["Octokit Ruby Gem 4.14.0"],"Content-Type":["application/json"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Vary":["Accept,Accept-Encoding,X-Forwarded-Host,X-Forwarded-Scheme,X-Forwarded-Proto,Fastly-SSL"],"Cache-Control":["max-age=0, private, must-revalidate"],"X-Cache":["HIT"],"Content-Type":["application/json; charset=utf-8"],"Strict-Transport-Security":["max-age=259200"],"X-Request-Id":["bbf54b8e-0c92-432f-ac30-d778ac7bfcbe"],"Date":["Thu, 09 May 2019 18:03:50 GMT"],"X-Download-Options":["noopen"],"X-Xss-Protection":["1; mode=block"],"X-Runtime":["0.050216"],"Transfer-Encoding":["chunked"],"X-Permitted-Cross-Domain-Policies":["none"],"Access-Control-Allow-Origin":["*"],"Accept-Ranges":["bytes"],"X-Content-Type-Options":["nosniff"],"Etag":["W/\"gz[300642b1de777d8f346df5a69354be97]\""],"X-Statuspage-Skip-Logging":["true"],"Connection":["keep-alive"],"X-Statuspage-Version":["96ad7c53a1850f20f0fcbd7ef7a8117d5f510b4a"],"Referrer-Policy":["strict-origin-when-cross-origin"],"Age":["36"]},"body":{"encoding":"ASCII-8BIT","base64_string":"eyJwYWdlIjp7ImlkIjoia2N0Ymg5dnJ0ZHdkIiwibmFtZSI6IkdpdEh1YiIs\nInVybCI6Imh0dHBzOi8vd3d3LmdpdGh1YnN0YXR1cy5jb20iLCJ0aW1lX3pv\nbmUiOiJFdGMvVVRDIiwidXBkYXRlZF9hdCI6IjIwMTktMDUtMDlUMTg6MDI6\nNDAuMTI4WiJ9LCJjb21wb25lbnRzIjpbeyJpZCI6IjhsNHlncDAwOXM1cyIs\nIm5hbWUiOiJHaXQgT3BlcmF0aW9ucyIsInN0YXR1cyI6Im9wZXJhdGlvbmFs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dkIiwi\nZ3JvdXAiOmZhbHNlLCJvbmx5X3Nob3dfaWZfZGVncmFkZWQiOmZhbHNlfSx7\nImlkIjoiMDRjMjh5a3oyYzVtIiwibmFtZSI6Ikdpc3RzIiwic3RhdHVzIjoi\nb3BlcmF0aW9uYWwiLCJjcmVhdGVkX2F0IjoiMjAxOC0wMS0xMFQyMzo0Nzoz\nNC40NzRaIiwidXBkYXRlZF9hdCI6IjIwMTktMDEtMTVUMjM6MTE6MjIuNjEy\nWiIsInBvc2l0aW9uIjo2LCJkZXNjcmlwdGlvbiI6IldlYiBzZXJ2aWNlIHJl\ncXVlc3RzIGZvciBnaXN0cyIsInNob3djYXNlIjpmYWxzZSwiZ3JvdXBfaWQi\nOm51bGwsInBhZ2VfaWQiOiJrY3RiaDl2cnRkd2QiLCJncm91cCI6ZmFsc2Us\nIm9ubHlfc2hvd19pZl9kZWdyYWRlZCI6ZmFsc2V9LHsiaWQiOiJ2ZzcwaG45\nczJ0eWoiLCJuYW1lIjoiR2l0SHViIFBhZ2VzIiwic3RhdHVzIjoib3BlcmF0\naW9uYWwiLCJjcmVhdGVkX2F0IjoiMjAxNy0wMS0zMVQyMDowNDozMy45MjNa\nIiwidXBkYXRlZF9hdCI6IjIwMTktMDQtMTNUMTc6NTg6MzQuMTMyWiIsInBv\nc2l0aW9uIjo3LCJkZXNjcmlwdGlvbiI6IkZyb250ZW5kIGFwcGxpY2F0aW9u\nIGFuZCBBUEkgc2VydmVycyBmb3IgUGFnZXMgYnVpbGRzIiwic2hvd2Nhc2Ui\nOmZhbHNlLCJncm91cF9pZCI6bnVsbCwicGFnZV9pZCI6ImtjdGJoOXZydGR3\nZCIsImdyb3VwIjpmYWxzZSwib25seV9zaG93X2lmX2RlZ3JhZGVkIjpmYWxz\nZX1dfQ==\n"},"http_version":null},"recorded_at":"Thu, 09 May 2019 18:04:26 GMT"}],"recorded_with":"VCR 4.0.0"} \ No newline at end of file diff --git a/spec/cassettes/Octokit_Client_ServiceStatus/_github_status_last_message/returns_the_last_human_message.json b/spec/cassettes/Octokit_Client_ServiceStatus/_github_status_last_message/returns_the_last_human_message.json index 3a07301d3..8cf38a605 100644 --- a/spec/cassettes/Octokit_Client_ServiceStatus/_github_status_last_message/returns_the_last_human_message.json +++ b/spec/cassettes/Octokit_Client_ServiceStatus/_github_status_last_message/returns_the_last_human_message.json @@ -1 +1 @@ -{"http_interactions":[{"request":{"method":"get","uri":"https://status.github.com/api.json","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"Accept":["application/vnd.github.beta+json"],"User-Agent":["Octokit Ruby Gem 2.0.0.pre"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Server":["GitHub.com"],"Date":["Mon, 24 Jun 2013 01:17:51 GMT"],"Content-Type":["application/json;charset=utf-8"],"Connection":["keep-alive"],"Status":["200 OK"],"Content-Length":["188"],"Vary":["Accept-Encoding"]},"body":{"encoding":"UTF-8","base64_string":"eyJzdGF0dXNfdXJsIjoiaHR0cHM6Ly9zdGF0dXMuZ2l0aHViLmNvbS9hcGkv\nc3RhdHVzLmpzb24iLCJtZXNzYWdlc191cmwiOiJodHRwczovL3N0YXR1cy5n\naXRodWIuY29tL2FwaS9tZXNzYWdlcy5qc29uIiwibGFzdF9tZXNzYWdlX3Vy\nbCI6Imh0dHBzOi8vc3RhdHVzLmdpdGh1Yi5jb20vYXBpL2xhc3QtbWVzc2Fn\nZS5qc29uIn0=\n"},"http_version":null},"recorded_at":"Mon, 24 Jun 2013 01:17:50 GMT"},{"request":{"method":"get","uri":"https://status.github.com/api/last-message.json","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"Accept":["application/vnd.github.beta+json"],"User-Agent":["Octokit Ruby Gem 2.0.0.pre"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Server":["GitHub.com"],"Date":["Mon, 24 Jun 2013 01:17:51 GMT"],"Content-Type":["application/json;charset=utf-8"],"Connection":["keep-alive"],"Status":["200 OK"],"Content-Length":["93"],"Vary":["Accept-Encoding"]},"body":{"encoding":"UTF-8","base64_string":"eyJzdGF0dXMiOiJnb29kIiwiYm9keSI6IkV2ZXJ5dGhpbmcgb3BlcmF0aW5n\nIG5vcm1hbGx5LiIsImNyZWF0ZWRfb24iOiIyMDEzLTA2LTIwVDEwOjA5OjIz\nWiJ9\n"},"http_version":null},"recorded_at":"Mon, 24 Jun 2013 01:17:51 GMT"}],"recorded_with":"VCR 2.4.0"} \ No newline at end of file +{"http_interactions":[{"request":{"method":"get","uri":"https://www.githubstatus.com/api/v2/components.json","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"Accept":["application/vnd.github.v3+json"],"User-Agent":["Octokit Ruby Gem 4.14.0"],"Content-Type":["application/json"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Vary":["Accept,Accept-Encoding,X-Forwarded-Host,X-Forwarded-Scheme,X-Forwarded-Proto,Fastly-SSL"],"Cache-Control":["max-age=0, private, must-revalidate"],"X-Cache":["MISS"],"Content-Type":["application/json; charset=utf-8"],"Strict-Transport-Security":["max-age=259200"],"X-Request-Id":["d5cf07e2-a695-45a0-a799-aeabb88a2b8e"],"Date":["Thu, 09 May 2019 18:04:27 GMT"],"X-Download-Options":["noopen"],"X-Xss-Protection":["1; mode=block"],"X-Runtime":["0.037367"],"Transfer-Encoding":["chunked"],"X-Permitted-Cross-Domain-Policies":["none"],"Access-Control-Allow-Origin":["*"],"Accept-Ranges":["bytes"],"X-Content-Type-Options":["nosniff"],"Etag":["W/\"gz[300642b1de777d8f346df5a69354be97]\""],"X-Statuspage-Skip-Logging":["true"],"Connection":["keep-alive"],"X-Statuspage-Version":["96ad7c53a1850f20f0fcbd7ef7a8117d5f510b4a"],"Referrer-Policy":["strict-origin-when-cross-origin"],"Age":["0"]},"body":{"encoding":"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yb250ZW5kIGFwcGxpY2F0aW9u\nIGFuZCBBUEkgc2VydmVycyBmb3IgUGFnZXMgYnVpbGRzIiwic2hvd2Nhc2Ui\nOmZhbHNlLCJncm91cF9pZCI6bnVsbCwicGFnZV9pZCI6ImtjdGJoOXZydGR3\nZCIsImdyb3VwIjpmYWxzZSwib25seV9zaG93X2lmX2RlZ3JhZGVkIjpmYWxz\nZX1dfQ==\n"},"http_version":null},"recorded_at":"Thu, 09 May 2019 18:04:27 GMT"}],"recorded_with":"VCR 4.0.0"} \ No newline at end of file diff --git a/spec/octokit/client/service_status_spec.rb b/spec/octokit/client/service_status_spec.rb index 2409bece9..4f1888c14 100644 --- a/spec/octokit/client/service_status_spec.rb +++ b/spec/octokit/client/service_status_spec.rb @@ -10,8 +10,7 @@ it "returns the current system status" do current_status = Octokit.github_status expect(current_status.status).not_to be_nil - assert_requested :get, "https://status.github.com/api.json" - assert_requested :get, "https://status.github.com/api/status.json" + assert_requested :get, "https://www.githubstatus.com/api/v2/status.json" end end # .github_status @@ -19,9 +18,8 @@ it "returns the last human message" do message = Octokit.github_status_last_message expect(message.status).not_to be_nil - expect(message.body).not_to be_nil - assert_requested :get, "https://status.github.com/api.json" - assert_requested :get, "https://status.github.com/api/last-message.json" + expect(message.description).not_to be_nil + assert_requested :get, "https://www.githubstatus.com/api/v2/components.json" end end # .github_status_last_message @@ -29,8 +27,7 @@ it "returns the most recent status messages" do messages = Octokit.github_status_messages expect(messages).to be_kind_of Array - assert_requested :get, "https://status.github.com/api.json" - assert_requested :get, "https://status.github.com/api/messages.json" + assert_requested :get, "https://www.githubstatus.com/api/v2/components.json" end end # .github_status From 80b77eac884b8e4ca36c62d7ab89eb7ee29e9548 Mon Sep 17 00:00:00 2001 From: Laura Paredes Date: Fri, 10 May 2019 23:14:42 +0200 Subject: [PATCH 2/3] Added a method to retrieve the status summary --- lib/octokit/client/service_status.rb | 9 +++++++++ .../returns_the_current_system_status_summary.json | 1 + spec/octokit/client/service_status_spec.rb | 9 +++++++++ 3 files changed, 19 insertions(+) create mode 100644 spec/cassettes/Octokit_Client_ServiceStatus/_github_status_summary/returns_the_current_system_status_summary.json diff --git a/lib/octokit/client/service_status.rb b/lib/octokit/client/service_status.rb index f1e7ae4c9..df58862f6 100644 --- a/lib/octokit/client/service_status.rb +++ b/lib/octokit/client/service_status.rb @@ -8,9 +8,18 @@ module ServiceStatus # Root for status API # @private + SUMMARY_ROOT = 'https://www.githubstatus.com/api/v2/summary.json' STATUS_ROOT = 'https://www.githubstatus.com/api/v2/status.json' COMPONENTS_ROOT = 'https://www.githubstatus.com/api/v2/components.json' + # Returns a summary with the current status and the last status messages. + # + # @return [] GitHub status summary + # @see https://www.githubstatus.com/api#summory + def github_status_summary + get(SUMMARY_ROOT) + end + # Returns the current system status # # @return [Sawyer::Resource] GitHub status diff --git a/spec/cassettes/Octokit_Client_ServiceStatus/_github_status_summary/returns_the_current_system_status_summary.json b/spec/cassettes/Octokit_Client_ServiceStatus/_github_status_summary/returns_the_current_system_status_summary.json new file mode 100644 index 000000000..97edf581a --- /dev/null +++ b/spec/cassettes/Octokit_Client_ServiceStatus/_github_status_summary/returns_the_current_system_status_summary.json @@ -0,0 +1 @@ +{"http_interactions":[{"request":{"method":"get","uri":"https://www.githubstatus.com/api/v2/summary.json","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"Accept":["application/vnd.github.v3+json"],"User-Agent":["Octokit Ruby Gem 4.14.0"],"Content-Type":["application/json"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Vary":["Accept,Accept-Encoding,X-Forwarded-Host,X-Forwarded-Scheme,X-Forwarded-Proto,Fastly-SSL"],"Cache-Control":["max-age=0, private, must-revalidate"],"X-Cache":["MISS"],"Content-Type":["application/json; charset=utf-8"],"Strict-Transport-Security":["max-age=259200"],"Access-Control-Expose-Headers":["ETag"],"X-Request-Id":["de10b0a5-2fd7-4d26-8b07-5c1b0b60a75c"],"Date":["Fri, 10 May 2019 21:13:34 GMT"],"X-Download-Options":["noopen"],"X-Xss-Protection":["1; mode=block"],"X-Runtime":["0.095981"],"Transfer-Encoding":["chunked"],"X-Permitted-Cross-Domain-Policies":["none"],"Access-Control-Allow-Origin":["*"],"Accept-Ranges":["bytes"],"X-Content-Type-Options":["nosniff"],"Etag":["W/\"gz[352ce2ac6d753d0183e702654326a77f]\""],"X-Statuspage-Skip-Logging":["true"],"Connection":["keep-alive"],"X-Statuspage-Version":["272bee90b31fe688800cdca78d9732a75e4dd0cb"],"Referrer-Policy":["strict-origin-when-cross-origin"],"Age":["0"]},"body":{"encoding":"ASCII-8BIT","base64_string":"eyJwYWdlIjp7ImlkIjoia2N0Ymg5dnJ0ZHdkIiwibmFtZSI6IkdpdEh1YiIs\nInVybCI6Imh0dHBzOi8vd3d3LmdpdGh1YnN0YXR1cy5jb20iLCJ0aW1lX3pv\nbmUiOiJFdGMvVVRDIiwidXBkYXRlZF9hdCI6IjIwMTktMDUtMTBUMjE6MTM6\nMDIuNzgxWiJ9LCJjb21wb25lbnRzIjpbeyJpZCI6IjhsNHlncDAwOXM1cyIs\nIm5hbWUiOiJHaXQgT3BlcmF0aW9ucyIsInN0YXR1cyI6Im9wZXJhdGlvbmFs\nIiwiY3JlYXRlZF9hdCI6IjIwMTctMDEtMzFUMjA6MDU6MDUuMzcwWiIsInVw\nZGF0ZWRfYXQiOiIyMDE5LTA0LTIyVDEyOjI4OjIwLjc0MloiLCJwb3NpdGlv\nbiI6MSwiZGVzY3JpcHRpb24iOiJQZXJmb3JtYW5jZSBvZiBnaXQgY2xvbmVz\nLCBwdWxscywgcHVzaGVzLCBhbmQgYXNzb2NpYXRlZCBvcGVyYXRpb25zIiwi\nc2hvd2Nhc2UiOmZhbHNlLCJncm91cF9pZCI6bnVsbCwicGFnZV9pZCI6Imtj\ndGJoOXZydGR3ZCIsImdyb3VwIjpmYWxzZSwib25seV9zaG93X2lmX2RlZ3Jh\nZGVkIjpmYW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m51bGwsInBhZ2VfaWQiOiJrY3RiaDl2cnRkd2QiLCJncm91cCI6ZmFsc2Us\nIm9ubHlfc2hvd19pZl9kZWdyYWRlZCI6ZmFsc2V9LHsiaWQiOiJ2ZzcwaG45\nczJ0eWoiLCJuYW1lIjoiR2l0SHViIFBhZ2VzIiwic3RhdHVzIjoib3BlcmF0\naW9uYWwiLCJjcmVhdGVkX2F0IjoiMjAxNy0wMS0zMVQyMDowNDozMy45MjNa\nIiwidXBkYXRlZF9hdCI6IjIwMTktMDQtMTNUMTc6NTg6MzQuMTMyWiIsInBv\nc2l0aW9uIjo3LCJkZXNjcmlwdGlvbiI6IkZyb250ZW5kIGFwcGxpY2F0aW9u\nIGFuZCBBUEkgc2VydmVycyBmb3IgUGFnZXMgYnVpbGRzIiwic2hvd2Nhc2Ui\nOmZhbHNlLCJncm91cF9pZCI6bnVsbCwicGFnZV9pZCI6ImtjdGJoOXZydGR3\nZCIsImdyb3VwIjpmYWxzZSwib25seV9zaG93X2lmX2RlZ3JhZGVkIjpmYWxz\nZX1dLCJpbmNpZGVudHMiOltdLCJzY2hlZHVsZWRfbWFpbnRlbmFuY2VzIjpb\nXSwic3RhdHVzIjp7ImluZGljYXRvciI6Im5vbmUiLCJkZXNjcmlwdGlvbiI6\nIkFsbCBTeXN0ZW1zIE9wZXJhdGlvbmFsIn19\n"},"http_version":null},"recorded_at":"Fri, 10 May 2019 21:13:35 GMT"}],"recorded_with":"VCR 4.0.0"} \ No newline at end of file diff --git a/spec/octokit/client/service_status_spec.rb b/spec/octokit/client/service_status_spec.rb index 4f1888c14..f036a61fa 100644 --- a/spec/octokit/client/service_status_spec.rb +++ b/spec/octokit/client/service_status_spec.rb @@ -6,6 +6,15 @@ Octokit.reset! end + describe ".github_status_summary", :vcr do + it "returns the current system status summary" do + current_status = Octokit.github_status_summary + expect(current_status.status).not_to be_nil + expect(current_status.components).not_to be_nil + assert_requested :get, "https://www.githubstatus.com/api/v2/summary.json" + end + end # .github_status_summary + describe ".github_status", :vcr do it "returns the current system status" do current_status = Octokit.github_status From 7142b226bc825aee415d091b8ae8a5b1af95006d Mon Sep 17 00:00:00 2001 From: Laura Paredes Date: Fri, 10 May 2019 23:19:58 +0200 Subject: [PATCH 3/3] Fix describe in service status tests to reflect the right method --- .../returns_the_most_recent_status_messages.json | 2 +- spec/octokit/client/service_status_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename spec/cassettes/Octokit_Client_ServiceStatus/{_github_status => _github_status_messages}/returns_the_most_recent_status_messages.json (80%) diff --git a/spec/cassettes/Octokit_Client_ServiceStatus/_github_status/returns_the_most_recent_status_messages.json b/spec/cassettes/Octokit_Client_ServiceStatus/_github_status_messages/returns_the_most_recent_status_messages.json similarity index 80% rename from spec/cassettes/Octokit_Client_ServiceStatus/_github_status/returns_the_most_recent_status_messages.json rename to spec/cassettes/Octokit_Client_ServiceStatus/_github_status_messages/returns_the_most_recent_status_messages.json index 07b24cf1a..010f20cf1 100644 --- a/spec/cassettes/Octokit_Client_ServiceStatus/_github_status/returns_the_most_recent_status_messages.json +++ b/spec/cassettes/Octokit_Client_ServiceStatus/_github_status_messages/returns_the_most_recent_status_messages.json @@ -1 +1 @@ -{"http_interactions":[{"request":{"method":"get","uri":"https://www.githubstatus.com/api/v2/components.json","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"Accept":["application/vnd.github.v3+json"],"User-Agent":["Octokit Ruby Gem 4.14.0"],"Content-Type":["application/json"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Vary":["Accept,Accept-Encoding,X-Forwarded-Host,X-Forwarded-Scheme,X-Forwarded-Proto,Fastly-SSL"],"Cache-Control":["max-age=0, private, must-revalidate"],"X-Cache":["HIT"],"Content-Type":["application/json; charset=utf-8"],"Strict-Transport-Security":["max-age=259200"],"X-Request-Id":["bbf54b8e-0c92-432f-ac30-d778ac7bfcbe"],"Date":["Thu, 09 May 2019 18:03:50 GMT"],"X-Download-Options":["noopen"],"X-Xss-Protection":["1; mode=block"],"X-Runtime":["0.050216"],"Transfer-Encoding":["chunked"],"X-Permitted-Cross-Domain-Policies":["none"],"Access-Control-Allow-Origin":["*"],"Accept-Ranges":["bytes"],"X-Content-Type-Options":["nosniff"],"Etag":["W/\"gz[300642b1de777d8f346df5a69354be97]\""],"X-Statuspage-Skip-Logging":["true"],"Connection":["keep-alive"],"X-Statuspage-Version":["96ad7c53a1850f20f0fcbd7ef7a8117d5f510b4a"],"Referrer-Policy":["strict-origin-when-cross-origin"],"Age":["36"]},"body":{"encoding":"ASCII-8BIT","base64_string":"eyJwYWdlIjp7ImlkIjoia2N0Ymg5dnJ0ZHdkIiwibmFtZSI6IkdpdEh1YiIs\nInVybCI6Imh0dHBzOi8vd3d3LmdpdGh1YnN0YXR1cy5jb20iLCJ0aW1lX3pv\nbmUiOiJFdGMvVVRDIiwidXBkYXRlZF9hdCI6IjIwMTktMDUtMDlUMTg6MDI6\nNDAuMTI4WiJ9LCJjb21wb25lbnRzIjpbeyJpZCI6IjhsNHlncDAwOXM1cyIs\nIm5hbWUiOiJHaXQgT3BlcmF0aW9ucyIsInN0YXR1cyI6Im9wZXJhdGlvbmFs\nIiwiY3JlYXRlZF9hdCI6IjIwMTctMDEtMzFUMjA6MDU6MDUuMzcwWiIsInVw\nZGF0ZWRfYXQiOiIyMDE5LTA0LTIyVDEyOjI4OjIwLjc0MloiLCJwb3NpdGlv\nbiI6MSwiZGVzY3JpcHRpb24iOiJQZXJmb3JtYW5jZSBvZiBnaXQgY2xvbmVz\nLCBwdWxscywgcHVzaGVzLCBhbmQgYXNzb2NpYXRlZCBvcGVyYXRpb25zIiwi\nc2hvd2Nhc2UiOmZhbHNlLCJncm91cF9pZCI6bnVsbCwicGFnZV9pZCI6Imtj\ndGJoOXZydGR3ZCIsImdyb3VwIjpmYWxzZSwib25seV9zaG93X2lmX2RlZ3Jh\nZGVkIjpmYWxzZX0seyJpZCI6ImJ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QiOiJrY3RiaDl2cnRkd2QiLCJncm91cCI6ZmFsc2Us\nIm9ubHlfc2hvd19pZl9kZWdyYWRlZCI6ZmFsc2V9LHsiaWQiOiJ2ZzcwaG45\nczJ0eWoiLCJuYW1lIjoiR2l0SHViIFBhZ2VzIiwic3RhdHVzIjoib3BlcmF0\naW9uYWwiLCJjcmVhdGVkX2F0IjoiMjAxNy0wMS0zMVQyMDowNDozMy45MjNa\nIiwidXBkYXRlZF9hdCI6IjIwMTktMDQtMTNUMTc6NTg6MzQuMTMyWiIsInBv\nc2l0aW9uIjo3LCJkZXNjcmlwdGlvbiI6IkZyb250ZW5kIGFwcGxpY2F0aW9u\nIGFuZCBBUEkgc2VydmVycyBmb3IgUGFnZXMgYnVpbGRzIiwic2hvd2Nhc2Ui\nOmZhbHNlLCJncm91cF9pZCI6bnVsbCwicGFnZV9pZCI6ImtjdGJoOXZydGR3\nZCIsImdyb3VwIjpmYWxzZSwib25seV9zaG93X2lmX2RlZ3JhZGVkIjpmYWxz\nZX1dfQ==\n"},"http_version":null},"recorded_at":"Thu, 09 May 2019 18:04:26 GMT"}],"recorded_with":"VCR 4.0.0"} \ No newline at end of file +{"http_interactions":[{"request":{"method":"get","uri":"https://www.githubstatus.com/api/v2/components.json","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"Accept":["application/vnd.github.v3+json"],"User-Agent":["Octokit Ruby Gem 4.14.0"],"Content-Type":["application/json"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Vary":["Accept,Accept-Encoding,X-Forwarded-Host,X-Forwarded-Scheme,X-Forwarded-Proto,Fastly-SSL"],"Cache-Control":["max-age=0, private, must-revalidate"],"X-Cache":["MISS"],"Content-Type":["application/json; charset=utf-8"],"Strict-Transport-Security":["max-age=259200"],"X-Request-Id":["b7f8ddd7-da78-4359-9c20-bcd70a8f810e"],"Date":["Fri, 10 May 2019 21:15:42 GMT"],"X-Download-Options":["noopen"],"X-Xss-Protection":["1; mode=block"],"X-Runtime":["0.064706"],"Transfer-Encoding":["chunked"],"X-Permitted-Cross-Domain-Policies":["none"],"Access-Control-Allow-Origin":["*"],"Accept-Ranges":["bytes"],"X-Content-Type-Options":["nosniff"],"Etag":["W/\"gz[f91eb49894fdb7197abf591f8cda2005]\""],"X-Statuspage-Skip-Logging":["true"],"Connection":["keep-alive"],"X-Statuspage-Version":["272bee90b31fe688800cdca78d9732a75e4dd0cb"],"Referrer-Policy":["strict-origin-when-cross-origin"],"Age":["0"]},"body":{"encoding":"ASCII-8BIT","base64_string":"eyJwYWdlIjp7ImlkIjoia2N0Ymg5dnJ0ZHdkIiwibmFtZSI6IkdpdEh1YiIs\nInVybCI6Imh0dHBzOi8vd3d3LmdpdGh1YnN0YXR1cy5jb20iLCJ0aW1lX3pv\nbmUiOiJFdGMvVVRDIiwidXBkYXRlZF9hdCI6IjIwMTktMDUtMTBUMjE6MTU6\nMzkuNjcyWiJ9LCJjb21wb25lbnRzIjpbeyJpZCI6IjhsNHlncDAwOXM1cyIs\nIm5hbWUiOiJHaXQgT3BlcmF0aW9ucyIsInN0YXR1cyI6Im9wZXJhdGlvbmFs\nIiwiY3JlYXRlZF9hdCI6IjIwMTctMDEtMzFUMjA6MDU6MDUuMzcwWiIsInVw\nZGF0ZWRfYXQiOiIyMDE5LTA0LTIyVDEyOjI4OjIwLjc0MloiLCJwb3NpdGlv\nbiI6MSwiZGVzY3JpcHRpb24iOiJQZXJmb3JtYW5jZSBvZiBnaXQgY2xvbmVz\nLCBwdWxscywgcHVzaGVzLCBhbmQgYXNzb2NpYXRlZCBvcGVyYXRpb25zIiwi\nc2hvd2Nhc2UiOmZhbHNlLCJncm91cF9pZCI6bnVsbCwicGFnZV9pZCI6Imtj\ndGJoOXZydGR3ZCIsImdyb3VwIjpmYWxzZSwib25seV9zaG93X2lmX2RlZ3Jh\nZGVkIjpmYWxzZX0seyJpZCI6ImJydjFia2dyd3g3cSIsIm5hbWUi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CJncm91cCI6ZmFsc2Us\nIm9ubHlfc2hvd19pZl9kZWdyYWRlZCI6ZmFsc2V9LHsiaWQiOiJ2ZzcwaG45\nczJ0eWoiLCJuYW1lIjoiR2l0SHViIFBhZ2VzIiwic3RhdHVzIjoib3BlcmF0\naW9uYWwiLCJjcmVhdGVkX2F0IjoiMjAxNy0wMS0zMVQyMDowNDozMy45MjNa\nIiwidXBkYXRlZF9hdCI6IjIwMTktMDQtMTNUMTc6NTg6MzQuMTMyWiIsInBv\nc2l0aW9uIjo3LCJkZXNjcmlwdGlvbiI6IkZyb250ZW5kIGFwcGxpY2F0aW9u\nIGFuZCBBUEkgc2VydmVycyBmb3IgUGFnZXMgYnVpbGRzIiwic2hvd2Nhc2Ui\nOmZhbHNlLCJncm91cF9pZCI6bnVsbCwicGFnZV9pZCI6ImtjdGJoOXZydGR3\nZCIsImdyb3VwIjpmYWxzZSwib25seV9zaG93X2lmX2RlZ3JhZGVkIjpmYWxz\nZX1dfQ==\n"},"http_version":null},"recorded_at":"Fri, 10 May 2019 21:15:42 GMT"}],"recorded_with":"VCR 4.0.0"} \ No newline at end of file diff --git a/spec/octokit/client/service_status_spec.rb b/spec/octokit/client/service_status_spec.rb index f036a61fa..086d6803b 100644 --- a/spec/octokit/client/service_status_spec.rb +++ b/spec/octokit/client/service_status_spec.rb @@ -32,12 +32,12 @@ end end # .github_status_last_message - describe ".github_status", :vcr do + describe ".github_status_messages", :vcr do it "returns the most recent status messages" do messages = Octokit.github_status_messages expect(messages).to be_kind_of Array assert_requested :get, "https://www.githubstatus.com/api/v2/components.json" end - end # .github_status + end # .github_status_messages end