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

Migrated ScheduleService to new design #6243

Merged
merged 8 commits into from Apr 28, 2023

Conversation

netopyr
Copy link
Contributor

@netopyr netopyr commented Apr 25, 2023

This PR migrates the ScheduleService to the new design:

  • Makes the preHandle() method generic. It has only one parameter context and is defined in TransactionHandler.
  • Introduces interfaces for each store (e.g. ReadableTokenStore) in the corresponding api-module
  • Adds the suffix 'Impl' to names of store implementations (e.g. ReadableTokenStoreImpl). The classes implement the new interfaces.
  • PreHandleContext will become an interface in an upcoming PR. To prepare this change, FakePreHandleContext was introduced and tests were updated. This class allows to do the switch without breaking all the tests in services.
  • We will stop to use AccountAccess soon. Instead the new interface ReadableAccountStore should be used instead.

Signed-off-by: Michael Heinrichs <netopyr@users.noreply.github.com>
@netopyr netopyr added CI:UnitTests Modularization Issues or PRs related to modularization labels Apr 25, 2023
@netopyr netopyr added this to the v0.38 milestone Apr 25, 2023
@netopyr netopyr self-assigned this Apr 25, 2023
@netopyr netopyr requested review from a team, iwsimon and kimbor as code owners April 25, 2023 07:51
@netopyr netopyr linked an issue Apr 25, 2023 that may be closed by this pull request
@github-actions
Copy link

github-actions bot commented Apr 25, 2023

Node: Unit Test Results

  1 317 files    1 317 suites   1h 16m 10s ⏱️
97 180 tests 97 172 ✔️ 8 💤 0
98 822 runs  98 814 ✔️ 8 💤 0

Results for commit 60dc641.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Apr 25, 2023

Node: Integration Test Results

    3 files      3 suites   14m 37s ⏱️
150 tests 150 ✔️ 0 💤 0
151 runs  151 ✔️ 0 💤 0

Results for commit 60dc641.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Apr 25, 2023

Node: E2E Test Results

    1 files      1 suites   17m 8s ⏱️
309 tests 309 ✔️ 0 💤 0
327 runs  327 ✔️ 0 💤 0

Results for commit 60dc641.

♻️ This comment has been updated with latest results.

hendrikebbers
hendrikebbers previously approved these changes Apr 25, 2023
# Conflicts:
#	hedera-node/hedera-app/src/main/java/com/hedera/node/app/workflows/dispatcher/ReadableStoreFactory.java
# Conflicts:
#	hedera-node/hedera-app/src/main/java/com/hedera/node/app/workflows/dispatcher/ReadableStoreFactory.java
#	hedera-node/hedera-app/src/test/java/com/hedera/node/app/workflows/dispatcher/MonoTransactionDispatcherTest.java
Signed-off-by: Michael Heinrichs <netopyr@users.noreply.github.com>
# Conflicts:
#	hedera-node/hedera-app/src/main/java/com/hedera/node/app/workflows/dispatcher/TransactionDispatcher.java
#	hedera-node/hedera-app/src/test/java/com/hedera/node/app/workflows/dispatcher/MonoTransactionDispatcherTest.java
@codecov
Copy link

codecov bot commented Apr 27, 2023

Codecov Report

Patch coverage: 87.50% and project coverage change: +23.26 🎉

Comparison is base (b9b192f) 67.82% compared to head (60dc641) 91.09%.

Additional details and impacted files
@@              Coverage Diff               @@
##             develop    #6243       +/-   ##
==============================================
+ Coverage      67.82%   91.09%   +23.26%     
+ Complexity     22043    17036     -5007     
==============================================
  Files           1985     1294      -691     
  Lines         134856    48896    -85960     
  Branches        7582     4902     -2680     
==============================================
- Hits           91469    44542    -46927     
+ Misses         41917     3426    -38491     
+ Partials        1470      928      -542     
Impacted Files Coverage Δ
...app/workflows/dispatcher/ReadableStoreFactory.java 76.92% <ø> (ø)
.../schedule/impl/handlers/ScheduleCreateHandler.java 83.33% <75.00%> (-10.42%) ⬇️
...ce/schedule/impl/handlers/ScheduleSignHandler.java 84.21% <80.00%> (-10.24%) ⬇️
...rvice/schedule/impl/ReadableScheduleStoreImpl.java 100.00% <100.00%> (ø)
...chedule/impl/handlers/AbstractScheduleHandler.java 66.66% <100.00%> (+3.50%) ⬆️
.../schedule/impl/handlers/ScheduleDeleteHandler.java 93.33% <100.00%> (+0.47%) ⬆️

... and 926 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@sonarcloud
Copy link

sonarcloud bot commented Apr 27, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug C 1 Bug
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

94.3% 94.3% Coverage
0.0% 0.0% Duplication

@netopyr netopyr merged commit 491de8c into develop Apr 28, 2023
11 of 13 checks passed
@netopyr netopyr deleted the 06178-cross-service-stores-schedule branch April 28, 2023 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Modularization Issues or PRs related to modularization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make stores of other services available via PreHandleContext
4 participants