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

Use common dispatcher for public client outbound #2 #4537

Conversation

vytautas-karpavicius
Copy link
Contributor

@vytautas-karpavicius vytautas-karpavicius commented Oct 5, 2021

What changed?
Same as #4523, but with fixed middleware pointer, which required the revert #4534.

authMiddleware was stored as a pointer, which is not equal to nil which is checked when wrapping a middleware here: https://github.com/yarpc/yarpc-go/blob/dev/api/middleware/outbound.go#L59

Also updated unit test to ensure true nil is used when auth is not configured.


Stop using DispatcherProvider for creating public client. Instead use common dispatcher from rpc.Factory.

Builder for public client outbound was created which also includes auth middleware initialization. It was previously located within server.go itself. Moving it here allows consolidating all logic related logic in one place and covering it with unit tests.

Why?
To eventually delete DispatcherProvider entirely.

How did you test it?
Existing tests and new unit tests.

Potential risks

Release notes

Documentation Changes

@coveralls
Copy link

coveralls commented Oct 5, 2021

Pull Request Test Coverage Report for Build b5489b83-bf38-4dff-8e66-962ef2ba48d0

  • 28 of 31 (90.32%) changed or added relevant lines in 3 files are covered.
  • 25 unchanged lines in 7 files lost coverage.
  • Overall coverage increased (+0.05%) to 56.478%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cmd/server/cadence/server.go 0 3 0.0%
Files with Coverage Reduction New Missed Lines %
common/task/weightedRoundRobinTaskScheduler.go 1 89.64%
service/history/execution/mutable_state_task_refresher.go 1 73.82%
common/types/mapper/thrift/shared.go 2 64.52%
service/history/execution/mutable_state_builder.go 2 69.77%
common/task/fifoTaskScheduler.go 4 83.51%
service/history/execution/context.go 6 73.83%
common/persistence/nosql/nosqlExecutionStore.go 9 57.52%
Totals Coverage Status
Change from base Build 0f1ac1c8-56e0-4096-b3bd-1e8bcf2ac3ad: 0.05%
Covered Lines: 80593
Relevant Lines: 142697

💛 - Coveralls

@vytautas-karpavicius vytautas-karpavicius marked this pull request as ready for review October 5, 2021 10:24
@vytautas-karpavicius vytautas-karpavicius requested a review from a team October 5, 2021 10:24
Comment on lines 65 to 68
type publicClientOutbound struct {
address string
authMiddleware middleware.UnaryOutbound
}
Copy link
Contributor

Choose a reason for hiding this comment

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

move this up

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@vytautas-karpavicius vytautas-karpavicius merged commit b1e3001 into cadence-workflow:master Oct 5, 2021
@vytautas-karpavicius vytautas-karpavicius deleted the public-sdk-outbound branch October 5, 2021 11:27
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.

3 participants