Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RT-749] raise timeout error for circuit breaker #17

Merged
merged 4 commits into from
Oct 8, 2024

Conversation

uncoder
Copy link
Contributor

@uncoder uncoder commented Oct 8, 2024

What is the goal?

Raise Factiva::TimeoutError error for CircuitBreaker. Second attempt to deploy #13 which was reverted.

References

How is it being implemented?

Re-raise HTTP::TimeoutError while handling other errors and converting them to Failure

How is it tested?

Automatic tests

How is it going to be deployed?

Standard deployment

@uncoder uncoder requested a review from a team as a code owner October 8, 2024 09:58
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

rubocop

📝 [rubocop] <Layout/SpaceInsideHashLiteralBraces> reported by reviewdog 🐶
Space inside { missing.

"variation" => {"structural" => false, "linguistic" => false, "non_linguistic" => false},


📝 [rubocop] <Layout/SpaceInsideHashLiteralBraces> reported by reviewdog 🐶
Space inside } missing.

"variation" => {"structural" => false, "linguistic" => false, "non_linguistic" => false},


📝 [rubocop] <Layout/SpaceAroundOperators> reported by reviewdog 🐶
Surrounding space missing for operator =>.

"percentage_match" =>1.0,


📝 [rubocop] <Layout/SpaceAroundOperators> reported by reviewdog 🐶
Surrounding space missing for operator =>.

"boosting_events" =>[],


📝 [rubocop] <Layout/SpaceInsideHashLiteralBraces> reported by reviewdog 🐶
Space inside { missing.

"current_state" => {"timestamp" => "2022-06-22T07:41:53", "state" => "OPEN"},


📝 [rubocop] <Layout/SpaceInsideHashLiteralBraces> reported by reviewdog 🐶
Space inside } missing.

"current_state" => {"timestamp" => "2022-06-22T07:41:53", "state" => "OPEN"},


📝 [rubocop] <Layout/SpaceInsideHashLiteralBraces> reported by reviewdog 🐶
Space inside { missing.

"birthdates" => [{"day" => 17, "year" => 1951, "month" => 2}],


📝 [rubocop] <Layout/SpaceInsideHashLiteralBraces> reported by reviewdog 🐶
Space inside } missing.

"birthdates" => [{"day" => 17, "year" => 1951, "month" => 2}],


📝 [rubocop] <Layout/SpaceInsideHashLiteralBraces> reported by reviewdog 🐶
Space inside { missing.

"primary_name" => {"name_type" => "PRIMARY", "first_name" => "Maria Remedios", "last_name" => "Garcia Albert"},


📝 [rubocop] <Layout/SpaceInsideHashLiteralBraces> reported by reviewdog 🐶
Space inside } missing.

"primary_name" => {"name_type" => "PRIMARY", "first_name" => "Maria Remedios", "last_name" => "Garcia Albert"},


📝 [rubocop] <Layout/SpaceInsideHashLiteralBraces> reported by reviewdog 🐶
Space inside { missing.

"variation" => {"structural"=>false, "linguistic"=>false, "non_linguistic"=>false},


📝 [rubocop] <Layout/SpaceAroundOperators> reported by reviewdog 🐶
Surrounding space missing for operator =>.

"variation" => {"structural"=>false, "linguistic"=>false, "non_linguistic"=>false},


📝 [rubocop] <Layout/SpaceAroundOperators> reported by reviewdog 🐶
Surrounding space missing for operator =>.

"variation" => {"structural"=>false, "linguistic"=>false, "non_linguistic"=>false},


📝 [rubocop] <Layout/SpaceAroundOperators> reported by reviewdog 🐶
Surrounding space missing for operator =>.

"variation" => {"structural"=>false, "linguistic"=>false, "non_linguistic"=>false},


📝 [rubocop] <Layout/SpaceInsideHashLiteralBraces> reported by reviewdog 🐶
Space inside } missing.

"variation" => {"structural"=>false, "linguistic"=>false, "non_linguistic"=>false},


📝 [rubocop] <Layout/SpaceInsideHashLiteralBraces> reported by reviewdog 🐶
Space inside { missing.

"current_state" => {"timestamp" => "2022-06-22T07:41:54", "state" => "OPEN"},


📝 [rubocop] <Layout/SpaceInsideHashLiteralBraces> reported by reviewdog 🐶
Space inside } missing.

"current_state" => {"timestamp" => "2022-06-22T07:41:54", "state" => "OPEN"},


📝 [rubocop] <Layout/SpaceInsideHashLiteralBraces> reported by reviewdog 🐶
Space inside { missing.

"birthdates" => [{"day"=>17, "year"=>1951, "month"=>2}],


📝 [rubocop] <Layout/SpaceAroundOperators> reported by reviewdog 🐶
Surrounding space missing for operator =>.

"birthdates" => [{"day"=>17, "year"=>1951, "month"=>2}],


📝 [rubocop] <Layout/SpaceAroundOperators> reported by reviewdog 🐶
Surrounding space missing for operator =>.

"birthdates" => [{"day"=>17, "year"=>1951, "month"=>2}],


📝 [rubocop] <Layout/SpaceAroundOperators> reported by reviewdog 🐶
Surrounding space missing for operator =>.

"birthdates" => [{"day"=>17, "year"=>1951, "month"=>2}],


📝 [rubocop] <Layout/SpaceInsideHashLiteralBraces> reported by reviewdog 🐶
Space inside } missing.

