Skip to content

Release (v0.2.0) - refactored & introduced new project structure & ideas#12

Merged
RepoRover merged 5 commits intomainfrom
dev
Dec 10, 2025
Merged

Release (v0.2.0) - refactored & introduced new project structure & ideas#12
RepoRover merged 5 commits intomainfrom
dev

Conversation

@RepoRover
Copy link
Contributor

@RepoRover RepoRover commented Dec 10, 2025

This pull request refactors the schema generation process to simplify variant resolution and enhance the organization of input and output schema files. It removes the conditional merging logic, introduces a registry-based variant extraction, and adds support for generating project schemas and a unified schema map. The documentation and configuration have been updated to reflect these changes.

Major refactor of schema generation and output organization:

  • Replaced conditional logic and merging with direct loading of engine/version-specific spec files, removing the ConditionalMerger from the codebase and imports. The generator now resolves references and generates final schemas for each engine/version using a registry file. [1] [2] [3] [4]
  • Updated the input and output directory structure in both code and documentation to use a registry file (_registry_.json), engine/version-specific spec files, and organized project schemas. The README now describes the new structure and the role of the schema map (smap.json). [1] [2] [3]

Project schema and schema map generation:

  • Added logic to generate project config schemas, engine-specific config schemas, and manifest schemas, each with dynamically injected $id fields, and output them in a standardized structure. [1] [2]
  • Introduced the generation of a unified schema map (smap.json) that indexes all generated schemas for discovery, replacing the previous version map. The schema map includes URLs for project schemas and engine specs. [1] [2]

Output manager and config improvements:

  • Refactored OutputManager to accept both output and docs directories, and added methods for writing project schemas and the schema map, with robust error handling and key ordering for $id and $schema. [1] [2] [3] [4]
  • Updated configuration to use new file naming conventions and patterns for registry, engine spec, and project schema files.

Matheus-OAMK and others added 4 commits August 18, 2025 10:16
* refactor: Move all files located in the root to a dedicated  folder

* chore: Setup development tools and packages

* refactor/fix: Remove redundant metadata and fix reference from .json documents

- Removed `$schema` and `$id` from nested .json documents
- Fixed the reference inside the oneOf block for PSQL v15.0 in the file `specs.json` to point to the correct `spec.json`

* feat: implement database schema specification generator with conditional resolution

Implement a comprehensive database schema specification generator that processes JSON Schema files with conditional oneOf logic for different database engines and versions.

### Core Features

**Schema Resolution System:**
- Add JSONRefResolver for handling $ref references with circular detection
- Implement ConditionalMerger for oneOf conditional logic resolution
- Support both if/then and direct property constraint formats
- Add VariantExtractor for database variant discovery from oneOf blocks

**Validation Framework:**
- Add SchemaValidator with JSON Schema Draft 7 compliance checking
- Implement custom validation rules for project-specific requirements
- Include validation for required fields and schema structure

**Logging Infrastructure:**
- Add centralized logging configuration with JSON-based setup
- Support both console and file handlers with detailed formatting
- Include queue-based logging for performance

**CLI Generator:**
- Implement SchemaGenerator for end-to-end schema processing
- Support multiple database variants (PostgreSQL, MySQL)
- Generate resolved schemas without oneOf conditionals

* feat: Add generation of all available files in .json format to `output/vmap.json`

- Introduced new functionality to generate a .json file that maps all available engines and their corresponndiing versions to an url. The map is saved in the output folder in a singleton file.
- Introduced a new configuration module to manage application settings.
- Added support for loading configuration from a .env file.
- Updated the schema generator and output manager to utilize the new config.
- Created example .env file and updated README with configuration instructions.
- Implemented tests for configuration handling and output manager functionality.

* feat: Add CI workflow and setup actions for Python and uv
* fix: enforce required environment variables in configuration & pass them into generated schemas dynamically

* fix: reorder top-level keys in generated schemas to prioritize $id and $schema fields

* fix: moved description field from snapshot to schema definition

* fix: enable overriding of environment variables when loading .env file

* feat: add Dockerfile, .dockerignore for schema generation and workflow to create images

* feat: added workflow to create production images & cleaned workflow to create staging images

* refactor(config): Remove unecessary python-dotenv dependency

- Removed python-dotenv dependency and lines utilizing it. The pydantic_settings managed the environment and should fail on missing dependencies.

* refactor(Dockerfile): Pin UV version and simplify building stage

- Refactiored the dockerfile to have a pinned version of UV for consistent builds.
- Simplified dockerfile by utilizing UV's prebuilt image

* refactor(config): Remove leftover comments

---------

