Skip to content

dev 0.1.2#18

Merged
AntoineBuirey merged 18 commits intomainfrom
0.1.2-dev
Oct 7, 2025
Merged

dev 0.1.2#18
AntoineBuirey merged 18 commits intomainfrom
0.1.2-dev

Conversation

@AntoineBuirey
Copy link
Copy Markdown
Collaborator

@AntoineBuirey AntoineBuirey commented Sep 22, 2025

Features

  • Add event documentation generation script (Markdown output) sourced from XML event descriptions.
  • Enhance version listing:
    • Dashboard initialization now includes modloader versions.
    • UI/API refactored to return Version objects directly.
    • Improved endpoints for fetching Minecraft and Forge versions.
  • Add a console log to confirm dashboard initialization.

Fixes

  • Bus message decoding:
    • Better error handling and error logging for decode failures.
    • Event argument conversion now uses the new encode/decode functions.
  • Makefile:
    • Use the PYTHON variable consistently.
    • Improve startup logging levels.
    • Refine cleanup behavior.

Refactor

  • Event arguments:
    • Remove deprecated type mapping in EventArg.
    • Consolidate argument conversion via new encode/decode helpers.

Chore/Tests

  • Add utility to split strings while ignoring nested structures.
  • Include unit tests for the new utility.

Style

  • Update regex patterns to better match Python type hints for dict, list, and tuple.

Potential Impact / Notes

  • API/UI now returning Version objects may require minor adjustments for any consumers that relied on primitive values.
  • No breaking changes expected beyond the Version return type consideration.

How to Test

  • Start the server and verify:
    • Enhanced logging appears at startup.
    • Dashboard initializes and displays modloader versions.
  • Hit the version endpoints and confirm they return Version objects as intended.
  • Run the event docs generation script (or associated Makefile target) and check that Markdown is produced from XML descriptions.
  • Execute the test suite to validate the new nested-split utility behavior.

AntoineBuirey and others added 6 commits September 22, 2025 21:20
- Updated the dashboard initialization to include modloader versions.
- Added a console log statement to confirm dashboard initialization.

fix: Update Makefile for improved logging and cleanup

- Changed Python command to use the PYTHON variable for consistency.
- Enhanced logging levels for server startup.
- Improved cleanup process in the Makefile.

feat: Add documentation generation script

- Introduced a new script to generate Markdown documentation for events.
- Updated event handling to include descriptions in the XML configuration.

fix: Improve error handling in bus message decoding

- Added error logging for message decoding failures in the Bus class.
- Enhanced event argument conversion to utilize the new encoding/decoding functions.

refactor: Streamline event argument handling

- Removed deprecated type mapping in EventArg class.
- Updated argument conversion methods to use the new encode/decode functions.

feat: Enhance user interface for version listing

- Modified the user interface to return Version objects directly.
- Improved API endpoints for fetching Minecraft and Forge versions.

chore: Add utility functions for nested string splitting

- Implemented a function to split strings while ignoring nested structures.
- Added tests for the new utility function to ensure correctness.

style: Update regex patterns for type matching

- Enhanced regex patterns to match Python type hints for dicts, lists, and tuples.
@AntoineBuirey AntoineBuirey changed the title feat: Enhance dashboard initialization and logging dev 0.1.2 Sep 23, 2025
@AntoineBuirey AntoineBuirey requested a review from Copilot October 6, 2025 13:51
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 updates the system to version 0.1.2 with comprehensive improvements to event handling, user interface, and development tooling. The changes refactor the argument handling system to use new encoding/decoding functions, enhance API endpoints to return Version objects directly, and add significant development infrastructure.

  • Streamlined event argument handling by replacing deprecated type mapping with new encode/decode functions
  • Enhanced user interface to return Version objects directly instead of strings in API endpoints
  • Added comprehensive development tooling including documentation generation, improved Makefile, and VSCode workspace configuration

