Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

update-bcd: various flaws with the design #571

Closed
foolip opened this issue Sep 30, 2020 · 5 comments
Closed

update-bcd: various flaws with the design #571

foolip opened this issue Sep 30, 2020 · 5 comments
Labels
Component: update-bcd BCD updater script Priority 3 (Medium) Medium priority, should be done but can wait

Comments

@foolip
Copy link
Owner

foolip commented Sep 30, 2020

At a high level, update-bcd takes a one or more test reports as input, and modifies a copy of BCD in place to match the test results.

The test results are potentially conflicting, for multiple reasons:

The current design of the update-bcd script is:

  • Build a "support matrix" mapping a BCD entry + browser release to a support status (true/false/null) and sometimes a prefix (this also resolves contradictory results for a single BCD entry)
  • For every BCD entry (in api/**.json and css/**.json) for which we have data in the support matrix:
    • Infer a BCD-style support statement from the per-version data in the support matrix. Where we have incomplete information, ranged (≤) versions are used.
    • If the inferred support statement isn't simple (a single object) give up and do nothing.
    • If the BCD support statement had only prefix/alternative_name/flags entries, add our inferred statement
    • Otherwise, there was an existing simple statement, which we update using the inferred statement

There are a bunch of problems here:

  • We don't correctly handle prefix and alternative_name, or at least not having multiple variants, as the support matrix squashes this information together too early.
  • We do nothing if the inferred support statement is too complicated (so for example, we don't update BCD if we've found a add-remove-and-add-again situation, regardless of the existing state of BCD)
  • We can never add a support statement if there's already a simple statement, only update it.

Not all of these are very serious, and I don't think any of them cause us to suggest incorrect updates. However, we're leaving some updates on the table by bailing in the situations.

@foolip
Copy link
Owner Author

foolip commented Sep 30, 2020

One feature of an improved design that I'd like to see is that we have an explicit test for contradictions between our results for a specific browser release and a BCD-style support statement. Given that, we could apply that test before and after we've updated, and much more easily see what contradictions weren't resolved by the updates. Maybe we'll see that there aren't many and we'd be better off resolving those contradictions manually.

@queengooborg queengooborg added Component: update-bcd BCD updater script Priority 2 (High) High priority, should be tackled soon labels Oct 1, 2020
@foolip
Copy link
Owner Author

foolip commented Oct 1, 2020

Hmm, I see that actually we can't deal with prefix or alternative_name at all, because we never look at the info object in the results where the prefix would be.

@foolip
Copy link
Owner Author

foolip commented Sep 20, 2022

#1904 added another case where we do nothing, a dataIsOlder early exit. That most likely leads to additional cases where we fail to update the data even though there are contradictions.

@jugglinmike
Copy link
Contributor

#1904 added another case where we do nothing, a dataIsOlder early exit. That most likely leads to additional cases where we fail to update the data even though there are contradictions.

@foolip was this addressed by the refectoring in gh-2629?

@foolip
Copy link
Owner Author

foolip commented May 30, 2023

@jugglinmike indeed it was!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Component: update-bcd BCD updater script Priority 3 (Medium) Medium priority, should be done but can wait
Projects
None yet
Development

No branches or pull requests

3 participants