-
-
Notifications
You must be signed in to change notification settings - Fork 137
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
uninflected words in a patch version #221
Comments
Confirming this, also with a model called Permission (which would resolve to a table called permissions). That aside, I'm not particularly sure I agree with permission being considered an uncountable word. |
Thanks for this report and your remarks. Let's try to get something actionable out of this.
kind of odd? Unless you know a large part of the users use the output of this package to generate database table names, it does not look that odd to me: the method outputs something that is clearly wrong, we fix it, that does sound like a patch.
I must admit I don't have in mind all the uses cases for this package, maybe that's not only an issue for Laravel. It might be worth documenting how this package is used inside and outside of Doctrine.
I definitely see how this can be an issue. In fact, it reminds me a bit of another Doctrine repository: Maybe something similar should be done for that repository as well? Another way to address the issue you're having might be to rework Laravel so that this method is called to generate a table name, but only once, meaning the table name would get stored in a configuration file, and then never change. That way, even if we release a major version of this library, you don't have to do a migration. I'm not sure if it's the right call but it might be worth considering.
Maybe it depends of the context? Can somebody research/corroborate that? |
Looks like "permission" is not the only questionable fix, see #222 |
The entry for "permission" in the Oxford Learner's Dictionary says
Similarly for "fruit"
and "experience"
Without going through every entry in #216 and checking it against Oxford, there are a few more such as "accommodation", "behavior", "business", "cake", "coffee", "damage" etc. that have at least one sense in which it is countable. |
Can one of you go through the whole list of words introduced in #216 and send a PR that reverts anything dubious? Otherwise I think I will just revert it. |
I can see your reasoning here. All depends on how you consider the usage of this library. If this library is intended for text generation and not anything key-based then it's indeed fine to do it in a patch release. Otherwise if you consider key-generation to be a usage then a major version would be needed.
I also think that clearly defining how this package should be used would help. Right now, I don't feel the readme is doing that: https://github.com/doctrine/inflector
This is unfortunately unpractical and would require a major rewrite in how we approach table generation. I don't think we will do that anytime soon. All in all I think that depending on how you intended to let this library be used we need to do A or B:
Hope that's clear 🙂 |
Very clear. So far there does not seem to be any complaints from the Symfony/Doctrine ecosystem, but I think I'll try to research how it's used anyway. Feel free to beat me to it, anybody! |
@greg0ire ok. In the meantime could we make a decision about my open PR? We need to act fast on it on our side to prevent more PRs from failing. Otherwise I'll need to patch Laravel's test suite itself for now. |
But that basically means that we would need to issue a major version bump everytime we fix a pluralization rule, doesn't it? |
Basically yes, I think you need to decide for yourself if the outcome of pluralization is part of the public API or not. If you think it's not then we need to re-evaluate how we use this library. |
Also want to make it clear that we've been using |
@driesvints I don't think we will merge your open PR, unless you add more words as suggested by #221 (comment) Let me know if you don't plan to do so, and I will just revert #216 entirely so that you are unblocked. We can still define a clear policy later. |
This comment was marked as resolved.
This comment was marked as resolved.
@greg0ire I think for now it's best that we revert this PR since so many are affected. Then you can have some time to think about this. |
On it. |
Sorry, reopening this since we still need to have a discussion about whether we consider this a breaking change somewhere, and the decision still needs to be clearly documented. |
This comment was marked as resolved.
This comment was marked as resolved.
Folks… this is fixed already, and although I know you mean well, your confirmations don't help. I'm fully aware this is an issue since after reading the very first message. Run |
@greg0ire Seeing this is the main goal of the library and it's in the doctrine namespace, meaning it's mainly used for determining table names, I would definitely consider anything changing the list of words a breaking change for a major version if we follow semver Another option would be a minor (but definitely not a patch, as that would remove the possibility to do fixes without behavior change, dep upgrade etc) and people should pin the dependency to For the latter, because it requires all library that already use it to change something, so if we go this route, it would be better if the policy takes effect in the next major |
This will mean potentially many major releases, but I think give how impactful this library is, we shouldn't see it as a blocker. It certainly isn't for If I'm wrong and we should go with a minor, then people should still not pin the dependency IMO, they should use |
We are on the same page regarding other patches, it's better to have a distinct layer for patches and behavior change, we could consider word change a feature in this regard because it's again the sole purpose of the library The semver states
The problem is the definition of Otherwise backward compatible manner doesn't have ambiguity here, as we learned the hard way just now, changing the words is not backward compatible in the context of this lib but it can be decided to not follow semver if it makes maintenance much harder |
Took a look, the inflector is used in the ORM when:
It is not used in any of the built-in naming strategies. Singular is used for table names (because entities are singular). Symfony has no dependency on Sylius depends on this library, but I don't know what for. I guess this explains why we got complaints only from Laravel users so far: to me, it seems to be the framework relying the most heavily on this library right now. I think a consequence of this is that somebody from the Laravel team should watch this repo and make sure to review all incoming PRs (which are very few). Since this repo is not very active, I think it wouldn't be unrealistic to bump the major version in cases such as #216. Next steps:
|
All right. Any more lectures on SemVer or your personal interpretation thereof in the context of this library and I will hide your post immediately. That's not getting us anywhere, sorry. |
This library does not and will never cover all pluralization rules of the English language. Not to mention other languages. The consequence is that it will always be incomplete and new rules are going to be added as soon as someone stumbles across a bad plural or singular form emitted by this library. And this strategy has always been fine for the use-case this library was built for: one-time code generation. If you rely on the conversion made by inflector to be stable, I see two options:
|
Understood @derrabus, thank you for clarifying that. I think personally in that case we'll look into an approach where we'd tackle this in Laravel itself. We'd definitely want the outcome of the generation to stay consistent but I totally understand if that wasn't the intention of this library. I'll try to see how we can move into a different direction. |
The |
I would like to raise a problem here that adding a bunch of words to the "uninflected" list is kind of odd to include in a patch version.
The problem here, in my case, is that the Laravel framework depends on this package for automatically generating database table names. Now, after the 2.0.7 patch, some words (like permission) are no longer pluralized and no longer match the already created table names that previous versions provided.
There is a workaround on my side, and I will be applying it. Nonetheless, I think it's worth mentioning that this change may raise problems on the end-user side because of it being a patch.
The text was updated successfully, but these errors were encountered: