Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds first-class configuration support for the REST API bridge port (rest_api_port) so the REST bridge port is no longer hardcoded and can be controlled consistently via default config, user config, and CLI overrides.
Changes:
- Introduces
rest_api_portintoServerConfig, validation, default TOML, and CLI merging. - Updates server startup to bind the REST bridge using the configured
rest_api_port(instead of an environment variable). - Reorganizes CLI options into clearer argument groups (ports, logging) and keeps
--versionavailable.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
STYLY-NetSync-Server/src/styly_netsync/config.py |
Adds rest_api_port to config schema, valid keys, port validation, and CLI override merging. |
STYLY-NetSync-Server/src/styly_netsync/default.toml |
Defines default rest_api_port = 8800. |
STYLY-NetSync-Server/src/styly_netsync/server.py |
Uses configured rest_api_port for REST bridge startup and reorganizes CLI flags into groups. |
STYLY-NetSync-Server/tests/test_config.py |
Updates custom ServerConfig construction to include rest_api_port. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds support for configuring the REST API bridge port (
rest_api_port) throughout the STYLY-NetSync-Server. The new port can now be set via configuration files, command-line arguments, and is validated and used consistently in the server startup logic. Additionally, the command-line interface is reorganized for better usability, grouping related options together.REST API Port Configuration:
rest_api_portfield to theServerConfigclass and included it in the list of configurable and validated ports. [1] [2] [3]default.toml) to include a default value forrest_api_port.rest_api_portinstead of a hardcoded or environment variable value.rest_api_portvia a new--rest-api-portcommand-line argument, and ensured it is merged into the configuration. [1] [2]Command-line Interface Improvements:
Testing:
rest_api_portin custom configuration scenarios.