This picks up #2068 by adding per-badge stats as discussed in #966. It ensures every service has a unique `name` property. By default this comes from the class name, and is overridden in all the various places where the class names are duplicated. (Some of those don't seem that useful, like the various download interval services, though those need to be refactored down into a single service anyway.) Tests enforce the names are unique. These are the names used by the service-test runner, so it's a good idea to make them unique anyway. (It was sort of strange before that you had to specify `nuget` instead of e.g. `resharper`.) I've added validation to `deprecatedService` and `redirector`, and required that every `route` has a `base`, even if it's an empty string. The name is used to generate unique metric labels, generating metrics like these: ``` service_requests_total{category="activity",family="eclipse-marketplace",service="eclipse_marketplace_update"} 2 service_requests_total{category="activity",family="npm",service="npm_collaborators"} 3 service_requests_total{category="activity",family="steam",service="steam_file_release_date"} 2 service_requests_total{category="analysis",family="ansible",service="ansible_galaxy_content_quality_score"} 2 service_requests_total{category="analysis",family="cii-best-practices",service="cii_best_practices_service"} 4 service_requests_total{category="analysis",family="cocoapods",service="cocoapods_docs"} 2 service_requests_total{category="analysis",family="codacy",service="codacy_grade"} 3 service_requests_total{category="analysis",family="coverity",service="coverity_scan"} 2 service_requests_total{category="analysis",family="coverity",service="deprecated_coverity_ondemand"} 2 service_requests_total{category="analysis",family="dependabot",service="dependabot_semver_compatibility"} 3 service_requests_total{category="analysis",family="lgtm",service="lgtm_alerts"} 2 service_requests_total{category="analysis",family="lgtm",service="lgtm_grade"} 3 service_requests_total{category="analysis",family="snyk",service="snyk_vulnerability_git_hub"} 4 service_requests_total{category="analysis",family="snyk",service="snyk_vulnerability_npm"} 5 service_requests_total{category="analysis",family="symfony",service="sensiolabs_i_redirector"} 1 service_requests_total{category="analysis",family="symfony",service="symfony_insight_grade"} 1 service_requests_total{category="build",family="appveyor",service="app_veyor_ci"} 3 service_requests_total{category="build",family="appveyor",service="app_veyor_tests"} 6 service_requests_total{category="build",family="azure-devops",service="azure_dev_ops_build"} 6 service_requests_total{category="build",family="azure-devops",service="azure_dev_ops_release"} 5 service_requests_total{category="build",family="azure-devops",service="azure_dev_ops_tests"} 6 service_requests_total{category="build",family="azure-devops",service="vso_build_redirector"} 2 service_requests_total{category="build",family="azure-devops",service="vso_release_redirector"} 1 service_requests_total{category="build",family="bitbucket",service="bitbucket_pipelines"} 5 service_requests_total{category="build",family="circleci",service="circle_ci"} 5 ``` This is predicated on being able to use Prometheus's [`rate()`](https://prometheus.io/docs/prometheus/latest/querying/functions/#rate) function to visualize a counter's rate of change, as mentioned at https://github.com/badges/shields/issues/2068#issuecomment-466696561. Otherwise the stats will be disrupted every time a server restarts. The metrics only appear on new-style services.
251 lines
9.0 KiB
JSON
251 lines
9.0 KiB
JSON
{
|
|
"name": "shields.io",
|
|
"version": "0.0.0",
|
|
"description": "Shields.io server and frontend",
|
|
"private": true,
|
|
"keywords": [
|
|
"GitHub",
|
|
"badge",
|
|
"SVG",
|
|
"image",
|
|
"shields.io"
|
|
],
|
|
"homepage": "http://shields.io",
|
|
"bugs": {
|
|
"url": "https://github.com/badges/shields/issues",
|
|
"email": "thaddee.tyl@gmail.com"
|
|
},
|
|
"license": "CC0-1.0",
|
|
"author": "Thaddée Tyl <thaddee.tyl@gmail.com>",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "https://github.com/badges/shields"
|
|
},
|
|
"dependencies": {
|
|
"bytes": "^3.1.0",
|
|
"camelcase": "^5.0.0",
|
|
"camp": "~17.2.2",
|
|
"chalk": "^2.4.2",
|
|
"check-node-version": "^3.1.0",
|
|
"chrome-web-store-item-property": "~1.1.2",
|
|
"config": "^3.0.1",
|
|
"cross-env": "^5.2.0",
|
|
"decamelize": "^2.0.0",
|
|
"dotenv": "^6.2.0",
|
|
"emojic": "^1.1.15",
|
|
"escape-string-regexp": "^1.0.5",
|
|
"fast-xml-parser": "^3.12.13",
|
|
"fsos": "^1.1.3",
|
|
"gh-badges": "file:gh-badges",
|
|
"glob": "^7.1.1",
|
|
"joi": "14.3.1",
|
|
"joi-extension-semver": "2.0.0",
|
|
"js-yaml": "^3.12.1",
|
|
"jsonpath": "~1.0.0",
|
|
"lodash.countby": "^4.6.0",
|
|
"lodash.throttle": "^4.1.1",
|
|
"lodash.times": "^4.3.2",
|
|
"moment": "^2.24.0",
|
|
"node-env-flag": "^0.1.0",
|
|
"parse-link-header": "^1.0.1",
|
|
"path-to-regexp": "^3.0.0",
|
|
"pretty-bytes": "^5.0.0",
|
|
"priorityqueuejs": "^1.0.0",
|
|
"prom-client": "^11.2.1",
|
|
"query-string": "^6.0.0",
|
|
"raven": "^2.4.2",
|
|
"redis": "~2.8.0",
|
|
"request": "~2.88.0",
|
|
"semver": "~5.6.0",
|
|
"simple-icons": "1.9.21",
|
|
"xml2js": "~0.4.16",
|
|
"xmldom": "~0.1.27",
|
|
"xpath": "~0.0.27"
|
|
},
|
|
"scripts": {
|
|
"coverage:test:server": "echo \"Deprecated; run `npm run coverage:test:core` instead.\" && npm run coverage:test:core",
|
|
"coverage:test:core": "nyc npm run test:core",
|
|
"coverage:test:frontend": "nyc --nycrc-path .nycrc-frontend.json npm run test:frontend",
|
|
"coverage:test:package": "nyc npm run test:package",
|
|
"coverage:test:entrypoint": "nyc npm run test:entrypoint",
|
|
"coverage:test:integration": "nyc npm run test:integration",
|
|
"coverage:test:services": "nyc npm run test:services",
|
|
"coverage:clean": "rimraf .nyc_output coverage",
|
|
"precoverage:test": "run-s --silent coverage:clean defs features",
|
|
"coverage:test": "run-s --silent --continue-on-error coverage:test:server coverage:test:package coverage:test:entrypoint coverage:test:frontend coverage:test:integration",
|
|
"coverage:report:generate": "nyc report",
|
|
"coverage:report:open": "opn coverage/lcov-report/index.html",
|
|
"coverage:report": "run-s --silent coverage:report:generate coverage:report:open",
|
|
"lint": "eslint \"**/*.js\"",
|
|
"prettier": "prettier --write \"**/*.@(js|md|json|yml)\"",
|
|
"prettier-check": "prettier-check \"**/*.@(js|md|json|yml)\"",
|
|
"danger": "danger",
|
|
"test:server": "echo \"Deprecated; run `npm run test:core` instead.\" && npm run test:core",
|
|
"test:js:server": "echo \"Deprecated; run `npm run test:core` instead.\" && npm run test:core",
|
|
"test:js:frontend": "echo \"Deprecated; run `npm run test:frontend` instead.\" && npm run test:frontend",
|
|
"test:js:package": "echo \"Deprecated; run `npm run test:package` instead.\" && npm run test:package",
|
|
"test:frontend": "cross-env NODE_ENV=test mocha --config .mocharc-frontend.yml \"frontend/**/*.spec.js\"",
|
|
"test:core": "cross-env NODE_CONFIG_ENV=test mocha \"core/**/*.spec.js\" \"lib/**/*.spec.js\" \"services/**/*.spec.js\"",
|
|
"test:package": "mocha \"gh-badges/**/*.spec.js\"",
|
|
"test:entrypoint": "cross-env NODE_CONFIG_ENV=test mocha entrypoint.spec.js",
|
|
"test:integration": "cross-env NODE_CONFIG_ENV=test mocha \"core/**/*.integration.js\" \"services/**/*.integration.js\"",
|
|
"test:services": "cross-env NODE_CONFIG_ENV=test mocha --delay core/service-test-runner/cli.js",
|
|
"test:services:trace": "cross-env NODE_CONFIG_ENV=test TRACE_SERVICES=true npm run test:services -- $*",
|
|
"test:services:pr:prepare": "node core/service-test-runner/pull-request-services-cli.js > pull-request-services.log",
|
|
"test:services:pr:run": "cross-env NODE_CONFIG_ENV=test mocha --delay core/service-test-runner/cli.js --stdin < pull-request-services.log",
|
|
"test:services:pr": "run-s --silent test:services:pr:prepare test:services:pr:run",
|
|
"pretest": "run-s --silent defs features",
|
|
"test": "run-s --silent --continue-on-error lint test:frontend test:package test:server test:entrypoint prettier-check",
|
|
"depcheck": "check-node-version --node \">= 8.0\"",
|
|
"postinstall": "run-s --silent depcheck",
|
|
"prebuild": "run-s --silent depcheck",
|
|
"features": "node scripts/export-supported-features-cli.js > supported-features.json",
|
|
"defs": "node scripts/export-service-definitions-cli.js > service-definitions.yml",
|
|
"build": "run-s defs features && gatsby build",
|
|
"heroku-postbuild": "run-s --silent build",
|
|
"start:server": "cross-env NODE_CONFIG_ENV=development node server 8080",
|
|
"now-start": "node server",
|
|
"prestart": "run-s --silent depcheck defs features",
|
|
"start": "concurrently --names server,frontend \"npm run start:server\" \"cross-env GATSBY_BASE_URL=http://localhost:8080 gatsby develop --port 3000\"",
|
|
"refactoring-report": "node scripts/refactoring-cli.js",
|
|
"badge": "cross-env NODE_CONFIG_ENV=test TRACE_SERVICES=true node scripts/badge-cli.js"
|
|
},
|
|
"lint-staged": {
|
|
"**/*.js": [
|
|
"eslint --fix",
|
|
"prettier --write",
|
|
"git add"
|
|
]
|
|
},
|
|
"devDependencies": {
|
|
"@babel/core": "^7.3.3",
|
|
"@babel/plugin-proposal-class-properties": "^7.3.3",
|
|
"@babel/plugin-proposal-object-rest-spread": "^7.3.2",
|
|
"@babel/polyfill": "^7.2.5",
|
|
"@babel/preset-env": "^7.3.1",
|
|
"@babel/register": "7.0.0",
|
|
"@mapbox/react-click-to-select": "^2.2.0",
|
|
"babel-eslint": "^10.0.0",
|
|
"babel-plugin-inline-react-svg": "^1.0.1",
|
|
"babel-plugin-istanbul": "^5.1.1",
|
|
"babel-preset-gatsby": "^0.1.8",
|
|
"caller": "^1.0.1",
|
|
"chai": "^4.1.2",
|
|
"chai-datetime": "^1.5.0",
|
|
"chai-enzyme": "^1.0.0-beta.1",
|
|
"chai-string": "^1.4.0",
|
|
"chainsmoker": "^0.1.0",
|
|
"child-process-promise": "^2.2.1",
|
|
"clipboard-copy": "^2.0.1",
|
|
"concurrently": "^4.1.0",
|
|
"danger": "^7.0.14",
|
|
"danger-plugin-no-test-shortcuts": "^2.0.0",
|
|
"enzyme": "^3.9.0",
|
|
"enzyme-adapter-react-16": "^1.9.1",
|
|
"eol": "^0.9.1",
|
|
"eslint": "^5.14.1",
|
|
"eslint-config-prettier": "^4.0.0",
|
|
"eslint-config-standard": "^12.0.0",
|
|
"eslint-config-standard-jsx": "^6.0.2",
|
|
"eslint-config-standard-react": "^7.0.2",
|
|
"eslint-plugin-chai-friendly": "^0.4.1",
|
|
"eslint-plugin-import": "^2.16.0",
|
|
"eslint-plugin-mocha": "^5.3.0",
|
|
"eslint-plugin-no-extension-in-require": "^0.2.0",
|
|
"eslint-plugin-node": "^8.0.1",
|
|
"eslint-plugin-promise": "^4.0.0",
|
|
"eslint-plugin-react": "^7.12.4",
|
|
"eslint-plugin-standard": "^4.0.0",
|
|
"fetch-ponyfill": "^6.0.0",
|
|
"fs-readfile-promise": "^3.0.1",
|
|
"gatsby": "2.1.17",
|
|
"gatsby-plugin-catch-links": "^2.0.11",
|
|
"gatsby-plugin-page-creator": "^2.0.8",
|
|
"gatsby-plugin-react-helmet": "^3.0.5",
|
|
"gatsby-plugin-remove-trailing-slashes": "^2.0.7",
|
|
"gatsby-plugin-styled-components": "^3.0.6",
|
|
"got": "^9.6.0",
|
|
"humanize-string": "^1.0.2",
|
|
"husky": "^1.3.1",
|
|
"icedfrisby": "2.0.0-alpha.4",
|
|
"icedfrisby-nock": "^1.1.0",
|
|
"is-png": "^1.1.0",
|
|
"is-svg": "^3.0.0",
|
|
"js-yaml-loader": "^1.0.1",
|
|
"lint-staged": "^8.1.4",
|
|
"lodash.debounce": "^4.0.8",
|
|
"lodash.difference": "^4.5.0",
|
|
"lodash.groupby": "^4.6.0",
|
|
"minimist": "^1.2.0",
|
|
"mkdirp": "^0.5.1",
|
|
"mocha": "^6.0.1",
|
|
"mocha-env-reporter": "^4.0.0",
|
|
"mocha-junit-reporter": "^1.18.0",
|
|
"mocha-yaml-loader": "^1.0.3",
|
|
"nock": "11.0.0-beta.6",
|
|
"node-fetch": "^2.3.0",
|
|
"node-mocks-http": "^1.7.3",
|
|
"npm-run-all": "^4.1.5",
|
|
"nyc": "^13.3.0",
|
|
"opn-cli": "^4.0.0",
|
|
"portfinder": "^1.0.20",
|
|
"prettier": "1.16.4",
|
|
"prettier-check": "^2.0.0",
|
|
"pretty": "^2.0.0",
|
|
"prop-types": "^15.7.2",
|
|
"react": "^16.8.3",
|
|
"react-dom": "^16.8.3",
|
|
"react-error-overlay": "^5.1.3",
|
|
"react-helmet": "^5.2.0",
|
|
"react-modal": "^3.8.1",
|
|
"react-pose": "^4.0.7",
|
|
"react-select": "^2.4.1",
|
|
"read-all-stdin-sync": "^1.0.5",
|
|
"redis-server": "^1.2.2",
|
|
"require-hacker": "^3.0.1",
|
|
"rimraf": "^2.6.3",
|
|
"sazerac": "^0.4.2",
|
|
"sinon": "^7.2.4",
|
|
"sinon-chai": "^3.3.0",
|
|
"snap-shot-it": "^6.2.10",
|
|
"styled-components": "^4.1.3",
|
|
"tmp": "0.0.33",
|
|
"url": "^0.11.0",
|
|
"walkdir": "0.3.2"
|
|
},
|
|
"engines": {
|
|
"node": ">= 8",
|
|
"npm": ">= 5"
|
|
},
|
|
"babel": {
|
|
"plugins": [
|
|
[
|
|
"inline-react-svg",
|
|
{
|
|
"svgo": false
|
|
}
|
|
]
|
|
],
|
|
"presets": [
|
|
"babel-preset-gatsby"
|
|
],
|
|
"env": {
|
|
"test": {
|
|
"plugins": [
|
|
"istanbul"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"collective": {
|
|
"type": "opencollective",
|
|
"url": "https://opencollective.com/shields",
|
|
"logo": "https://opencollective.com/opencollective/logo.txt"
|
|
},
|
|
"husky": {
|
|
"hooks": {
|
|
"pre-commit": "lint-staged"
|
|
}
|
|
}
|
|
}
|