Skip to content

feat: enhance configuration management and logging in the MoLing server#3

Merged
cfc4n merged 4 commits intomasterfrom
feat/enhance-configuration
Mar 27, 2025
Merged

feat: enhance configuration management and logging in the MoLing server#3
cfc4n merged 4 commits intomasterfrom
feat/enhance-configuration

Conversation

@cfc4n
Copy link
Copy Markdown
Member

@cfc4n cfc4n commented Mar 27, 2025

No description provided.

@cfc4n cfc4n requested a review from Copilot March 27, 2025 13:38
@cfc4n cfc4n added the enhancement New feature or request label Mar 27, 2025
Copy link
Copy Markdown

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 enhances configuration management and logging for the MoLing server. It renames and repurposes configuration fields, updates logging levels, and refactors CLI command options.

  • Rename FSRootPath to CachePath in the file system configuration.
  • Update logging levels and add a debug flag.
  • Modify CLI commands to use centralized configuration settings and directory lists.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
services/file_system_config.go Renames field from FSRootPath to CachePath without updating JSON tag/comment consistency.
services/file_system.go Updates file path join to use the newly renamed CachePath field.
services/config.go Adds the Debug flag to the MoLingConfig.
services/command.go Changes logging level from Info to Debug for the CommandServer config output.
cli/cmd/root.go Introduces a config file constant and debug flag, and refactors base path usage.
cli/cmd/perrun.go Uses the centralized mlDirectories constant for directory creation.
cli/cmd/config.go Updates config command to initialize and display config details with the new logger setup.
Comments suppressed due to low confidence (2)

services/file_system_config.go:34

  • The field name 'CachePath' conflicts with its JSON tag 'fs_root_path' and comment indicating a file system root, which may lead to confusion regarding its actual purpose. Consider updating the JSON tag and comment to reflect that this field represents a cache path, or rename the field to match its intended usage.
CachePath   string   `json:"fs_root_path"` // CachePath is the root path for the file system.

cli/cmd/config.go:98

  • [nitpick] The flag '--init' may be ambiguous regarding its purpose of saving the configuration to a file. Consider renaming the flag to '--save-config' or a similar descriptive name to better convey its functionality.
configCmd.PersistentFlags().BoolVar(&initial, "init", false, fmt.Sprintf("Save configuration to %s", filepath.Join(mlConfig.BasePath, MLConfigName)))

cfc4n added 3 commits March 27, 2025 22:02
…lication

Signed-off-by: cfc4n <cfc4n.cs@gmail.com>
…uration format

Signed-off-by: cfc4n <cfc4n.cs@gmail.com>
Signed-off-by: cfc4n <cfc4n.cs@gmail.com>
@cfc4n cfc4n merged commit c880129 into master Mar 27, 2025
6 checks passed
@cfc4n cfc4n deleted the feat/enhance-configuration branch March 27, 2025 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants