-
Notifications
You must be signed in to change notification settings - Fork 37
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
Allow users to ignore specific built-in rules by name #87
Comments
Hey @viswajithiii - Before considering the PR you've suggested, would you be open to trying a comment annotation on your RPCs? Currently, the Here's an example: Lines 55 to 56 in c6b4295
(here, the The comment (called a "hint" in protolock) is not implemented on any other type aside from My main concern with a configurable base of built-in rules, is that depending on how the configuration is stated, a user may not be aware of ignored rules, and it could break API compatibility. I see value in making the tool more flexible, though, and appreciate this idea! |
Hey @nilslice, thanks for your response! Thanks for the suggestion about Further, this is not the only use case I have in mind for this. Another example of a thing I would like to do is to have a rule that doesn't require field names to be reserved, just ids. I'm not sure there's a great way to achieve this with the tool right now. I do understand your concerns about this creating a whole new surface of API compatibility that would have to be preserved. For now, I've created a fork and made the changes I need in a (destructive) way and I'm using that for now. I'll try to spend some time thinking of how best to achieve this within the constraints of this repo, though. |
@viswajithiii - I wanted to follow up on this, since I am starting to think about supporting an optional configuration file for protolock. Within this conf, it would be possible to disable any of the built-in rules (among other features). I was wondering if you had come up with a solution for your initial issue or if you have some feedback/suggestions for a conf file? Thanks! See #86 for some more info as this progresses. |
Would also be interested in being able to enable/disable rules by name. Use case:We represent schemas for analytics data sent as JSON, with proto schemas. Since analytics event data must maintain backwards compatibility with historical events, removing fields, even when marking them as reserved is not allowed. If a field needs to be removed, then really it should be in an entirely new event in our system. I'd like to disable the But right now the only way to accomplish that is to wrap |
@nilslice I apologize, I completely missed your previous note, but got notified now that @wadejensen commented. An optional config file sounds like a great way to go about this -- one that is flexible, and doesn't break backwards compatibility. I'd be happy to share my thoughts on any design you come up with, if that would be helpful. 🙂 |
I will revisit this over the next few days and propose a config design/implementation. Will post back here with updates. Thanks! |
@nilslice any updates? |
@guyisra I suppose a minimal, extensible option would be to read a # protolock.yaml
skip_rules:
- NoUsingReservedFields
- NoRemovingReservedFields And provide this config to the rule checking step (or create a Lines 474 to 492 in c61398f
I don't have the time currently to implement and test, but would be happy to review a PR if you need this functionality and would like to take a stab it it! |
I would like to be able to specify which built-in rules to ignore on the command line. Currently, the closest mechanism that exists is the
strict
flag, but the rules that disables aren't the ones I would like to disable. (I'm facing a situation where I want to prevent proto message breakages, but I'm okay with RPC compatibility breakages.)If you agree this would be good to have, I'm happy to send a PR for this your way. 🙂
The text was updated successfully, but these errors were encountered: