#748 Add configuration option to control wrapping of sink exceptions.#749
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThis PR adds a workflow-level config flag ChangesSink exception wrapping control
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
pramen/core/src/test/scala/za/co/absa/pramen/core/pipeline/SinkJobSuite.scala (1)
229-237:⚠️ Potential issue | 🟠 Major | ⚡ Quick winFix the assertion contract for the unwrapped exception path.
On Line 229 you switched to
intercept[RuntimeException], but on Lines 236-237 the test still asserts wrapped-exception fields. WithConfigFactory.empty()on Line 265, wrapping is off, so this should assert the original exception message/cause shape.Suggested fix
- assert(ex.getMessage == "Unable to write to the sink.") - assert(ex.getCause.getMessage == "Dummy Exception") + assert(ex.getMessage == "Dummy Exception") + assert(ex.getCause == null)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pramen/core/src/test/scala/za/co/absa/pramen/core/pipeline/SinkJobSuite.scala` around lines 229 - 237, The test uses intercept[RuntimeException] around job.save(...) but still asserts wrapped-exception messages (assert(ex.getMessage == "Unable to write to the sink.") and assert(ex.getCause.getMessage == "Dummy Exception")), while the config (ConfigFactory.empty()) disables wrapping; update the assertions to reflect the unwrapped exception shape by asserting the original exception message (e.g., "Dummy Exception") and any direct cause or null as appropriate—locate the intercept block around job.save(...) and replace the wrapped-exception assertions with checks against the unwrapped exception message and cause.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In
`@pramen/core/src/test/scala/za/co/absa/pramen/core/pipeline/SinkJobSuite.scala`:
- Around line 229-237: The test uses intercept[RuntimeException] around
job.save(...) but still asserts wrapped-exception messages (assert(ex.getMessage
== "Unable to write to the sink.") and assert(ex.getCause.getMessage == "Dummy
Exception")), while the config (ConfigFactory.empty()) disables wrapping; update
the assertions to reflect the unwrapped exception shape by asserting the
original exception message (e.g., "Dummy Exception") and any direct cause or
null as appropriate—locate the intercept block around job.save(...) and replace
the wrapped-exception assertions with checks against the unwrapped exception
message and cause.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 88a1b425-7a4e-4859-810a-4c99e9844de6
📒 Files selected for processing (7)
pramen/core/src/main/resources/reference.confpramen/core/src/main/scala/za/co/absa/pramen/core/config/Keys.scalapramen/core/src/main/scala/za/co/absa/pramen/core/pipeline/OperationSplitter.scalapramen/core/src/main/scala/za/co/absa/pramen/core/pipeline/SinkJob.scalapramen/core/src/main/scala/za/co/absa/pramen/core/pipeline/TransferJob.scalapramen/core/src/test/scala/za/co/absa/pramen/core/pipeline/SinkJobSuite.scalapramen/core/src/test/scala/za/co/absa/pramen/core/pipeline/TransferJobSuite.scala
Unit Test Coverage
Files
|
Summary by CodeRabbit
New Features
Bug Fixes
Tests