Skip to content

[nightshift] backward-compat: schema versioning, policy version, rate-limit key versioning#8

Open
nightshift-micr wants to merge 1 commit intoMicrock:mainfrom
nightshift-micr:nightshift/backward-compat
Open

[nightshift] backward-compat: schema versioning, policy version, rate-limit key versioning#8
nightshift-micr wants to merge 1 commit intoMicrock:mainfrom
nightshift-micr:nightshift/backward-compat

Conversation

@nightshift-micr
Copy link
Copy Markdown

Automated by Nightshift v3 (GLM 5.1).

Task: backward-compat
Category: pr
Changes:

  • Schema versioning: Replace unversioned DDL with ordered schema_migrations tracking. Creates tracking table first, applies only pending migrations. Idempotent on every startup.
  • Policy version field: Add optional version field to policy YAML. Defaults to "1" for existing files without the field. Rejects unknown versions with a clear error message for future-proofing.
  • Rate-limit key versioning: Add rateLimitKeyVersion prefix (v1) to all Redis rate-limit keys. Future format changes won't collide with or misinterpret existing counters.
  • Documentation: Document ForRole nil-return behavior for unrecognized role names.

All existing tests pass. No new dependencies. Backward-compatible — existing deployments, policy files, and Redis state work unchanged.

…, rate-limit key versioning

- Add schema_migrations table to track applied migrations in order,
  replacing the unversioned DDL approach. Idempotent and safe for
  rolling upgrades.
- Add optional 'version' field to Policy YAML. Defaults to '1' for
  existing files. Rejects unknown versions with a clear error message.
- Add rateLimitKeyVersion prefix to all Redis rate-limit keys so future
  format changes don't collide with existing counters.
- Document ForRole nil-return behavior for unrecognized role names.

All existing tests pass. No new dependencies.
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