Skip to content

feat: schema versioning - #12

Merged
xBlaz3kx merged 2 commits into
mainfrom
feat/versioning
Aug 5, 2026
Merged

xBlaz3kx merged 2 commits into
mainfrom
feat/versioning

Conversation

@xBlaz3kx

@xBlaz3kx xBlaz3kx commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Proposed changes

Allows to search and version OCPP schemas - in case of patches, we can now inspect each individual version.

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of
them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before
merging your code.

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you
did and what alternatives you considered, etc...

Schemas now track a content version separate from ocpp_version,
incrementing on real content changes and recording a queryable
changelog (schema_versions). Upsert only bumps the version when the
new content actually differs from what's stored; Add starts new
schemas at version 1 with an initial changelog entry.

Exposed via a new ListSchemaVersions gRPC RPC and a list_schema_versions
MCP tool, plus an optional version arg on get_schema to fetch a
specific historical version instead of the latest.

Also fixes mockery's output directory so generated mocks are actually
importable from _test.go files (the previous gen/mocks/internal/schema
path was blocked by Go's internal-import rule) and adds unit test
coverage for the new service/handler/tool logic.
The insert-vs-insert race on a brand-new logical key is rare and
already surfaces a clear duplicate-key error; retrying added
complexity for a benefit not worth the cost.
@xBlaz3kx
xBlaz3kx merged commit 24e561c into main Aug 5, 2026
1 of 4 checks passed
@xBlaz3kx
xBlaz3kx deleted the feat/versioning branch August 5, 2026 22:26
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.

1 participant