Commit Graph

2063 Commits

Author SHA1 Message Date
dependabot[bot]
b0f1d99e13 Bump eslint-plugin-react from 7.10.0 to 7.11.0 (#1915)
Bumps [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) from 7.10.0 to 7.11.0.
- [Release notes](https://github.com/yannickcr/eslint-plugin-react/releases)
- [Changelog](https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yannickcr/eslint-plugin-react/compare/v7.10.0...v7.11.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-14 08:30:18 -07:00
dependabot[bot]
8e27ae0f2a Bump eslint-plugin-import from 2.13.0 to 2.14.0 (#1918)
Bumps [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import) from 2.13.0 to 2.14.0.
- [Release notes](https://github.com/benmosher/eslint-plugin-import/releases)
- [Changelog](https://github.com/benmosher/eslint-plugin-import/blob/master/CHANGELOG.md)
- [Commits](https://github.com/benmosher/eslint-plugin-import/compare/v2.13.0...v2.14.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-14 08:19:21 -07:00
dependabot[bot]
3b9d2325b8 Bump eslint-plugin-mocha from 5.1.0 to 5.2.0 (#1919)
Bumps [eslint-plugin-mocha](https://github.com/lo1tuma/eslint-plugin-mocha) from 5.1.0 to 5.2.0.
- [Release notes](https://github.com/lo1tuma/eslint-plugin-mocha/releases)
- [Changelog](https://github.com/lo1tuma/eslint-plugin-mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/lo1tuma/eslint-plugin-mocha/compare/5.1.0...5.2.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-14 08:10:18 -07:00
dependabot[bot]
8b34a927dd Bump eslint-config-prettier from 2.9.0 to 3.0.1 (#1916)
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 2.9.0 to 3.0.1.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v2.9.0...v3.0.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-14 08:05:20 -07:00
dependabot[bot]
9c64589944 Bump nock from 9.5.0 to 9.6.1 (#1913)
Bumps [nock](https://github.com/nock/nock) from 9.5.0 to 9.6.1.
- [Release notes](https://github.com/nock/nock/releases)
- [Changelog](https://github.com/nock/nock/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nock/nock/compare/v9.5.0...v9.6.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-13 19:14:04 +01:00
dependabot[bot]
909776ad6d Bump eslint-plugin-standard from 3.0.1 to 3.1.0 (#1909)
Bumps [eslint-plugin-standard](https://github.com/xjamundx/eslint-plugin-standard) from 3.0.1 to 3.1.0.
- [Release notes](https://github.com/xjamundx/eslint-plugin-standard/releases)
- [Commits](https://github.com/xjamundx/eslint-plugin-standard/compare/v3.0.1...v3.1.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-13 18:58:34 +01:00
dependabot[bot]
801bcf5bb8 Bump joi from 13.5.2 to 13.6.0 (#1912)
Bumps [joi](https://github.com/hapijs/joi) from 13.5.2 to 13.6.0.
- [Release notes](https://github.com/hapijs/joi/releases)
- [Changelog](https://github.com/hapijs/joi/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hapijs/joi/compare/v13.5.2...v13.6.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-13 18:47:19 +01:00
Paul Melnikow
0c703c11b5 Rewrite [uptimerobot] (#1891) 2018-08-12 21:47:30 -07:00
Paul Melnikow
66d444aa40 Clean up our callback style and enforce no exclusive tests and remove an exclusive test (#1900)
We use arrow functions in most places; this enforces it.

Passing arrow functions to Mocha is discouraged: https://mochajs.org/#arrow-functions

This was a mix of autofixes and hand adjustments.
2018-08-12 20:45:43 -04:00
Paul Melnikow
0a7c833452 Fix an edge case in NpmBase (#1904)
I noticed this when I copied this code while I was working on #1895.
2018-08-12 19:13:31 -04:00
chris48s
0f534cefc0 use fetch/render pattern in [apm appveyor cdnjs clojars gem] (#1901)
* remove tests we don't need
* use fetch/render pattern in [apm appveyor cdnjs clojars gem]
2018-08-12 18:27:47 +01:00
Paul Melnikow
67193ce09b Add [librariesio-sourcerank] (#1898)
It seems like 30+ is great; under 10 pretty bad. I picked some values for a color scheme.

Closes #1532
2018-08-12 12:58:03 -04:00
Paul Melnikow
1a71acfa2e Add badge for dependents and dependent repos using Libraries.io (#1895)
See #1845
2018-08-12 11:05:43 -04:00
Paul Melnikow
2c646ae6ca Create Monitoring category (#1903) 2018-08-12 09:12:47 -04:00
Paul Melnikow
2a035d9111 ServiceTester: Minor readability tweak (#1893)
Was debugging this just now, and think this is easier to read and understand than the previous version.
2018-08-12 07:43:12 -04:00
Danial
b2af8f7a04 [GitHub] support issue tags with "/" character (#1902)
* support tags with "/" character
2018-08-12 15:20:30 +12:00
Paul Melnikow
9007658fd0 Refactor and test [github] token persistence (#1863)
Ref #1848 #1205
2018-08-11 20:13:40 -04:00
Paul Melnikow
39d393028d Fix and test the github admin route (#1886)
Fix regressions in the github admin and token acceptor endpoints, introduced in #1813.
2018-08-11 19:48:43 -04:00
Paul Melnikow
cd6c38a616 Add InvalidParameter runtime error and return inaccessible for 5xx errors (#1890)
* InvalidParameter: New error type
* Return inaccessible for 5xx errors from services
* Add test for Inaccessible on 5xx
* Add tests for named error types
2018-08-11 21:05:56 +01:00
Paul Melnikow
db4bffb300 Split BaseService and BaseJsonService into separate modules (#1889)
There’s a lot of behavior here, and going to be even more, so I think it makes sense to split these up as I’ve done with the tests.
2018-08-11 10:43:05 -04:00
Paul Melnikow
ed81dcbb36 npm downloads: Better experience for new projects (#1892)
When a new project is created, the download badge shows “project not found” as reported in #1882. This gives a more informative message in that case.
2018-08-11 10:18:41 -04:00
Danial
39776d5814 support for colorA + logo when no label specified (#1896)
* support for colorA + logo

* adjust spacing when no label present but logo is present
2018-08-11 15:33:29 +12:00
Paul Melnikow
09be682963 BaseService: Make it easier to add more config options (#1884)
I ran into this while working on #1867, where ultimately I couldn't solve my problem by injecting config. This will make it easier in the future, though.
2018-08-10 16:02:58 -04:00
chris48s
f05a3496ee Validate response json in [apm appveyor cdnjs clojars gem] (#1883)
* split gem service into multiple files
* add validation to apm, appveyor, cdnjs, clojars & gem services
* fix the apm examples
2018-08-10 20:52:09 +01:00
dependabot[bot]
15a1449407 Bump redis from 2.6.5 to 2.8.0 (#1855)
Bumps [redis](https://github.com/NodeRedis/node_redis) from 2.6.5 to 2.8.0.
- [Release notes](https://github.com/NodeRedis/node_redis/releases)
- [Changelog](https://github.com/NodeRedis/node_redis/blob/master/changelog.md)
- [Commits](https://github.com/NodeRedis/node_redis/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-10 15:38:03 -04:00
Paul Melnikow
0db88d33e0 Add debug logging to BaseService and BaseJsonService (#1867)
Invoke this using `npm run test:services:trace`.
2018-08-10 15:22:13 -04:00
Paul Melnikow
ada1dec815 Lengthen timeout on a flaky service test (#1885) 2018-08-10 15:10:31 -04:00
dependabot[bot]
2ebb173a62 Bump simple-icons from 1.7.1 to 1.8.3 (#1877)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 1.7.1 to 1.8.3.
- [Release notes](https://github.com/simple-icons/simple-icons/releases)
- [Commits](https://github.com/simple-icons/simple-icons/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-10 13:33:17 -04:00
dependabot[bot]
be8fbc2308 Bump babel-eslint from 8.0.2 to 8.2.6 (#1878)
Bumps [babel-eslint](https://github.com/babel/babel-eslint) from 8.0.2 to 8.2.6.
- [Release notes](https://github.com/babel/babel-eslint/releases)
- [Commits](https://github.com/babel/babel-eslint/compare/v8.0.2...v8.2.6)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-10 12:38:16 +01:00
dependabot[bot]
049530c7a9 Bump node-fetch from 2.0.0 to 2.2.0 (#1873)
Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.0.0 to 2.2.0.
- [Release notes](https://github.com/bitinn/node-fetch/releases)
- [Changelog](https://github.com/bitinn/node-fetch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bitinn/node-fetch/compare/v2.0.0...v2.2.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-10 12:36:26 +01:00
dependabot[bot]
96be0a94f9 Bump joi from 13.3.0 to 13.5.2 (#1879)
Bumps [joi](https://github.com/hapijs/joi) from 13.3.0 to 13.5.2.
- [Release notes](https://github.com/hapijs/joi/releases)
- [Changelog](https://github.com/hapijs/joi/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hapijs/joi/compare/v13.3.0...v13.5.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-10 12:34:32 +01:00
dependabot[bot]
872fbf68b0 Bump eslint from 5.2.0 to 5.3.0 (#1876)
Bumps [eslint](https://github.com/eslint/eslint) from 5.2.0 to 5.3.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v5.2.0...v5.3.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-10 12:29:13 +01:00
dependabot[bot]
1640ff98c2 Bump sinon from 6.1.4 to 6.1.5 (#1875)
Bumps [sinon](https://github.com/sinonjs/sinon) from 6.1.4 to 6.1.5.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/docs/changelog.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v6.1.4...v6.1.5)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-10 12:28:31 +01:00
Paul Melnikow
27170f85fc Rm greenkeeper config (#1871) 2018-08-09 11:07:14 -04:00
dependabot[bot]
fabc9f2b41 Bump nock from 9.3.2 to 9.5.0 (#1865)
Bumps [nock](https://github.com/nock/nock) from 9.3.2 to 9.5.0.
- [Release notes](https://github.com/nock/nock/releases)
- [Changelog](https://github.com/nock/nock/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nock/nock/compare/v9.3.2...v9.5.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-09 10:34:10 -04:00
dependabot[bot]
8d669385e1 Bump classnames from 2.2.5 to 2.2.6 (#1850)
Bumps [classnames](https://github.com/JedWatson/classnames) from 2.2.5 to 2.2.6.
- [Release notes](https://github.com/JedWatson/classnames/releases)
- [Changelog](https://github.com/JedWatson/classnames/blob/master/HISTORY.md)
- [Commits](https://github.com/JedWatson/classnames/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-09 10:00:40 -04:00
dependabot[bot]
c7851e2d38 Bump prop-types from 15.6.0 to 15.6.2 (#1851)
Bumps [prop-types](https://github.com/facebook/prop-types) from 15.6.0 to 15.6.2.
- [Release notes](https://github.com/facebook/prop-types/releases)
- [Changelog](https://github.com/facebook/prop-types/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/prop-types/commits/v15.6.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-09 09:59:02 -04:00
dependabot[bot]
72d017d9ad Bump query-string from 6.0.0 to 6.1.0 (#1853)
Bumps [query-string](https://github.com/sindresorhus/query-string) from 6.0.0 to 6.1.0.
- [Release notes](https://github.com/sindresorhus/query-string/releases)
- [Commits](https://github.com/sindresorhus/query-string/compare/v6.0.0...v6.1.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-09 09:53:32 -04:00
dependabot[bot]
efe639a0c7 Bump js-yaml from 3.11.0 to 3.12.0 (#1860)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.11.0 to 3.12.0.
- [Release notes](https://github.com/nodeca/js-yaml/releases)
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/3.11.0...3.12.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-09 09:52:44 -04:00
dependabot[bot]
68e6ed9d5a Bump prettier from 1.14.0 to 1.14.2 (#1869)
Bumps [prettier](https://github.com/prettier/prettier) from 1.14.0 to 1.14.2.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/1.14.0...1.14.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-09 09:47:07 -04:00
Paul Melnikow
8af48c0a21 Minor tweaks in [github] auth code (#1862)
* Move / rework is-valid-token

* TokenPool: Add allValidTokenIds method

* Minor cleanup in server.js
2018-08-09 07:22:54 -04:00
Paul Melnikow
c11d97a192 Refactor [github] initialization (#1861)
This creates a new convenience class which consolidates all the Github initialization. It supports dependency injection and facilitates refactoring the persistence along the lines of #1205.

Also ref #1848
2018-08-09 07:20:57 -04:00
Paul Melnikow
7a664ca3e8 Run prettier (#1866)
Merging this separately so the commit with the tooling change is readable. This is a follow-on to #1167 which turned prettier on.
2018-08-08 17:57:14 -04:00
Paul Melnikow
ab051b3804 Turn on prettier (except repo root) (#1167)
* Use prettier-check
* Update semi option
    See discussion https://github.com/badges/shields/issues/948#issuecomment-349205606
* Developer documentation
* Run the same steps in both `main` jobs
* Move integration tests from `danger` to `main` where they belong
2018-08-08 17:49:06 -04:00
dependabot[bot]
ff15e9bdab Bump mocha from 5.0.0 to 5.2.0 (#1864)
Bumps [mocha](https://github.com/mochajs/mocha) from 5.0.0 to 5.2.0.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v5.0.0...v5.2.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-08 17:28:59 -04:00
Paul Melnikow
e3b100504d Add Joi-based request validation to BaseJsonService and rewrite [NPM] and [node] badges (#1743)
When JSON responses come back, they are sometimes not in the format expected by the API. As a result we have a lot of defensive coding (expressions like `(data || {}).someProperty`) to avoid exceptions being thrown in badge processing. Often we rely on the `try` blocks that wrap so much of the badge-processing code, which catch all JavaScript exceptions and return some error result, usually **invalid**. The problem with this is that these `try` blocks catch all sorts of programmer errors too, so when we see **invalid** we don't know whether the API returned something unexpected, or we've made a mistake. We also spend a lot of time writing defensive tests around malformed responses, and creating and maintaining the defensive coding.

A better solution is to validate the API responses using declarative contracts. Here the programmer says exactly what they expect from the API. That way, if the response isn't what we expect we can just say it's an **invalid json response**. And if our code then throws an exception, well that's our mistake; when we catch that we can call it a **shields internal error**. It's also less code and less error-prone. Over time we may be confident enough in the contracts that we won't need so many tests of malformed responses. The contract doesn't need to describe the entire response, only the part that's needed. Unknown keys can simply be dropped, preventing unvalidated parts of the response from creeping into the code. Checking what's in our response before calling values on it also makes our code more secure.

I used Joi here, since we're already using it for testing. There may be another contracts library that's a better fit, though I think we could look at that later.

Those changes are in base.js.

The rest is a rewrite of the remaining NPM badges, including the extraction of an NpmBase class. Inspired by @chris48s's work in #1740, this class splits the service concerns into fetching, validation, transformation, and rendering. This is treated as a design pattern. See the PR discussion for more. There are two URL patterns, one which allows specifying a tag (used by e.g. the version badge `https://img.shields.io/npm/v/npm/next.svg`), and the other which does not accept a tag (e.g. the license badge `https://img.shields.io/npm/l/express.svg`). Subclasses like NpmLicense and NpmTypeDefinitions can specify the URL fragment, examples, the validation schema for the chunk of the package data they use, and a render function. The NpmVersion subclass uses a different endpoint, so it overrides the `handle` implementation from NpmBase.

The remaining services using BaseJsonService are shimmed, so they will keep working after the changes.
2018-08-08 17:08:16 -04:00
Pyves
e1affea266 [GitHub] Fix undefined badges (#1816) 2018-08-08 20:57:57 +01:00
dependabot[bot]
11cb3e3929 Bump danger from 3.8.3 to 3.8.4 (#1857)
Bumps [danger](https://github.com/danger/danger-js) from 3.8.3 to 3.8.4.
- [Release notes](https://github.com/danger/danger-js/releases)
- [Changelog](https://github.com/danger/danger-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/danger/danger-js/compare/3.8.3...3.8.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-07 23:28:11 -04:00
Paul Melnikow
c7e28de025 Show test status on master, not latest build (#1859) 2018-08-07 23:27:35 -04:00
Paul Melnikow
56fcb2e5ba GithubApiProvider: injectible interface for code that calls github (#1812) 2018-08-07 16:46:12 -04:00