"birthdates" => [{"day"=>17, "year"=>1951, "month"=>2}],


📝 [rubocop] <Layout/SpaceInsideHashLiteralBraces> reported by reviewdog 🐶
Space inside { missing.

"primary_name" => {"name_type" => "PRIMARY", "first_name" => "Maria Remedios", "last_name" => "Garcia Albert"},


📝 [rubocop] <Layout/SpaceInsideHashLiteralBraces> reported by reviewdog 🐶
Space inside } missing.

"primary_name" => {"name_type" => "PRIMARY", "first_name" => "Maria Remedios", "last_name" => "Garcia Albert"},


📝 [rubocop] <Layout/LineLength> reported by reviewdog 🐶
Line is too long. [135/128]

expect(result["data"][0]["attributes"]["matches"][0]["match_invalid_reason"]).to eq "Match excluded by filter: year_of_birth"


📝 [rubocop] <Layout/SpaceInsideHashLiteralBraces> reported by reviewdog 🐶
Space inside { missing.

expect(res["data"]["attributes"]["current_state"]).to eq({"timestamp"=>"2022-06-21T10:04:37.645", "comment"=>"False positive", "state"=>"CLEARED", "risk_rating"=>1})


📝 [rubocop] <Layout/SpaceAroundOperators> reported by reviewdog 🐶
Surrounding space missing for operator =>.

expect(res["data"]["attributes"]["current_state"]).to eq({"timestamp"=>"2022-06-21T10:04:37.645", "comment"=>"False positive", "state"=>"CLEARED", "risk_rating"=>1})


📝 [rubocop] <Layout/SpaceAroundOperators> reported by reviewdog 🐶
Surrounding space missing for operator =>.

expect(res["data"]["attributes"]["current_state"]).to eq({"timestamp"=>"2022-06-21T10:04:37.645", "comment"=>"False positive", "state"=>"CLEARED", "risk_rating"=>1})


📝 [rubocop] <Layout/LineLength> reported by reviewdog 🐶
Line is too long. [173/128]

expect(res["data"]["attributes"]["current_state"]).to eq({"timestamp"=>"2022-06-21T10:04:37.645", "comment"=>"False positive", "state"=>"CLEARED", "risk_rating"=>1})


📝 [rubocop] <Layout/SpaceAroundOperators> reported by reviewdog 🐶
Surrounding space missing for operator =>.

expect(res["data"]["attributes"]["current_state"]).to eq({"timestamp"=>"2022-06-21T10:04:37.645", "comment"=>"False positive", "state"=>"CLEARED", "risk_rating"=>1})


📝 [rubocop] <Layout/SpaceAroundOperators> reported by reviewdog 🐶
Surrounding space missing for operator =>.

expect(res["data"]["attributes"]["current_state"]).to eq({"timestamp"=>"2022-06-21T10:04:37.645", "comment"=>"False positive", "state"=>"CLEARED", "risk_rating"=>1})


📝 [rubocop] <Layout/SpaceInsideHashLiteralBraces> reported by reviewdog 🐶
Space inside } missing.

expect(res["data"]["attributes"]["current_state"]).to eq({"timestamp"=>"2022-06-21T10:04:37.645", "comment"=>"False positive", "state"=>"CLEARED", "risk_rating"=>1})

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

rubocop

📝 [rubocop] <Layout/SpaceInsideHashLiteralBraces> reported by reviewdog 🐶
Space inside { missing.

"variation" => {"structural"=>false, "linguistic"=>false, "non_linguistic"=>false},


📝 [rubocop] <Layout/SpaceAroundOperators> reported by reviewdog 🐶
Surrounding space missing for operator =>.

"variation" => {"structural"=>false, "linguistic"=>false, "non_linguistic"=>false},


📝 [rubocop] <Layout/SpaceAroundOperators> reported by reviewdog 🐶
Surrounding space missing for operator =>.

"variation" => {"structural"=>false, "linguistic"=>false, "non_linguistic"=>false},


📝 [rubocop] <Layout/SpaceAroundOperators> reported by reviewdog 🐶
Surrounding space missing for operator =>.

"variation" => {"structural"=>false, "linguistic"=>false, "non_linguistic"=>false},


📝 [rubocop] <Layout/SpaceInsideHashLiteralBraces> reported by reviewdog 🐶
Space inside } missing.

"variation" => {"structural"=>false, "linguistic"=>false, "non_linguistic"=>false},


📝 [rubocop] <Layout/SpaceInsideHashLiteralBraces> reported by reviewdog 🐶
Space inside { missing.

"current_state" => {"timestamp" => "2022-06-22T07:41:54", "state" => "OPEN"},


📝 [rubocop] <Layout/SpaceInsideHashLiteralBraces> reported by reviewdog 🐶
Space inside } missing.

