-
Notifications
You must be signed in to change notification settings - Fork 165
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: support schema version 1.2 for modular models #1443
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1443 +/- ##
==========================================
+ Coverage 85.95% 86.02% +0.07%
==========================================
Files 85 85
Lines 8049 8057 +8
==========================================
+ Hits 6918 6930 +12
+ Misses 796 793 -3
+ Partials 335 334 -1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We had a similar need in the past: #613
We introduced two flags, one that allowed you to write models, and one that allowed you to call Check/ListObjects.
I think we should do something similar here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we wrap the below line into it's own method so that it can be reused. Any future versions to be supported can be added here. Any version to be dropped from can be removed from here.
t.GetSchemaVersion() == SchemaVersion1_1 || t.GetSchemaVersion() == SchemaVersion1_2)
Ah thanks for raising that @miparnisari, I'll refactor the existing one to be @poovamraj Yeah I was thinking simplifying it would make sense, @jon-whit's suggestion makes sense to me and allows us handle if the feature is enabled a little easier. I'll work on the above and once those are done I think this should be ready for review |
I don't think we need to. Unlike Schema 1.0, we're not planning on dropping support for 1.1. All this new flag is doing is allowing support for 1.2. We expect to have a release out and remove that flag in a couple of weeks. So as far as the server is concerned, only That means if you can write the model, you can take all actions using it. |
3f13843
to
d6e6636
Compare
d6e6636
to
4245759
Compare
# Conflicts: # pkg/server/server_test.go
e7679cd
to
3d14bf4
Compare
Description
This PR adds support for using the schema version
1.2
behind theenable-modular-models
experimental flag, and brings in the versions of openfga/api and openfga/language that support modular models.As I was writing the additions I was thinking that the process of adding a new version isn't really scalable with the checks but I'm not familiar enough with the codebase to suggest any potential improvements here. Would love any feedback/prior consideration folks have had on this and would be happy to integrate into this PR.
Opening as a draft for now mostly just so the PR is here.
References
Closes #1402
Review Checklist
main