Reviewed Changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
server/src/utils/regex.py Added regex patterns for Python type hints and encoded data structures
server/src/utils/misc.py Added utility function for nested string splitting with comprehensive tests
server/src/user_interface/web_server/http_server.py Updated type annotations, improved error handling, and fixed variable naming conflicts
server/src/user_interface/Base_interface.py Modified API methods to return Version objects directly instead of converting from strings
server/src/gen_doc.py New script for generating Markdown documentation from event definitions
server/src/events_descriptions.json New JSON file containing event descriptions for documentation generation
server/src/decode_event.py Added raw mode option for event decoding
server/src/core/core.py Added validation for required configuration paths
server/src/bus/events.xml Updated XML schema and cleaned up comments
server/src/bus/events.py Major refactor replacing type mapping with new encode/decode functions
server/src/bus/bus.py Enhanced error handling for message decoding failures
pyproject.toml Added new documentation generation script and package data
makefile Improved Python variable consistency and enhanced logging configuration
forge-server-manager.code-workspace Added comprehensive VSCode tasks and UI improvements
client/src/dashboard/dashboard.ts Added modloader version initialization and console logging

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread server/src/decode_event.py
Comment thread server/src/user_interface/web_server/http_server.py
Comment thread server/src/user_interface/web_server/http_server.py Outdated
Comment thread server/src/bus/events.py
Comment thread server/src/bus/events.py
Comment thread server/src/bus/events.py
Comment thread server/src/bus/events.py
@AntoineBuirey AntoineBuirey marked this pull request as ready for review October 7, 2025 17:27
@AntoineBuirey AntoineBuirey requested a review from Copilot October 7, 2025 17:27
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

Copilot reviewed 15 out of 16 changed files in this pull request and generated 4 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +104 to +108
if args.raw:
print(f"Decoded string: {decoded_string}")
else:
event, event_args = decode_event(decoded_string)
print_event(event, event_args)
Copy link

Copilot AI Oct 7, 2025

Choose a reason for hiding this comment

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

The else block should be moved outside the if args.prefix block. Currently, if args.raw is True, the event decoding and printing logic will be skipped entirely, regardless of the prefix flag.

Copilot uses AI. Check for mistakes.
server_path = data.get("path")
autostart = str2bool(data.get("autostart", "false"))

autostart = data.get("autostart", False)
Copy link

Copilot AI Oct 7, 2025

Choose a reason for hiding this comment

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

The autostart parameter is extracted but the validation logic on line 329 still expects it to be converted from string. Either remove the str2bool conversion logic or keep using str2bool here.

Suggested change
autostart = data.get("autostart", False)
autostart = data.get("autostart", False)
if isinstance(autostart, str):
autostart = str2bool(autostart)

Copilot uses AI. Check for mistakes.
Comment on lines 322 to +328
if server_type != "vanilla" and not modloader_version or not isinstance(modloader_version, str):
Logger.debug("Invalid modloader_version")
return {"message": "Invalid parameters"}, HTTP.BAD_REQUEST
modloader_version = Version.from_string(modloader_version) if modloader_version else None
if not modloader_version:
Logger.debug("Modloader version is required for non-vanilla servers")
return {"message": "Invalid parameters"}, HTTP.BAD_REQUEST
modloader_version = Version.from_string(modloader_version)
Copy link

Copilot AI Oct 7, 2025

Choose a reason for hiding this comment

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

This validation incorrectly requires modloader_version for all server types. The check should only apply when server_type != 'vanilla' as indicated by the error message.

Copilot uses AI. Check for mistakes.
Comment thread makefile
# if version is in the form of x.y.z-dev-aaaa or x.y.z-dev+aaaa, set it to x.y.z-dev
# VERSION_STR = $(shell echo $(VERSION) | sed 's/-dev-[a-z0-9]*//')
VERSION_STR = $(shell echo $(VERSION) | sed 's/-dev-[a-z0-9]*//; s/-dev+.*//')
# VERSION_STR = $(shell echo $(VERSION) | sed 's/-dev-[a-z0-9]*\/\/')
Copy link

Copilot AI Oct 7, 2025

Choose a reason for hiding this comment

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

Corrected comment has invalid sed syntax with '//' at the end.

Suggested change
# VERSION_STR = $(shell echo $(VERSION) | sed 's/-dev-[a-z0-9]*\/\/')
# VERSION_STR = $(shell echo $(VERSION) | sed 's/-dev-[a-z0-9]*//')

Copilot uses AI. Check for mistakes.
@AntoineBuirey AntoineBuirey merged commit dad903b into main Oct 7, 2025
4 checks passed
@AntoineBuirey AntoineBuirey deleted the 0.1.2-dev branch October 7, 2025 17:37
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.

2 participants