Skip to content
This repository was archived by the owner on Dec 10, 2025. It is now read-only.

feat: pass configHolder to connection setup for enhanced configuration flexibility#127

Merged
twisti-dev merged 2 commits intomasterfrom
105-failed-to-initialize-a-channel
Nov 1, 2025
Merged

feat: pass configHolder to connection setup for enhanced configuration flexibility#127
twisti-dev merged 2 commits intomasterfrom
105-failed-to-initialize-a-channel

Conversation

@twisti-dev
Copy link
Copy Markdown
Contributor

This pull request updates the client-server connection logic to ensure that serialization and logging handlers use the correct configuration from configHolder. The main change is passing configHolder through the connection setup process, allowing for more flexible and accurate configuration management during network initialization.

Configuration propagation and serialization updates

  • The ConnectionImpl.connect method now accepts a configHolder parameter, enabling configuration data to be used when setting up connections. ([[1]](https://github.com/SLNE-Development/surf-cloud/pull/127/files#diff-20cf3f52f4f8e9c6180d76191766936b5515e1a235a5388ac65d593c9d55c694L91-R92), [[2]](https://github.com/SLNE-Development/surf-cloud/pull/127/files#diff-20cf3f52f4f8e9c6180d76191766936b5515e1a235a5388ac65d593c9d55c694L208-R209), [[3]](https://github.com/SLNE-Development/surf-cloud/pull/127/files#diff-df77ee0c4e4c29a956ed179b19d51fa84cc61a550eac5d12bc35aeaf169adbfbL1224-R1225))
  • The configureSerialization method in ConnectionImpl has been updated to take configHolder as a parameter, ensuring that serialization and logging handlers use the correct logging level from the configuration. ([surf-cloud-core/surf-cloud-core-common/src/main/kotlin/dev/slne/surf/cloud/core/common/netty/network/ConnectionImpl.ktL1251-R1278](https://github.com/SLNE-Development/surf-cloud/pull/127/files#diff-df77ee0c4e4c29a956ed179b19d51fa84cc61a550eac5d12bc35aeaf169adbfbL1251-R1278))
  • All calls to configureSerialization in both client and server connection setup now pass the configHolder, making configuration handling consistent across the codebase. ([[1]](https://github.com/SLNE-Development/surf-cloud/pull/127/files#diff-506d22b76b9a082323332c3dc92549cb0beeb7f98ebe28b5421f435a9a398175L94-R95), [[2]](https://github.com/SLNE-Development/surf-cloud/pull/127/files#diff-df77ee0c4e4c29a956ed179b19d51fa84cc61a550eac5d12bc35aeaf169adbfbL1251-R1278))

These changes improve maintainability and make it easier to adjust connection behaviors based on configuration settings.

…ion flexibility

- Updated `ServerConnectionListener`, `ConnectionImpl`, and `ClientNettyClientImpl` to include `configHolder` in their connection setup methods.
- Simplified logging configuration by directly utilizing `configHolder.config`.
@twisti-dev twisti-dev linked an issue Nov 1, 2025 that may be closed by this pull request
@github-project-automation github-project-automation Bot moved this to Backlog in surf-cloud Nov 1, 2025
@twisti-dev twisti-dev self-assigned this Nov 1, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Nov 1, 2025

Qodana for JVM

513 new problems were found

Inspection name Severity Problems
Unstable API Usage 🔴 Failure 2
Hardcoded passwords 🔴 Failure 1
Incorrect autowiring in Spring bean components 🔴 Failure 1
Unresolved reference in KDoc 🔶 Warning 54
Serializable class without 'serialVersionUID' 🔶 Warning 5
Constant conditions 🔶 Warning 4
Leaking 'this' in constructor 🔶 Warning 4
Control flow with empty body 🔶 Warning 2
Possibly blocking call in non-blocking context 🔶 Warning 1
Unused return value of a function with lambda expression body 🔶 Warning 1
Incorrect formatting ◽️ Notice 397
Convert 'object' to 'data object' ◽️ Notice 15
Function or property has platform type ◽️ Notice 11
@Deprecated annotation without 'replaceWith' argument ◽️ Notice 5
Leaking 'this' in constructor ◽️ Notice 5
Package name does not match containing directory ◽️ Notice 4
Redundant empty initializer block ◽️ Notice 1

☁️ View the detailed Qodana report

Contact Qodana team

Contact us at [email protected]

@twisti-dev twisti-dev marked this pull request as ready for review November 1, 2025 16:42
Copilot AI review requested due to automatic review settings November 1, 2025 16:42
@twisti-dev twisti-dev merged commit 76fb7e4 into master Nov 1, 2025
1 check failed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in surf-cloud Nov 1, 2025
@twisti-dev twisti-dev deleted the 105-failed-to-initialize-a-channel branch November 1, 2025 16:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the Netty configuration initialization to pass the AbstractSurfCloudConfigHolder instance explicitly instead of relying on Spring's bean<>() lookup. This improves testability and reduces coupling to Spring's dependency injection framework.

  • Adds configHolder parameter to ConnectionImpl.configureSerialization() and ConnectionImpl.connect()
  • Removes Spring bean<>() lookup from configureSerialization() to use the passed parameter
  • Updates all call sites to provide the configHolder instance

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
surf-cloud-core/surf-cloud-core-common/src/main/kotlin/dev/slne/surf/cloud/core/common/netty/network/ConnectionImpl.kt Adds configHolder parameter to connect() and configureSerialization() methods; replaces Spring bean lookup with parameter usage
surf-cloud-core/surf-cloud-core-client/src/main/kotlin/dev/slne/surf/cloud/core/client/netty/ClientNettyClientImpl.kt Updates both ConnectionImpl.connect() call sites to pass configHolder
surf-cloud-standalone/src/main/kotlin/dev/slne/surf/cloud/standalone/netty/server/connection/ServerConnectionListener.kt Updates ConnectionImpl.configureSerialization() call and formats broadcast() method signature

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Failed to initialize a channel

2 participants