Browser-compat-data: Create a mirroring script for future mirror migrations

Created on 29 Aug 2019  路  5Comments  路  Source: mdn/browser-compat-data

As we work on getting real values, we've worked on the main browsers and then later "mirrored" (or rather derived) real values to browsers that are variations of that browser or that use the same engine. For example:

Main browser: chrome
Mirrored browsers: chrome android, webview android, opera, opera android, samsung

Main browser: safari
Mirrored browser: safari ios

These mirrorings should be done using a migration. We will likely have a few migrations of this specific type. So, I propose we create a generic mirroring migration that you can run at a desired time. So, e.g. "mirror from chrome to opera in the css folder" or "mirror from Safari to Safari ios in the javascript folder".

This mirroring should be tested and be run at times where we can avoid rebases as these often introduced errors in the past.

bulk_update infra

Most helpful comment

I've merged the mission critical mirroring PRs (Safari iOS and Webview mirroring in css/), but for the other PRs (Opera and Samsung mirroring in css/), I propose we first implement this and then re-do said PRs using a script as described here.

All 5 comments

@vinyldarkscratch has a script as prior art for this, so that is probably a good start to get this into place. Vinyl, can you provide a link to said script?

Certainly, yeah! I will admit that my script is written in Python, however I've had plans to convert it into JavaScript and turn it into an official script for this repository. The script can be found here: https://github.com/vinyldarkscratch/bcd-toolkit/blob/master/fix.py

Thanks! That's a good starting point then.
Also this will need to follow the process that comes out of https://github.com/mdn/browser-compat-data/issues/4469.

Yeah, I'm definitely supportive of this proposal. I'd add a little detail: I'd expect a script that takes these details as options (e.g., npm run mirror -- --src=chrome --dest=opera ./css). We could have tests and documentation for this script. The actual migration scripts (e.g., /scripts/migrations/012-mirror-chrome-to-opera.js) could run the mirror command with a specific set of arguments.

I've merged the mission critical mirroring PRs (Safari iOS and Webview mirroring in css/), but for the other PRs (Opera and Samsung mirroring in css/), I propose we first implement this and then re-do said PRs using a script as described here.

Was this page helpful?
0 / 5 - 0 ratings