A small bug fix release for
everyone’s my favorite Magento 2 code generation tool and ad-hoc PHP module system. This fixes a small bug in the
magento2:generate:schema-add-column command that only triggered when using pestle’s interactive mode.
This bug, although small, was interesting to the software builder in me for a a few reasons.
First — this fell through the automated tests because there’s no easy/obvious way to automate the tests of an interactive command line application. Not that it’s impossible, just that the lack of easy/obvious tooling around doing so meant I spent time on other things instead of building a CLI testing framework from scratch.
Second — this is one of those bugs that wouldn’t have happened in a more strongly typed language/system. PHP accepted the function call to
inputFromArray because it assumes the function will be defined at runtime. In a more strictly typed language this sort of problem would have been caught at compile-time or before running the program.
Third — and the ultimately maddening thing to a programmer — is this bug has existed for years without tripping anyone up or not tripping them up enough to open an issue. Software doesn’t need to be correct to provide value. The majority of what makes this work difficult is deciding how right your programs need to be before unleashing them on the world.