Skip to content

Refactor config files#385

Merged
bishoy-at-pieces merged 4 commits intomainfrom
refactor-config-files
Jul 28, 2025
Merged

Refactor config files#385
bishoy-at-pieces merged 4 commits intomainfrom
refactor-config-files

Conversation

@bishoy-at-pieces
Copy link
Collaborator

@bishoy-at-pieces bishoy-at-pieces commented Jul 28, 2025

  • Config file locking
  • unified schema interface verifying schemas
  • remove pkl use as it is not safe

Copilot AI review requested due to automatic review settings July 28, 2025 14:02
Copy link
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 CLI configuration system by consolidating scattered JSON config files into a unified structure with proper validation, type safety, and manager classes. It also extracts MCP-related test utilities into a reusable test base class to reduce code duplication.

  • Introduces new configuration schemas using Pydantic for validation and type safety
  • Consolidates multiple JSON config files (pieces_config.json, mcp_config.json, etc.) into domain-specific managers
  • Creates a shared test utility module for MCP tests to eliminate duplicated mock setup code

Reviewed Changes

Copilot reviewed 47 out of 47 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
tests/mcps/utils.py New shared test utilities module providing MockPiecesClient and MCPTestBase for MCP unit tests
tests/mcps/mcp_*_test.py Updated to use shared test utilities, eliminating duplicated setup code
src/pieces/settings.py Refactored to use new configuration managers instead of direct file operations
src/pieces/mcp/integration.py Updated to use centralized MCP schema and removed local config management
src/pieces/config/ New configuration management package with schemas, managers, and migration utilities
src/pieces/core/config_command.py Removed - functionality moved to ConfigCommand class
src/pieces/app.py Updated to use new config system and migration logic

@bishoy-at-pieces bishoy-at-pieces force-pushed the refactor-config-files branch 10 times, most recently from bc6096c to 10ff63f Compare July 28, 2025 15:49
@tsavo-at-pieces tsavo-at-pieces self-requested a review July 28, 2025 16:06
Copy link
Contributor

@tsavo-at-pieces tsavo-at-pieces left a comment

Choose a reason for hiding this comment

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

Looking good here!

@bishoy-at-pieces bishoy-at-pieces merged commit 9bb5896 into main Jul 28, 2025
7 checks passed
@bishoy-at-pieces bishoy-at-pieces deleted the refactor-config-files branch July 28, 2025 16:29
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.

3 participants