uber / cadence

Cadence is a distributed, scalable, durable, and highly available orchestration engine to execute asynchronous long-running business logic in a scalable and resilient way.
https://cadenceworkflow.io
MIT License
7.97k stars 773 forks source link

wrapped error support in transport mappers #6050

Closed 3vilhamster closed 1 month ago

3vilhamster commented 1 month ago

What changed? I've added support for wrapped errors for transport level.

Why? This will allow us to return wrapped errors in services and not think about transport-level conversions.

Alternatively, we could introduce error methods To/FromProto and To/FromThrift, so instead of type assertion, we just return the result, I've tried it, but it complicates the error code significantly, while the generic solution is easier to understand.

How did you test it? Unti tests

Potential risks

Release notes

Documentation Changes

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 67.33%. Comparing base (fb4bfce) to head (fe2b7a8). Report is 2 commits behind head on master.

Additional details and impacted files | [Files](https://app.codecov.io/gh/uber/cadence/pull/6050?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber) | Coverage Δ | | |---|---|---| | [common/types/mapper/errorutils/convert.go](https://app.codecov.io/gh/uber/cadence/pull/6050?src=pr&el=tree&filepath=common%2Ftypes%2Fmapper%2Ferrorutils%2Fconvert.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber#diff-Y29tbW9uL3R5cGVzL21hcHBlci9lcnJvcnV0aWxzL2NvbnZlcnQuZ28=) | `100.00% <100.00%> (ø)` | | | [common/types/mapper/proto/errors.go](https://app.codecov.io/gh/uber/cadence/pull/6050?src=pr&el=tree&filepath=common%2Ftypes%2Fmapper%2Fproto%2Ferrors.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber#diff-Y29tbW9uL3R5cGVzL21hcHBlci9wcm90by9lcnJvcnMuZ28=) | `100.00% <100.00%> (ø)` | | | [common/types/mapper/thrift/errors.go](https://app.codecov.io/gh/uber/cadence/pull/6050?src=pr&el=tree&filepath=common%2Ftypes%2Fmapper%2Fthrift%2Ferrors.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber#diff-Y29tbW9uL3R5cGVzL21hcHBlci90aHJpZnQvZXJyb3JzLmdv) | `100.00% <100.00%> (ø)` | | ... and [8 files with indirect coverage changes](https://app.codecov.io/gh/uber/cadence/pull/6050/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber) ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/uber/cadence/pull/6050?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/uber/cadence/pull/6050?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber). Last update [fb4bfce...fe2b7a8](https://app.codecov.io/gh/uber/cadence/pull/6050?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber).
coveralls commented 1 month ago

Pull Request Test Coverage Report for Build 018fa703-7c36-4de4-bf85-55da8ebb37f0

Details


Files with Coverage Reduction New Missed Lines %
common/task/weighted_round_robin_task_scheduler.go 2 88.06%
common/peerprovider/ringpopprovider/config.go 2 81.58%
common/persistence/execution_manager.go 2 86.43%
service/matching/tasklist/task_list_manager.go 2 76.09%
common/persistence/sql/sqlplugin/mysql/task.go 2 73.68%
service/history/task/transfer_active_task_executor.go 2 72.72%
common/persistence/sql/sqlplugin/mysql/db.go 2 79.49%
common/task/fifo_task_scheduler.go 3 84.54%
service/history/task/fetcher.go 3 85.57%
service/frontend/api/handler.go 4 62.26%
<!-- Total: 51 -->
Totals Coverage Status
Change from base Build 018fa464-40c9-4742-b88d-967555b43b81: -0.002%
Covered Lines: 102170
Relevant Lines: 147418

💛 - Coveralls