mozilla-extensions / secure-proxy

Firefox Private Network Web Extension
Mozilla Public License 2.0
140 stars 33 forks source link

use both min/max version in manifest #176

Open mixedpuppy opened 5 years ago

mixedpuppy commented 5 years ago

While there is a min version, you should also use a max version. If by chance anything the experimental api uses changes in a later version, the extension could break in potentially unknown ways. Using max version will help alleviate that concern, but also require us to be on top of updates.

pdehaan commented 5 years ago

Currently we only specify a strict_min_version: "68.0", per

https://github.com/mozilla/secure-proxy/blob/e581af0074465c0f0333f47697bf54a7a41aadab/src/manifest.json#L7-L12

I wonder if there is an API or JSON file somewhere that would tell us what the latest version number for Nightly is. If so, we could almost script it to fetch the latest Firefox Nightly version number and update the /src/manifest.json file before doing a web-ext build (versus us having to manually remember to update that the strict_max_version value each time we do a new release -- but also means we'll need to get a new version built and signed and deployed on the launch site every ~6 weeks, regardless of if there were any other code changes).


UPDATE: I think this was the API I was trying to remember: https://product-details.mozilla.org/1.0/firefox_versions.json

{
  FIREFOX_AURORA: "",
  FIREFOX_DEVEDITION: "69.0b5",
  FIREFOX_ESR: "60.8.0esr",
  FIREFOX_ESR_NEXT: "68.0esr",
  FIREFOX_NIGHTLY: "70.0a1",
  LAST_MERGE_DATE: "2019-07-08",
  LAST_RELEASE_DATE: "2019-07-09",
  LAST_SOFTFREEZE_DATE: "2019-07-01",
  LATEST_FIREFOX_DEVEL_VERSION: "69.0b5",
  LATEST_FIREFOX_OLDER_VERSION: "3.6.28",
  LATEST_FIREFOX_RELEASED_DEVEL_VERSION: "69.0b5",
  LATEST_FIREFOX_VERSION: "68.0",
  NEXT_MERGE_DATE: "2019-09-02",
  NEXT_RELEASE_DATE: "2019-09-03",
  NEXT_SOFTFREEZE_DATE: "2019-08-26"
}
const axios = require("axios");
const manifestJson = require("./src/manifest.json");

main();

async function main() {
  const res = await axios.get("https://product-details.mozilla.org/1.0/firefox_versions.json");
  const nightlyVersion = parseFloat(res.data.FIREFOX_NIGHTLY, 10).toFixed(1);

  manifestJson.applications.gecko.strict_max_version = nightlyVersion;
  console.log(JSON.stringify(manifestJson.applications, null, 2));

  /*
    {
      "gecko": {
        "id": "secure-proxy@mozilla.com",
        "strict_min_version": "68.0",
        "strict_max_version": "70.0"
      }
    }
  */
}
mixedpuppy commented 5 years ago

You probably can use https://searchfox.org/mozilla-central/source/browser/config/version.txt

An alternative could be implementing issue 177

https://github.com/mozilla/secure-proxy/issues/177