From 1b2f57a4cfb017dcd69d81664f562fb354542eff Mon Sep 17 00:00:00 2001 From: Yoann Lecuyer Date: Sat, 28 Dec 2024 16:27:36 +0100 Subject: [PATCH 1/4] CI: Add ruby 3.4 --- .github/workflows/test.yml | 2 +- changelog.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 014baddd..734e3654 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: [2.7, "3.0", 3.1, 3.2, 3.3, head] + ruby: [2.7, "3.0", 3.1, 3.2, 3.3, 3.4, head] steps: - name: Checkout repository diff --git a/changelog.md b/changelog.md index ca86e504..c7b51f51 100644 --- a/changelog.md +++ b/changelog.md @@ -15,6 +15,8 @@ Internal improvements: Testing improvements: + * Add ruby 3.4 to CI ([696](https://github.com/arsduo/koala/pull/696)) + Others: v3.6.0 (2024-06-27) From 1cf751c68d8f63df96c01dfc65edfdc2472a0f5c Mon Sep 17 00:00:00 2001 From: Yoann Lecuyer Date: Sat, 28 Dec 2024 16:39:11 +0100 Subject: [PATCH 2/4] Fix spec --- spec/cases/http_service_spec.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/cases/http_service_spec.rb b/spec/cases/http_service_spec.rb index 03f4023f..e1fee32c 100644 --- a/spec/cases/http_service_spec.rb +++ b/spec/cases/http_service_spec.rb @@ -238,8 +238,8 @@ def adapter(arg) it 'logs tokens' do allow(Koala.config).to receive(:mask_tokens) { false } - expect(Koala::Utils).to receive(:debug).with('STARTED => GET: /foo params: {"an"=>:arg, "access_token"=>"myvisbleaccesstoken"}') - expect(Koala::Utils).to receive(:debug).with('FINISHED => GET: /foo params: {"an"=>:arg, "access_token"=>"myvisbleaccesstoken"}') + expect(Koala::Utils).to receive(:debug).with('STARTED => GET: /foo params: {"an" => :arg, "access_token" => "myvisbleaccesstoken"}') + expect(Koala::Utils).to receive(:debug).with('FINISHED => GET: /foo params: {"an" => :arg, "access_token" => "myvisbleaccesstoken"}') Koala::HTTPService.make_request(request) end @@ -247,8 +247,8 @@ def adapter(arg) it 'doesnt log tokens' do allow(Koala.config).to receive(:mask_tokens) { true } - expect(Koala::Utils).to receive(:debug).with('STARTED => GET: /foo params: {"an"=>:arg, "access_token"=>"myvisbleac*****token"}') - expect(Koala::Utils).to receive(:debug).with('FINISHED => GET: /foo params: {"an"=>:arg, "access_token"=>"myvisbleac*****token"}') + expect(Koala::Utils).to receive(:debug).with('STARTED => GET: /foo params: {"an" => :arg, "access_token" => "myvisbleac*****token"}') + expect(Koala::Utils).to receive(:debug).with('FINISHED => GET: /foo params: {"an" => :arg, "access_token" => "myvisbleac*****token"}') Koala::HTTPService.make_request(request) end @@ -258,8 +258,8 @@ def adapter(arg) allow(Koala.config).to receive(:mask_tokens) { true } - expect(Koala::Utils).to receive(:debug).with('STARTED => GET: /debug_token params: {"input_token"=>"myvisiblea*****token", "access_token"=>"myvisiblea*****token"}') - expect(Koala::Utils).to receive(:debug).with('FINISHED => GET: /debug_token params: {"input_token"=>"myvisiblea*****token", "access_token"=>"myvisiblea*****token"}') + expect(Koala::Utils).to receive(:debug).with('STARTED => GET: /debug_token params: {"input_token" => "myvisiblea*****token", "access_token" => "myvisiblea*****token"}') + expect(Koala::Utils).to receive(:debug).with('FINISHED => GET: /debug_token params: {"input_token" => "myvisiblea*****token", "access_token" => "myvisiblea*****token"}') Koala::HTTPService.make_request(request) end From 738ac8cd3435ce2472e364050a6f3d80a888dd49 Mon Sep 17 00:00:00 2001 From: Yoann Lecuyer Date: Sat, 28 Dec 2024 16:49:31 +0100 Subject: [PATCH 3/4] fix specs for all ruby versions --- spec/cases/http_service_spec.rb | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/spec/cases/http_service_spec.rb b/spec/cases/http_service_spec.rb index e1fee32c..3a4a4981 100644 --- a/spec/cases/http_service_spec.rb +++ b/spec/cases/http_service_spec.rb @@ -238,8 +238,12 @@ def adapter(arg) it 'logs tokens' do allow(Koala.config).to receive(:mask_tokens) { false } - expect(Koala::Utils).to receive(:debug).with('STARTED => GET: /foo params: {"an" => :arg, "access_token" => "myvisbleaccesstoken"}') - expect(Koala::Utils).to receive(:debug).with('FINISHED => GET: /foo params: {"an" => :arg, "access_token" => "myvisbleaccesstoken"}') + expect(Koala::Utils).to receive(:debug) do |log| + expect(log).to match(/STARTED => GET: \/foo params: {"an"\s?=>\s?:arg, "access_token"\s?=>\s?"myvisbleaccesstoken"}/) + end + expect(Koala::Utils).to receive(:debug) do |log| + expect(log).to match(/FINISHED => GET: \/foo params: {"an"\s?=>\s?:arg, "access_token"\s?=>\s?"myvisbleaccesstoken"}/) + end Koala::HTTPService.make_request(request) end @@ -247,8 +251,12 @@ def adapter(arg) it 'doesnt log tokens' do allow(Koala.config).to receive(:mask_tokens) { true } - expect(Koala::Utils).to receive(:debug).with('STARTED => GET: /foo params: {"an" => :arg, "access_token" => "myvisbleac*****token"}') - expect(Koala::Utils).to receive(:debug).with('FINISHED => GET: /foo params: {"an" => :arg, "access_token" => "myvisbleac*****token"}') + expect(Koala::Utils).to receive(:debug) do |log| + expect(log).to match(/STARTED => GET: \/foo params: {"an"\s?=>\s?:arg, "access_token"\s?=>\s?"myvisbleac[*]{5}token"}/) + end + expect(Koala::Utils).to receive(:debug) do |log| + expect(log).to match(/FINISHED => GET: \/foo params: {"an"\s?=>\s?:arg, "access_token"\s?=>\s?"myvisbleac[*]{5}token"}/) + end Koala::HTTPService.make_request(request) end @@ -258,8 +266,12 @@ def adapter(arg) allow(Koala.config).to receive(:mask_tokens) { true } - expect(Koala::Utils).to receive(:debug).with('STARTED => GET: /debug_token params: {"input_token" => "myvisiblea*****token", "access_token" => "myvisiblea*****token"}') - expect(Koala::Utils).to receive(:debug).with('FINISHED => GET: /debug_token params: {"input_token" => "myvisiblea*****token", "access_token" => "myvisiblea*****token"}') + expect(Koala::Utils).to receive(:debug) do |log| + expect(log).to match(/STARTED => GET: \/debug_token params: {"input_token"\s?=>\s?"myvisiblea[*]{5}token", "access_token"\s?=>\s?"myvisiblea[*]{5}token"}/) + end + expect(Koala::Utils).to receive(:debug) do |log| + expect(log).to match(/FINISHED => GET: \/debug_token params: {"input_token"\s?=>\s?"myvisiblea[*]{5}token", "access_token"\s?=>\s?"myvisiblea[*]{5}token"}/) + end Koala::HTTPService.make_request(request) end From fc68cc83f0466cf1d0b9f1751f6d191f4e54b981 Mon Sep 17 00:00:00 2001 From: Yoann Lecuyer Date: Sat, 28 Dec 2024 16:52:43 +0100 Subject: [PATCH 4/4] empty commit