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: use commons module in simulator #271

Merged
merged 9 commits into from
Oct 28, 2024

Conversation

ata-nas
Copy link
Contributor

@ata-nas ata-nas commented Oct 17, 2024

Description:

  • refactor :simulator to start using logic from :common

Related issue(s):
Fixes #253

Notes for reviewer:

  • have I missed any places to refactor?

Checklist

  • removed com.hedera.block.simulator.Constants from :simulator and replace usages with com.hedera.block.common.constants.StringsConstants from :common
  • removed com.hedera.block.simulator.generator.Utils from :simulator and replace usages with com.hedera.block.common.utils.FileUtilities from :common

  • Documented (Code comments, README, etc.) - N/A
  • Tested (unit, integration, etc.) - N/A

@ata-nas ata-nas added Improvement Code changes driven by non business requirements Common Issue/PR related to Common module labels Oct 17, 2024
@ata-nas ata-nas added this to the 0.2.0 milestone Oct 17, 2024
@ata-nas ata-nas self-assigned this Oct 17, 2024
@ata-nas ata-nas linked an issue Oct 17, 2024 that may be closed by this pull request
@ata-nas ata-nas marked this pull request as ready for review October 17, 2024 14:24
@ata-nas ata-nas requested a review from a team as a code owner October 17, 2024 14:24
@ata-nas ata-nas force-pushed the 253-refactor-use-commons-module-in-simulator branch 4 times, most recently from a44ffcc to db7654d Compare October 23, 2024 07:22
@ata-nas ata-nas force-pushed the 253-refactor-use-commons-module-in-simulator branch 2 times, most recently from 7b202ca to 76efcc6 Compare October 24, 2024 12:59
AlfredoG87
AlfredoG87 previously approved these changes Oct 24, 2024
Copy link
Contributor

@AlfredoG87 AlfredoG87 left a comment

Choose a reason for hiding this comment

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

LG, just 1 question/nit.

Copy link
Member

@jsync-swirlds jsync-swirlds left a comment

Choose a reason for hiding this comment

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

It appears you ran an IDE reformat on these files without disabling a lot of very bad defaults. It's important to keep in mind that most IDEs do not, and often cannot, correctly format the codebase. The gradle spotlessApply task is much preferred.
Most of these comments are to not apply those reformats (particularly in Javadoc which is using a very resource-expensive, completely unnecessary, and relatively difficult to read formatting pattern).

Beyond that the Constants file should not have been removed (it holds exactly the constants we should be keeping and using from the Simulator).

@ata-nas ata-nas force-pushed the 253-refactor-use-commons-module-in-simulator branch from 6811957 to e2923e0 Compare October 28, 2024 09:34
Signed-off-by: Atanas Atanasov <[email protected]>
@ata-nas ata-nas requested review from jsync-swirlds, AlfredoG87 and a team and removed request for AlfredoG87, georgi-l95 and mattp-swirldslabs October 28, 2024 14:39
Copy link

codecov bot commented Oct 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.81%. Comparing base (d829247) to head (2363021).

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #271      +/-   ##
============================================
+ Coverage     99.62%   99.81%   +0.18%     
+ Complexity      288      285       -3     
============================================
  Files            57       56       -1     
  Lines          1060     1053       -7     
  Branches         78       77       -1     
============================================
- Hits           1056     1051       -5     
+ Misses            3        2       -1     
+ Partials          1        0       -1     
Files with missing lines Coverage Δ
...ulator/generator/BlockAsDirBlockStreamManager.java 100.00% <100.00%> (ø)
...lator/generator/BlockAsFileBlockStreamManager.java 100.00% <100.00%> (ø)
.../simulator/generator/BlockAsFileLargeDataSets.java 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

Copy link
Contributor

@mattp-swirldslabs mattp-swirldslabs left a comment

Choose a reason for hiding this comment

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

Joseph has a few comments but otherwise looks good

Copy link
Contributor

@mattp-swirldslabs mattp-swirldslabs left a comment

Choose a reason for hiding this comment

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

Looks good

@ata-nas ata-nas merged commit 88ef1f8 into main Oct 28, 2024
11 checks passed
@ata-nas ata-nas deleted the 253-refactor-use-commons-module-in-simulator branch October 28, 2024 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Common Issue/PR related to Common module Improvement Code changes driven by non business requirements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor: use commons module in simulator
4 participants