Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Custom runtime api versioning + struct versioning #5415

Merged
merged 7 commits into from
Nov 19, 2024

Conversation

marcellorigotti
Copy link
Contributor

@marcellorigotti marcellorigotti commented Nov 14, 2024

Pull Request

Closes: PRO-1793

Checklist

Please conduct a thorough self-review before opening the PR.

  • I am confident that the code works.
  • I have written sufficient tests.
  • I have written and tested required migrations.
  • I have updated documentation where appropriate.

Summary

Replica of #5406 which was merged in 1.7, with the addition of using obake to create struct versioning.

This PR is here just to have an example in the codebase as a reference implementation.

Copy link

codecov bot commented Nov 14, 2024

Codecov Report

Attention: Patch coverage is 1.23457% with 80 lines in your changes missing coverage. Please review.

Project coverage is 72%. Comparing base (2d727e6) to head (d46eeb8).
Report is 17 commits behind head on main.

Files with missing lines Patch % Lines
state-chain/custom-rpc/src/lib.rs 0% 70 Missing ⚠️
state-chain/runtime/src/runtime_apis.rs 9% 10 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##            main   #5415    +/-   ##
======================================
  Coverage     71%     72%            
======================================
  Files        488     490     +2     
  Lines      86360   86792   +432     
  Branches   86360   86792   +432     
======================================
+ Hits       61718   62217   +499     
+ Misses     21731   21640    -91     
- Partials    2911    2935    +24     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Copy link
Collaborator

@dandanlen dandanlen left a comment

Choose a reason for hiding this comment

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

Looks good, thanks.

state-chain/runtime/src/runtime_apis.rs Outdated Show resolved Hide resolved
Comment on lines 167 to 168
#[obake(version("0.1.0"))]
#[obake(version("0.2.0"))]
Copy link
Collaborator

Choose a reason for hiding this comment

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

We could align these versions with our own release versions? WDYT?

Otherwise we could use 1.0.0/2.0.0 etc. "0.1.0" seems a bit strange - like it's not 'complete'.

tbh. i'm not sure why it require a full semver-compatible version specifier. If it's not a breaking change (ie. patch version) then we wouldn't need a versioned struct?

Copy link
Collaborator

@dandanlen dandanlen left a comment

Choose a reason for hiding this comment

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

Looks good, thanks.

@dandanlen dandanlen added this pull request to the merge queue Nov 19, 2024
Merged via the queue into main with commit 7beca6d Nov 19, 2024
49 checks passed
@dandanlen dandanlen deleted the customRuntimeAPIVersioning branch November 19, 2024 16:55
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.

2 participants