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

Moved RPC related types to a dedicated package #4505

Merged

Conversation

vytautas-karpavicius
Copy link
Contributor

@vytautas-karpavicius vytautas-karpavicius commented Sep 23, 2021

What changed?
Moved RPC related stuff from config package to a dedicated rpc package, with minor renaming and splitting into files.

Why?
These types contain significant amount of RPC related logic, that IMO deserves their own place. Those are not very config related.

Also, this serves as a first refactoring step for further changes planned. Specifically unifying how dispatchers are created and used. This includes DispatcherProvider and all related stuff such as dnsDispatcherProvider, dnsUpdater, etc. Currently they lie under client package. In the end, these types will end up here as well.

How did you test it?
Existing tests.

Potential risks
None, only mechanical move.

Release notes

Documentation Changes

@vytautas-karpavicius vytautas-karpavicius marked this pull request as ready for review September 23, 2021 13:56
@coveralls
Copy link

coveralls commented Sep 23, 2021

Pull Request Test Coverage Report for Build d6fcb8ae-0329-4864-8f23-1582e6a7502b

  • 21 of 31 (67.74%) changed or added relevant lines in 5 files are covered.
  • 23 unchanged lines in 6 files lost coverage.
  • Overall coverage increased (+0.02%) to 56.482%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cmd/server/cadence/server.go 0 1 0.0%
common/rpc/factory.go 0 9 0.0%
Files with Coverage Reduction New Missed Lines %
common/membership/rpServiceResolver.go 2 73.58%
common/persistence/historyManager.go 2 66.33%
common/task/fifoTaskScheduler.go 2 85.57%
common/types/mapper/thrift/shared.go 2 64.65%
common/persistence/dataManagerInterfaces.go 3 60.91%
service/history/queue/transfer_queue_processor.go 12 58.22%
Totals Coverage Status
Change from base Build a06fe325-6b61-4e2c-8ea1-a8f9c1e9827d: 0.02%
Covered Lines: 80242
Relevant Lines: 142066

💛 - Coveralls

config *RPC
// Factory is an implementation of service.RPCFactory interface
type Factory struct {
config config.RPC
serviceName string
ch *tchannel.ChannelTransport
Copy link
Contributor

Choose a reason for hiding this comment

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

nit and not directly related to this change: rename ch to tchannel?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, fixed.

func newRPCFactory(cfg *RPC, sName string, logger log.Logger, grpcPorts GRPCPorts) *RPCFactory {
factory := &RPCFactory{config: cfg, serviceName: sName, logger: logger, grpcPorts: grpcPorts}
return factory
func NewFactory(sName string, cfg config.RPC, logger log.Logger, grpcPorts GRPCPorts) *Factory {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit and not directly related to this change: sName -> name or service

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, fixed.

@vytautas-karpavicius vytautas-karpavicius merged commit 0b2107f into cadence-workflow:master Sep 24, 2021
@vytautas-karpavicius vytautas-karpavicius deleted the move-rpc branch September 24, 2021 06:52
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.

4 participants