Skip to content

Feature/versioned releases#6

Merged
Matheus-OAMK merged 11 commits intodevfrom
feature/versioned-releases
Aug 28, 2025
Merged

Feature/versioned releases#6
Matheus-OAMK merged 11 commits intodevfrom
feature/versioned-releases

Conversation

@RepoRover
Copy link
Contributor

@RepoRover RepoRover commented Aug 27, 2025

This pull request introduces a new Docker-based build and release workflow for the database schema spec generator, along with improvements to schema output structure, configuration management, and example/documentation consistency. The changes enable automated production and staging image builds, enforce environment variable requirements, and update the schema specification to improve clarity and validation.

CI/CD and Docker Integration:

  • Added .github/workflows/create-prod-image.yaml and .github/workflows/create-staging-image.yaml to automate Docker image builds and pushes for production (on release tags) and staging (on release candidate tags). These workflows run quality checks, extract metadata, build/push images to GHCR, and manage build caches. [1] [2]
  • Introduced a multi-stage Dockerfile that builds the schema spec generator, installs dependencies with uv, runs schema generation, and produces a lightweight final image containing only the output.
  • Added a comprehensive .dockerignore to exclude development, build, and CI/CD files from Docker image context, improving build efficiency and image cleanliness.

Schema Specification and Output Improvements:

  • Updated the output directory structure, renaming the generated PostgreSQL schema file from unified_schema.json to spec.json for clarity and consistency.
  • Modified schema generation logic to dynamically inject the $id field based on the configured BASE_URL, and reordered top-level keys so $id appears immediately after $schema when present, improving schema discoverability and compliance.
  • Updated base schema definition (docs/schemas/base/schema.json) to move the description field from snapshot to the top-level schema object, require it, and remove it from snapshot. This clarifies the meaning and location of schema descriptions and updates required fields. [1] [2] [3]
  • Updated example JSON files to match the new schema structure, moving description to the top-level and removing it from snapshot. [1] [2] [3]
  • Removed the $id field from specs.json and PostgreSQL engine spec JSON, as it is now dynamically injected during generation. [1] [2]

Configuration and Environment Handling:

  • Enforced presence of the BASE_URL environment variable at application startup, raising a clear error if missing, and loaded environment variables from .env using dotenv for improved testability and reliability. [1] [2] [3]

@RepoRover RepoRover marked this pull request as draft August 27, 2025 10:20
@RepoRover RepoRover self-assigned this Aug 27, 2025
@RepoRover RepoRover marked this pull request as ready for review August 27, 2025 21:06
@RepoRover RepoRover added chores Tasks related to internal project upkeep and improvements development This is software development devops This is to do with automation internal Changes that affect the project's internal structure, tooling, or infrastructure, not visible to end to-fix This should be fixed labels Aug 27, 2025
@RepoRover RepoRover requested a review from Matheus-OAMK August 27, 2025 21:15
- Removed python-dotenv dependency and lines utilizing it. The pydantic_settings managed the environment and should fail on missing dependencies.
- Refactiored the dockerfile to have a pinned version of UV for consistent builds.
- Simplified dockerfile by utilizing UV's prebuilt image
Copy link
Contributor

@Matheus-OAMK Matheus-OAMK left a comment

Choose a reason for hiding this comment

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

As per my comments. I have opened a PR that addresses these issues

@RepoRover RepoRover force-pushed the feature/versioned-releases branch from ece4232 to 5c6c3d9 Compare August 28, 2025 21:02
Remove python-dotenv and simplify dockerfile building stage
@RepoRover RepoRover requested a review from Matheus-OAMK August 28, 2025 21:10
@Matheus-OAMK Matheus-OAMK merged commit 713d246 into dev Aug 28, 2025
5 checks passed
@RepoRover RepoRover deleted the feature/versioned-releases branch September 1, 2025 08:59
RepoRover added a commit that referenced this pull request Sep 2, 2025
* 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

---------

Co-authored-by: Matheus-OAMK <t2fema00@students.oamk.fi>

* 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 added a commit that referenced this pull request Dec 10, 2025
* 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

---------

Co-authored-by: Matheus-OAMK <t2fema00@students.oamk.fi>

* 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 added a commit that referenced this pull request Dec 10, 2025
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chores Tasks related to internal project upkeep and improvements development This is software development devops This is to do with automation internal Changes that affect the project's internal structure, tooling, or infrastructure, not visible to end to-fix This should be fixed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] $id Field Static Value on Generation [Backend] Move "description" field from "snapshot" to "schema" [Chores] Create CD workflow

2 participants