uber-go / cadence-client

Framework for authoring workflows and activities running on top of the Cadence orchestration engine.
https://cadenceworkflow.io
MIT License
339 stars 128 forks source link

Add methods on Worker to get registered workflows and activities #1342

Closed ketsiambaku closed 3 weeks ago

ketsiambaku commented 3 weeks ago

What changed? Introduce the following methods to the WorkflowRegistry and ActivityRegistry interfaces:

The logic already exists in the internal implementation of the registry but not exposed to the public API. Also implement these methods for WorkflowReplayer and WorkflowShadower. Update unit tests so that they now call the top level methods.

Why? To expose on Uber internal debug page

How did you test it? Unit tests Tested on staging environment

Potential risks Worst case: these methods return unexpected result

codecov[bot] commented 3 weeks ago

Codecov Report

Attention: Patch coverage is 94.28571% with 2 lines in your changes missing coverage. Please review.

Project coverage is 73.29%. Comparing base (bf68484) to head (d404463).

Additional details and impacted files | [Files](https://app.codecov.io/gh/uber-go/cadence-client/pull/1342?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber-go) | Coverage Δ | | |---|---|---| | [internal/internal\_worker.go](https://app.codecov.io/gh/uber-go/cadence-client/pull/1342?src=pr&el=tree&filepath=internal%2Finternal_worker.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber-go#diff-aW50ZXJuYWwvaW50ZXJuYWxfd29ya2VyLmdv) | `79.79% <100.00%> (+0.23%)` | :arrow_up: | | [internal/workflow\_replayer.go](https://app.codecov.io/gh/uber-go/cadence-client/pull/1342?src=pr&el=tree&filepath=internal%2Fworkflow_replayer.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber-go#diff-aW50ZXJuYWwvd29ya2Zsb3dfcmVwbGF5ZXIuZ28=) | `76.92% <100.00%> (+2.21%)` | :arrow_up: | | [internal/workflow\_shadower.go](https://app.codecov.io/gh/uber-go/cadence-client/pull/1342?src=pr&el=tree&filepath=internal%2Fworkflow_shadower.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber-go#diff-aW50ZXJuYWwvd29ya2Zsb3dfc2hhZG93ZXIuZ28=) | `77.77% <100.00%> (+0.63%)` | :arrow_up: | | [internal/registry.go](https://app.codecov.io/gh/uber-go/cadence-client/pull/1342?src=pr&el=tree&filepath=internal%2Fregistry.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber-go#diff-aW50ZXJuYWwvcmVnaXN0cnkuZ28=) | `91.83% <86.66%> (-0.43%)` | :arrow_down: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/uber-go/cadence-client/pull/1342/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber-go) ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/uber-go/cadence-client/pull/1342?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber-go). > **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-go) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/uber-go/cadence-client/pull/1342?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber-go). Last update [bf68484...d404463](https://app.codecov.io/gh/uber-go/cadence-client/pull/1342?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber-go). 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-go).