"current_state" => {"timestamp" => "2022-06-22T07:41:54", "state" => "OPEN"},


📝 [rubocop] <Layout/SpaceInsideHashLiteralBraces> reported by reviewdog 🐶
Space inside { missing.

"birthdates" => [{"day"=>17, "year"=>1951, "month"=>2}],


📝 [rubocop] <Layout/SpaceAroundOperators> reported by reviewdog 🐶
Surrounding space missing for operator =>.

"birthdates" => [{"day"=>17, "year"=>1951, "month"=>2}],


📝 [rubocop] <Layout/SpaceAroundOperators> reported by reviewdog 🐶
Surrounding space missing for operator =>.

"birthdates" => [{"day"=>17, "year"=>1951, "month"=>2}],


📝 [rubocop] <Layout/SpaceAroundOperators> reported by reviewdog 🐶
Surrounding space missing for operator =>.

"birthdates" => [{"day"=>17, "year"=>1951, "month"=>2}],


📝 [rubocop] <Layout/SpaceInsideHashLiteralBraces> reported by reviewdog 🐶
Space inside } missing.

"birthdates" => [{"day"=>17, "year"=>1951, "month"=>2}],


📝 [rubocop] <Layout/SpaceInsideHashLiteralBraces> reported by reviewdog 🐶
Space inside { missing.

"primary_name" => {"name_type" => "PRIMARY", "first_name" => "Maria Remedios", "last_name" => "Garcia Albert"},


📝 [rubocop] <Layout/SpaceInsideHashLiteralBraces> reported by reviewdog 🐶
Space inside } missing.

"primary_name" => {"name_type" => "PRIMARY", "first_name" => "Maria Remedios", "last_name" => "Garcia Albert"},


📝 [rubocop] <Layout/LineLength> reported by reviewdog 🐶
Line is too long. [135/128]

expect(result["data"][0]["attributes"]["matches"][0]["match_invalid_reason"]).to eq "Match excluded by filter: year_of_birth"


📝 [rubocop] <Layout/SpaceInsideHashLiteralBraces> reported by reviewdog 🐶
Space inside { missing.

expect(res["data"]["attributes"]["current_state"]).to eq({"timestamp"=>"2022-06-21T10:04:37.645", "comment"=>"False positive", "state"=>"CLEARED", "risk_rating"=>1})


📝 [rubocop] <Layout/SpaceAroundOperators> reported by reviewdog 🐶
Surrounding space missing for operator =>.

expect(res["data"]["attributes"]["current_state"]).to eq({"timestamp"=>"2022-06-21T10:04:37.645", "comment"=>"False positive", "state"=>"CLEARED", "risk_rating"=>1})


📝 [rubocop] <Layout/SpaceAroundOperators> reported by reviewdog 🐶
Surrounding space missing for operator =>.

expect(res["data"]["attributes"]["current_state"]).to eq({"timestamp"=>"2022-06-21T10:04:37.645", "comment"=>"False positive", "state"=>"CLEARED", "risk_rating"=>1})


📝 [rubocop] <Layout/LineLength> reported by reviewdog 🐶
Line is too long. [173/128]

expect(res["data"]["attributes"]["current_state"]).to eq({"timestamp"=>"2022-06-21T10:04:37.645", "comment"=>"False positive", "state"=>"CLEARED", "risk_rating"=>1})


📝 [rubocop] <Layout/SpaceAroundOperators> reported by reviewdog 🐶
Surrounding space missing for operator =>.

expect(res["data"]["attributes"]["current_state"]).to eq({"timestamp"=>"2022-06-21T10:04:37.645", "comment"=>"False positive", "state"=>"CLEARED", "risk_rating"=>1})


📝 [rubocop] <Layout/SpaceAroundOperators> reported by reviewdog 🐶
Surrounding space missing for operator =>.

expect(res["data"]["attributes"]["current_state"]).to eq({"timestamp"=>"2022-06-21T10:04:37.645", "comment"=>"False positive", "state"=>"CLEARED", "risk_rating"=>1})


📝 [rubocop] <Layout/SpaceInsideHashLiteralBraces> reported by reviewdog 🐶
Space inside } missing.

expect(res["data"]["attributes"]["current_state"]).to eq({"timestamp"=>"2022-06-21T10:04:37.645", "comment"=>"False positive", "state"=>"CLEARED", "risk_rating"=>1})

@@ -134,7 +134,7 @@ def create_association(first_name:, last_name:, birth_year:, external_id:, nin:,

def add_association_to_case(case_id:, association_id:)
params = { json: case_association_body(
association_id,
association_id,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: This could be one line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there was 45 offenses, I let rubocop to fix them himself

@@ -153,7 +153,7 @@ def get_matches(case_id:)

def log_decision(case_id:, match_id:, comment:, state:, risk_rating:)
params = { json: log_decision_body(
comment, state, risk_rating,
comment, state, risk_rating,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: This could be one line

@uncoder uncoder merged commit f329c20 into master Oct 8, 2024
5 checks passed
@uncoder uncoder deleted the rt-749-exceptions-only branch October 8, 2024 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants