Problem/Motivation
Today, I told @tedbow that alarm bells are going off in my mind as I review the version validation code in Automatic Updates. It feels too complicated. Too many moving parts. The policy is hard to follow.
That reminds me of another thing: _update_calculate_project_status(). That code is a spaghetti-flavored eldritch horror and is barely maintainable. I think we are unwittingly heading down the same path.
Proposed resolution
We need to change direction before we find ourselves in a quagmire of impossible code from which we cannot escape. We need to simplify the way we encode the version policy in code.
I discussed with Ted and we think that what might be best is to have all version validation, both starting and target versions, attended and unattended, in one final class. We should split the logic into small, well-named, easy to follow methods. The class should be final because this is our policy we're talking about. We don't want people extending or overriding parts of it. Either you take our whole policy, or you reject it entirely.
Remaining tasks
Merge all version validators into a single long final class with many small, well-named, well-scoped, private methods.
Issue fork automatic_updates-3280180
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
phenaproximaAssigning to @tedbow for review.
Comment #4
tedbowfor more things still . very close though
Comment #5
phenaproximaComment #6
tedbow@phenaproxima amazing work!
Comment #7
phenaproximaI absolutely think @tedbow deserves credit for what he put into this. I may have written the code but this is absolutely the product of two brains.
Comment #9
phenaproximaMerged into 8.x-2.x. Thanks!