-
Notifications
You must be signed in to change notification settings - Fork 278
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
Organize scalapb rules #818
Organize scalapb rules #818
Conversation
I see your point about having tool agnostic names, although I don't care too much if the prefix is scala_proto or scalapb_ as long as naming is consistent. Currently the core API is named |
My prior is to be negative on any change that is user visible. I think migrations and deprecations should be used VERY sparingly when the win can be clearly articulated. All software has warts, and I'm very suspect of breaking users (which can have a huge cost when multiplied out on all the users we don't see) to get marginally cleaner code. So, that said, I would much rather we do any of this modularization in a way that doesn't break or deprecate anything. Frankly, I don't care much about the modularization: my editor (vim!) can find functions even if everything is in one file. Everything is in one repo, or one directory, or one github. It isn't obvious to me why multiple files are necessarily great, and I think the loss of the skylark privacy mechanism is real loss. I'm willing to be flexible since it seems this is of great importance to others and they are willing to trade the loss of the privacy mechanism for organizing things into files. By the way, an alternative would be block commented regions of the file: #############
# scala protobuf support begins here....
#############
def scalapb_.. Anyway. Like I said, I'm willing to go along with the modularization, but I would prefer we take things in multiple independent steps:
|
Bazel is approaching 1.0, and it's only going to get more difficult to make user facing changes. The goal here, IMHO, is to have a high quality rule set for Scala. For me this includes clear intuitive organization of the code, as it affects users of the rules as well as developers of the rules. Currently organization here isn't consistent. I like @ittaiz's notion of proto centric naming instead of implementation specific naming. We should apply this across the whole project:
Practically speaking, this means that these rules remain
Additionally:
|
Good to get to the meat of our disagreements.... I think we both value consistency, and we both value stability. I think what we have here is a conflict of how much stability to trade for consistency. I would trade a little consistency for a lot of stability. Next, I don't think users care how our code is organized. That is a feature for developers. Hurting users to help developers is generally a negative in my view, as a general principle, since we will have far more users than developers ideally (hopefully 2-3 orders of magnitude more, maybe 4-5?). |
First, one thing to be clear about: this PR shouldn't be merged. I was quickly turned to favor the Now, regarding the discussion: There are only a handful of renames we need to make to have a well organized public facing API for rules_scala. I vote that we should make these changes now before Bazel hits a 1.0 release. We can keep aliases to maintain compatibility. Going forward, we will also need a way to address breaking changes if we want to have any hope of merging functionality from https://github.com/higherkindness/rules_scala here. If we handle renames now, future changes should be isolated to rule attributes (mostly providers/toolchains) and configuration for rules_scala in |
I opened #821 to swing the change the other way: aligning on |
I generally agree with this statement. However, I think having a clean, easy to navigate code base does help end users of OSS projects. Occasionally users will wish to understand what's happening under the hood, especially when things don't behave exactly as expected (which is surprisingly common). Additionally, a cleaner code base will make it easier for people to come up to speed and contribute, bringing more value to users.
I think this is a very valid point--Bazel is still at a point where users can expect breaking changes to occur. We should definitely try to minimize these and their impact, but a deprecation warning at this stage in Bazel's development should not cause great concern among users imo. It'll be harder to tackle these issues in the future. |
I like #821 better. Should we close this one? |
Yeah totally 👍 on closing this one. I only left it open because of the discussion. |
Description
Renames the public facing parts of the scalapb rules/targets to have the the
scalapb
prefix. Existing functionality is preserved by introducing deprecated forwarding method.The diff looks rather large, but it was merely files rename combined with method level renames.
Use of the deprecated methods yields messages like the following:
This shouldn't have any impact on current usage other than outputting warnings like the above.
Motivation
Naming for files/rules in rules_scala is inconsistent and should be cleaned up.
More generally, I propose that all public functions/rules/targets should be named with the prefix of their path or owning file. You can see what I mean by looking at the names in this PR:
console_print_deprecation
is inconsole.bzl
scalapb_proto_library
is in//scalapb:scalapb.bzl
scalapb_repositories
is in//scalapb:scalapb.bzl
scalapb_toolchain
is in//scalapb:scalapb_toolchain.bzl
. Placing this in//scalapb:scalapb.bzl
would also be acceptable.