Skip to content

refactor: Remove transitive dependency from swirlds-platform-core on consensus-hashgraph-impl#23389

Open
poulok wants to merge 29 commits intomainfrom
23091-remove-requires-transitive-test-fixtures
Open

refactor: Remove transitive dependency from swirlds-platform-core on consensus-hashgraph-impl#23389
poulok wants to merge 29 commits intomainfrom
23091-remove-requires-transitive-test-fixtures

Conversation

@poulok
Copy link
Contributor

@poulok poulok commented Feb 6, 2026

Description:
This PR eliminates the transitive dependency from swirlds-platform-core testFixtures on consensus-hashgraph-impl testFixture. The concern with this dependency is that classes like EventImpl could be leaked to a src/test module via the testFixtures.

SimpleGraph was split into two classes that implement a new interface, each parameterizing it with the type of event they provide. The one that provides PlatformEvent is exposed externally for other testFixtures and tests. The one that provides EventImpl is only exposed to the consensus-hashgraph-impl src and test module, not to any external modules. This ensures that classes such as EventImpl are not exposed outside of the module at all.

Related issue(s):

Fixes #23091

poulok added 22 commits February 4, 2026 12:11
Signed-off-by: Kelly Greco <kelly@swirldslabs.com>
Signed-off-by: Kelly Greco <kelly@swirldslabs.com>

# Conflicts:
#	platform-sdk/swirlds-platform-core/src/testFixtures/java/module-info.java
Signed-off-by: Kelly Greco <kelly@swirldslabs.com>
Signed-off-by: Kelly Greco <kelly@swirldslabs.com>
Signed-off-by: Kelly Greco <kelly@swirldslabs.com>
Signed-off-by: Kelly Greco <kelly@swirldslabs.com>
Signed-off-by: Kelly Greco <kelly@swirldslabs.com>
Signed-off-by: Kelly Greco <kelly@swirldslabs.com>
Signed-off-by: Kelly Greco <kelly@swirldslabs.com>
Signed-off-by: Kelly Greco <kelly@swirldslabs.com>
Signed-off-by: Kelly Greco <kelly@swirldslabs.com>
Signed-off-by: Kelly Greco <kelly@swirldslabs.com>
Signed-off-by: Kelly Greco <kelly@swirldslabs.com>
Signed-off-by: Kelly Greco <kelly@swirldslabs.com>
Signed-off-by: Kelly Greco <kelly@swirldslabs.com>
Signed-off-by: Kelly Greco <kelly@swirldslabs.com>

# Conflicts:
#	platform-sdk/consensus-hashgraph-impl/src/test/java/org/hiero/consensus/hashgraph/impl/HashgraphGuiMain.java
#	platform-sdk/consensus-hashgraph-impl/src/test/java/org/hiero/consensus/hashgraph/impl/consensus/AncientParentsTest.java
#	platform-sdk/consensus-hashgraph-impl/src/test/java/org/hiero/consensus/hashgraph/impl/consensus/ConsensusEngineContractTest.java
#	platform-sdk/consensus-hashgraph-impl/src/test/java/org/hiero/consensus/hashgraph/impl/consensus/ConsensusTestDefinitions.java
#	platform-sdk/consensus-hashgraph-impl/src/testFixtures/java/module-info.java
#	platform-sdk/consensus-hashgraph-impl/src/testFixtures/java/org/hiero/consensus/hashgraph/impl/test/fixtures/consensus/ConsensusTestOrchestrator.java
#	platform-sdk/consensus-hashgraph-impl/src/testFixtures/java/org/hiero/consensus/hashgraph/impl/test/fixtures/consensus/framework/ConsensusTestNode.java
#	platform-sdk/consensus-hashgraph-impl/src/testFixtures/java/org/hiero/consensus/hashgraph/impl/test/fixtures/consensus/framework/OrchestratorBuilder.java
#	platform-sdk/consensus-hashgraph-impl/src/testFixtures/java/org/hiero/consensus/hashgraph/impl/test/fixtures/event/generator/StandardGraphGenerator.java
#	platform-sdk/consensus-hashgraph-impl/src/testFixtures/java/org/hiero/consensus/hashgraph/impl/test/fixtures/gui/runner/TestGuiSource.java
#	platform-sdk/swirlds-cli/src/main/java/org/hiero/consensus/pcli/GenesisPlatformStateCommand.java
#	platform-sdk/swirlds-cli/src/main/java/org/hiero/consensus/pcli/recovery/EventRecoveryWorkflow.java
#	platform-sdk/swirlds-platform-core/src/testFixtures/java/module-info.java
Signed-off-by: Kelly Greco <kelly@swirldslabs.com>
Signed-off-by: Kelly Greco <kelly@swirldslabs.com>
Signed-off-by: Kelly Greco <kelly@swirldslabs.com>
Signed-off-by: Kelly Greco <kelly@swirldslabs.com>
@poulok poulok added this to the v0.72 milestone Feb 6, 2026
@poulok poulok self-assigned this Feb 6, 2026
@trunk-io
Copy link

trunk-io bot commented Feb 6, 2026

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

@lfdt-bot
Copy link

lfdt-bot commented Feb 6, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Signed-off-by: Kelly Greco <kelly@swirldslabs.com>
@poulok poulok changed the title 23091 remove requires transitive test fixtures refactor: Remove transitive dependency from swirlds-platform-core on consensus-hashgraph-impl Feb 6, 2026
Signed-off-by: Kelly Greco <kelly@swirldslabs.com>
Signed-off-by: Kelly Greco <kelly@swirldslabs.com>
Signed-off-by: Kelly Greco <kelly@swirldslabs.com>
Base automatically changed from 23063-gui-module-new to main February 6, 2026 17:54
Signed-off-by: Kelly Greco <kelly@swirldslabs.com>
Signed-off-by: Kelly Greco <kelly@swirldslabs.com>

# Conflicts:
#	platform-sdk/consensus-hashgraph-impl/src/test/java/org/hiero/consensus/hashgraph/impl/consensus/AncientParentsTest.java
#	platform-sdk/consensus-hashgraph-impl/src/test/java/org/hiero/consensus/hashgraph/impl/consensus/ConsensusEngineContractTest.java
#	platform-sdk/consensus-hashgraph-impl/src/testFixtures/java/module-info.java
#	platform-sdk/swirlds-platform-core/build.gradle.kts
#	platform-sdk/swirlds-platform-core/src/testFixtures/java/com/swirlds/platform/test/fixtures/graph/SimpleGraph.java
#	platform-sdk/swirlds-platform-core/src/testFixtures/java/module-info.java
Signed-off-by: Kelly Greco <kelly@swirldslabs.com>
@poulok poulok marked this pull request as ready for review February 6, 2026 19:25
@poulok poulok requested a review from a team as a code owner February 6, 2026 19:25
@poulok poulok requested a review from mxtartaglia-sl February 6, 2026 19:25
@codacy-production
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% (target: -1.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (2a023e7) 91276 74848 82.00%
Head commit (74b53e8) 91276 (+0) 74852 (+4) 82.01% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#23389) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@codecov
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@            Coverage Diff            @@
##               main   #23389   +/-   ##
=========================================
  Coverage     78.02%   78.02%           
+ Complexity    23413    23412    -1     
=========================================
  Files          2458     2458           
  Lines         91459    91459           
  Branches       9710     9710           
=========================================
+ Hits          71359    71364    +5     
+ Misses        16511    16507    -4     
+ Partials       3589     3588    -1     

see 15 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@poulok poulok requested review from netopyr and removed request for mxtartaglia-sl February 6, 2026 20:15
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.

Determine impact of transitive dependency on impl modules in test fixtures

2 participants