Skip to content

feat: implement comprehensive API versioning strategy#399

Merged
Xhristin3 merged 4 commits intorinafcode:mainfrom
Just-Bamford:feat/api-versioning-strategy
Apr 28, 2026
Merged

feat: implement comprehensive API versioning strategy#399
Xhristin3 merged 4 commits intorinafcode:mainfrom
Just-Bamford:feat/api-versioning-strategy

Conversation

@Just-Bamford
Copy link
Copy Markdown
Contributor

Summary

Extends the existing InterfaceVersioning module with a full API versioning
strategy covering semantic versioning enforcement, backward compatibility
checks, a deprecation policy registry, and migration path documentation.

this pr Closes #270

Changes

Semantic Versioning

  • set_interface_versions now enforces new version must be strictly greater
    than current (no downgrades)
  • Version upgrade history recorded on every bump via get_version_history

Backward Compatibility

  • is_backward_compatible(from, to) — returns true if same major and to >= from
  • Compatibility window: same major, >= minimum_compatible, <= current

Deprecation Policy

  • deprecate_function — admin registers a function as deprecated with
    deprecated_in, removal_in, optional replacement, and reason
  • get_deprecation — query deprecation info for any function
  • get_deprecation_policy — returns current version + all deprecated functions

Migration Paths

  • register_migration_path — admin documents breaking changes and ordered
    migration steps between any two versions
  • get_migration_path — retrieve path for a specific version pair
  • get_all_migration_paths — list all registered paths

New Types

  • DeprecatedFunction, DeprecationPolicy, MigrationPath

Acceptance Criteria

  • Implement semantic versioning — enforced on every version bump
  • Ensure backward compatibility — same-major window + helper function
  • Define deprecation policy — registry with removal version + replacement
  • Create migration paths — breaking changes + ordered steps per version pair

Base

rinafcode/teachLink_contract:main

- Enforce semantic versioning: new version must be strictly greater than current
- Record version upgrade history on every set_interface_versions call
- Add is_backward_compatible() helper (same major, to >= from)
- Add deprecation policy: deprecate_function(), get_deprecation(),
  get_all_deprecations(), get_deprecation_policy()
  - Validates removal_in > deprecated_in
  - Admin-only write, open read
- Add migration paths: register_migration_path(), get_migration_path(),
  get_all_migration_paths()
  - Documents breaking changes and ordered migration steps per version pair
  - Encoded as compact u128 key for storage efficiency
- Add DeprecatedFunction, DeprecationPolicy, MigrationPath types to types.rs
- Wire 9 new public entry points into lib.rs
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 23, 2026

@Just-Bamford Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Just-Bamford
Copy link
Copy Markdown
Contributor Author

@Xhristin3
Please prioritize reviewing and merging this PR. Continued delays are leading to repeated conflicts as new PRs are merged.

@Xhristin3 Xhristin3 merged commit 950d9d3 into rinafcode:main Apr 28, 2026
1 of 2 checks passed
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.

Add comprehensive API versioning strategy

2 participants