Victory! After days of epic bug fighting and stuborn resistance against the mere idea of conducting proper functional testing before making critical Git commits, the Tags field of Bootstrap is working again. We can all breathe a huge sigh of relief…
Why is it such a big deal? Because the Tags field is using the Tags datatype, which itself uses the JSON primitive. Up until now, the values of fields which datatype was using this primitive were serialized in plain text within our database (Elasticsearch). It was a quick and easy way of implementing this primitive in the early days, but it created some severe limitations, especially regarding the lookup of values within arrays and collections.
Fortunately, Elasticsearch provides native support for JSON structures, especially those that have a consistent schema across all records of the same object. Such is the case for the Tags datatypes, which is a simple array of strings. It’s also the case for advanced relationships, which are modeled as arrays of two key/value pairs (target object, target record).
Last week, Hugues and I decided that our quick and easy implementation of JSON primitive had run its course, and that native JSON mapping was overdue. Hugues worked on it, and delivered an implementation much faster than he had anticipated. He forgot to perform the minimum functional testing that would have been required to find a couple of trivial bugs though. A few email and Skype exchanges followed, and the bugs were eventually fixed, but without any functional testing to back it up. If I’m not going to do my fair share of unit testing, why should Hugues do any functional testing after all?
Hugues got lucky on this one, and his bravado (and talent) paid off.
PS: And as I’m writing all this, François is playing Daft Punk’s Get Lucky in the office…