DEPRECATED - Calculate the Top Site Compatibility Index metric
Перейти к файлу
Mike Taylor 828cf52899
Merge pull request #151 from mozilla/dependabot/npm_and_yarn/lodash-4.17.19
Bump lodash from 4.17.14 to 4.17.19
2020-07-20 16:06:16 -05:00
tests Issue #117 - Rename tranco module to trexa 2020-05-28 15:51:31 -05:00
.eslintrc.js Issue #78 - Add jest and jest eslint integration 2019-11-28 06:51:42 -06:00
.gitignore Issue #115 - Write the current document id to disk 2019-10-31 16:23:25 -05:00
.prettierrc Issue #74 - Run prettier on everything. 2019-11-25 11:07:51 -06:00
.travis.yml Issue #78 - Copy config for tests 2019-11-28 15:21:41 -05:00
CODE_OF_CONDUCT.md Add Mozilla's CoC 2019-06-14 14:40:50 -07:00
LICENSE Add a license file to mirror package.json 2019-07-01 13:22:06 -07:00
README.md Issue #117 - Add an --exact commandline option 2020-05-28 15:51:31 -05:00
bugs.js Issue #74 - Run prettier on everything. 2019-11-25 11:07:51 -06:00
config.json.example Issue #115 - Make currentDoc.json location configurable 2019-11-01 12:06:57 -05:00
helpers.js Issue #117 - Add an --exact commandline option 2020-05-28 15:51:31 -05:00
index.js Issue #149 - Stop deleting old documents, just log them instead. 2020-06-03 11:16:11 -05:00
package-lock.json Bump lodash from 4.17.14 to 4.17.19 2020-07-17 01:35:56 +00:00
package.json Issue #78 - Add jest to test command 2019-11-28 06:54:53 -06:00
spreadsheet.js Issue #137 - set publishedOutsideDomain permission on doc 2019-12-11 14:40:15 -06:00
trexa.js Issue #117 - Rename tranco module to trexa 2020-05-28 15:51:31 -05:00

README.md

tsci

Build Status

Calculate the Top Site Compatibility Index web compat metric.

Usage

Requires Node 8+ and a Google Cloud Platform service account. You need to create a service account and download the JSON file containing the authentication credentials. Put that file in the project workspace as credentials.json.

Copy config.json.example in the project workspace to a file named config.json and edit accordingly, notably the API keys for Bugzilla and GitHub. You can omit any keys where the defaults would suffice. Here is what a commented config.json.example would look like:

{
  // The size of the Trexa list to download, up to ~150k sites.
  "listSize": 500,
  // The directory that will be used to store the downloaded list.
  "listDir": "data/",
  // The Bugzilla API authentication key.
  "bugzillaKey": "",
  // The GitHub API authentication key.
  "githubKey": "",
  // The path to save currentDoc.json (by default, CWD)
  "currentDocPath": ".",
  // A list of domains to ignore when fetching bug results.
  "ignoredDomains": [
    "github.com",
    "github.io",
    "t.co"
  ],
  // Whether we should ignore Fenix bugs (since it's pre-release)
  "ignoreFenix": true,
  // A list of GitHub accounts to ignore bugs from (QA)
  "ignoredGitHubAccounts": [
    "softvision-oana-arbuzov",
    "softvision-sergiulogigan",
    "cipriansv"
  ],
  // A QA email domain for ignoring Bugzilla bugs
  "ignoredQADomain": "@softvision.ro",
  // A cutoff date for calculating the TSCI (if not a Sunday, will be rounded to the next Sunday).
  // E.g. a value of "2019-03-01" would lead to using "2019-03-03" (March 1st was a Friday).
  "maxDate": null,
  // The earliest date to consider for when the bug or issue has to have been
  // filed. By default 2018-01-01 is used.
  "minDate": "2018",
  // The ID of a spreadsheet to work on. This only applies to the first weekly runs,
  // if more than one week is specified. Otherwise, a new spreadsheet will be created.
  "startingSpreadsheetId": null,
  // A list of Google accounts with whom the final spreadsheet should be shared.
  "writers": [
    "user@example.com"
  ]
}

Then run:

npm install
npm start

A single argument may also be provided to specify a cut-off date, providing a best-effort view of what the historical results would have been, had the program been run at that date. Note that the end of the week for the given date is what is actually used, regardless of the day-of-week specified. For instance, this will return issue-counts up to and including Saturday May 25 2018:

npm start 2019-05-23

A --resume option also exists, to continue collecting weekly results until the present date, rather than just a single weekly result:

npm start 2019-05-23 -- --resume

A --exact option exists to allow testing of single dates that don't fall at the end of the week.

npm start 2020-05-28 -- --exact

Code of Conduct

This project and repository is governed by Mozilla's code of conduct and etiquette guidelines. For more details please see the Code of Conduct file.