From 2d56e825b211a16cb1bc943cc93ad4c161e54cb6 Mon Sep 17 00:00:00 2001 From: dima Date: Thu, 18 Jan 2024 01:13:17 +0000 Subject: [PATCH 1/6] Place Faraday::HttpCache middleware after the Faraday::Request::Authorization middleware because it needs the Authorization header to be set --- lib/octokit/client.rb | 2 ++ lib/octokit/connection.rb | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/octokit/client.rb b/lib/octokit/client.rb index b4005bf77..1fd395756 100644 --- a/lib/octokit/client.rb +++ b/lib/octokit/client.rb @@ -261,6 +261,7 @@ def client_without_redirects(options = {}) conn_opts[:proxy] = @proxy if @proxy conn_opts[:ssl] = { verify_mode: @ssl_verify_mode } if @ssl_verify_mode conn = Faraday.new(conn_opts) do |http| + http_cache_middleware = http.builder.handlers.delete(Faraday::HttpCache) if Faraday.const_defined?(:HttpCache) if basic_authenticated? http.request(*FARADAY_BASIC_AUTH_KEYS, @login, @password) elsif token_authenticated? @@ -268,6 +269,7 @@ def client_without_redirects(options = {}) elsif bearer_authenticated? http.request :authorization, 'Bearer', @bearer_token end + http.builder.handlers.push(http_cache_middleware) unless http_cache_middleware.nil? http.headers['accept'] = options[:accept] if options.key?(:accept) end conn.builder.delete(Octokit::Middleware::FollowRedirects) diff --git a/lib/octokit/connection.rb b/lib/octokit/connection.rb index 1ee5c2019..089b60481 100644 --- a/lib/octokit/connection.rb +++ b/lib/octokit/connection.rb @@ -106,6 +106,7 @@ def agent http.headers[:accept] = default_media_type http.headers[:content_type] = 'application/json' http.headers[:user_agent] = user_agent + http_cache_middleware = http.builder.handlers.delete(Faraday::HttpCache) if Faraday.const_defined?(:HttpCache) if basic_authenticated? http.request(*FARADAY_BASIC_AUTH_KEYS, @login, @password) elsif token_authenticated? @@ -115,6 +116,7 @@ def agent elsif application_authenticated? http.request(*FARADAY_BASIC_AUTH_KEYS, @client_id, @client_secret) end + http.builder.handlers.push(http_cache_middleware) unless http_cache_middleware.nil? end end From bbbe982e8ad49efa5e0d98e88c0340e839aa4248 Mon Sep 17 00:00:00 2001 From: dima Date: Thu, 18 Jan 2024 11:46:50 +0000 Subject: [PATCH 2/6] Add tests for caching --- Gemfile | 1 + ...er_user_when_using_caching_middleware.json | 237 ++++++++++++++++++ spec/octokit/client/repositories_spec.rb | 10 + spec/spec_helper.rb | 25 +- 4 files changed, 271 insertions(+), 2 deletions(-) create mode 100644 spec/cassettes/Octokit_Client_Repositories/_repositories/performs_requests_per_user_when_using_caching_middleware.json diff --git a/Gemfile b/Gemfile index 4c489c572..2653f1c34 100644 --- a/Gemfile +++ b/Gemfile @@ -19,6 +19,7 @@ group :test do install_if -> { RUBY_VERSION >= '2.8' } do gem 'rexml', '>= 3.2.4' end + gem 'faraday-http-cache', '~> 2.5', '>= 2.5.1' gem 'json', '>= 2.3.0' gem 'jwt', '~> 2.2', '>= 2.2.1' gem 'mime-types', '~> 3.3', '>= 3.3.1' diff --git a/spec/cassettes/Octokit_Client_Repositories/_repositories/performs_requests_per_user_when_using_caching_middleware.json b/spec/cassettes/Octokit_Client_Repositories/_repositories/performs_requests_per_user_when_using_caching_middleware.json new file mode 100644 index 000000000..ac9740cf4 --- /dev/null +++ b/spec/cassettes/Octokit_Client_Repositories/_repositories/performs_requests_per_user_when_using_caching_middleware.json @@ -0,0 +1,237 @@ +{ + "http_interactions": [ + { + "request": { + "method": "get", + "uri": "https://api.github.com/user/repos", + "body": { + "encoding": "US-ASCII", + "base64_string": "" + }, + "headers": { + "Accept": [ + "application/vnd.github.v3+json" + ], + "User-Agent": [ + "Octokit Ruby Gem 8.0.0" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token <>" + ], + "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": [ + "Thu, 18 Jan 2024 11:45:10 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "Etag": [ + "W/\"8310debcd3dc6e6d0d73d8572f82d3f287917b8e261073bbe46b83c96311133d\"" + ], + "X-Oauth-Scopes": [ + "admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, copilot, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages" + ], + "X-Accepted-Oauth-Scopes": [ + "" + ], + "X-Github-Media-Type": [ + "github.v3; format=json" + ], + "X-Github-Api-Version-Selected": [ + "2022-11-28" + ], + "X-Ratelimit-Limit": [ + "5000" + ], + "X-Ratelimit-Remaining": [ + "4995" + ], + "X-Ratelimit-Reset": [ + "1705581494" + ], + "X-Ratelimit-Used": [ + "5" + ], + "X-Ratelimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Xss-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "X-Github-Request-Id": [ + "ECF8:52EA7:B4B9105:B68ED11:65A90F45" + ] + }, + "body": { + "encoding": "ASCII-8BIT", + "base64_string": "W3siaWQiOjc0NDc4MTA2Niwibm9kZV9pZCI6IlJfa2d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iOjAsInN0YXJnYXplcnNfY291bnQiOjAsIndhdGNoZXJzX2NvdW50\nIjowLCJsYW5ndWFnZSI6bnVsbCwiaGFzX2lzc3VlcyI6dHJ1ZSwiaGFzX3By\nb2plY3RzIjp0cnVlLCJoYXNfZG93bmxvYWRzIjp0cnVlLCJoYXNfd2lraSI6\ndHJ1ZSwiaGFzX3BhZ2VzIjpmYWxzZSwiaGFzX2Rpc2N1c3Npb25zIjpmYWxz\nZSwiZm9ya3NfY291bnQiOjAsIm1pcnJvcl91cmwiOm51bGwsImFyY2hpdmVk\nIjpmYWxzZSwiZGlzYWJsZWQiOmZhbHNlLCJvcGVuX2lzc3Vlc19jb3VudCI6\nMCwibGljZW5zZSI6bnVsbCwiYWxsb3dfZm9ya2luZyI6dHJ1ZSwiaXNfdGVt\ncGxhdGUiOmZhbHNlLCJ3ZWJfY29tbWl0X3NpZ25vZmZfcmVxdWlyZWQiOmZh\nbHNlLCJ0b3BpY3MiOltdLCJ2aXNpYmlsaXR5IjoicHVibGljIiwiZm9ya3Mi\nOjAsIm9wZW5faXNzdWVzIjowLCJ3YXRjaGVycyI6MCwiZGVmYXVsdF9icmFu\nY2giOiJtYWluIiwicGVybWlzc2lvbnMiOnsiYWRtaW4iOnRydWUsIm1haW50\nYWluIjp0cnVlLCJwdXNoIjp0cnVlLCJ0cmlhZ2UiOnRydWUsInB1bGwiOnRy\ndWV9fV0=\n" + } + }, + "recorded_at": "Thu, 18 Jan 2024 11:45:10 GMT" + }, + { + "request": { + "method": "get", + "uri": "https://api.github.com/user/repos", + "body": { + "encoding": "US-ASCII", + "base64_string": "" + }, + "headers": { + "Accept": [ + "application/vnd.github.v3+json" + ], + "User-Agent": [ + "Octokit Ruby Gem 8.0.0" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token <>" + ], + "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": [ + "Thu, 18 Jan 2024 11:45:10 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "Etag": [ + "W/\"91fc9ca4f67da4d142b645664b6a6bb5435fd8b4cbd102ed5a8dc46cdf3499f1\"" + ], + "X-Oauth-Scopes": [ + "admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, copilot, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages" + ], + "X-Accepted-Oauth-Scopes": [ + "" + ], + "X-Github-Media-Type": [ + "github.v3; format=json" + ], + "X-Github-Api-Version-Selected": [ + "2022-11-28" + ], + "X-Ratelimit-Limit": [ + "5000" + ], + "X-Ratelimit-Remaining": [ + "4995" + ], + "X-Ratelimit-Reset": [ + "1705581494" + ], + "X-Ratelimit-Used": [ + "5" + ], + "X-Ratelimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Xss-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "X-Github-Request-Id": [ + "ECFA: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HJ1ZSwicHVzaCI6dHJ1ZSwidHJpYWdlIjp0cnVlLCJwdWxsIjp0cnVlfX1d\n" + } + }, + "recorded_at": "Thu, 18 Jan 2024 11:45:10 GMT" + } + ], + "recorded_with": "VCR 6.2.0" +} \ No newline at end of file diff --git a/spec/octokit/client/repositories_spec.rb b/spec/octokit/client/repositories_spec.rb index ce5ea21fe..3397eaa5c 100644 --- a/spec/octokit/client/repositories_spec.rb +++ b/spec/octokit/client/repositories_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +require "faraday-http-cache" describe Octokit::Client::Repositories do before do @@ -260,6 +261,15 @@ expect(repositories).to be_kind_of Array assert_requested :get, github_url('/user/repos') end + it 'performs requests per user when using caching middleware' do + client_with_caching = oauth_client_with_http_cache_middleware(access_token: test_github_token) + client_with_caching.repositories + + client_with_caching_two = oauth_client_with_http_cache_middleware(access_token: test_github_token_two) + client_with_caching_two.repositories + + assert_requested :get, github_url('/user/repos'), times: 2 + end end # .repositories describe '.all_repositories', :vcr do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ba3be28fe..11ca40a89 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -52,6 +52,9 @@ c.filter_sensitive_data('<>') do test_github_token end + c.filter_sensitive_data('<>') do + test_github_token_two + end c.filter_sensitive_data('') do test_github_collaborator_token end @@ -176,6 +179,10 @@ def test_github_token ENV.fetch 'OCTOKIT_TEST_GITHUB_TOKEN', 'x' * 40 end +def test_github_token_two + ENV.fetch 'OCTOKIT_TEST_GITHUB_TOKEN_TWO', 'x' * 40 +end + def test_github_collaborator_token ENV.fetch 'OCTOKIT_TEST_GITHUB_COLLABORATOR_TOKEN', 'x' * 40 end @@ -299,8 +306,8 @@ def basic_auth_client(login: test_github_login, password: test_github_password) Octokit::Client.new(login: login, password: password) end -def oauth_client - Octokit::Client.new(access_token: test_github_token) +def oauth_client(access_token: test_github_token) + Octokit::Client.new(access_token: access_token) end def enterprise_admin_client @@ -321,6 +328,20 @@ def enterprise_admin_client client end +def oauth_client_with_http_cache_middleware(access_token: test_github_token) + stack = Faraday::RackBuilder.new do |builder| + builder.use Faraday::HttpCache, serializer: Marshal, shared_cache: false + builder.adapter Faraday.default_adapter + end + + client = oauth_client(access_token: access_token) + + client.configure do |c| + c.middleware = stack + end + client +end + def enterprise_management_console_client stack = Faraday::RackBuilder.new do |builder| builder.request :multipart From 7504f3cf125bef136a698cbb2c6613ae7fc41448 Mon Sep 17 00:00:00 2001 From: dima Date: Thu, 18 Jan 2024 12:21:31 +0000 Subject: [PATCH 3/6] Use a shared store for the Faraday::HttpCache middleware --- ...er_user_when_using_caching_middleware.json | 20 +++++++++---------- spec/octokit/client/repositories_spec.rb | 2 ++ spec/spec_helper.rb | 6 +++++- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/spec/cassettes/Octokit_Client_Repositories/_repositories/performs_requests_per_user_when_using_caching_middleware.json b/spec/cassettes/Octokit_Client_Repositories/_repositories/performs_requests_per_user_when_using_caching_middleware.json index ac9740cf4..170e6869d 100644 --- a/spec/cassettes/Octokit_Client_Repositories/_repositories/performs_requests_per_user_when_using_caching_middleware.json +++ b/spec/cassettes/Octokit_Client_Repositories/_repositories/performs_requests_per_user_when_using_caching_middleware.json @@ -36,7 +36,7 @@ "GitHub.com" ], "Date": [ - "Thu, 18 Jan 2024 11:45:10 GMT" + "Thu, 18 Jan 2024 12:19:38 GMT" ], "Content-Type": [ "application/json; charset=utf-8" @@ -70,13 +70,13 @@ "5000" ], "X-Ratelimit-Remaining": [ - "4995" + "4988" ], "X-Ratelimit-Reset": [ "1705581494" ], "X-Ratelimit-Used": [ - "5" + "12" ], "X-Ratelimit-Resource": [ "core" @@ -106,7 +106,7 @@ "default-src 'none'" ], "X-Github-Request-Id": [ - "ECF8:52EA7:B4B9105:B68ED11:65A90F45" + "F39E:505BC:B66211A:B83D6EA:65A91759" ] }, "body": { @@ -114,7 +114,7 @@ "base64_string": "W3siaWQiOjc0NDc4MTA2Niwibm9k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UiOm51bGws\nInNpemUiOjAsInN0YXJnYXplcnNfY291bnQiOjAsIndhdGNoZXJzX2NvdW50\nIjowLCJsYW5ndWFnZSI6bnVsbCwiaGFzX2lzc3VlcyI6dHJ1ZSwiaGFzX3By\nb2plY3RzIjp0cnVlLCJoYXNfZG93bmxvYWRzIjp0cnVlLCJoYXNfd2lraSI6\ndHJ1ZSwiaGFzX3BhZ2VzIjpmYWxzZSwiaGFzX2Rpc2N1c3Npb25zIjpmYWxz\nZSwiZm9ya3NfY291bnQiOjAsIm1pcnJvcl91cmwiOm51bGwsImFyY2hpdmVk\nIjpmYWxzZSwiZGlzYWJsZWQiOmZhbHNlLCJvcGVuX2lzc3Vlc19jb3VudCI6\nMCwibGljZW5zZSI6bnVsbCwiYWxsb3dfZm9ya2luZyI6dHJ1ZSwiaXNfdGVt\ncGxhdGUiOmZhbHNlLCJ3ZWJfY29tbWl0X3NpZ25vZmZfcmVxdWlyZWQiOmZh\nbHNlLCJ0b3BpY3MiOltdLCJ2aXNpYmlsaXR5IjoicHVibGljIiwiZm9ya3Mi\nOjAsIm9wZW5faXNzdWVzIjowLCJ3YXRjaGVycyI6MCwiZGVmYXVsdF9icmFu\nY2giOiJtYWluIiwicGVybWlzc2lvbnMiOnsiYWRtaW4iOnRydWUsIm1haW50\nYWluIjp0cnVlLCJwdXNoIjp0cnVlLCJ0cmlhZ2UiOnRydWUsInB1bGwiOnRy\ndWV9fV0=\n" } }, - "recorded_at": "Thu, 18 Jan 2024 11:45:10 GMT" + "recorded_at": "Thu, 18 Jan 2024 12:19:38 GMT" }, { "request": { @@ -152,7 +152,7 @@ "GitHub.com" ], "Date": [ - "Thu, 18 Jan 2024 11:45:10 GMT" + "Thu, 18 Jan 2024 12:19:40 GMT" ], "Content-Type": [ "application/json; charset=utf-8" @@ -186,13 +186,13 @@ "5000" ], "X-Ratelimit-Remaining": [ - "4995" + "4990" ], "X-Ratelimit-Reset": [ "1705581494" ], "X-Ratelimit-Used": [ - "5" + "10" ], "X-Ratelimit-Resource": [ "core" @@ -222,7 +222,7 @@ "default-src 'none'" ], "X-Github-Request-Id": [ - "ECFA:2A43E9:664AA67:676F1BB:65A90F46" + "F3A1:2BCADA:A79D161:A9786D2:65A9175C" ] }, "body": { @@ -230,7 +230,7 @@ "base64_string": "W3siaWQiOjc0NDk2NDk1MSwibm9kZV9pZCI6IlJfa2dET0xHZERWdyIsIm5h\nbWUiOiJyZXBvc2l0b3J5LXR3byIsImZ1bGxfbmFtZSI6ImRpbWEtZ2l0aHVi\nLW9jdG9raXQtdGVzdC10d28vcmVwb3NpdG9yeS10d28iLCJwcml2YXRlIjpm\nYWxzZSwib3duZXIiOnsibG9naW4iOiJkaW1hLWdpdGh1Yi1vY3Rva2l0LXRl\nc3QtdHdvIiwiaWQiOjE1NzAxNzIwMCwibm9kZV9pZCI6IlVfa2dET0NWdmtj\nQSIsImF2YXRhcl91cmwiOiJodHRwczovL2F2YXRhcnMuZ2l0aHVidXNlcmNv\nbnRlbnQuY29tL3UvMTU3MDE3MjAwP3Y9NCIsImdyYXZhdGFyX2lkIjoiIiwi\ndXJsIjoiaHR0cHM6Ly9hcGkuZ2l0aHViLmNvbS91c2Vycy9kaW1hLWdpdGh1\nYi1vY3Rva2l0LXRlc3QtdHdvIiwiaHRtbF91cmwiOiJodHRwczovL2dpdGh1\nYi5jb20vZGltYS1naXRodWItb2N0b2tpdC10ZXN0LXR3byIsImZvbGxvd2Vy\nc191cmwiOiJodHRwczovL2FwaS5naXRodWIuY29tL3VzZXJzL2RpbWEtZ2l0\naHViLW9jdG9raXQtdGVzdC10d28vZm9sbG93ZXJzIiwiZm9sbG93aW5nX3Vy\nbCI6Imh0dHBzOi8vYXBpLmdpdGh1Yi5jb20vdXNlcnMvZGltYS1naXRodWIt\nb2N0b2tpdC10ZXN0LXR3by9mb2xsb3dpbmd7L290aGVyX3VzZXJ9IiwiZ2lz\ndHNfdXJsIjoiaHR0cHM6Ly9hcGkuZ2l0aHViLmNvbS91c2Vycy9ka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cnMiOjAsImRlZmF1bHRfYnJhbmNoIjoi\nbWFpbiIsInBlcm1pc3Npb25zIjp7ImFkbWluIjp0cnVlLCJtYWludGFpbiI6\ndHJ1ZSwicHVzaCI6dHJ1ZSwidHJpYWdlIjp0cnVlLCJwdWxsIjp0cnVlfX1d\n" } }, - "recorded_at": "Thu, 18 Jan 2024 11:45:10 GMT" + "recorded_at": "Thu, 18 Jan 2024 12:19:40 GMT" } ], "recorded_with": "VCR 6.2.0" diff --git a/spec/octokit/client/repositories_spec.rb b/spec/octokit/client/repositories_spec.rb index 3397eaa5c..368b00e0e 100644 --- a/spec/octokit/client/repositories_spec.rb +++ b/spec/octokit/client/repositories_spec.rb @@ -264,9 +264,11 @@ it 'performs requests per user when using caching middleware' do client_with_caching = oauth_client_with_http_cache_middleware(access_token: test_github_token) client_with_caching.repositories + client_with_caching.repositories client_with_caching_two = oauth_client_with_http_cache_middleware(access_token: test_github_token_two) client_with_caching_two.repositories + client_with_caching_two.repositories assert_requested :get, github_url('/user/repos'), times: 2 end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 11ca40a89..48cd0a63b 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -328,9 +328,13 @@ def enterprise_admin_client client end +def http_cache_middleware_store + @http_cache_middleware_store ||= Faraday::HttpCache::MemoryStore.new +end + def oauth_client_with_http_cache_middleware(access_token: test_github_token) stack = Faraday::RackBuilder.new do |builder| - builder.use Faraday::HttpCache, serializer: Marshal, shared_cache: false + builder.use Faraday::HttpCache, serializer: Marshal, store: http_cache_middleware_store, shared_cache: false builder.adapter Faraday.default_adapter end From c1abe4f2a8f3ab7fc616f08224fd99f6969c5450 Mon Sep 17 00:00:00 2001 From: dima Date: Thu, 18 Jan 2024 12:25:56 +0000 Subject: [PATCH 4/6] Make sure the default test_github_token differs from the default test_github_token_two --- spec/spec_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 48cd0a63b..84b2e0dfe 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -180,7 +180,7 @@ def test_github_token end def test_github_token_two - ENV.fetch 'OCTOKIT_TEST_GITHUB_TOKEN_TWO', 'x' * 40 + ENV.fetch 'OCTOKIT_TEST_GITHUB_TOKEN_TWO', 'y' * 40 end def test_github_collaborator_token From 3b30724efb9ebf3066630c1792d6fb9ee28f20a7 Mon Sep 17 00:00:00 2001 From: dima Date: Thu, 18 Jan 2024 12:49:34 +0000 Subject: [PATCH 5/6] Make sure to freeze time at the point that the cassette was recorded so that the cache is considered fresh --- Gemfile | 1 + spec/octokit/client/repositories_spec.rb | 17 ++++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index 2653f1c34..62b8e44f3 100644 --- a/Gemfile +++ b/Gemfile @@ -30,6 +30,7 @@ group :test do gem 'rspec', '~> 3.9' gem 'simplecov', require: false gem 'test-queue' + gem 'timecop', '~> 0.9.8' gem 'vcr', '~> 6.1' gem 'webmock', '~> 3.8', '>= 3.8.2' end diff --git a/spec/octokit/client/repositories_spec.rb b/spec/octokit/client/repositories_spec.rb index 368b00e0e..125927d1f 100644 --- a/spec/octokit/client/repositories_spec.rb +++ b/spec/octokit/client/repositories_spec.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true require "faraday-http-cache" +require "timecop" describe Octokit::Client::Repositories do before do @@ -262,15 +263,17 @@ assert_requested :get, github_url('/user/repos') end it 'performs requests per user when using caching middleware' do - client_with_caching = oauth_client_with_http_cache_middleware(access_token: test_github_token) - client_with_caching.repositories - client_with_caching.repositories + Timecop.freeze(VCR.current_cassette.originally_recorded_at || Time.now) do + client_with_caching = oauth_client_with_http_cache_middleware(access_token: test_github_token) + client_with_caching.repositories + client_with_caching.repositories - client_with_caching_two = oauth_client_with_http_cache_middleware(access_token: test_github_token_two) - client_with_caching_two.repositories - client_with_caching_two.repositories + client_with_caching_two = oauth_client_with_http_cache_middleware(access_token: test_github_token_two) + client_with_caching_two.repositories + client_with_caching_two.repositories - assert_requested :get, github_url('/user/repos'), times: 2 + assert_requested :get, github_url('/user/repos'), times: 2 + end end end # .repositories From 28a38b140e6b968c06cb764513b53c1743e06726 Mon Sep 17 00:00:00 2001 From: dima Date: Thu, 18 Jan 2024 12:52:12 +0000 Subject: [PATCH 6/6] More calls --- spec/octokit/client/repositories_spec.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/octokit/client/repositories_spec.rb b/spec/octokit/client/repositories_spec.rb index 125927d1f..cb731ec65 100644 --- a/spec/octokit/client/repositories_spec.rb +++ b/spec/octokit/client/repositories_spec.rb @@ -272,6 +272,9 @@ client_with_caching_two.repositories client_with_caching_two.repositories + client_with_caching.repositories + client_with_caching_two.repositories + assert_requested :get, github_url('/user/repos'), times: 2 end end