Co-authored-by: Matheus-OAMK <t2fema00@students.oamk.fi>
…and removing staging image workflow (#9)

* feat: consolidate CI/CD workflows by creating service version images and removing staging image workflow

* feat: remove staging branch from CI workflow triggers
…djusted the schema spec generation logic

* Feat/automate unified doc creation (#3)

* refactor: Move all files located in the root to a dedicated  folder

* chore: Setup development tools and packages

* refactor/fix: Remove redundant metadata and fix reference from .json documents

- Removed `$schema` and `$id` from nested .json documents
- Fixed the reference inside the oneOf block for PSQL v15.0 in the file `specs.json` to point to the correct `spec.json`

* feat: implement database schema specification generator with conditional resolution

Implement a comprehensive database schema specification generator that processes JSON Schema files with conditional oneOf logic for different database engines and versions.

### Core Features

**Schema Resolution System:**
- Add JSONRefResolver for handling $ref references with circular detection
- Implement ConditionalMerger for oneOf conditional logic resolution
- Support both if/then and direct property constraint formats
- Add VariantExtractor for database variant discovery from oneOf blocks

**Validation Framework:**
- Add SchemaValidator with JSON Schema Draft 7 compliance checking
- Implement custom validation rules for project-specific requirements
- Include validation for required fields and schema structure

**Logging Infrastructure:**
- Add centralized logging configuration with JSON-based setup
- Support both console and file handlers with detailed formatting
- Include queue-based logging for performance

**CLI Generator:**
- Implement SchemaGenerator for end-to-end schema processing
- Support multiple database variants (PostgreSQL, MySQL)
- Generate resolved schemas without oneOf conditionals

* feat: Add generation of all available files in .json format to `output/vmap.json`

- Introduced new functionality to generate a .json file that maps all available engines and their corresponndiing versions to an url. The map is saved in the output folder in a singleton file.
- Introduced a new configuration module to manage application settings.
- Added support for loading configuration from a .env file.
- Updated the schema generator and output manager to utilize the new config.
- Created example .env file and updated README with configuration instructions.
- Implemented tests for configuration handling and output manager functionality.

* feat: Add CI workflow and setup actions for Python and uv

* Feature/versioned releases (#6)

* fix: enforce required environment variables in configuration & pass them into generated schemas dynamically

* fix: reorder top-level keys in generated schemas to prioritize $id and $schema fields

* fix: moved description field from snapshot to schema definition

* fix: enable overriding of environment variables when loading .env file

* feat: add Dockerfile, .dockerignore for schema generation and workflow to create images

* feat: added workflow to create production images & cleaned workflow to create staging images

* refactor(config): Remove unecessary python-dotenv dependency

- Removed python-dotenv dependency and lines utilizing it. The pydantic_settings managed the environment and should fail on missing dependencies.

* refactor(Dockerfile): Pin UV version and simplify building stage

- Refactiored the dockerfile to have a pinned version of UV for consistent builds.
- Simplified dockerfile by utilizing UV's prebuilt image

* refactor(config): Remove leftover comments

---------



* feat: consolidate CI/CD workflows by creating service version images and removing staging image workflow (#9)

* feat: consolidate CI/CD workflows by creating service version images and removing staging image workflow

* feat: remove staging branch from CI workflow triggers

---------

Co-authored-by: Matheus Oliveira <t2fema00@students.oamk.fi>
@RepoRover RepoRover self-assigned this Dec 10, 2025
@RepoRover RepoRover requested a review from Copilot December 10, 2025 01:10
@RepoRover RepoRover added documentation Improvements or additions to documentation development This is software development labels Dec 10, 2025
Copy link

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 is a major v0.2.0 release that refactors the project structure and introduces a new architectural approach. The PR transitions from a monolithic JSON schema with conditional logic (oneOf blocks) to a modular architecture with separate project schemas, engine-specific specs, and a registry-based variant discovery system.

Key Changes:

  • Removed conditional merger logic (oneOf resolution) in favor of self-contained engine-specific spec files
  • Introduced new project schemas for configuration (base + engine-specific) and manifest tracking
  • Renamed version map to schema map with enhanced structure including project-level schemas
  • Updated file naming conventions (specs.json → registry.json, vmap.json → smap.json)

Reviewed changes

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

Show a summary per file
File Description
tests/test_resolver.py Removed unused line and added type ignore comment for method assignment
tests/test_output_manager.py Renamed test methods and variables from version_map to engine_map/schema_map, added tests for config directory exclusion
tests/test_integration_production.py Updated paths to include 'v' prefix for versions, added project schema validation, updated registry file references
tests/test_conditional_merger*.py Deleted conditional merger test files (feature removed)
tests/conftest.py Restructured fixtures to match new architecture with registry.json and project schemas
database_schema_spec/resolution/* Removed ConditionalMerger class and oneOf resolution logic from resolver
database_schema_spec/io/output_manager.py Renamed methods, added project schema writing, restructured schema map with project and engines sections
database_schema_spec/core/config.py Updated file name configuration constants
database_schema_spec/cli/generator.py Refactored to generate project schemas and use engine-specific specs directly
docs/* Major restructuring: deleted old files, added new project schemas, registry.json, YAML examples, and comprehensive ARCHITECTURE.md
README.md Updated to reflect new project structure and schema map format

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@RepoRover RepoRover merged commit b09c7d1 into main Dec 10, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

development This is software development documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants