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

Refactor history packages #5673

Merged
merged 4 commits into from
Feb 20, 2024

Conversation

jakobht
Copy link
Member

@jakobht jakobht commented Feb 19, 2024

What changed?
Moving structs in the service/history package to their own packages

The handler is moved to it's own package with the interface (like in frontend)
The handler wrappers (grpc, and thrift) are moved to their own packages under wrapped (like in frontend)

The engine implementation is moved to it's own package as there was a circular dependency
history (service) -> handler -> history (engine)
and the engine implementation cannot be in the same package as the engine interface, as there is a dependency
engineimpl -> shard -> engine (Interface)

Moved all the error values in handler to a constants package as at least one of them (ErrRunIDNotValid) is referenced from two different packages (handler and engineimpl tests)

Why?
We should not have this much in the same package

Also when service and handler are in the same package we cannot introduce wrappers around handler in any other package than history as that will create a circular dependency:
history (service) -> wrapper -> history (handler)

How did you test it?
Ran unit tests

Potential risks
It just moves things around, so no real code changes

Release notes

Documentation Changes

When service and handler are in the same package we cannot introduce
wrappers around handler in another package as that will create a
circular dependency:
history (service) -> wrapper -> history (handler)

This moves handler to the handler package.

Also moves the engine implementation to it's own package as there was a
circular dependency

history (service) -> handler -> history (engine)

The engine implementation cannot be in the same package as the engine
interface, as there is a dependency
engineimpl -> shard -> engine (Interface)

Moved all the error values in handler to a constants package as at least
one of them (ErrRunIDNotValid) is referenced from two different packages
(handler and engine tests)
@coveralls
Copy link

coveralls commented Feb 19, 2024

Pull Request Test Coverage Report for Build 018dc4d7-f7fb-43dd-8272-61d5e263000b

Details

  • -86 of 91 (5.49%) changed or added relevant lines in 3 files are covered.
  • 48 unchanged lines in 10 files lost coverage.
  • Overall coverage increased (+0.03%) to 62.737%

Changes Missing Coverage Covered Lines Changed/Added Lines %
service/history/handler/handler.go 1 87 1.15%
Files with Coverage Reduction New Missed Lines %
common/task/weighted_round_robin_task_scheduler.go 1 89.05%
common/membership/hashring.go 2 82.23%
service/history/task/transfer_standby_task_executor.go 2 87.84%
service/matching/taskListManager.go 2 80.2%
service/history/execution/mutable_state_task_refresher.go 3 58.86%
common/persistence/nosql/nosqlplugin/cassandra/tasks.go 4 76.09%
common/persistence/nosql/nosql_task_store.go 5 61.95%
common/persistence/nosql/utils.go 8 12.0%
common/persistence/nosql/nosqlplugin/cassandra/db.go 9 47.06%
common/persistence/nosql/nosqlplugin/cassandra/gocql/public/client.go 12 20.93%
Totals Coverage Status
Change from base Build 018dc39c-5b2f-40c1-abd2-356e5a779477: 0.03%
Covered Lines: 92641
Relevant Lines: 147666

💛 - Coveralls

@jakobht jakobht merged commit 8f3e6bd into cadence-workflow:master Feb 20, 2024
16 checks passed
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