Closed foolip closed 4 years ago
I'm submitting this as a pull request for visibility. @vinyldarkscratch, this is in order to fix a bunch of bugs I found so that I could extract all the juice possible before https://github.com/mdn/browser-compat-data/pull/6435.
However, it ended up being an exercise in how to map a series of test results to BCD entries, and there may be something to learn/reuse here. In particular, a bit of an unsolved problem is how to deal with transient additions or removals, where they're reverted a release or two later. This results in a bunch of noise, but worse, if only the addition is trusted then the result will be wrong.
Self-reviewing and merging this. More bugs will likely be found while testing the sum of recent changes before release.
There were a number of issues here:
version_added
andversion_removed
could be partially applied, which was the default becauseversion_removed
was only added with --remove.This was addressed by:
patchPredicte
considers the whole patch, not its parts.Also, confluenceRowToCompatJsonFragment was reduced to a single scan through the row, which necessitated changing how the
support
object is updated. Important changes:patchPredicate
.version_added
is never set to true, but uses ≤ if necessary.p => !!p.f(row)
filter.)The many repeated calls to
getMdnBrowserRelease
could be hoisted out to be less wasteful, but speed is not of the essence here.Drive-by: replace use of foam.String.isInstance