Compare commits

..

1833 Commits
1.3.0 ... 2.2.1

Author SHA1 Message Date
chris48s
98f380b254 improve logo escaping (#3511)
* escape logo in make-badge

* 2.2.1 release notes

* tighten up validation of logo param
2019-05-30 18:28:37 +01:00
chris48s
829971f0ef Fix BadgeFactory.create() docblock (#3506)
* fix docblock

* add a reminder in make-badge.js
2019-05-30 12:28:17 +01:00
chris48s
bfe0bde83d switch [powershellgallery] platform example (#3504)
The example we were previously using
(Az.Storage) now renders

platform | not specified

This replaces the example with a
package that gives us a valid result
2019-05-29 21:21:35 +01:00
Marcin Mielnicki
9008c4ef0f Show a badge pattern instead of a badge url (#3438)
* Show patterns instead of real paths

* realBadge property instead of preview.buildFromExample

* E2e test for displaying a badge

* Check bagde url in badge wrapper

* expectBadgeExample helper function

* Remove a hostname from badge url

* Simpler Cypress assertions

* realBadge -> isBadgeSuggestion

* Do not show regexp in patterns
2019-05-29 21:17:27 +02:00
chris48s
f50fcac107 fix 'failing service test' template (#3503) 2019-05-29 16:30:16 +01:00
chris48s
ebb70d57f7 gh-badges v2.2.0 (#3501) 2019-05-29 16:16:32 +01:00
chris48s
6fe566de41 Run package tests on multiple node versions with nvm (#3498)
* run package tests on multiple node versions with nvm

* Add release schedule to package readme
2019-05-29 15:55:27 +01:00
chris48s
65dba94fa8 Stop calling variables "which"; affects [chocolatey codeclimate conda crates debug gem github mozillaobservatory nuget powershellgallery pub resharper vaadindirectory] (#3495)
* which --> variant

* which --> alias

* which --> format

* improve param names in codeclimate

* improve param names in github-issue-detail

* update github-issue-detail unit tests
2019-05-28 23:00:12 +01:00
chris48s
52e90af310 improve docs on examples (#3496)
closes #3440
2019-05-28 18:17:59 +01:00
chris48s
fd271b834e Switch dependabot to yaml config (#3494) 2019-05-28 18:09:56 +01:00
dependabot-preview[bot]
f9ec7d0445 Build(deps-dev): bump react-error-overlay from 5.1.4 to 5.1.6 (#3485)
Bumps [react-error-overlay](https://github.com/facebook/create-react-app/tree/HEAD/packages/react-error-overlay) from 5.1.4 to 5.1.6.
- [Release notes](https://github.com/facebook/create-react-app/releases)
- [Changelog](https://github.com/facebook/create-react-app/blob/master/CHANGELOG-1.x.md)
- [Commits](https://github.com/facebook/create-react-app/commits/react-error-overlay@5.1.6/packages/react-error-overlay)
2019-05-27 16:47:55 -05:00
dependabot-preview[bot]
eb2325310c Build(deps-dev): bump @babel/core from 7.4.3 to 7.4.5 (#3492)
Bumps [@babel/core](https://github.com/babel/babel) from 7.4.3 to 7.4.5.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.4.3...v7.4.5)
2019-05-27 16:30:40 -05:00
Caleb Cartwright
b7982f4459 feat: deprecate jitpack downloads badge (#3493) 2019-05-27 16:21:50 -05:00
dependabot-preview[bot]
91ce3af172 Build(deps-dev): bump @babel/preset-env from 7.4.4 to 7.4.5 (#3491)
Bumps [@babel/preset-env](https://github.com/babel/babel) from 7.4.4 to 7.4.5.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.4.4...v7.4.5)
2019-05-27 15:54:31 -05:00
dependabot-preview[bot]
c54a7a0042 Build(deps-dev): bump lint-staged from 8.1.5 to 8.1.7 (#3487)
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 8.1.5 to 8.1.7.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Commits](https://github.com/okonet/lint-staged/compare/v8.1.5...v8.1.7)
2019-05-27 20:03:55 +02:00
dependabot-preview[bot]
1e3d66f3e9 Build(deps-dev): bump eslint-plugin-import from 2.17.2 to 2.17.3 (#3489)
Bumps [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import) from 2.17.2 to 2.17.3.
- [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.17.2...v2.17.3)
2019-05-27 11:20:19 -05:00
dependabot-preview[bot]
b2281880d1 Build(deps-dev): bump eslint-config-prettier from 4.1.0 to 4.3.0 (#3488)
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 4.1.0 to 4.3.0.
- [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/v4.1.0...v4.3.0)
2019-05-27 11:13:46 -05:00
dependabot-preview[bot]
099b7b4eb9 Build(deps-dev): bump js-yaml-loader from 1.0.1 to 1.2.0 (#3483)
Bumps [js-yaml-loader](https://github.com/wwilsman/js-yaml-loader) from 1.0.1 to 1.2.0.
- [Release notes](https://github.com/wwilsman/js-yaml-loader/releases)
- [Commits](https://github.com/wwilsman/js-yaml-loader/compare/v1.0.1...v1.2.0)
2019-05-27 13:52:48 +01:00
dependabot-preview[bot]
ab711fca05 Build(deps-dev): bump cypress from 3.3.0 to 3.3.1 (#3490)
Bumps [cypress](https://github.com/cypress-io/cypress) from 3.3.0 to 3.3.1.
- [Release notes](https://github.com/cypress-io/cypress/releases)
- [Commits](https://github.com/cypress-io/cypress/compare/v3.3.0...v3.3.1)
2019-05-27 12:53:51 +01:00
dependabot-preview[bot]
ae0f4e236a Build(deps-dev): bump nodemon from 1.19.0 to 1.19.1 (#3486)
Bumps [nodemon](https://github.com/remy/nodemon) from 1.19.0 to 1.19.1.
- [Release notes](https://github.com/remy/nodemon/releases)
- [Commits](https://github.com/remy/nodemon/compare/v1.19.0...v1.19.1)
2019-05-27 12:45:38 +01:00
dependabot-preview[bot]
8b3bbdb228 Build(deps): bump check-node-version from 3.3.0 to 4.0.1 (#3467)
Bumps [check-node-version](https://github.com/parshap/check-node-version) from 3.3.0 to 4.0.1.
- [Release notes](https://github.com/parshap/check-node-version/releases)
- [Changelog](https://github.com/parshap/check-node-version/blob/master/CHANGELOG.md)
- [Commits](https://github.com/parshap/check-node-version/compare/v3.3.0...v4.0.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-26 11:41:03 -04:00
Pierre-Yves B
638ad39b9e Open Collective funding link (#3481) 2019-05-26 12:12:04 +01:00
dependabot-preview[bot]
46c4063880 Build(deps): bump camp from 17.2.2 to 17.2.4 (#3466)
Bumps [camp](https://github.com/espadrine/sc) from 17.2.2 to 17.2.4.
- [Release notes](https://github.com/espadrine/sc/releases)
- [Commits](https://github.com/espadrine/sc/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-25 11:51:13 +01:00
Caleb Cartwright
27bb914172 tests(jsdelivr): increase timeout (#3479) 2019-05-24 13:31:35 +01:00
Caleb Cartwright
37030b92a0 tests(GitHubReleaseDate): fix service tests (#3477) 2019-05-23 19:31:49 +01:00
Josep Bernad
d685cde52b Add [Subreddit] subscribers (#3443)
* Add subreddit subscribers service file.

* Fix small detail in service and add the tests files.

* Apply suggested changes by the reviewer.

* Trying to make tests work.

* Update services/reddit/subreddit-subscribers.tester.js

Co-Authored-By: Caleb Cartwright <calebcartwright@users.noreply.github.com>

* Update services/reddit/subreddit-subscribers.tester.js

Co-Authored-By: Caleb Cartwright <calebcartwright@users.noreply.github.com>

* Apply suggested changes.

* Add different handler for non existing and invalid subreddits.

* Update services/reddit/subreddit-subscribers.service.js

Co-Authored-By: Caleb Cartwright <calebcartwright@users.noreply.github.com>
2019-05-22 16:43:13 -05:00
Caleb Cartwright
02ee34d2a5 feat: deprecate waffle service (#3473) 2019-05-22 10:04:30 +01:00
Caleb Cartwright
f94efe74db fix(aur): update test and example package targets (#3475) 2019-05-22 09:57:15 +01:00
dependabot[bot]
a74ddc87ef Build(deps-dev): bump gatsby from 2.3.33 to 2.5.7 (#3472)
Bumps [gatsby](https://github.com/gatsbyjs/gatsby) from 2.3.33 to 2.5.7.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.3.33...gatsby@2.5.7)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-21 18:14:27 -05:00
dependabot[bot]
c358ad3cd9 Build(deps-dev): bump enzyme-adapter-react-16 from 1.12.1 to 1.13.1 (#3469)
Bumps [enzyme-adapter-react-16](https://github.com/airbnb/enzyme/tree/HEAD/packages/enzyme-adapter-react-16) from 1.12.1 to 1.13.1.
- [Release notes](https://github.com/airbnb/enzyme/releases)
- [Changelog](https://github.com/airbnb/enzyme/blob/master/CHANGELOG.md)
- [Commits](https://github.com/airbnb/enzyme/commits/enzyme-adapter-react-16@1.13.1/packages/enzyme-adapter-react-16)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-21 17:30:49 -05:00
dependabot[bot]
f5b3119a43 Build(deps-dev): bump husky from 2.1.0 to 2.3.0 (#3463)
Bumps [husky](https://github.com/typicode/husky) from 2.1.0 to 2.3.0.
- [Release notes](https://github.com/typicode/husky/releases)
- [Changelog](https://github.com/typicode/husky/blob/master/CHANGELOG.md)
- [Commits](https://github.com/typicode/husky/compare/v2.1.0...v2.3.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-20 19:57:46 +01:00
dependabot[bot]
066a2957a4 Build(deps-dev): bump @babel/plugin-proposal-class-properties (#3462)
Bumps [@babel/plugin-proposal-class-properties](https://github.com/babel/babel) from 7.4.0 to 7.4.4.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.4.0...v7.4.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-20 10:37:30 -05:00
dependabot[bot]
d593da8337 Build(deps-dev): bump eslint-plugin-react from 7.12.4 to 7.13.0 (#3461)
Bumps [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) from 7.12.4 to 7.13.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.12.4...v7.13.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-20 07:36:06 -05:00
dependabot[bot]
91e013a738 Build(deps-dev): bump cypress from 3.2.0 to 3.3.0 (#3468)
Bumps [cypress](https://github.com/cypress-io/cypress) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/cypress-io/cypress/releases)
- [Commits](https://github.com/cypress-io/cypress/compare/v3.2.0...v3.3.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-20 07:13:30 -05:00
dependabot[bot]
91f5f8f557 Build(deps-dev): bump nyc from 14.0.0 to 14.1.1 (#3470)
Bumps [nyc](https://github.com/istanbuljs/nyc) from 14.0.0 to 14.1.1.
- [Release notes](https://github.com/istanbuljs/nyc/releases)
- [Changelog](https://github.com/istanbuljs/nyc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/istanbuljs/nyc/compare/v14.0.0...v14.1.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-20 06:58:07 -05:00
dependabot[bot]
b3e58c67be Build(deps-dev): bump mocha-junit-reporter from 1.21.0 to 1.22.0 (#3464)
Bumps [mocha-junit-reporter](https://github.com/michaelleeallen/mocha-junit-reporter) from 1.21.0 to 1.22.0.
- [Release notes](https://github.com/michaelleeallen/mocha-junit-reporter/releases)
- [Commits](https://github.com/michaelleeallen/mocha-junit-reporter/compare/v1.21.0...v1.22.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-20 05:53:29 -05:00
Pierre-Yves B
570ba18333 lastCompletedBuild for [Jenkins] badges and better discoverability (#3460) 2019-05-16 21:29:16 +01:00
Josep Bernad
17446efb45 Improvements in the TUTORIAL.md file (#3435)
* Improve tutorial file with explaining how to solve an error.

* Fix typo.

* Fix typo.

* Add more information about the fix.

* Apply suggested changes.

* Add missing method in the first example

* Modify the second example that did't compile.

* Add troubleshooting for the localhost and link to the issue solving it.

* Rephrase.

* Update doc/TUTORIAL.md

Co-Authored-By: Caleb Cartwright <calebcartwright@users.noreply.github.com>

* Add get category() function explanation in both examples.

* Update doc/TUTORIAL.md

Co-Authored-By: Paul Melnikow <github@paulmelnikow.com>
2019-05-15 19:40:18 +01:00
dependabot[bot]
b87bf0f4ba Build(deps-dev): bump snap-shot-it from 6.3.5 to 7.4.4 (#3455)
Bumps [snap-shot-it](https://github.com/bahmutov/snap-shot-it) from 6.3.5 to 7.4.4.
- [Release notes](https://github.com/bahmutov/snap-shot-it/releases)
- [Commits](https://github.com/bahmutov/snap-shot-it/compare/v6.3.5...v7.4.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-14 18:49:08 -05:00
dependabot[bot]
aee5f0da02 Build(deps-dev): bump sazerac from 0.4.2 to 1.0.0 (#3453)
Bumps [sazerac](https://github.com/sazeracjs/sazerac) from 0.4.2 to 1.0.0.
- [Release notes](https://github.com/sazeracjs/sazerac/releases)
- [Changelog](https://github.com/sazeracjs/sazerac/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sazeracjs/sazerac/compare/v0.4.2...v1.0.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-14 15:34:36 -05:00
Caleb Cartwright
60e69ee43b docs: fix link in Contributing guide (#3457) 2019-05-14 15:25:55 -05:00
Caleb Cartwright
9fe238a81f fix(stackexchange): questions/month badge with 0 questions (#3456) 2019-05-13 20:41:56 -04:00
dependabot[bot]
04d75f09c5 Build(deps-dev): bump react from 16.8.5 to 16.8.6 (#3446)
Bumps [react](https://github.com/facebook/react/tree/HEAD/packages/react) from 16.8.5 to 16.8.6.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v16.8.6/packages/react)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-13 19:16:38 -05:00
dependabot[bot]
30460a770d Build(deps-dev): bump opn-cli from 4.1.0 to 5.0.0 (#3452)
* Build(deps-dev): bump opn-cli from 4.1.0 to 5.0.0

Bumps [opn-cli](https://github.com/sindresorhus/open-cli) from 4.1.0 to 5.0.0.
- [Release notes](https://github.com/sindresorhus/open-cli/releases)
- [Commits](https://github.com/sindresorhus/open-cli/compare/v4.1.0...v5.0.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* chore: update script to reflect new bin name
2019-05-13 18:58:28 -05:00
dependabot[bot]
c5946cd617 Build(deps-dev): bump @babel/register from 7.4.0 to 7.4.4 (#3451)
Bumps [@babel/register](https://github.com/babel/babel) from 7.4.0 to 7.4.4.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.4.0...v7.4.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-13 22:30:41 +01:00
dependabot[bot]
905577bba3 Build(deps-dev): bump babel-plugin-istanbul from 5.1.2 to 5.1.4 (#3448)
Bumps [babel-plugin-istanbul](https://github.com/istanbuljs/babel-plugin-istanbul) from 5.1.2 to 5.1.4.
- [Release notes](https://github.com/istanbuljs/babel-plugin-istanbul/releases)
- [Changelog](https://github.com/istanbuljs/babel-plugin-istanbul/blob/master/CHANGELOG.md)
- [Commits](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v5.1.2...v5.1.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-13 22:23:00 +01:00
dependabot[bot]
9253c4c32f Build(deps-dev): bump react-helmet from 5.2.0 to 5.2.1 (#3449)
Bumps [react-helmet](https://github.com/nfl/react-helmet) from 5.2.0 to 5.2.1.
- [Release notes](https://github.com/nfl/react-helmet/releases)
- [Changelog](https://github.com/nfl/react-helmet/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nfl/react-helmet/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-13 22:13:13 +01:00
dependabot[bot]
ab3b77ec32 Build(deps-dev): bump start-server-and-test from 1.7.12 to 1.9.0 (#3450)
Bumps [start-server-and-test](https://github.com/bahmutov/start-server-and-test) from 1.7.12 to 1.9.0.
- [Release notes](https://github.com/bahmutov/start-server-and-test/releases)
- [Commits](https://github.com/bahmutov/start-server-and-test/compare/v1.7.12...v1.9.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-13 22:06:46 +01:00
dependabot[bot]
2edd390aa9 Build(deps-dev): bump nock from 11.0.0-beta.10 to 11.0.0-beta.14 (#3454)
Bumps [nock](https://github.com/nock/nock) from 11.0.0-beta.10 to 11.0.0-beta.14.
- [Release notes](https://github.com/nock/nock/releases)
- [Changelog](https://github.com/nock/nock/blob/beta/CHANGELOG.md)
- [Commits](https://github.com/nock/nock/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-13 21:58:23 +01:00
dependabot[bot]
0e6dff769d Build(deps): bump glob from 7.1.3 to 7.1.4 (#3447)
Bumps [glob](https://github.com/isaacs/node-glob) from 7.1.3 to 7.1.4.
- [Release notes](https://github.com/isaacs/node-glob/releases)
- [Changelog](https://github.com/isaacs/node-glob/blob/master/changelog.md)
- [Commits](https://github.com/isaacs/node-glob/compare/v7.1.3...v7.1.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-13 20:59:06 +02:00
Pierre-Yves B
992bd81baa Fixed Wordpress rating examples (#3445) 2019-05-12 22:12:47 +01:00
chris48s
7caf301730 switch [circleci] service to scrape SVG badge, reorganise routes (#3413)
* switch [circleci] service to scrape SVG badge

* reorganise [circleci] routes

Default URL is now
circleci/build/gh/badges/shields/master?token=abc123
There are redirects on the legacy routes to provide
backwards compatibility for existing users
2019-05-11 17:55:32 +01:00
chris48s
3bb614ff39 fix [microbadger] examples (#3439) 2019-05-09 16:39:40 -04:00
Marcin Mielnicki
283601423f Redirect an old png badge with a number as a color; test on [static] (#3412)
Fixes https://github.com/badges/shields/issues/3260

Problem happens when a value of a color in an old PNG static badge is a number: http://localhost:8080/my-label/my-message.png?color=1. In this case `color` in `queryParams` is a number. 
0a0b5b3f03/core/server/server.js (L203-L212)

Surprisingly service test listed below is passing currently on master - value `1` is represented in `queryParams` as a String (only in test). 
`services/static-badge/static-badge.tester.js`
```js
t.create('Old static badge with a number as a color')
  .get('/foo/bar.png?color=1', { followRedirect: false })
  .expectStatus(301)
  .expectHeader('Location', '/badge/foo-bar-1.png')
```

Moreover I added some code + description allowing to debug server.
2019-05-08 12:33:43 -04:00
Paul Melnikow
7afb26ef14 Add some aliases for license colors; refactor; test colors for [PypiLicense] (#3431)
This covers some of the license strings used by the PyPI badges like **BSD** which currently shows up in lightgrey.
2019-05-07 23:32:15 -04:00
Jeffrey Paul
9b3fd375bb Update references to "WordPress" (#3434)
Fixes #3432
2019-05-07 11:39:00 -04:00
Chris Gavin
d6c875c519 Fix [LGTM] badges for non-GitHub projects. (#3362)
* Fix LGTM badges for non-GitHub projects.

* Allow using full repository host names in LGTM badge URLs.

* Add an LGTM redirector service to redirect old LGTM badge URLs to new LGTM badge URLs.

* Add LGTM redirector tester.

* Remove unneeded check in LGTM base file.

Co-Authored-By: chrisgavin <chris@chrisgavin.me>
2019-05-07 07:46:14 -07:00
Paul Melnikow
5e8fcc3b3c MarkupModal: Convert from class component to function component (#3415)
This continues the work from #3096, of converting our class components to function components.
2019-05-06 12:13:06 -04:00
dependabot[bot]
e5829fb353 Build(deps): bump dotenv from 7.0.0 to 8.0.0 (#3420)
Bumps [dotenv](https://github.com/motdotla/dotenv) from 7.0.0 to 8.0.0.
- [Release notes](https://github.com/motdotla/dotenv/releases)
- [Changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md)
- [Commits](https://github.com/motdotla/dotenv/compare/v7.0.0...v8.0.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-06 09:06:45 -04:00
dependabot[bot]
43b0b408db Build(deps-dev): bump @babel/preset-env from 7.3.1 to 7.4.4 (#3423)
Bumps [@babel/preset-env](https://github.com/babel/babel) from 7.3.1 to 7.4.4.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.3.1...v7.4.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-06 09:00:36 -04:00
dependabot[bot]
af9a28459d Build(deps-dev): bump eslint-plugin-node from 8.0.1 to 9.0.1 (#3419)
Bumps [eslint-plugin-node](https://github.com/mysticatea/eslint-plugin-node) from 8.0.1 to 9.0.1.
- [Release notes](https://github.com/mysticatea/eslint-plugin-node/releases)
- [Commits](https://github.com/mysticatea/eslint-plugin-node/compare/v8.0.1...v9.0.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-06 08:20:34 -04:00
dependabot[bot]
168da685dd Build(deps): bump pretty-bytes from 5.1.0 to 5.2.0 (#3422)
Bumps [pretty-bytes](https://github.com/sindresorhus/pretty-bytes) from 5.1.0 to 5.2.0.
- [Release notes](https://github.com/sindresorhus/pretty-bytes/releases)
- [Commits](https://github.com/sindresorhus/pretty-bytes/compare/v5.1.0...v5.2.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-06 08:09:21 -04:00
dependabot[bot]
f6dd3bb8dd Build(deps): bump query-string from 6.4.2 to 6.5.0 (#3424)
Bumps [query-string](https://github.com/sindresorhus/query-string) from 6.4.2 to 6.5.0.
- [Release notes](https://github.com/sindresorhus/query-string/releases)
- [Commits](https://github.com/sindresorhus/query-string/compare/v6.4.2...v6.5.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-06 10:55:06 +01:00
dependabot[bot]
ed75191739 Build(deps-dev): bump node-mocks-http from 1.7.3 to 1.7.5 (#3426)
Bumps [node-mocks-http](https://github.com/howardabrams/node-mocks-http) from 1.7.3 to 1.7.5.
- [Release notes](https://github.com/howardabrams/node-mocks-http/releases)
- [Changelog](https://github.com/howardabrams/node-mocks-http/blob/master/HISTORY.md)
- [Commits](https://github.com/howardabrams/node-mocks-http/compare/v1.7.3...v1.7.5)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-06 10:32:49 +01:00
Paul Melnikow
786bac21ce Convert remaining uses of node-fetch to got (#3417) 2019-05-06 10:10:07 +01:00
Paul Melnikow
4d5acd54df Remove unused pretty dependency (#3416)
Looks like this was added way back in #1163 and is definitely not the way things are happening now. I don't see anywhere else it's being used.
2019-05-06 10:00:25 +01:00
Paul Melnikow
1da791e778 LogoPage: Update function style (#3414)
Many of the components (e.g. the ones in `common.js`) have already been converted to this style. This file was missed.
2019-05-06 09:51:07 +01:00
dependabot[bot]
ac34705524 Build(deps-dev): bump eslint-plugin-import from 2.17.1 to 2.17.2 (#3427)
Bumps [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import) from 2.17.1 to 2.17.2.
- [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.17.1...v2.17.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-06 09:41:08 +01:00
dependabot[bot]
1333ff8ba4 Build(deps): bump simple-icons from 1.9.24 to 1.9.26 (#3421)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 1.9.24 to 1.9.26.
- [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>
2019-05-06 09:34:12 +01:00
dependabot[bot]
86e9457fed Build(deps-dev): bump nodemon from 1.18.11 to 1.19.0 (#3418)
Bumps [nodemon](https://github.com/remy/nodemon) from 1.18.11 to 1.19.0.
- [Release notes](https://github.com/remy/nodemon/releases)
- [Commits](https://github.com/remy/nodemon/compare/v1.18.11...v1.19.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-06 09:28:00 +01:00
Pierre-Yves B
0a0b5b3f03 Added support for branches in "commits since" GitHub badge (#3411) 2019-05-05 10:47:07 -04:00
Ville Skyttä
3b73900b8a Add [Fedora] package version support (#3372) 2019-05-03 17:15:38 -04:00
Ville Skyttä
742f287f06 Move optional path components to the end for [Debian] and [Ubuntu] (#3409)
Refs https://github.com/badges/shields/pull/3372
2019-05-03 17:05:57 -04:00
Paul Melnikow
001ade3704 Move checkErrorResponse from lib/ to core/ [chrome] (#3408) 2019-05-02 18:07:18 -04:00
Paul Melnikow
a0da978886 Bury the loader fixtures with the code that uses them (#3407)
One less thing to have in the root of the project!
2019-05-02 12:36:00 -04:00
Paul Melnikow
c3bc0ac96f Take the Endpoint badge out of beta (#3405)
Close #2838
2019-05-01 23:05:34 -04:00
Marcin Mielnicki
65d42d5cb1 Remove IP filtering documentation for metrics (#3406) 2019-05-01 22:50:27 +02:00
Paul Melnikow
73ed7778fd Automatically reload the server when it changes (#3401)
While working on #2428 I found myself wanting to reload the server frequently. This is working great and reducing my iteration time significantly. I should have tackled this way sooner! 🙊 

I’ve left `verbose` on which seems useful, at least in the short term while we’re tuning the configuration.

Close #2426
2019-05-01 16:39:25 -04:00
Ville Skyttä
26852eece9 Add [Ubuntu] package version support (#3398)
* Add [Ubuntu] package version support

https://api.launchpad.net/1.0/

* Mark 400 responses as series not found

* Extract API call into separate fetch function
2019-05-01 11:24:21 -05:00
Marcin Mielnicki
ec244fe305 Remove code duplication in CircleCI configuration; test on [jetbrains] (#3400)
* Remove code duplication in CircleCI configuration

* Common steps moved to the root
2019-04-30 23:21:50 +02:00
dependabot[bot]
6abff761dd Build(deps-dev): bump gatsby-plugin-remove-trailing-slashes (#3387)
Bumps [gatsby-plugin-remove-trailing-slashes](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-remove-trailing-slashes) from 2.0.10 to 2.0.11.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-remove-trailing-slashes/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/commits/gatsby-plugin-remove-trailing-slashes@2.0.11/packages/gatsby-plugin-remove-trailing-slashes)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-30 20:21:30 +02:00
Ville Skyttä
8f4042f4c8 Distro version improvements (#3397) 2019-04-30 11:24:50 -04:00
Paul Melnikow
ae2499bf53 Generate JSON badges without using a template [GithubSearch] (#3395)
Warm up for #2428.
2019-04-29 23:26:52 -04:00
Paul Melnikow
7980a65d7f [WordpressPlatformTests] Support tested version without trailing ".0" (#3396)
See https://circleci.com/gh/badges/shields/52378 for an example failure,
where a value of `5.2` is triggering "TypeError: Invalid Version: 5.2"
2019-04-29 21:52:57 -04:00
Paul Melnikow
b2e21da34d Remove legacy helper makeBadgeData (#3392)
Close #3369
2019-04-29 19:44:25 -04:00
dependabot[bot]
b752bbfd5a Bump escape-string-regexp from 1.0.5 to 2.0.0; move to dev deps (#3383) 2019-04-29 18:35:56 -04:00
dependabot[bot]
91592802da Build(deps-dev): bump gatsby from 2.3.25 to 2.3.33 (#3389)
Bumps [gatsby](https://github.com/gatsbyjs/gatsby) from 2.3.25 to 2.3.33.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.3.25...gatsby@2.3.33)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-29 18:27:10 -04:00
Paul Melnikow
ad182885ad Get two service helpers to 100% coverage (#3391) 2019-04-29 14:16:33 -04:00
Pierre-Yves B
9a869e24ba Added link test expectations (#3376) 2019-04-29 18:52:58 +01:00
Paul Melnikow
a0492c5283 Remove unused callback-based error helpers (#3371) 2019-04-29 13:35:57 -04:00
dependabot[bot]
ca4763b0ff Build(deps-dev): bump @babel/plugin-proposal-object-rest-spread (#3379)
Bumps [@babel/plugin-proposal-object-rest-spread](https://github.com/babel/babel) from 7.4.3 to 7.4.4.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.4.3...v7.4.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-29 19:19:40 +02:00
Marcin Mielnicki
2462951254 Run entrypoint tests in CI (#3390)
* Start server in test without args from mocha

* Entrypoint tests added to CI
2019-04-29 19:09:52 +02:00
dependabot[bot]
a994c13655 Build(deps-dev): bump @babel/polyfill from 7.4.3 to 7.4.4 (#3381)
Bumps [@babel/polyfill](https://github.com/babel/babel) from 7.4.3 to 7.4.4.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.4.3...v7.4.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-29 18:51:30 +02:00
Marcin Mielnicki
eeb78ccf15 Badge suggestion feature fix (#3331)
* Display suggested badges

* E2e test for badge suggestion

* Suggest resource returns example with pattern

* Do not require preview in MarkupModalContent

* Skip integration test for suggestion

* Unmodifiable path in customizer

* Use suggested link

* Allow to change suggested badges

* Enable skipped test

* Enable skipped test

* Code refactoring

* Code refactoring

* Code refactoring

* Code refactoring

* Code refactoring

* Code refactoring

* Unused code removed

* Unused code removed

* getExampleWithServiceByPattern helper added

* BadgeExamples uses examples instead of services definitions

* Revert "getExampleWithServiceByPattern helper added"

This reverts commit 80839fd705.

* style removed from example

* example.exact replaced with preview.buildFromExample

* keywords are required again

* Code refactoring

* More e2e tests for suggestion feature

* Code refactoring

* Build add with a base url

* showActualParams -> isPrefilled

* A new schema for BadgeExamples

* Link moved to queryParams

* Updated documentation for the suggest reponse format

* Link moved to queryParams - another test updated

* Revert "Link moved to queryParams - another test updated"

This reverts commit b5f811bb07.

* Revert "Link moved to queryParams"

This reverts commit 3b54c6d2b4.

* Disable changes in path in suggested badges

* 'link' element documentation restored
2019-04-29 18:38:27 +02:00
dependabot[bot]
2fc4e71410 Build(deps): bump check-node-version from 3.2.0 to 3.3.0 (#3386)
Bumps [check-node-version](https://github.com/parshap/check-node-version) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/parshap/check-node-version/releases)
- [Changelog](https://github.com/parshap/check-node-version/blob/master/CHANGELOG.md)
- [Commits](https://github.com/parshap/check-node-version/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-29 11:54:53 -04:00
dependabot[bot]
26a8c7c52a Build(deps-dev): bump snap-shot-it from 6.3.3 to 6.3.5 (#3382)
Bumps [snap-shot-it](https://github.com/bahmutov/snap-shot-it) from 6.3.3 to 6.3.5.
- [Release notes](https://github.com/bahmutov/snap-shot-it/releases)
- [Commits](https://github.com/bahmutov/snap-shot-it/compare/v6.3.3...v6.3.5)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-29 17:10:39 +02:00
dependabot[bot]
cc61ab31e9 Build(deps-dev): bump react-select from 2.4.2 to 2.4.3 (#3380)
Bumps [react-select](https://github.com/JedWatson/react-select) from 2.4.2 to 2.4.3.
- [Release notes](https://github.com/JedWatson/react-select/releases)
- [Changelog](https://github.com/JedWatson/react-select/blob/master/.sweet-changelogs.js)
- [Commits](https://github.com/JedWatson/react-select/compare/v2.4.2...v2.4.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-29 16:59:18 +02:00
dependabot[bot]
48efd0ed8f Build(deps-dev): bump husky from 1.3.1 to 2.1.0 (#3384)
Bumps [husky](https://github.com/typicode/husky) from 1.3.1 to 2.1.0.
- [Release notes](https://github.com/typicode/husky/releases)
- [Changelog](https://github.com/typicode/husky/blob/master/CHANGELOG.md)
- [Commits](https://github.com/typicode/husky/compare/v1.3.1...v2.1.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-29 16:46:55 +02:00
dependabot[bot]
722398a413 Build(deps-dev): bump mocha from 6.1.3 to 6.1.4 (#3388)
Bumps [mocha](https://github.com/mochajs/mocha) from 6.1.3 to 6.1.4.
- [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/v6.1.3...v6.1.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-29 16:33:24 +02:00
Ville Skyttä
802c3cd8e8 Allow tilde as optional suffix separator (#3378)
For example [Debian] uses them, typically for pre-releases.
2019-04-29 15:11:55 +01:00
chris48s
5f29f6a175 case-insentitive asset name compare in [githubdownloads] (#3377)
closes #3364
2019-04-29 15:05:27 +01:00
Ville Skyttä
3875d292a6 Add [Debian] package version support (#3373)
https://wiki.debian.org/Services/api.ftp-master.debian.org
2019-04-29 14:58:45 +01:00
Ville Skyttä
75def85eca Add [ArchLinux] package version support (#3374) 2019-04-28 21:19:42 +01:00
Pierre-Yves B
2806eb8a00 Legacy services clean up (#3367)
* Deleted remaining legacy service bits

* Removed badge from README

* Removed no longer needed try/catch

* Deleted refactoring script

* Switched to const

* Reinstated doc

* Ran Prettier
2019-04-27 19:25:01 +01:00
Pierre-Yves B
499fb8dbaf Fixed color of GitHub forks badge (#3366) 2019-04-27 13:48:47 -04:00
Caleb Cartwright
07a8d2ecbe refactor [Scrutinizer] (#3266)
* refactor(Scrutinizer): migrated to new BaseJsonService

* refactor(ScrutinizerCoverage): updated color scale to match

* refactor(Scrutinizer): switched to multiple classes to handle dif. git hosts

* refactor(Scrutinizer): finished migrating to new service arch.

* fix(Scrutinizer): fixed branch check logic

* refactor(Scrutinizer): inline transforms based on PR feedback

* refactor(ScrutinizerCoverage): change handling of no coverage scenario
2019-04-26 21:50:28 -05:00
James Cahill
01d745122b refactor [mavencentral] (#3290)
* refactor maven central

* misc fixes

- include a pretty message on NotFound when the filter returns no results

- split the group and artifact into seperate variables

- remove the connection error test

* remove xml parsing test and add inexistent version prefix test

* use existing test validators and shorthand createservicetester
2019-04-25 18:35:50 -05:00
Paul Melnikow
2215693557 Rewrite [GithubTag] (#3360)
Ref #2863
2019-04-25 11:23:16 -04:00
Paul Melnikow
0088a9d0da Unify remaining service order and enforce (#3359)
Ref #3353
2019-04-24 16:53:33 -04:00
Paul Melnikow
f8aeb56129 Unify order of more services (#3358)
Ref #3353
2019-04-24 15:08:26 -04:00
Paul Melnikow
1dd8d1329c Unify order of another handful of services (#3356)
Ref #3353
2019-04-24 15:03:23 -04:00
Paul Melnikow
36f50f2a02 Refactor [cii] (#3357) 2019-04-24 08:36:39 -05:00
Paul Melnikow
051e7d04c1 Rewrite [travisphpversion]; improve error message in expectBadge (#3352)
The change in `expectBadge` prints a more helpful error when `message` is empty.

Ref #2863
2019-04-23 23:03:21 -04:00
Paul Melnikow
1cdcaabd38 Unify order of properties and methods in services (#3353)
I find having these in a consistent order makes the services much faster to read.

This is the order I’ve generally been using:

1. Category
2. Route
3. Examples
4. Rendering
5. Other helpers (`fetch()`, `transform()`)
6. `handle()`
2019-04-23 21:36:04 -04:00
Caleb Cartwright
12191e20c4 refactor [JenkinsTests JenkinsCoverage], also run [JenkinsBuild] (#3337)
* refactor(JenkinsTests): finished core refactor to new service model

* refactor(JenkinsTests): more updates

* refactor(JenkinsCoverage): minor refactor to leverage new common Jenkins content

* refactor(JenkinsBuild): update redirector to include shorthand alias

* chore: apply suggestion on jenkins-tests.service.js

Co-Authored-By: calebcartwright <calebcartwright@users.noreply.github.com>

* refactor(JenkinsTests): rename test helpers

* chore: cleanup JenkinsCoverage redirector

* chore: cleanup JenkinsBuild redirector

* chore: cleanup test docs
2019-04-23 20:20:34 -05:00
Paul Melnikow
8ad0b105b1 Make the config from env more obvious at first glance; explain cascading config (#3355) 2019-04-23 13:57:23 -04:00
Caleb Cartwright
6547a5765c chore: minor cleanup (#3354) 2019-04-23 10:22:47 -04:00
Guy Saar
d3ec64c789 [Bit] add bit components count service (#3338)
* [Bit] add bit components count service

* [Bit] change 404 error to 'collection not found'

* [Bit] remove comment

* [Bit] change collection schema

* [Bit] use isMetric

* [Bit] replace static color to dynamic color

* [BIt] change bit total components route

* change scope to collection

* change all scope var to collection
2019-04-23 06:54:51 -05:00
Paul Melnikow
ca22d01606 Rewrite [GithubDownloads] (#3351)
For consistency with other download badges, I changed some formatting:

-  **downloads | 24k total** -> **downloads | 24k**
- **downloads | 3k** -> **downloads@latest | 3k**
- **downloads | 3k v0.29.0** -> **downloads@v0.29.0 | 3k**

Ref #2863
2019-04-22 22:55:31 -04:00
Paul Melnikow
f13326dddf Rewrite [githubcommitssince]; also test [githubrelease] (#3350) 2019-04-22 18:54:58 -05:00
dependabot[bot]
aa32f48765 Build(deps-dev): bump gatsby-plugin-react-helmet from 3.0.10 to 3.0.12 (#3347)
Bumps [gatsby-plugin-react-helmet](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-react-helmet) from 3.0.10 to 3.0.12.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-react-helmet/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/commits/gatsby-plugin-react-helmet@3.0.12/packages/gatsby-plugin-react-helmet)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-22 18:45:52 -05:00
dependabot[bot]
d5cc72b3a8 Build(deps-dev): bump babel-plugin-istanbul from 5.1.1 to 5.1.2 (#3344)
Bumps [babel-plugin-istanbul](https://github.com/istanbuljs/babel-plugin-istanbul) from 5.1.1 to 5.1.2.
- [Release notes](https://github.com/istanbuljs/babel-plugin-istanbul/releases)
- [Changelog](https://github.com/istanbuljs/babel-plugin-istanbul/blob/master/CHANGELOG.md)
- [Commits](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v5.1.1...v5.1.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-22 18:35:05 -05:00
dependabot[bot]
35d328b222 Build(deps): bump camelcase from 5.2.0 to 5.3.1 (#3349)
Bumps [camelcase](https://github.com/sindresorhus/camelcase) from 5.2.0 to 5.3.1.
- [Release notes](https://github.com/sindresorhus/camelcase/releases)
- [Commits](https://github.com/sindresorhus/camelcase/compare/v5.2.0...v5.3.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-22 21:09:24 +01:00
dependabot[bot]
7f2e0f5913 Build(deps-dev): bump clipboard-copy from 2.0.1 to 3.0.0 (#3346)
Bumps [clipboard-copy](https://github.com/feross/clipboard-copy) from 2.0.1 to 3.0.0.
- [Release notes](https://github.com/feross/clipboard-copy/releases)
- [Commits](https://github.com/feross/clipboard-copy/compare/v2.0.1...v3.0.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-22 20:53:23 +01:00
dependabot[bot]
884a6041dd Build(deps-dev): bump gatsby from 2.3.22 to 2.3.25 (#3343)
Bumps [gatsby](https://github.com/gatsbyjs/gatsby) from 2.3.22 to 2.3.25.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.3.22...gatsby@2.3.25)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-22 20:48:00 +01:00
dependabot[bot]
093b5d19ed Build(deps-dev): bump humanize-string from 1.0.2 to 2.1.0 (#3340)
Bumps [humanize-string](https://github.com/sindresorhus/humanize-string) from 1.0.2 to 2.1.0.
- [Release notes](https://github.com/sindresorhus/humanize-string/releases)
- [Commits](https://github.com/sindresorhus/humanize-string/compare/v1.0.2...v2.1.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-22 20:42:30 +01:00
dependabot[bot]
3db3552dde Build(deps-dev): bump is-png from 1.1.0 to 2.0.0 (#3342)
Bumps [is-png](https://github.com/sindresorhus/is-png) from 1.1.0 to 2.0.0.
- [Release notes](https://github.com/sindresorhus/is-png/releases)
- [Commits](https://github.com/sindresorhus/is-png/compare/v1.1.0...v2.0.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-22 20:35:38 +01:00
dependabot[bot]
90fc3e65d8 Build(deps-dev): bump opn-cli from 4.0.0 to 4.1.0 (#3341)
Bumps [opn-cli](https://github.com/sindresorhus/opn-cli) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/sindresorhus/opn-cli/releases)
- [Commits](https://github.com/sindresorhus/opn-cli/compare/v4.0.0...v4.1.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-22 12:45:50 -05:00
dependabot[bot]
b800cfed0f Build(deps-dev): bump sinon from 7.3.1 to 7.3.2 (#3348)
Bumps [sinon](https://github.com/sinonjs/sinon) from 7.3.1 to 7.3.2.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v7.3.1...v7.3.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-22 12:13:20 -05:00
dependabot[bot]
1e8f0b05c9 Build(deps-dev): bump nock from 11.0.0-beta.6 to 11.0.0-beta.10 (#3345)
Bumps [nock](https://github.com/nock/nock) from 11.0.0-beta.6 to 11.0.0-beta.10.
- [Release notes](https://github.com/nock/nock/releases)
- [Changelog](https://github.com/nock/nock/blob/beta/CHANGELOG.md)
- [Commits](https://github.com/nock/nock/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-22 10:55:23 -05:00
Paul Melnikow
5828223356 Refactor [Wordpress] services (#3324)
- Prefer inline transforms to take place in `handle()` rather than `render()`
- Avoid inversion of control by removing `BaseWordpress#handle()`, passing `extensionType` into `fetch()`, and removing one layer of subclassing
- Move “not found” checks into `fetch()`
- Cache wordpress versions instead of fetching on each request
- Start to convert aliases to redirects (there are more of these which could be tackled in a follow-on)
- Replace at least one route `format` with a `pattern` (ref #3329)
- Partially reorder: name, category, route, examples, defaultBadgeData, render, fetch, handle

Some of this is in line with our established patterns or makes it clearly easier to follow; some of it is arguably stylistic.
2019-04-22 10:45:25 -05:00
chris48s
05af1f82b2 refactor [vaadindirectory] badges (#3339) 2019-04-21 21:10:30 +01:00
Paul Melnikow
b55e3eef60 Rewrite [codeclimate] analysis (#3321)
* WIP

* Rewrite [codeclimate] analysis

Ref #2683

* Tweak names

* chore: tweak redirector category
2019-04-21 11:44:07 -05:00
Paul Melnikow
a291ba73a3 Use url pattern for [nexus] + minor cleanup (#3326)
* Use url `pattern` for [nexus]

* chore: minor nexus example tweaks

* chore: fix prettier issue

* refactor(Nexus): minor refactor to fix tests and examples

* chore: increase timeout on nexus service tests

* chore: prettified for prettier

* tests(Nexus): increase timeout for recurringly slow test

* chore: update nexus schema with docs
2019-04-20 16:23:42 -05:00
Caleb Cartwright
049057c230 add strictSSL query param toggle to [coverity] (#3336)
* feat(coverity): adding query param toggle for strict ssl

* feat: disable coverity strict ssl check by default
2019-04-20 13:52:48 -05:00
Caleb Cartwright
a144f957b6 refactor [JenkinsBuild] (#3302)
* refactor(JenkinsBuild): ported to new service model

* refactor(JenkinsBuild): added redirector for jenkins-ci route

* refactor(JenkinsBuild): trying to debug test on circle

* refactor(JenkinsBuild): fix test of mock creds

* chore: fix typo in wrong file 🤦

* refactor(JenkinsBuild): update route

* refactor(JenkinsBuild): fixed service test

* refactor(JenkinsBuild): made strictSSL configurable via QP
2019-04-19 15:34:21 -05:00
Caleb Cartwright
4ae393565a refactor: deprecated php-eye/hhvm badges (#3335) 2019-04-18 21:05:38 -05:00
Paul Melnikow
b069dbbaad Use route patterns in [snap-ci nsp gratipay githubmanifest codacy cauditor bithound] (#3327)
Ref #3329
2019-04-18 18:15:48 -05:00
Paul Melnikow
066193c002 Readme: Update node compatibility (#3330) 2019-04-17 15:15:46 -04:00
Paul Melnikow
d1f00b93e8 [security] Bump nyc from 13.3.0 to 14.0.0 (#3323) 2019-04-17 14:51:56 -04:00
Paul Melnikow
b431923e35 Minor rename in [node] (#3325) 2019-04-17 13:13:24 -04:00
Paul Melnikow
5bedbbd9c1 [security] npm audit fixes; ignore [security] in PR title (#3322) 2019-04-17 11:30:34 -04:00
Pierre-Yves B
0a9611d574 Migrated JenkinsPluginVersion to new service architecture (#3317) 2019-04-17 06:53:45 +01:00
Paul Melnikow
cffa29dd5c Fix [codeclimatecoverage] coverage-percentage route (#3320) 2019-04-16 23:39:03 -04:00
Paul Melnikow
fc5cd07a0f Consolidate [DubDownloads] into one service (#3319)
Same idea as #3318.
2019-04-16 21:50:15 -04:00
Paul Melnikow
b79d1952c0 Consolidate [NpmDownloads] into one service (#3318)
This moves the four npm download services into a single class, in line with #3174, and other service implementations we've written in the last couple months. 

1. Change the suffixes from **/m** to **/month** for consistency.
2. Add tests of one of the intervals besides total.
3. Rewrite mocked service tests as unit tests.
4. Use (and work with) the `intervalMap` pattern that I think @calebcartwright started us using.
2019-04-16 19:18:16 -04:00
Cedric van Putten
483ecf24de [Drone] Add Drone build badge (#3240)
* Add drone build badge based on travis

* Fix wrong mocked endpoint for done builder

* Refactor service tester using helper method

* Add missing failure status to red statuses

* Remove extraneous invalid svg test from drone

* Test on failure red status in build status spec

* refactor(drone): use json service instead of svg

* refactor(drone): remove status text and extraneous build path in test

* refactor(drone): allow defining self-hosted drone instances

* fix(drone): use proper urls in drone examples

* fix(drone): add drone token authorization for self-hosted instances

* refactor(drone): call render build status badge directly instead of render

* refactor(drone): use server query parameter for self-hosted instances

* fix(drone): separate url and query params in example

* fix(drone): use actual build status message in examples

* fix(drone): add missing message for status code 401

Co-Authored-By: byCedric <me@bycedric.com>

* refactor(drone): remove color from drone tests

* refactor(drone): remove extraneous comments from drone tests

* refactor(drone): remove unused static preview method

* refactor(drone): remove unused static render method

* refactor(drone): reuse render build status badge helper in static previews

* fix(drone): test inaccessible repos on new message
2019-04-16 11:33:15 -05:00
Paul Melnikow
91d6dd6643 Rewrite [codeclimate] coverage (#3316)
Attacking this in two pieces for ease of review. The legacy implementation for coverage is still there, though I disabled it via the route. That whole file will be removed in the next PR.

Ref #2863
2019-04-15 23:47:25 -04:00
Caleb Cartwright
700b61e16b Refactor [Sonar] (#3189)
* refactor(sonar)

* refactor(sonarqube): creating separate services for SQ badges

* refactor(sonar): more sonar refactorings

* refactor(sonar): fixed duplicate service names from c/p

* refactor(sonar): finished violations service impl

* refactor(sonar): finished unit tests for violations service

* feat(sonar): violation badge updates

* refactor(sonar): finished doc. api density service

* feat(sonar): added quality gate service

* chore: sonar doc tweaks

* refactor(sonar): added redirector service

* refactor(sonar): added examples

* refactor(sonar): minor example updates

* refactor(sonar): added final tests

* chore(sonar): removed unneeded test spec file for base class

* refactor(sonar): updates based on PR feedback

* refactor(sonar): change query param to sonarVersion

* refactor(sonar): fixing query param issue

* refactor(sonar): fix test color for generic metric

* chore: fix lint/prettier issue

* chore(sonar): update query param name in examples

* refactor(sonar): make schema metric key required

* reactor(sonar): fix tests

* refactor(sonar): added more example listings

* refactor(sonar): minor style updates

* refactor(sonar): update examples

* refactor(Sonar): minor example tweaks
2019-04-15 17:03:57 -05:00
dependabot[bot]
c2472f3397 Bump config from 3.0.1 to 3.1.0 (#3311)
Bumps [config](https://github.com/lorenwest/node-config) from 3.0.1 to 3.1.0.
- [Release notes](https://github.com/lorenwest/node-config/releases)
- [Changelog](https://github.com/lorenwest/node-config/blob/master/History.md)
- [Commits](https://github.com/lorenwest/node-config/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-15 14:06:39 -04:00
dependabot[bot]
1684f1ac51 Bump snap-shot-it from 6.2.10 to 6.3.3 (#3312)
Bumps [snap-shot-it](https://github.com/bahmutov/snap-shot-it) from 6.2.10 to 6.3.3.
- [Release notes](https://github.com/bahmutov/snap-shot-it/releases)
- [Commits](https://github.com/bahmutov/snap-shot-it/compare/v6.2.10...v6.3.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-15 13:38:26 -04:00
dependabot[bot]
f3303c4a41 Bump gatsby from 2.1.19 to 2.3.22 (#3307)
Bumps [gatsby](https://github.com/gatsbyjs/gatsby) from 2.1.19 to 2.3.22.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.1.19...gatsby@2.3.22)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-15 13:11:07 -04:00
Caleb Cartwright
89e749f714 fix [gratipay] test (#3303)
Not really sure what happened, but the test for the deprecated gratipay/gittp service has been failing for a while with a 404 badge not found error. For example

`AssertionError: label mismatch: expected '404' to equal 'gratipay'`

This tweaks the rout pattern so the test is passing again.
2019-04-15 13:05:30 -04:00
dependabot[bot]
709554daa4 Bump danger from 7.1.0 to 7.1.2 (#3308)
Bumps [danger](https://github.com/danger/danger-js) from 7.1.0 to 7.1.2.
- [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/7.1.0...7.1.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-15 12:58:38 -04:00
Caleb Cartwright
9221075d31 fix [sourcegraph] test (#3304) 2019-04-15 12:53:15 -04:00
Caleb Cartwright
263e1be06d tests(Maintenance): refactor and test (#3305)
One of the tests for the Maintenance service that was added when the service was refactored is failing 
`AssertionError: message mismatch: expected 'no! (as of 2018)' to equal 'stale (as of 2019)'`

I believe the test was added in an attempt to cover the one of the code paths, but that original test would only pass a couple months out of the year. 

Testing those paths with the original implementation would have required a lot of stubbing clocks/timers, so instead I refactored the code a bit. I removed the flaky live/service test, and added some unit tests instead (which made more sense to me since this service badge doesn't hit a live endpoint)
2019-04-15 12:47:06 -04:00
dependabot[bot]
9598d80bdd Bump is-svg from 3.0.0 to 4.1.0 (#3315)
Bumps [is-svg](https://github.com/sindresorhus/is-svg) from 3.0.0 to 4.1.0.
- [Release notes](https://github.com/sindresorhus/is-svg/releases)
- [Commits](https://github.com/sindresorhus/is-svg/compare/v3.0.0...v4.1.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-15 12:41:31 -04:00
dependabot[bot]
765d6ddc23 Bump @babel/plugin-proposal-object-rest-spread from 7.3.4 to 7.4.3 (#3309)
Bumps [@babel/plugin-proposal-object-rest-spread](https://github.com/babel/babel) from 7.3.4 to 7.4.3.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.3.4...v7.4.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-15 08:22:35 -05:00
dependabot[bot]
ab08541b71 Bump @babel/polyfill from 7.2.5 to 7.4.3 (#3310)
Bumps [@babel/polyfill](https://github.com/babel/babel) from 7.2.5 to 7.4.3.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.2.5...v7.4.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-15 08:04:29 -05:00
dependabot[bot]
b7fb6ed853 Bump @babel/core from 7.4.0 to 7.4.3 (#3314)
Bumps [@babel/core](https://github.com/babel/babel) from 7.4.0 to 7.4.3.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.4.0...v7.4.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-15 07:50:48 -05:00
dependabot[bot]
de4a289cdf Bump eslint-plugin-import from 2.16.0 to 2.17.1 (#3313)
Bumps [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import) from 2.16.0 to 2.17.1.
- [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.16.0...v2.17.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-15 07:09:10 -05:00
dependabot[bot]
335fca170b Bump mocha from 6.1.1 to 6.1.3 (#3306)
Bumps [mocha](https://github.com/mochajs/mocha) from 6.1.1 to 6.1.3.
- [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/v6.1.1...v6.1.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-15 06:43:52 -05:00
Tesla_Ice_Zhang
e12e625141 Add pull request merge/open/closed badge (#3295) 2019-04-14 09:57:26 -05:00
Paul Melnikow
ab95e8415f Rewrite [GitHubForks] (#3299) 2019-04-13 20:12:31 -04:00
Paul Melnikow
11cd0bdbc5 Split up [codeclimate] tests (#3300)
* Split up [codeclimate] tests

* Fix copy-pasta
2019-04-13 18:47:59 -05:00
Paul Melnikow
d343fddb2c Rewrite [dynamicxml] tests, and fix issue with attribute filters (#3298)
This fixes queries with an attribute filter in the middle, such as //book[@id='bk102']/title.

Close #3089
2019-04-13 15:06:36 -04:00
Paul Melnikow
64b6e6c81c Bump anafanafo from 0.1.0 to 1.0.0 (#3296) 2019-04-13 12:47:44 -04:00
Eray Erdin
6935be5d50 [Jitpack] Added Downloads Badge (#3291)
* added jitpack downloads pack

* added jitpack downloads badge

* used isMetricOverTimePeriod in jitpack-downloads.tester
2019-04-12 08:09:56 -05:00
Paul Melnikow
2e1d47baed Prettier: Enforce standard line endings (#3293)
This requires lf (typical for git repos, Linux, Mac OS) rather than crlf (typical for Windows).
2019-04-11 20:23:40 -04:00
Paul Melnikow
4a85d08059 Prettier now has a --check option (#3292) 2019-04-11 18:55:30 -04:00
dependabot[bot]
f86dbb4fbf Bump tmp from 0.0.33 to 0.1.0 (#3283)
Bumps [tmp](https://github.com/raszi/node-tmp) from 0.0.33 to 0.1.0.
- [Release notes](https://github.com/raszi/node-tmp/releases)
- [Commits](https://github.com/raszi/node-tmp/compare/v0.0.33...v0.1.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-10 19:26:28 +01:00
dependabot[bot]
df406bf40d Bump decamelize from 3.1.1 to 3.2.0 (#3279)
Bumps [decamelize](https://github.com/sindresorhus/decamelize) from 3.1.1 to 3.2.0.
- [Release notes](https://github.com/sindresorhus/decamelize/releases)
- [Commits](https://github.com/sindresorhus/decamelize/compare/v3.1.1...v3.2.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-09 21:17:35 +01:00
dependabot[bot]
2f10f7d9c9 Bump js-yaml from 3.12.2 to 3.13.1 (#3277)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.12.2 to 3.13.1.
- [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.12.2...3.13.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-09 21:11:59 +01:00
dependabot[bot]
b6eae86e5b Bump query-string from 6.4.0 to 6.4.2 (#3280)
Bumps [query-string](https://github.com/sindresorhus/query-string) from 6.4.0 to 6.4.2.
- [Release notes](https://github.com/sindresorhus/query-string/releases)
- [Commits](https://github.com/sindresorhus/query-string/compare/v6.4.0...v6.4.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-09 21:05:39 +01:00
dependabot[bot]
efe41428fe Bump enzyme-adapter-react-16 from 1.9.1 to 1.12.1 (#3285)
Bumps [enzyme-adapter-react-16](https://github.com/airbnb/enzyme/tree/HEAD/packages/enzyme-adapter-react-16) from 1.9.1 to 1.12.1.
- [Release notes](https://github.com/airbnb/enzyme/releases)
- [Changelog](https://github.com/airbnb/enzyme/blob/master/CHANGELOG.md)
- [Commits](https://github.com/airbnb/enzyme/commits/enzyme-adapter-react-16@1.12.1/packages/enzyme-adapter-react-16)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-09 20:55:08 +01:00
dependabot[bot]
e73df6eda4 Bump fast-xml-parser from 3.12.13 to 3.12.16 (#3284)
Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 3.12.13 to 3.12.16.
- [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases)
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/commits/3.12.16)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-09 17:39:54 +02:00
dependabot[bot]
268abae623 Bump eslint-plugin-promise from 4.0.1 to 4.1.1 (#3281)
Bumps [eslint-plugin-promise](https://github.com/xjamundx/eslint-plugin-promise) from 4.0.1 to 4.1.1.
- [Release notes](https://github.com/xjamundx/eslint-plugin-promise/releases)
- [Changelog](https://github.com/xjamundx/eslint-plugin-promise/blob/master/CHANGELOG.md)
- [Commits](https://github.com/xjamundx/eslint-plugin-promise/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-09 07:35:16 -04:00
dependabot[bot]
8f845b6ef7 Bump babel-preset-gatsby from 0.1.8 to 0.1.11 (#3286)
Bumps babel-preset-gatsby from 0.1.8 to 0.1.11.

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-09 07:19:16 -04:00
Pierre-Yves B
fd5553b810 [Node] tests improvements (#3288) 2019-04-08 20:44:28 +01:00
dependabot[bot]
be65f6eaf6 Bump prom-client from 11.2.1 to 11.3.0 (#3287)
Bumps [prom-client](https://github.com/siimon/prom-client) from 11.2.1 to 11.3.0.
- [Release notes](https://github.com/siimon/prom-client/releases)
- [Changelog](https://github.com/siimon/prom-client/blob/master/CHANGELOG.md)
- [Commits](https://github.com/siimon/prom-client/compare/v11.2.1...v11.3.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-08 20:53:22 +02:00
dependabot[bot]
f831fc11d8 Bump mocha-junit-reporter from 1.18.0 to 1.21.0 (#3278)
Bumps [mocha-junit-reporter](https://github.com/michaelleeallen/mocha-junit-reporter) from 1.18.0 to 1.21.0.
- [Release notes](https://github.com/michaelleeallen/mocha-junit-reporter/releases)
- [Commits](https://github.com/michaelleeallen/mocha-junit-reporter/compare/v1.18.0...v1.21.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-08 06:44:10 -05:00
dependabot[bot]
fc0e456de2 Bump mocha from 6.0.2 to 6.1.1 (#3282)
Bumps [mocha](https://github.com/mochajs/mocha) from 6.0.2 to 6.1.1.
- [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/v6.0.2...v6.1.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-08 06:26:34 -05:00
Paul Melnikow
991d4a1cad Bump Danger (which now ships with Chainsmoker!) and some housekeeping (#3276)
See https://github.com/danger/danger-js/issues/431#issuecomment-480269809 and danger/danger-js#850
2019-04-07 14:06:22 -05:00
chris48s
83c3c70908 refactor [puppetforge] service, add tests (#3275)
This migrates the puppetforge-modules from legacy
services to the new service arch
There are also some changes to the puppetforge-users
badges, but its just moving code around
2019-04-07 19:35:30 +01:00
Pierre-Yves B
25f8541e5b JSON format modernisation and _shields_test removal (#3272)
* Modernised JSON format and removed _shields_test style

* Added logoWidth and labelColor fields to JSON response

* Reinstated and updated comment

* Extended expectBadge to accept Joi schemas for all fields
2019-04-07 18:57:55 +01:00
Caleb Cartwright
93333509c6 Fix [NpmDependencyVersion] (#3274)
* fix(NpmDependencyVersion): refs #3271

* refactor(NpmDependencyVersion): tweaked route based on PR feedback
2019-04-07 12:28:11 +01:00
Pierre-Yves B
167fb89ff0 Updated IcedFrisby version (#3270) 2019-04-05 21:57:08 +01:00
dependabot[bot]
18b3f97879 Bump react-dom from 16.8.5 to 16.8.6 (#3254)
Bumps [react-dom](https://github.com/facebook/react/tree/HEAD/packages/react-dom) from 16.8.5 to 16.8.6.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v16.8.6/packages/react-dom)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-05 17:58:11 +02:00
Marcin Mielnicki
9e3bc86a5e In CI, run e2e tests on the build (#3269)
* In CI, run e2e tests on the build

* Windows compatibility in "e2e-on-build" script

Co-Authored-By: platan <marcin.mielnicki@gmail.com>
2019-04-04 23:42:03 +02:00
dependabot[bot]
afec96c9cd Bump react-error-overlay from 5.1.3 to 5.1.4 (#3255)
Bumps [react-error-overlay](https://github.com/facebook/create-react-app) from 5.1.3 to 5.1.4.
- [Release notes](https://github.com/facebook/create-react-app/releases)
- [Changelog](https://github.com/facebook/create-react-app/blob/master/CHANGELOG-1.x.md)
- [Commits](https://github.com/facebook/create-react-app/compare/react-error-overlay@5.1.3...react-error-overlay@5.1.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-04 04:57:13 -07:00
dependabot[bot]
3929b5aad0 Bump @babel/register from 7.0.0 to 7.4.0 (#3248)
Bumps [@babel/register](https://github.com/babel/babel) from 7.0.0 to 7.4.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.0.0...v7.4.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-04 04:34:21 -07:00
dependabot[bot]
37bdc96ca7 Bump react-pose from 4.0.7 to 4.0.8 (#3252)
Bumps [react-pose](https://github.com/Popmotion/popmotion) from 4.0.7 to 4.0.8.
- [Release notes](https://github.com/Popmotion/popmotion/releases)
- [Commits](https://github.com/Popmotion/popmotion/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-04 04:29:33 -07:00
Paul Melnikow
766d55e001 [pypi] Improve formatting of trove-based licenses (#3265)
Currently the trove-based license classifiers generate different formatting than the legacy license classifiers. This brings them into alignment.
2019-04-04 04:22:47 -07:00
Denis Duliçi
48e454c63d Fixed GitHub release downloads, run [GithubDownloads] (#3256)
* fixed github release downloads

* npm run prettier code push.

* master package-lock.json file
2019-04-03 17:28:48 -05:00
Caleb Cartwright
7f24e93671 refactor [GithubIssueDetail] (#3259)
* refactor(GithubIssueDetail): ported to new service model

* refactor(GithubIssueDetail): updates based on PR discussions

* refactor(GithubIssueDetail): minor updates and additional tests

* refactor(GithubIssueDetail): minor updates to render functions per PR disc.
2019-04-03 11:59:49 -05:00
Caleb Cartwright
4b81f824d9 refactor(GithubIssues) (#3263) 2019-04-03 10:26:03 -05:00
dependabot[bot]
65487f5a57 Bump decamelize from 2.0.0 to 3.1.1 (#3247)
Bumps [decamelize](https://github.com/sindresorhus/decamelize) from 2.0.0 to 3.1.1.
- [Release notes](https://github.com/sindresorhus/decamelize/releases)
- [Commits](https://github.com/sindresorhus/decamelize/compare/v2.0.0...v3.1.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-02 17:23:59 -05:00
dependabot[bot]
9c858dafbe Bump dotenv from 6.2.0 to 7.0.0 (#3246)
Bumps [dotenv](https://github.com/motdotla/dotenv) from 6.2.0 to 7.0.0.
- [Release notes](https://github.com/motdotla/dotenv/releases)
- [Changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md)
- [Commits](https://github.com/motdotla/dotenv/compare/v6.2.0...v7.0.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-02 16:53:22 -05:00
Marcin Mielnicki
c81b482082 End to end tests (#3262)
* Frontend test using Cypress

* test:end-to-end script added

* cypress and eslint-plugin-cypress moved to dev dependencies

* Run end-to-end tests at CI using end2end script

* cypress/screenshots/ added to gitignore

* end2end job added

* Dedicated docker image for Cypress

* Store videos and screenshots

* Prepare and store junit report

* Use junit reporter

* Code refactoring

* Code refactoring

* Code refactoring

* lint-staged for json, md and yml files

* Format json config

* Assert that PyPI - License is displayed

* Do not create fixtures
2019-04-02 22:25:37 +02:00
dependabot[bot]
e701d36277 Bump semver from 5.6.0 to 6.0.0 (#3253)
Bumps [semver](https://github.com/npm/node-semver) from 5.6.0 to 6.0.0.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/master/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v5.6.0...v6.0.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-02 15:14:56 -05:00
dependabot[bot]
d8fef68628 Bump simple-icons from 1.9.23 to 1.9.24 (#3251)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 1.9.23 to 1.9.24.
- [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>
2019-04-02 08:39:11 -07:00
Caleb Cartwright
c2f44cc284 Fix [TeamCity] build (#3245)
Fix #3244

Updated schema validation on statusText field to account for additional text suffixes
2019-04-02 08:36:21 -07:00
dependabot[bot]
23538fe8d7 Bump sinon from 7.2.6 to 7.3.1 (#3249)
Bumps [sinon](https://github.com/sinonjs/sinon) from 7.2.6 to 7.3.1.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v7.2.6...v7.3.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-02 08:10:54 -07:00
Eray Erdin
c7b37a5de8 Fixed [Jitpack] Badges According to Shields Convention (#3257)
* added fixed jitpack badge

* removing accidental pasted file

* updated transformPath for jitpack-version-redirector service

* refactored jitpack.*.js to jitpack-version.*.js
2019-04-01 17:25:39 -05:00
dependabot[bot]
1421d3a950 Bump eslint from 5.15.3 to 5.16.0 (#3250)
Bumps [eslint](https://github.com/eslint/eslint) from 5.15.3 to 5.16.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.15.3...v5.16.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-01 09:12:01 -07:00
chris48s
a12ece3d7c refactor [twitter] service (#3241)
* refactor [twitter] service

* pass screen_names in options.qs
2019-03-31 14:00:37 -05:00
Caleb Cartwright
b03b644451 Fix [packagist] badges (#3239)
* fix(packagist): updated schema and version svc to resolve #3238

* refactor(packagist): multiple changes relative to #3238
2019-03-31 09:45:13 -05:00
James Cahill
f0e037e040 refactor [Packagist] service (#3004) 2019-03-27 17:59:41 -04:00
Paul Melnikow
bd92aef3bc Bump gatsby-plugin-page-creator (#3237)
Ref gatsbyjs/gatsby#11304

Fix #3209 Fix #3208
2019-03-27 16:55:14 -04:00
chris48s
96d416068c rewrite Github Languages, split into [githubcodesize githublanguagecount githubtoplanguage] (#3225) 2019-03-25 20:54:58 -04:00
dependabot[bot]
b269661333 Bump gatsby-plugin-styled-components from 3.0.6 to 3.0.7 (#3229)
Bumps [gatsby-plugin-styled-components](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-styled-components) from 3.0.6 to 3.0.7.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-styled-components/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/commits/gatsby-plugin-styled-components@3.0.7/packages/gatsby-plugin-styled-components)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-25 20:02:35 +00:00
dependabot[bot]
68df6a58ed Bump @babel/plugin-proposal-class-properties from 7.3.4 to 7.4.0 (#3226)
Bumps [@babel/plugin-proposal-class-properties](https://github.com/babel/babel) from 7.3.4 to 7.4.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.3.4...v7.4.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-25 19:46:05 +00:00
dependabot[bot]
8b463a03a4 Bump react from 16.8.3 to 16.8.5 (#3228)
Bumps [react](https://github.com/facebook/react/tree/HEAD/packages/react) from 16.8.3 to 16.8.5.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v16.8.5/packages/react)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-25 19:39:30 +00:00
dependabot[bot]
ae6fe1d4ca Bump @babel/core from 7.3.4 to 7.4.0 (#3232)
Bumps [@babel/core](https://github.com/babel/babel) from 7.3.4 to 7.4.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.3.4...v7.4.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-25 19:36:13 +00:00
dependabot[bot]
324eaf2ef2 Bump gatsby-plugin-remove-trailing-slashes from 2.0.7 to 2.0.10 (#3231)
Bumps [gatsby-plugin-remove-trailing-slashes](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-remove-trailing-slashes) from 2.0.7 to 2.0.10.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-remove-trailing-slashes/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/commits/gatsby-plugin-remove-trailing-slashes@2.0.10/packages/gatsby-plugin-remove-trailing-slashes)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-25 19:30:11 +00:00
dependabot[bot]
ff7c380eac Bump styled-components from 4.1.3 to 4.2.0 (#3235)
Bumps [styled-components](https://github.com/styled-components/styled-components) from 4.1.3 to 4.2.0.
- [Release notes](https://github.com/styled-components/styled-components/releases)
- [Changelog](https://github.com/styled-components/styled-components/blob/master/CHANGELOG.md)
- [Commits](https://github.com/styled-components/styled-components/compare/v4.1.3...styled-components@4.2.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-25 19:27:04 +00:00
dependabot[bot]
5762b5cfd5 Bump react-dom from 16.8.4 to 16.8.5 (#3230)
Bumps [react-dom](https://github.com/facebook/react/tree/HEAD/packages/react-dom) from 16.8.4 to 16.8.5.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v16.8.5/packages/react-dom)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-25 19:23:34 +00:00
dependabot[bot]
776cdbbfc7 Bump eslint-plugin-react-hooks from 1.5.1 to 1.6.0 (#3227)
Bumps [eslint-plugin-react-hooks](https://github.com/facebook/react/tree/HEAD/packages/eslint-plugin-react-hooks) from 1.5.1 to 1.6.0.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/HEAD/packages/eslint-plugin-react-hooks)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-25 19:19:00 +00:00
dependabot[bot]
7b221c1943 Bump mocha from 6.0.1 to 6.0.2 (#3234)
Bumps [mocha](https://github.com/mochajs/mocha) from 6.0.1 to 6.0.2.
- [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/v6.0.1...v6.0.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-25 19:16:04 +00:00
dependabot[bot]
cbbe06cb46 Bump eslint from 5.15.2 to 5.15.3 (#3233)
Bumps [eslint](https://github.com/eslint/eslint) from 5.15.2 to 5.15.3.
- [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.15.2...v5.15.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-25 19:11:26 +00:00
dependabot[bot]
4d40f44ded Bump @babel/plugin-proposal-class-properties from 7.3.3 to 7.3.4 (#3194)
Bumps [@babel/plugin-proposal-class-properties](https://github.com/babel/babel) from 7.3.3 to 7.3.4.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.3.3...v7.3.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-24 12:10:21 -04:00
chris48s
d59785b35d refactor [puppetforgeusers], add tests (#3224) 2019-03-24 11:55:28 -04:00
tooomm
4911e11584 add more helpful syntax links to dynamic badges (#3223) 2019-03-22 22:00:10 +00:00
chris48s
4f5268aa0f refactor [githubreleasedate] (#3206) 2019-03-18 17:36:17 -05:00
chris48s
5706b82f92 throw Deprecated() when [waffle] shuts down (#3219) 2019-03-18 17:29:34 -05:00
dependabot[bot]
e209db37e5 Bump gatsby-plugin-catch-links from 2.0.12 to 2.0.13 (#3214)
Bumps [gatsby-plugin-catch-links](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-catch-links) from 2.0.12 to 2.0.13.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-catch-links/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/commits/gatsby-plugin-catch-links@2.0.13/packages/gatsby-plugin-catch-links)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-18 21:39:09 +00:00
dependabot[bot]
70be83d250 Bump gatsby-plugin-react-helmet from 3.0.8 to 3.0.10 (#3211)
Bumps [gatsby-plugin-react-helmet](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-react-helmet) from 3.0.8 to 3.0.10.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-react-helmet/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/commits/gatsby-plugin-react-helmet@3.0.10/packages/gatsby-plugin-react-helmet)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-18 21:36:35 +00:00
dependabot[bot]
7f7f941d9c Bump react-select from 2.4.1 to 2.4.2 (#3217)
Bumps [react-select](https://github.com/JedWatson/react-select) from 2.4.1 to 2.4.2.
- [Release notes](https://github.com/JedWatson/react-select/releases)
- [Changelog](https://github.com/JedWatson/react-select/blob/master/.sweet-changelogs.js)
- [Commits](https://github.com/JedWatson/react-select/compare/v2.4.1...v2.4.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-18 21:29:16 +00:00
dependabot[bot]
85478b5e51 Bump query-string from 6.3.0 to 6.4.0 (#3213)
Bumps [query-string](https://github.com/sindresorhus/query-string) from 6.3.0 to 6.4.0.
- [Release notes](https://github.com/sindresorhus/query-string/releases)
- [Commits](https://github.com/sindresorhus/query-string/compare/v6.3.0...v6.4.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-18 21:23:36 +00:00
dependabot[bot]
c43f51d483 Bump gatsby-plugin-page-creator from 2.0.8 to 2.0.10 (#3216)
Bumps [gatsby-plugin-page-creator](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-page-creator) from 2.0.8 to 2.0.10.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-page-creator/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/commits/gatsby-plugin-page-creator@2.0.10/packages/gatsby-plugin-page-creator)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-18 21:13:09 +00:00
dependabot[bot]
2127a6934c Bump eslint-plugin-react-hooks from 1.2.0 to 1.5.1 (#3212)
Bumps [eslint-plugin-react-hooks](https://github.com/facebook/react/tree/HEAD/packages/eslint-plugin-react-hooks) from 1.2.0 to 1.5.1.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/HEAD/packages/eslint-plugin-react-hooks)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-18 21:05:39 +00:00
dependabot[bot]
6e5b5c2bcf Bump eslint from 5.14.1 to 5.15.2 (#3210)
Bumps [eslint](https://github.com/eslint/eslint) from 5.14.1 to 5.15.2.
- [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.14.1...v5.15.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-18 21:01:44 +00:00
dependabot[bot]
3559bff5aa Bump react-dom from 16.8.3 to 16.8.4 (#3191)
Bumps [react-dom](https://github.com/facebook/react/tree/HEAD/packages/react-dom) from 16.8.3 to 16.8.4.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v16.8.4/packages/react-dom)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-18 20:58:14 +00:00
dependabot[bot]
000053acf8 Bump danger from 7.0.14 to 7.0.15 (#3215)
Bumps [danger](https://github.com/danger/danger-js) from 7.0.14 to 7.0.15.
- [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/7.0.14...7.0.15)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-18 20:55:08 +00:00
Marcin Mielnicki
e43593e3bb OVH link fix (#3207) 2019-03-17 18:10:42 +01:00
chris48s
6e203d2455 refactor [githubreposize] (#3205) 2019-03-16 12:43:52 -05:00
Matthew Ratzke
f4ad1aa6fc fix [clojars] snapshot fallback (#3187)
* fix snapshot fallback

* fix prettier formatting

* update schema

* chore: test schema tweak

* fix schema

* Add allow null on schema
2019-03-14 20:27:54 -05:00
Paul Melnikow
2a9e1bbd83 Lengthen timeouts on [jsdelivr] tests (#3201)
These are failing pretty often in CI.
2019-03-13 10:05:24 -05:00
chris48s
2b29c226e0 refactor [githublastcommit] (#3199) 2019-03-13 00:17:39 -04:00
chris48s
9496b6d84c refactor [githubsize] (#3198) 2019-03-12 18:51:46 +00:00
dependabot[bot]
b0ff851e5c Bump simple-icons from 1.9.21 to 1.9.23 (#3193)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 1.9.21 to 1.9.23.
- [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>
2019-03-11 20:38:29 +00:00
dependabot[bot]
1316310503 Bump eslint-config-prettier from 4.0.0 to 4.1.0 (#3192)
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 4.0.0 to 4.1.0.
- [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/v4.0.0...v4.1.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-11 20:34:08 +00:00
dependabot[bot]
0cdb4319ff Bump lint-staged from 8.1.4 to 8.1.5 (#3195)
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 8.1.4 to 8.1.5.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Commits](https://github.com/okonet/lint-staged/compare/v8.1.4...v8.1.5)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-11 20:26:38 +00:00
Paul Melnikow
3733de6232 Rewrite GitHub commit status (#3186)
* WIP

* Parse the error response

* Clarify

* Restore one test

* Add a schema
2019-03-10 18:43:37 -05:00
Paul Melnikow
cbcf980182 Rewrite [website]; also affects [nodeping] (#3184) 2019-03-09 17:17:59 -05:00
Paul Melnikow
3baf0a8037 Rewrite [GithubCommitActivity] (#3183) 2019-03-08 18:39:11 -06:00
Caleb Cartwright
6e84e9b317 Refactor [Codecov] (#3074)
* feat: started refactoring codecov

* tests: removed erroneous test from draft PR

* chore: prettified for prettier

* feat: more codecov updates and tests

* feat: more codecov refactor updates

* feat: added codecov redirect content

* refactor: removed legacy codecov service file

* refactor(codecov): added redirect for legacy token route path

* docs(codecov): added documentation to examples for token info

* docs(codecov): updated vcs param in example patterns

* refactor(codecov): update redirect service date

Co-Authored-By: calebcartwright <calebcartwright@users.noreply.github.com>

* refactor(codecov): various updates based on PR feedback

* chore: added comment to codecov 401 test
2019-03-07 23:11:41 -06:00
Caleb Cartwright
3f4097b355 fix(maven-metadata): update schema to support single published versions (#3182) 2019-03-07 23:08:46 -06:00
Paul Melnikow
612831a2d8 Remove legacy analytics (#3179)
We're getting good results from #3093, so there's no reason to keep maintaining this code.

Ref #1848 #2068
2019-03-08 00:05:37 -05:00
Paul Melnikow
667bbbebfa Rewrite a bunch of components as functions, with consistent func style (#3177) 2019-03-08 00:02:23 -05:00
Paul Melnikow
b288c99a29 Fix console error before applying a frontend route redirect (#3176) 2019-03-07 19:34:27 -06:00
chris48s
3fc9b81ca8 allow numeric version for NuGet v2 services (#3181) 2019-03-07 20:13:22 +00:00
Paul Melnikow
5d42fe6858 Refactor two legacy services 😉 (#3175) 2019-03-06 23:34:30 -05:00
chris48s
4f9d44c33f refactor [chromewebstore] service (#3114) 2019-03-06 23:24:35 -05:00
Paul Melnikow
946abc9ded Refactor [librariesio] (#3160)
This takes another pass over the modern services to remove unused code. I switched the shared code to use a function instead of a class and removed the indirection in the route params which led to skew between the route and examples and wasn't making things any clearer.
2019-03-06 23:21:22 -05:00
Paul Melnikow
ace2a7a695 Tweak Docker initialization (#3173)
* Tweak Docker initialization

1. Set NODE_ENV=production in Docker.
2. When NODE_ENV is production, bind to all interfaces. This seems like a
   sensible default.
3. Exclude Dockerfile from container to improve layer cacheability when
   modifying the dockerfile.

Ref #3165

* Rm obsolete comment
2019-03-06 21:15:03 -06:00
Paul Melnikow
a6d02239f7 Document queryParams + rename example module (#3170)
This file does more than transform, and `examples` seems is a bit more consistent with e.g. `trace.js` and `route.js`.
2019-03-06 21:04:08 -06:00
Paul Melnikow
a12cbb76fc Prevent queryParams from reaching handle() when no schema is defined (#3171)
I believe I’ve added all the schemas to the new-style services in #3164, so this should be purely preventive.
2019-03-06 21:26:09 -05:00
Paul Melnikow
f5306f2df4 Appveyor example: improve doc formatting and invoke render() (#3172) 2019-03-06 21:23:28 -05:00
Paul Melnikow
be95faf347 Tweak examples for observatory, azure devops (#3169) 2019-03-06 19:55:42 -06:00
Paul Melnikow
388b0eefbb Add query param validation to remaining new-style services [azuredevops appveyor npm] (#3164)
Remove now-obsolete code.

Close #2675
2019-03-06 18:13:36 -05:00
dependabot[bot]
fb290d66f6 Bump gatsby-plugin-react-helmet from 3.0.6 to 3.0.8 (#3167)
Bumps [gatsby-plugin-react-helmet](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-react-helmet) from 3.0.6 to 3.0.8.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-react-helmet/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/commits/gatsby-plugin-react-helmet@3.0.8/packages/gatsby-plugin-react-helmet)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-06 19:34:12 +00:00
Caleb Cartwright
a41ec5a3e5 Refactor [waffle] (#3133)
* refactor(waffle)

* refactor(waffle): added joi schema

* tests(waffle): added unit tests for transform & render

* chore: added qs for waffle api call

* refactor(waffle): tweaked test names

* refactor(waffle): made label required param, added redirect for BC

* refactor(waffle): relax schema to handle missing colors and null labels

* chore: removed waffle label test no longer needed

* refactor(waffle): updated redirect service
2019-03-06 19:23:23 +00:00
chris48s
4908bc5b1a refactor [microbadger] service (#3143)
* refactor [microbadger] service

* account for missing size key
2019-03-06 09:37:24 +00:00
Paul Melnikow
4f411755da Add a stats category for static badges (#3168)
Right now they're showing up in "other," though I expect they make up
most of that category.

https://github.com/badges/shields/issues/966#issuecomment-469851361
2019-03-05 21:23:20 -06:00
Paul Melnikow
e159d90516 Reorganize a couple of the legacy helpers [npm node jenkinsplugin dynamic] (#3163) 2019-03-05 20:43:33 -06:00
Paul Melnikow
a801450dd6 Move deprecation helpers to services/ (#3162)
This is currently unused, though it seems fine to keep it around.
2019-03-05 20:32:41 -06:00
dependabot[bot]
0941b6c39c Bump gatsby-plugin-catch-links from 2.0.11 to 2.0.12 (#3151)
Bumps [gatsby-plugin-catch-links](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-catch-links) from 2.0.11 to 2.0.12.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-catch-links/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/commits/gatsby-plugin-catch-links@2.0.12/packages/gatsby-plugin-catch-links)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-05 20:21:35 +00:00
dependabot[bot]
39d5fceaba Bump camelcase from 5.0.0 to 5.2.0 (#3166)
Bumps [camelcase](https://github.com/sindresorhus/camelcase) from 5.0.0 to 5.2.0.
- [Release notes](https://github.com/sindresorhus/camelcase/releases)
- [Commits](https://github.com/sindresorhus/camelcase/compare/v5.0.0...v5.2.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-05 20:06:57 +00:00
dependabot[bot]
767626fbd5 Bump gatsby from 2.1.17 to 2.1.19 (#3153)
Bumps [gatsby](https://github.com/gatsbyjs/gatsby) from 2.1.17 to 2.1.19.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.1.17...gatsby@2.1.19)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-05 20:01:03 +00:00
Paul Melnikow
b7d632c6eb Make [AmoDownloads] test more reliable (#3159)
Close #3156
2019-03-04 23:52:27 -05:00
dependabot[bot]
136e174e35 Bump @babel/plugin-proposal-object-rest-spread from 7.3.2 to 7.3.4 (#3150)
Bumps [@babel/plugin-proposal-object-rest-spread](https://github.com/babel/babel) from 7.3.2 to 7.3.4.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.3.2...v7.3.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-04 23:37:24 -05:00
dependabot[bot]
ce4e3281ea Bump @babel/core from 7.3.3 to 7.3.4 (#3146)
Bumps [@babel/core](https://github.com/babel/babel) from 7.3.3 to 7.3.4.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.3.3...v7.3.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-04 23:33:14 -05:00
dependabot[bot]
4907cea8f5 Bump js-yaml from 3.12.1 to 3.12.2 (#3154)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.12.1 to 3.12.2.
- [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.12.1...3.12.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-04 23:28:31 -05:00
dependabot[bot]
5021bdd21d Bump sinon from 7.2.4 to 7.2.6 (#3148)
Bumps [sinon](https://github.com/sinonjs/sinon) from 7.2.4 to 7.2.6.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v7.2.4...v7.2.6)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-04 23:10:06 -05:00
Caleb Cartwright
c52ea44450 fix: GH followers example style (#3158) 2019-03-04 23:07:13 -05:00
Caleb Cartwright
33786fa891 refactor [GitHubFollowers] (#3157) 2019-03-04 22:49:55 -05:00
Ludovic Fernandez
df56ca81e2 feat: [DockerCloud] and automated. (#3139)
* feat: docker cloud build and automated.

* refactor: better title.

* refactor: better badge URL.

* refactor: applies review comments.

* Update services/docker/docker-cloud-common-fetch.js

Co-Authored-By: ldez <ldez@users.noreply.github.com>

* refactor: encode query parameters.
2019-03-04 20:05:50 -06:00
Matthew Ratzke
85658250b6 update [clojars] endpoint (#3128)
* refactor(sourceforge): ref. sourceforge and add folder test (#3127)

doc: updated tutorial links and code snippets (#3124)

Refactor [Coveralls] (#3130)

* refactor(coveralls)

* chore: added comment with link to api

* doc: updated coveralls api doc comment

* doc: updated coveralls api doc comment

update clojars endpoint

Updates clojars badge to use api endpoints

Added release endpoint which returns latest stable release

Updates version endpoint which will now also return snapshots if available or latest stable release

check for invalid version and update variable send to render

import InvalidResponse

update require

make pretty

switch to prettyMessage

remove metadata lines

initial base class

initial base class

update schema

update ClojarsDownloads base class

simplify version classes

remove transform from export

update schema

remove unused var

replace == with ===

remove extra line

fix versionColor ?

fix lint error

make pretty

refactor transform

refactor transform and update tests

add error messagest to download service

fix error messages

remove errorSchema, revert changes to tests

refactor schema

update ClojarsDownloads base class

simplify version classes

remove transform from export

remove unused var

fix lint error

make pretty

refactor transform and update tests

add error messagest to download service

fix error messages

remove errorSchema, revert changes to tests

refactor schema

* fix versionColor

* remove errorMessages

* change prettyMessge to string

* update service names and add api docs reference

* update shields url

* update service names for clarity

* rename service files for clarity

* remove transform

* remove InvalidResponse
2019-03-04 19:50:05 -06:00
Caleb Cartwright
f4b66062b4 Refactor [buildkite] (#3126) 2019-03-04 19:55:13 -05:00
dependabot[bot]
ec24efd2b1 Bump query-string from 6.2.0 to 6.3.0 (#3145)
Bumps [query-string](https://github.com/sindresorhus/query-string) from 6.2.0 to 6.3.0.
- [Release notes](https://github.com/sindresorhus/query-string/releases)
- [Commits](https://github.com/sindresorhus/query-string/compare/v6.2.0...v6.3.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-04 19:52:01 -05:00
Caleb Cartwright
879581466c Refactor [Codeship] (#3131) 2019-03-04 19:41:57 -05:00
dependabot[bot]
839d7c5825 Bump jsonpath from 1.0.0 to 1.0.1 (#3152)
Bumps [jsonpath](https://github.com/dchester/jsonpath) from 1.0.0 to 1.0.1.
- [Release notes](https://github.com/dchester/jsonpath/releases)
- [Commits](https://github.com/dchester/jsonpath/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-04 19:39:17 -05:00
Caleb Cartwright
726830f067 Add ability to transform query params in redirct service, run [Endpoint GitHubReleaseRedirect SensioLabs VSO] (#3125)
* feat(redirector): added transformQueryParams to redirector

* refactor: renamed to transformPath in redirector

* Rename targetUrl to targetPath

Co-Authored-By: calebcartwright <calebcartwright@users.noreply.github.com>

* feat(redirector): handle param conflicts
2019-03-04 18:11:37 -06:00
Paul Melnikow
c7deb5a0d1 First adoption of React hooks (#3096)
I did this as a warm-up to using [React hooks](https://reactjs.org/docs/hooks-intro.html), which provide a better way to accomplish stateful things and side effects using functional components. This allows all components to be written in the same style, improves testability, facilitates code reuse, etc.

There's [a intro here](https://reactjs.org/docs/hooks-intro.html) which links to [Dan's talk at React Conf](https://www.youtube.com/watch?time_continue=3599&v=dpw9EHDh2bM) which does a really good job of explaining why hooks are a good way to write components. He describes hooks as being the electrons and neutrons to components which are atoms. Low-level functionality which was always there in React, though not as accessibly or visibly.

This adds a lint rule that enforces "the rule of hooks" which says they have to be declared at the top level in the functional component.

I don't think this changeset does a fabulous job of showing off the improvements hooks allows, though I think it is still a good direction for this code.
2019-03-03 18:30:20 -05:00
Caleb Cartwright
1a6b32b49a Refactor [david] (#3135) 2019-03-03 20:19:27 +00:00
Caleb Cartwright
c009f3cf51 Refactor [continuousphp] (#3134) 2019-03-03 19:54:15 +00:00
chris48s
711c3044dc add schema for [bugzilla] service (#3142) 2019-03-03 19:46:25 +00:00
Caleb Cartwright
cc0f1fc6db Refactor [bundlephobia] (#3132) 2019-03-03 19:00:52 +00:00
Pierre-Yves B
eb453401e3 Updated remaining documentation (#3141) 2019-03-03 10:42:14 -06:00
Pierre-Yves B
96dfa5b085 Allowed expectBadge to be called with null color (#3137) 2019-03-02 23:26:10 +00:00
Caleb Cartwright
f6e061f150 Refactor [GitHubWatchers] (#3136) 2019-03-02 22:19:11 +00:00
Caleb Cartwright
cad3ea434f Refactor [Coveralls] (#3130)
* refactor(coveralls)

* chore: added comment with link to api

* doc: updated coveralls api doc comment

* doc: updated coveralls api doc comment
2019-03-02 10:48:38 +00:00
Caleb Cartwright
f0eac60191 doc: updated tutorial links and code snippets (#3124) 2019-03-01 16:00:18 -06:00
Caleb Cartwright
ee97de13f3 refactor(sourceforge): ref. sourceforge and add folder test (#3127) 2019-03-01 21:56:34 +00:00
Paul Melnikow
56e71d7c76 Label all deprecated services as such (#3120)
* Label all deprecated services as such

This will change

service_requests_total{category="other",family="cocoapods",service="cocoapods_apps"} 76

to

service_requests_total{category="other",family="cocoapods",service="deprecated_cocoapods_apps"} 76

* Fix tests
2019-02-28 18:22:28 -06:00
Paul Melnikow
97358c1399 Rewrite [GitHubStars] (#3119)
* Refactor [GithubStars]

* Add test of link array
2019-02-28 18:18:32 -06:00
Henry Poydar
513b69272e Update instructions for self-hosting Shields with Heroku (#3123) 2019-02-28 18:13:44 -06:00
Pierre-Yves B
1f29c22d3d Migrated most service tests to use new expectBadge (#3122) 2019-02-28 21:43:23 +00:00
XhmikosR
4e2d144f97 Fix footer links (#3121)
Fix discord footer link and remove trailing slash from repo URL
2019-02-28 11:55:38 -05:00
Paul Melnikow
b43c9c7c18 Refactor [bitrise] (#3117) 2019-02-27 23:21:11 -05:00
Paul Melnikow
fafb22efee Move "good" badge helpers from lib/ to services/ (#3101)
This moves a few helpers from `lib/` to `services/`:

build-status.js
build-status.spec.js
color-formatters.js
color-formatters.spec.js
contributor-count.js
licenses.js
licenses.spec.js
php-version.js
php-version.spec.js
text-formatters.js
text-formatters.spec.js
version.js
version.spec.js

And one from `lib/` to `core/`:

unhandled-rejection.spec.js

The diff is long, but the changes are straightforward.

Ref #2832
2019-02-27 20:47:46 -05:00
Paul Melnikow
8b2ecaefd1 Remove Heroku buildpack config; allow devDependencies to be pruned (#3115)
The buildpack config doesn't seem to be needed. This would affect review apps, staging, and self-hosting.

Also, devDependencies are installed by default during the build: https://devcenter.heroku.com/changelog-items/1376

By removing `NPM_CONFIG_PRODUCTION=false` we allow these to be pruned so they're kept out of the slug. This also has the advantage of creating a test environment in PRs where missing production dependencies will cause things to break. That'd be a good thing!
2019-02-27 19:08:19 -05:00
Paul Melnikow
dfc95ddd1a Add per-badge metrics for BaseService (#3093)
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.
2019-02-27 18:58:59 -05:00
dependabot[bot]
62a89fc834 Bump react from 16.8.2 to 16.8.3 (#3102)
Bumps [react](https://github.com/facebook/react/tree/HEAD/packages/react) from 16.8.2 to 16.8.3.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v16.8.3/packages/react)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-27 18:42:09 -05:00
dependabot[bot]
c050fc976f Bump babel-preset-gatsby from 0.1.7 to 0.1.8 (#3106)
Bumps babel-preset-gatsby from 0.1.7 to 0.1.8.

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-27 18:25:50 -05:00
dependabot[bot]
f3804a0764 Bump gatsby-plugin-page-creator from 2.0.7 to 2.0.8 (#3108)
Bumps gatsby-plugin-page-creator from 2.0.7 to 2.0.8.

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-27 18:22:32 -05:00
dependabot[bot]
94b150195e Bump mocha-env-reporter from 3.0.0 to 4.0.0 (#3078)
Bumps [mocha-env-reporter](https://github.com/wix/mocha-env-reporter) from 3.0.0 to 4.0.0.
- [Release notes](https://github.com/wix/mocha-env-reporter/releases)
- [Commits](https://github.com/wix/mocha-env-reporter/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-27 18:19:51 -05:00
Paul Melnikow
73d8156f44 Convert some format regexes to patterns (#3109) 2019-02-27 17:52:20 -05:00
Pierre-Yves B
81fbd4ed49 Introduced expectBadge helper (#3097) 2019-02-27 08:02:14 +00:00
Paul Melnikow
e4fe8c0c5f Rewrite [GithubSearch] (#3099) 2019-02-25 15:24:41 -05:00
chris48s
92039e413d add notes to logo docs about brand guidelines (#3088) 2019-02-25 20:02:07 +00:00
chris48s
c6ea546fab use caret for all gh-badges dependencies (#3110) 2019-02-25 19:56:24 +00:00
Paul Melnikow
b14fdd7fd7 Reorganize categories code (#3100)
Seems that the list of categories belongs with the services, while the
support code belongs with base service.

Ref #2832
2019-02-25 14:39:12 -05:00
Paul Melnikow
9fa9785568 Rewrite [GithubRelease] (#3098) 2019-02-25 14:33:52 -05:00
dependabot[bot]
95c11dd7ac Bump gatsby from 2.1.14 to 2.1.17 (#3105)
Bumps [gatsby](https://github.com/gatsbyjs/gatsby) from 2.1.14 to 2.1.17.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.1.14...gatsby@2.1.17)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-25 19:01:29 +00:00
dependabot[bot]
7217a7e3ba Bump simple-icons from 1.9.20 to 1.9.21 (#3107)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 1.9.20 to 1.9.21.
- [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>
2019-02-25 18:57:24 +00:00
dependabot[bot]
781c7b941e Bump danger from 7.0.13 to 7.0.14 (#3104)
Bumps [danger](https://github.com/danger/danger-js) from 7.0.13 to 7.0.14.
- [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/7.0.13...7.0.14)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-25 18:54:29 +00:00
Paul Melnikow
c7d707363c Refactor [luarocks] (#3094) 2019-02-24 16:11:17 -05:00
Paul Melnikow
f831fba4d4 Rewrite [GitHubLicense] (#3095) 2019-02-24 16:04:24 -05:00
Paul Melnikow
e3d115cf99 Rename maxAge to cacheSeconds (#3090)
Close #3069
2019-02-23 20:33:38 -05:00
chris48s
9ed78867f7 fix [amo] badges (#3083)
This switches to the new mozilla add-ons API.

It's not a completely like-for-like replacement. I was able to replicate the version, users and rating badges but we no longer have total download stats. We've got weekly downloads instead, so I've redirected `/d` to the new `/dw`

closes #3079
2019-02-23 20:11:11 -05:00
Paul Melnikow
8c244c2e40 Fix color overriding for legacy services (#3091)
While I was doing #3090 I realized the work in #3012 did not handle legacy services.

I tested this manually with `/librariesio/release/hex/phoenix.svg?color=blue` and it works.
2019-02-23 19:07:31 -05:00
dependabot[bot]
c3ecde05ee Bump react-dom from 16.8.2 to 16.8.3 (#3075)
Bumps [react-dom](https://github.com/facebook/react/tree/HEAD/packages/react-dom) from 16.8.2 to 16.8.3.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v16.8.3/packages/react-dom)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-23 15:43:48 -05:00
Paul Melnikow
751af4bb3a Remove unused package (#3087) 2019-02-23 15:40:48 -05:00
Paul Melnikow
a40093d4a1 Named logo should override logoSvg in [endpoint]; also test [static] (#3049)
Fix #2998
2019-02-23 15:37:37 -05:00
Paul Melnikow
09e902fa38 Add frontend prop-type validation for the service definition schema (#3063)
Closes #2702
2019-02-23 15:34:49 -05:00
chris48s
7d1d74cfcf refactor [maven-metadata] service (#3085) 2019-02-23 15:29:46 -05:00
Paul Melnikow
6684f4b566 Remove unused version helper (#3086) 2019-02-23 15:20:34 -05:00
chris48s
912d2018f9 refactor chef [cookbook] service (#3084) 2019-02-23 15:12:13 -05:00
dependabot[bot]
6b7561b150 Bump gatsby from 2.1.13 to 2.1.14 (#3076)
Bumps [gatsby](https://github.com/gatsbyjs/gatsby) from 2.1.13 to 2.1.14.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.1.13...gatsby@2.1.14)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-22 22:07:17 +00:00
dependabot[bot]
f98484f8e7 Bump danger from 7.0.12 to 7.0.13 (#3070)
Bumps [danger](https://github.com/danger/danger-js) from 7.0.12 to 7.0.13.
- [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/7.0.12...7.0.13)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-22 22:04:39 +00:00
dependabot[bot]
a46df6b347 Bump mocha from 6.0.0 to 6.0.1 (#3077)
Bumps [mocha](https://github.com/mochajs/mocha) from 6.0.0 to 6.0.1.
- [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/v6.0.0...v6.0.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-22 10:57:55 -05:00
Paul Melnikow
cd49bda968 Improve coverage in frontend and remove some dead code (#3031) 2019-02-22 00:08:11 -05:00
dependabot[bot]
a9ed1e144e Bump gatsby-plugin-page-creator from 2.0.6 to 2.0.7 (#3060)
Bumps gatsby-plugin-page-creator from 2.0.6 to 2.0.7.

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-22 00:04:55 -05:00
Paul Melnikow
ab18bc0f09 Shorten [endpoint] URL (#3050)
Ref https://github.com/badges/shields/issues/2838#issuecomment-461794344
2019-02-22 00:01:56 -05:00
Paul Melnikow
4bd16f93e8 Sort imports and requires (#3056)
This will definitely save time, and ensure more uniformity.

It moves the `createServiceTester()` calls to a different place from where I'd like them, though I'm happy to have them checked by the linter.

Closes #2701
2019-02-21 22:14:40 -05:00
mbarkhau
f6628e62b7 [QueryStringStatic] service (#3024)
Ref #2673
2019-02-21 21:12:24 -05:00
Paul Melnikow
9e4a8cec09 Consolidate badge URL generation functions (#3032)
This consolidates all the badge URL generation functions into a single place, and updates the rest of the calling code to use it. It renames some things and updates labels to bring the names into alignment with the current API.

Resolve #2027
2019-02-21 21:07:27 -05:00
Danial
f550f0cc4d Update Travis logo, Reduce some duplication (#3047)
Switch Travis to use full-color logo approved at https://github.com/badges/shields/pull/1276#issuecomment-466164851
2019-02-21 20:29:23 -05:00
dependabot[bot]
41fc3bbbf8 Bump icedfrisby from 2.0.0-alpha.3 to 2.0.0-alpha.4 (#3073)
Bumps [icedfrisby](https://github.com/RobertHerhold/IcedFrisby) from 2.0.0-alpha.3 to 2.0.0-alpha.4.
- [Release notes](https://github.com/RobertHerhold/IcedFrisby/releases)
- [Changelog](https://github.com/IcedFrisby/IcedFrisby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/RobertHerhold/IcedFrisby/compare/2.0.0-alpha.3...2.0.0-alpha.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-21 00:45:51 -05:00
Paul Melnikow
33aefcfaf8 Minor cleanup related to colorB -> color (#3066)
As `color` is now the canonical, it makes sense to update some of these tests to say `colorB` instead.

Ref #3012
2019-02-20 23:34:22 -05:00
Paul Melnikow
2d7be31b0c Validate query params in BaseService (#3042)
This is a mid-sized PR that adds query param validation to BaseService and updates most of the services which use query param validation to use it. There are a couple minor tweaks I made along the way.

Fix #2676
2019-02-20 22:24:47 -05:00
dependabot[bot]
52a71cb327 Bump gatsby from 2.1.4 to 2.1.13 (#3067)
Bumps [gatsby](https://github.com/gatsbyjs/gatsby) from 2.1.4 to 2.1.13.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.1.4...gatsby@2.1.13)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-20 19:15:55 -05:00
dependabot[bot]
d49ce75fee Bump gatsby-plugin-styled-components from 3.0.5 to 3.0.6 (#3064)
Bumps [gatsby-plugin-styled-components](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-styled-components) from 3.0.5 to 3.0.6.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-styled-components/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/commits/gatsby-plugin-styled-components@3.0.6/packages/gatsby-plugin-styled-components)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-20 19:08:09 -05:00
Paul Melnikow
5fda6ac11e Alphabetize JSX props in the frontend (#3055)
I'm game to give this a shot.

Ref #2701
2019-02-20 18:58:24 -05:00
Paul Melnikow
c770a43dd8 Move flip cache debug service into [debug] (#3057)
Close #2636
2019-02-20 18:43:27 -05:00
Caleb Cartwright
a4bd3f5fd6 Add SymfonyInsight stars badge, run [SymfonyInsight sensiolabs amo chrome-web-store redmine spigetratings vaadin-directory visualstudiomarketplacerating wordpress] (#2971)
* feat: added stars badge for symfony insight

* refactor: changed symfony star determination logic

* feat: updating symfony to handle old scan scenarios

* feat: updated symfony insight to handle older projects

* tests: removed another test for symfony insight per request
2019-02-20 17:15:31 -06:00
Caleb Cartwright
96d48dc486 chore: make mocha rc configs dotfiles (#3065)
Fixes #3054 

Apparently mocha 6's new auto-config discovery only works with dotfiles. This renames our mocha rc files accordingly: `mocharc.yml` --> `.mocharc.yml` and solely to be consistent `mocharc-frontend.yml` --> ` .mocharc-frontend.yml`

- https://github.com/mochajs/mocha/blob/master/lib/cli/config.js#L23
- https://mochajs.org/#configuring-mocha-nodejs
- https://github.com/mochajs/mocha/blob/master/CHANGELOG.md#tada-enhancements-1
2019-02-20 18:05:14 -05:00
Paul Melnikow
bc523e3aae Fix your-badge link (#3058)
Fix #1954
2019-02-20 16:34:50 -05:00
Paul Melnikow
84db9e6fe3 Remove IP filtering code for prometheus metrics (#3059)
Closes #2657
2019-02-20 18:38:16 +00:00
Pierre-Yves B
27696d4691 Require constructors to be called with new (#3052) 2019-02-20 09:49:42 +00:00
dependabot[bot]
144d1632f5 Bump icedfrisby from 2.0.0-alpha.2 to 2.0.0-alpha.3 (#3061)
Bumps [icedfrisby](https://github.com/RobertHerhold/IcedFrisby) from 2.0.0-alpha.2 to 2.0.0-alpha.3.
- [Release notes](https://github.com/RobertHerhold/IcedFrisby/releases)
- [Changelog](https://github.com/IcedFrisby/IcedFrisby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/RobertHerhold/IcedFrisby/compare/2.0.0-alpha.2...2.0.0-alpha.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-20 01:21:28 -05:00
dependabot[bot]
f754b1ac2e Bump @babel/plugin-proposal-class-properties from 7.3.0 to 7.3.3 (#3018)
Bumps [@babel/plugin-proposal-class-properties](https://github.com/babel/babel) from 7.3.0 to 7.3.3.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.3.0...v7.3.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-19 23:48:16 -05:00
dependabot[bot]
77ef526997 Bump react-select from 2.3.0 to 2.4.1 (#3043)
Bumps [react-select](https://github.com/JedWatson/react-select) from 2.3.0 to 2.4.1.
- [Release notes](https://github.com/JedWatson/react-select/releases)
- [Changelog](https://github.com/JedWatson/react-select/blob/master/.sweet-changelogs.js)
- [Commits](https://github.com/JedWatson/react-select/compare/v2.3.0...v2.4.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-19 23:45:50 -05:00
Paul Melnikow
a30c833989 Use drop-down for [jsdelivr] and make badges more consistent with other download badges (#3036)
- Move to Downloads
- Use `downloadCount`
- Remove “hits” from the message
- "package name" for better appearance in the UI
- Simplify validation
2019-02-19 23:43:29 -05:00
dependabot[bot]
049a5409df Bump @babel/core from 7.2.2 to 7.3.3 (#3021)
Bumps [@babel/core](https://github.com/babel/babel) from 7.2.2 to 7.3.3.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.2.2...v7.3.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-19 22:21:10 -05:00
chris48s
6d4b80f124 improve docs for simple-icons usage (#3007)
Closes #2980
2019-02-19 22:14:19 -05:00
mbarkhau
6e2992a3e3 Rename colorB -> color; colorA -> labelColor (#3012)
This makes it possible to override the parameters `color` and `labelColor`.

ref #2673
2019-02-19 22:03:45 -05:00
dependabot[bot]
f721eb7424 Bump sinon from 7.2.3 to 7.2.4 (#3044)
Bumps [sinon](https://github.com/sinonjs/sinon) from 7.2.3 to 7.2.4.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v7.2.3...v7.2.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-19 21:44:17 +00:00
dependabot[bot]
cc57d32227 Bump danger from 7.0.11 to 7.0.12 (#3023)
Bumps [danger](https://github.com/danger/danger-js) from 7.0.11 to 7.0.12.
- [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/7.0.11...7.0.12)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-19 21:41:44 +00:00
dependabot[bot]
d727986f5a Bump lint-staged from 8.1.3 to 8.1.4 (#3016)
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 8.1.3 to 8.1.4.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Commits](https://github.com/okonet/lint-staged/compare/v8.1.3...v8.1.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-19 21:36:09 +00:00
dependabot[bot]
471e53afc9 Bump simple-icons from 1.9.19 to 1.9.20 (#3045)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 1.9.19 to 1.9.20.
- [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>
2019-02-19 20:12:57 +00:00
dependabot[bot]
42683a0587 Bump enzyme from 3.8.0 to 3.9.0 (#3046)
Bumps [enzyme](https://github.com/airbnb/enzyme/tree/HEAD/packages/enzyme) from 3.8.0 to 3.9.0.
- [Release notes](https://github.com/airbnb/enzyme/releases)
- [Changelog](https://github.com/airbnb/enzyme/blob/master/CHANGELOG.md)
- [Commits](https://github.com/airbnb/enzyme/compare/enzyme@3.8.0...enzyme@3.9.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-19 09:58:26 -05:00
Ville Skyttä
4611ba155f Fall back to grabbing version from "X :: Only" PyPI classifiers (#3014)
If e.g. `3 :: Only` alone is specified in PyPI classifiers, use the `3` from it. But keep ignoring `* :: Only` when it occurs with other specified versions.
2019-02-19 09:49:53 -05:00
Danial
c2c27ea795 TypeError: s.toLowerCase is not a function (#2997)
* Update color.js

* fixup

* expand test

* expand test (again)
2019-02-19 07:52:37 +00:00
dependabot[bot]
0e56258ac0 Bump eslint from 5.13.0 to 5.14.1 (#3039)
Bumps [eslint](https://github.com/eslint/eslint) from 5.13.0 to 5.14.1.
- [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.13.0...v5.14.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-18 23:09:22 -05:00
Paul Melnikow
24bc7bcfc3 Combine some badge examples using drop-downs, tweak some titles (#3037)
This updates several badges to take advantage of the change from #2882.
2019-02-18 23:04:25 -05:00
Paul Melnikow
ed7aa31808 Test transformExample directly (#3041)
These tests in `base.spec.js` are difficult to maintain.
2019-02-18 21:45:05 -05:00
Pierre-Yves B
e9f8700607 Fix [GithubManifest] and [GithubPackageJson] when static auth is not configured (#3035)
* Fixed fetchJsonFromRepo function when static auth is not configured

* Removed redundant await
2019-02-18 20:02:52 -06:00
Paul Melnikow
ad81f3c6ec Improve handling of some edge cases and get 100% coverage in generate-image-markup (#3030) 2019-02-18 19:25:02 -06:00
Paul Melnikow
1b2b556ca8 Upgrade to Mocha 6 and update configuration (#3038) 2019-02-18 19:03:49 -06:00
Paul Melnikow
0013641fdd Tweak [maintenance] badge in UI; remove caching (#3040) 2019-02-18 18:54:27 -06:00
dependabot[bot]
b1afccdce9 Bump react from 16.8.1 to 16.8.2 (#3022)
Bumps [react](https://github.com/facebook/react/tree/HEAD/packages/react) from 16.8.1 to 16.8.2.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/compare/v16.8.1...v16.8.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-18 19:22:20 -05:00
dependabot[bot]
ad6f8a07f9 Bump eslint from 5.13.0 to 5.14.0 (#3020)
Bumps [eslint](https://github.com/eslint/eslint) from 5.13.0 to 5.14.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.13.0...v5.14.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-18 19:16:43 -05:00
dependabot[bot]
f8a48457fb Bump gatsby from 2.1.2 to 2.1.4 (#3019)
Bumps [gatsby](https://github.com/gatsbyjs/gatsby) from 2.1.2 to 2.1.4.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-18 19:14:04 -05:00
Paul Melnikow
d2861b2438 Switch to npm ci (#3034) 2019-02-18 17:28:09 -06:00
Paul Melnikow
0506a1762b Omit style=flat from generated URLs (#3025)
Fix #2953
2019-02-18 18:01:44 -05:00
dependabot[bot]
c45aa48a98 Bump react-error-overlay from 5.1.2 to 5.1.3 (#2975)
Bumps [react-error-overlay](https://github.com/facebook/create-react-app) from 5.1.2 to 5.1.3.
- [Release notes](https://github.com/facebook/create-react-app/releases)
- [Changelog](https://github.com/facebook/create-react-app/blob/master/CHANGELOG-1.x.md)
- [Commits](https://github.com/facebook/create-react-app/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-18 17:03:13 -05:00
Paul Melnikow
0f22c0af25 Store the deprecation date inline (#3029) 2019-02-18 16:59:08 -05:00
dependabot[bot]
fb21fdf8f7 Bump babel-plugin-istanbul from 5.1.0 to 5.1.1 (#3017)
Bumps [babel-plugin-istanbul](https://github.com/istanbuljs/babel-plugin-istanbul) from 5.1.0 to 5.1.1.
- [Release notes](https://github.com/istanbuljs/babel-plugin-istanbul/releases)
- [Changelog](https://github.com/istanbuljs/babel-plugin-istanbul/blob/master/CHANGELOG.md)
- [Commits](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v5.1.0...v5.1.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-18 11:18:50 -05:00
Paul Melnikow
d9d8a3b227 Drop-downs for multiple choice in patterns (#2882)
You can see it in effect on the PyPI downloads and the David badges.
2019-02-18 11:15:58 -05:00
Yves M
ee1a3564f0 Add Mozilla HTTP Observatory badge [MozillaObservatory] (#2935)
* Begin adding a Mozilla Observatory badge (#2912)

* Update tests to add `_shields_test` style

* Add grade D and E tests

* Use Shields color scheme

See https://github.com/badges/shields/issues/2912#issuecomment-461692102

Resolves https://github.com/badges/shields/pull/2935#pullrequestreview-201432260

* Fix grade response validation regex

A bit related to https://github.com/badges/shields/pull/2935#pullrequestreview-201430779

* Add the host query param via `qs`

Resolves https://github.com/badges/shields/pull/2935#pullrequestreview-201431030

* Make integration test on `observatory.mozilla.org`

- Use `observatory.mozilla.org` instead of `httpforever.com` which redirects to `observatory.mozilla.org` anyway
- Use Joi to validate response

* Define label using `defaultBadgeData`

Resolves https://github.com/badges/shields/pull/2935#pullrequestreview-201431659

* Use short hand `createServiceTester` function helper in tests

Resolves https://github.com/badges/shields/pull/2935#pullrequestreview-201431898

* Make strict API response validation

See https://github.com/badges/shields/pull/2935#discussion_r255097377

* Use the `POST` API endpoint to trigger new scan

See https://github.com/badges/shields/issues/2912#issuecomment-462064216

* Handle unfinished states

See https://github.com/badges/shields/issues/2912#issuecomment-462064216

* Split in two separate badges, with and without score

See https://github.com/badges/shields/issues/2912#issuecomment-461692102

* Add a `publish` parameter to include the result in public list

See https://github.com/badges/shields/issues/2912#issuecomment-461764463

* Add documentation

* Update tester importer

* Remove redundant example keywords

Resolves https://github.com/badges/shields/pull/2935#discussion_r257086115

* Minor doc update

* Embed `which` parameter in examples

* Remove root path from pattern in examples

Resolves https://github.com/badges/shields/pull/2935#pullrequestreview-204582763 and https://github.com/badges/shields/pull/2935#pullrequestreview-204582728

* Pass missing `which` parameter to render in examples

Resolves https://github.com/badges/shields/pull/2935#discussion_r257525827
2019-02-18 10:11:44 -06:00
dependabot[bot]
c93f254315 Bump react-dom from 16.8.1 to 16.8.2 (#2999)
Bumps [react-dom](https://github.com/facebook/react) from 16.8.1 to 16.8.2.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/compare/v16.8.1...v16.8.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-18 10:45:49 -05:00
chris48s
332e9fd6b7 refactor [bugzilla] service (#3008) 2019-02-17 22:55:31 -05:00
chris48s
0b73b1d734 refactor [discourse] service (#3010) 2019-02-17 21:57:44 +00:00
chris48s
0da1bb2b08 fix asciiDoc links (#3006) 2019-02-17 21:55:22 +00:00
Ville Skyttä
0d4a74bd6b Spelling fixes (#3013) 2019-02-17 14:10:06 -05:00
chris48s
21612dd003 refactor [homebrew] service (#3009) 2019-02-17 17:25:31 +00:00
dependabot[bot]
8d9fa3e121 Bump nyc from 13.2.0 to 13.3.0 (#3000)
Bumps [nyc](https://github.com/istanbuljs/nyc) from 13.2.0 to 13.3.0.
- [Release notes](https://github.com/istanbuljs/nyc/releases)
- [Changelog](https://github.com/istanbuljs/nyc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/istanbuljs/nyc/compare/v13.2.0...v13.3.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-17 12:25:27 +00:00
dependabot[bot]
e6ef4c012c Bump snap-shot-it from 6.2.9 to 6.2.10 (#3002)
Bumps [snap-shot-it](https://github.com/bahmutov/snap-shot-it) from 6.2.9 to 6.2.10.
- [Release notes](https://github.com/bahmutov/snap-shot-it/releases)
- [Commits](https://github.com/bahmutov/snap-shot-it/compare/v6.2.9...v6.2.10)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-17 12:21:05 +00:00
dependabot[bot]
37ecb936fc Bump gatsby from 2.1.0 to 2.1.2 (#3001)
Bumps [gatsby](https://github.com/gatsbyjs/gatsby) from 2.1.0 to 2.1.2.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-17 12:18:02 +00:00
James Cahill
08bf7f02e4 refactor maintenance service (#3005) 2019-02-17 12:03:31 +00:00
Skyper
6bfa9b1b41 Add badges for [Keybase] (#2969)
* Add Keybase PGP badge

* Return 'not found' if the key is not present

* Change the default colour

* Add more constraints to the schema

* Render 64-bit fingerprints

* Add example

* Add a 'hex()' constraint to the fingerprint

* Improve error handling

* Add class 'KeybaseProfile'

* Add unit tests for Keybase PGP

* Add Keybase BTC

* Add unit tests for Keybase BTC

* Add Keybase ZEC

* Add unit tests for Keybase ZEC

* Add Keybase XLM

* Add unit tests for Keybase XLM

* Validate the BTC address using a regex

Regex taken from
https://mokagio.github.io/tech-journal/2014/11/21/regex-bitcoin.html.

* Exclude 'not found' from addresses' value in unit tests

* Remove useless keywords

* Add the link to the Keybase API documentation

* Move the colour into 'defaultBadgeData'

* Remove the HTTP method

'GET' is already the default one.

* Improve the error handling for Keybase BTC

* Add more constraints to the Keybase BTC schema

* Update one unit test for Keybase BTC

* Fix the error handling for Keybase BTC

* Add more unit tests for Keybase BTC

* Improve the error handling for Keybase ZEC

* Improve the error handling for Keybase PGP

* Improve the error handling for Keybase XLM

* Display a real username value in the examples

* Include the status code in the schemas

* Move the category to the base class

The same category is used by all badges.

* Add function 'transform' to the base class

The function 'transform' is used to encapsulate the error handling logic
as it is the same in each service.
2019-02-15 11:33:06 -06:00
Paul Melnikow
90f8ad5b73 Endpoint customizer (#2908)
* Endpoint page: improve formatting

Cherry-picked from #2906 (conflicts with that)

Partly addresses #2837 but does not resolve it

* Add badge customizer to the endpoint page

* Clean lint
2019-02-14 19:08:56 -06:00
dependabot[bot]
24945adfed [Security] Bump handlebars from 4.0.12 to 4.1.0 (#2992)
Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.0.12 to 4.1.0. **This update includes security fixes.**
- [Release notes](https://github.com/wycats/handlebars.js/releases)
- [Changelog](https://github.com/wycats/handlebars.js/blob/v4.1.0/release-notes.md)
- [Commits](https://github.com/wycats/handlebars.js/compare/v4.0.12...v4.1.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-14 20:36:00 +00:00
dependabot[bot]
5c44cf5d23 Bump prop-types from 15.7.1 to 15.7.2 (#2993)
Bumps [prop-types](https://github.com/facebook/prop-types) from 15.7.1 to 15.7.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/compare/v15.7.1...v15.7.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-14 20:31:35 +00:00
dependabot[bot]
74b7bba79e Bump eslint-plugin-mocha from 5.2.1 to 5.3.0 (#2994)
Bumps [eslint-plugin-mocha](https://github.com/lo1tuma/eslint-plugin-mocha) from 5.2.1 to 5.3.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.2.1...5.3.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-14 20:24:45 +00:00
Paul Melnikow
951aa0f9ea Tweak [spiget] badges (#2989)
1. Move tested server version to platform support, tweak description
2. Make version label consistent with others
3. Avoid setting category or defaultBadgeData in abstract base class
2019-02-13 21:06:31 +00:00
dependabot[bot]
c8d49d702a Bump gatsby from 2.0.118 to 2.1.0 (#2990)
Bumps [gatsby](https://github.com/gatsbyjs/gatsby) from 2.0.118 to 2.1.0.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-13 20:59:28 +00:00
dependabot[bot]
0284697ffe Bump react-pose from 4.0.6 to 4.0.7 (#2985)
Bumps [react-pose](https://github.com/Popmotion/popmotion) from 4.0.6 to 4.0.7.
- [Release notes](https://github.com/Popmotion/popmotion/releases)
- [Commits](https://github.com/Popmotion/popmotion/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-13 20:56:16 +00:00
dependabot[bot]
3acef2fb2e Bump danger from 7.0.10 to 7.0.11 (#2984)
Bumps [danger](https://github.com/danger/danger-js) from 7.0.10 to 7.0.11.
- [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/7.0.10...7.0.11)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-13 20:49:33 +00:00
dependabot[bot]
5d7bfe7d0b Bump gatsby-plugin-catch-links from 2.0.10 to 2.0.11 (#2983)
Bumps [gatsby-plugin-catch-links](https://github.com/gatsbyjs/gatsby) from 2.0.10 to 2.0.11.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-13 20:47:15 +00:00
Pierre-Yves B
bc96f0e25f Example keywords validation (#2956)
This pull request closes #2551: making sure that the keywords don't already appear in the example's title.

I also added validation that checks that they are at least two characters long, as this is enforced by the homepage when type your search.
2019-02-13 13:14:12 -04:00
Paul Melnikow
28948925c2 Remove unused parameter in [jsdelivr] (#2988)
`headers` is not destructured; it needs to go in `options`.

`Shields.io` is set as the `User-Agent` by code in `legacy-request-handler.js`.
2019-02-13 10:53:48 -06:00
Hugo van Rijswijk
56d374a467 Allow plus in semver [Nexus aur bintray chocolatey dubversion myget nuget powershellgallery resharper] (#2987)
* Also allow + in semver

* Add test for + in semver version

* Add more dashes to test version

* Fix tests
2019-02-13 10:50:21 -06:00
chris48s
b87d67bb18 refactor [cocoapods] service (#2977)
* refactor [cocoapods] service

* remove pointless default

* move join to render()
2019-02-12 20:14:36 -06:00
James Cahill
e1a50a7246 [jsDelivr] badges (#2970) 2019-02-12 19:45:18 +00:00
dependabot[bot]
6e36e52084 Bump danger from 7.0.9 to 7.0.10 (#2976)
Bumps [danger](https://github.com/danger/danger-js) from 7.0.9 to 7.0.10.
- [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/7.0.9...7.0.10)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-11 20:43:46 +00:00
dependabot[bot]
969ad81e05 Bump fast-xml-parser from 3.12.12 to 3.12.13 (#2974)
Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 3.12.12 to 3.12.13.
- [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases)
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-11 20:41:00 +00:00
dependabot[bot]
5aa63c1f3f Bump walkdir from 0.2.0 to 0.3.2 (#2960)
Bumps [walkdir](https://github.com/soldair/node-walkdir) from 0.2.0 to 0.3.2.
- [Release notes](https://github.com/soldair/node-walkdir/releases)
- [Changelog](https://github.com/soldair/node-walkdir/blob/master/CHANGELOG.md)
- [Commits](https://github.com/soldair/node-walkdir/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-11 20:37:26 +00:00
dependabot[bot]
3cfb4b2fa8 Bump prop-types from 15.6.2 to 15.7.1 (#2973)
Bumps [prop-types](https://github.com/facebook/prop-types) from 15.6.2 to 15.7.1.
- [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/compare/v15.6.2...v15.7.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-11 20:34:40 +00:00
chris48s
93a209f8a4 refactor [amo] service (#2972)
* refactor [amo] service

* change colour
2019-02-10 15:42:35 -06:00
Paul Melnikow
725ffca2d1 Add some more perfunctory coverage of the frontend (#2962) 2019-02-10 20:34:17 +00:00
dependabot[bot]
1379ea3980 Bump danger from 7.0.7 to 7.0.9 (#2961)
Bumps [danger](https://github.com/danger/danger-js) from 7.0.7 to 7.0.9.
- [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/7.0.7...7.0.9)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-10 11:41:34 +00:00
Caleb Cartwright
9b4fec0d2e Restored coverity service (#2967) 2019-02-10 11:39:12 +00:00
Paul Melnikow
dfb8d0392c Update coverage ignores (#2966)
* Update coverage ignores

* Add one removed by mistake

* Clean diff

* chore: minor coverage update
2019-02-09 16:18:00 -06:00
Paul Melnikow
5f2ab77319 Add some coverage to BaseService, export directly, improve an error message (#2963) 2019-02-09 15:46:11 -06:00
Caleb Cartwright
8d94c25c8a Update build status list (#2965)
Fixes #2848 

Appveyor briefly has a status of `starting` before the job begins, so adding `starting` to the list of `otherStatuses` to prevent the Appveyor badges from showing `invalid response data` during that window
2019-02-09 15:43:08 -06:00
Paul Melnikow
dbe5eb8346 Some cleanup in [bower] (#2959)
* Some cleanup in [bower]

* More fixes
2019-02-08 17:38:13 -06:00
dependabot[bot]
e800d48e70 Bump gatsby from 2.0.115 to 2.0.116 (#2947)
* Bump gatsby from 2.0.115 to 2.0.116

Bumps [gatsby](https://github.com/gatsbyjs/gatsby) from 2.0.115 to 2.0.116.
- [Release notes](https://github.com/gatsbyjs/gatsby/releases)
- [Changelog](https://github.com/gatsbyjs/gatsby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gatsbyjs/gatsby/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Reset package-lock

* Update lockfile

* caret to tilde for gatsby

* Why stop there

* Bump to 2.0.117

* Bump to 2.0.118 which fixes the issue
2019-02-08 13:31:43 -06:00
Owen Voke
5702ac470e Add badge for the [HSTS] preload list (#2926)
As per #2913, this PR adds a new badge for the [HSTS preload][hsts] list.

Badges will use the format `/hsts/preload/:domain.svg` (e.g. `/hsts/preload/github.com.svg`)

Closes #2913 

[hsts]: https://hstspreload.org
2019-02-08 07:59:42 -05:00
Paul Melnikow
1486fd2fca Redirect from alias to canonical URL [azuredevops vso] (#2939)
As described in #2340, this provides a way to replace an old alias with a redirect. This makes it easier to migrate our URLs over time without making our matching patterns more complicated.

The 301 redirect is sent back to the requester. If a user pastes the aliased URL into the address bar, it'll be replaced in the browser with the new URL, which gently encourages them to migrate.

Close #2340
2019-02-08 01:07:50 -05:00
Paul Melnikow
4d45fe3ea0 Make [wercker] no builds terminology consistent with other badges (#2957)
This makes the "no builds" state pass `isBuildStatus`, which is what fixes the failing tests:

https://circleci.com/gh/badges/daily-tests/138
2019-02-08 00:52:20 -05:00
Paul Melnikow
8c478d0e0a Use normalized colors to fix [dynamic matrix nexus] service tests (#2958) 2019-02-08 00:49:27 -05:00
Paul Melnikow
ae37e9b723 Add a diagnostic page for testing logos (#2890)
It can be helpful to have some diagnostic pages for development and quality control. I added one here for the logos, which renders all the named logos in ?style=flat and ?style=social.
2019-02-08 00:08:45 -05:00
Andrew Marcuse
c46d2f9dae [NodePing] support for NodePing uptime monitoring service (#2910)
* [NodePing] support for NodePing uptime monitoring service

* NodePing test tweaks
2019-02-07 20:24:40 -06:00
Paul Melnikow
2ee1327eed Refactor the NuGet v2 badges; switch Resharper to XML (#2934)
This closes #2921 by switching ReSharper to the XML API used by Powershell, and refactors the powershell code back into the common nuget v2 service class. It also removes mocked tests of the color logic, replacing them with smaller-bracket tests that accomplish the same thing more concisely.
2019-02-07 21:14:04 -05:00
dependabot[bot]
49ee68fcb3 Bump babel-preset-gatsby from 0.1.6 to 0.1.7 (#2949)
Bumps babel-preset-gatsby from 0.1.6 to 0.1.7.

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-07 20:11:04 -05:00
dependabot[bot]
310bfba542 Bump react from 16.7.0 to 16.8.1 (#2950)
* Bump react from 16.7.0 to 16.8.1

Bumps [react](https://github.com/facebook/react) from 16.7.0 to 16.8.1.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/compare/v16.7.0...v16.8.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Update lockfile
2019-02-07 19:46:10 -05:00
dependabot[bot]
f963fa4421 Bump walkdir from 0.0.12 to 0.2.0 (#2948)
Bumps [walkdir](https://github.com/soldair/node-walkdir) from 0.0.12 to 0.2.0.
- [Release notes](https://github.com/soldair/node-walkdir/releases)
- [Changelog](https://github.com/soldair/node-walkdir/blob/master/CHANGELOG.md)
- [Commits](https://github.com/soldair/node-walkdir/commits/v0.2.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-07 19:38:31 -05:00
dependabot[bot]
568d687fa6 Bump react-dom from 16.7.0 to 16.8.1 (#2946)
Bumps [react-dom](https://github.com/facebook/react) from 16.7.0 to 16.8.1.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/compare/v16.7.0...v16.8.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-07 19:35:44 -05:00
dependabot[bot]
de916536e4 [Security] Bump lodash from 4.17.10 to 4.17.11 (#2954)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.10 to 4.17.11. **This update includes security fixes.**
- [Release notes](https://github.com/lodash/lodash/releases)
- [Changelog](https://github.com/lodash/lodash/blob/master/CHANGELOG)
- [Commits](https://github.com/lodash/lodash/compare/4.17.10...4.17.11)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-07 19:19:08 +00:00
Owen Voke
dd6ee70802 Update from RawGit to local path (#2952) 2019-02-07 12:44:51 -05:00
Paul Melnikow
9070570a39 Update deploy script for Gatsby deploy (#2944)
Knock on wood, that deploy went remarkably well. 👔
2019-02-07 00:59:33 -05:00
Paul Melnikow
da5fd26847 Readme: Repair link to logo (#2945) 2019-02-06 19:15:16 -06:00
Paul Melnikow
d8ce045ead Adopt Gatsby (#2906)
While Next.js can handle static sites, we've had a few issues with it, notably a performance hit at runtime and some bugginess around routing and SSR. Gatsby being fully intended for high-performance static sites makes it a great technical fit for the Shields frontend. The `createPages()` API should be a really nice way to add a page for each service family, for example.

This migrates the frontend from Next.js to Gatsby. Gatsby is a powerful tool, which has a bit of downside as there's a lot to dig through. Overall I found configuration easier than Next.js. There are a lot of plugins and for the most part they worked out of the box. The documentation is good.

Links are cleaner now: there is no #. This will break old links though perhaps we could add some redirection to help with that. The only one I’m really concerned about `/#/endpoint`. I’m not sure if folks are deep-linking to the category pages.

There are a lot of enhancements we could add, in order to speed up the site even more. In particular we could think about inlining the SVGs rather than making separate requests for each one.

While Gatsby recommends GraphQL, it's not required. To keep things simple and reduce the learning curve, I did not use it here.

Close #1943 
Fix #2837 Fix #2616
2019-02-06 16:37:55 -05:00
Philip Harrison
cf7b76d5a6 Update Dependabot logo (#2931)
* Update dependabot logo
* update tests
2019-02-06 21:33:40 +00:00
chris48s
7953a97e1d refactor [jitpack] service (#2943) 2019-02-06 16:11:46 -05:00
chris48s
4a8a1f20ef refactor [pub] service (#2942) 2019-02-06 16:07:06 -05:00
dependabot[bot]
44c891a3be Bump enzyme-adapter-react-16 from 1.9.0 to 1.9.1 (#2941)
Bumps [enzyme-adapter-react-16](https://github.com/airbnb/enzyme) from 1.9.0 to 1.9.1.
- [Release notes](https://github.com/airbnb/enzyme/releases)
- [Changelog](https://github.com/airbnb/enzyme/blob/master/CHANGELOG.md)
- [Commits](https://github.com/airbnb/enzyme/compare/enzyme-adapter-utils@1.9.0...enzyme-adapter-utils@1.9.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-06 00:47:45 -05:00
Caleb Cartwright
aa105e4a6c tests: update teamcity test targets (#2940) 2019-02-05 21:39:54 -06:00
Caleb Cartwright
855c9cd261 Remove dev dep imports in production code (#2937)
Fixes #2876 with @paulmelnikow's suggestion 

Moved imports of `ServiceTester` and `createServiceTester` to a separate file so that dev dependencies are not imported by service classes.
2019-02-05 21:51:55 -05:00
Paul Melnikow
cdeba2fdf9 Fix some service tests [circle dependabot githubissues] (#2936) 2019-02-05 21:49:40 -05:00
Paul Melnikow
84e5d58d9b Add CLI for debugging badges (#2930)
Often when responding to bug reports it would be helpful to easily run an example failing badge URL. It takes a while to do that, because you have to copy and paste just the right part of the badge URL. This works on `img.shields.io` links as well as partial paths and should make this really easy. 💨
2019-02-05 21:47:30 -05:00
Paul Melnikow
e083dd3ce5 deprecatedService: rename url to route for consistency; test on [versioneye] (#2938) 2019-02-05 21:37:00 -05:00
dependabot[bot]
023588bbc2 Bump nyc from 13.1.0 to 13.2.0 (#2923)
Bumps [nyc](https://github.com/istanbuljs/nyc) from 13.1.0 to 13.2.0.
- [Release notes](https://github.com/istanbuljs/nyc/releases)
- [Changelog](https://github.com/istanbuljs/nyc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/istanbuljs/nyc/compare/v13.1.0...v13.2.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-05 17:47:34 -05:00
dependabot[bot]
e383c0e36c Bump @babel/plugin-proposal-object-rest-spread from 7.3.1 to 7.3.2 (#2925)
Bumps [@babel/plugin-proposal-object-rest-spread](https://github.com/babel/babel) from 7.3.1 to 7.3.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.3.1...v7.3.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-05 17:40:08 -05:00
Pierre-Yves B
b6c2f166f5 Fixed Jacoco example (#2933)
This small pull request closes #2648. The previous project targeted by the example no longer seems to be using the Jacoco plugin, so I've hunted down another one:
https://img.shields.io/jenkins/j/https/builds.apache.org/job/Derby-JaCoCo.svg 
![](https://img.shields.io/jenkins/j/https/builds.apache.org/job/Derby-JaCoCo.svg)
2019-02-05 17:38:00 -05:00
dependabot[bot]
652e960204 Bump enzyme-adapter-react-16 from 1.8.0 to 1.9.0 (#2922)
Bumps [enzyme-adapter-react-16](https://github.com/airbnb/enzyme) from 1.8.0 to 1.9.0.
- [Release notes](https://github.com/airbnb/enzyme/releases)
- [Changelog](https://github.com/airbnb/enzyme/blob/master/CHANGELOG.md)
- [Commits](https://github.com/airbnb/enzyme/compare/enzyme-adapter-utils@1.8.0...enzyme-adapter-utils@1.9.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-05 17:31:52 -05:00
Paul Melnikow
ef5c36dcb4 Remove some obsolete .networkOff() tests (#2932) 2019-02-05 21:23:24 +00:00
dependabot[bot]
3b8fb49aac Bump nock from 11.0.0-beta.5 to 11.0.0-beta.6 (#2924)
Bumps [nock](https://github.com/nock/nock) from 11.0.0-beta.5 to 11.0.0-beta.6.
- [Release notes](https://github.com/nock/nock/releases)
- [Changelog](https://github.com/nock/nock/blob/beta/CHANGELOG.md)
- [Commits](https://github.com/nock/nock/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-05 10:08:17 -05:00
Pierre-Yves B
ea833a83c4 [GitHubCommitActivity] improvements and examples (#2920) 2019-02-04 20:27:52 -05:00
chris48s
566a8cb461 delete LGTM logo (#2919) 2019-02-04 21:13:32 +00:00
Paul Melnikow
552e5e798d Add semantic color keywords and improve formatting of color examples (#2869)
* Add semantic color keywords

This is based on the list I proposed at https://github.com/badges/shields/issues/1522#issuecomment-456455618. As I started documenting `default` I realized it didn't feel quite right. It's not semantic in relation to the content the way the others are, and it's also not the default left color. I changed it to `disabled` which isn't perfect, but seems better. I'm open to other suggestions.

I updated the documentation but the colors won't render correctly until this is deployed

Close #1522

* Reformat the aliases

* Pretty up the docs

* Reset whitespace changes

* Clean lint
2019-02-04 15:05:57 -06:00
dependabot[bot]
6179090a96 Bump lint-staged from 8.1.1 to 8.1.3 (#2918)
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 8.1.1 to 8.1.3.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Commits](https://github.com/okonet/lint-staged/compare/v8.1.1...v8.1.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-04 20:59:07 +00:00
dependabot[bot]
26f3881e7c Bump danger from 7.0.4 to 7.0.7 (#2917)
Bumps [danger](https://github.com/danger/danger-js) from 7.0.4 to 7.0.7.
- [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/7.0.4...7.0.7)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-04 20:57:18 +00:00
dependabot[bot]
4d9a1967dd Bump eslint from 5.12.1 to 5.13.0 (#2914)
Bumps [eslint](https://github.com/eslint/eslint) from 5.12.1 to 5.13.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.12.1...v5.13.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-04 20:54:27 +00:00
dependabot[bot]
e3b6f06e08 Bump prettier from 1.16.3 to 1.16.4 (#2916)
Bumps [prettier](https://github.com/prettier/prettier) from 1.16.3 to 1.16.4.
- [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.16.3...1.16.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-04 20:49:13 +00:00
dependabot[bot]
006cc92729 Bump simple-icons from 1.9.18 to 1.9.19 (#2915)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 1.9.18 to 1.9.19.
- [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>
2019-02-04 20:16:27 +00:00
Paul Melnikow
7c3bca1ab7 Refactor endpoint functions (#2909) 2019-02-03 17:29:52 -05:00
dependabot[bot]
a72a36d1fc Bump lint-staged from 8.1.0 to 8.1.1 (#2892)
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 8.1.0 to 8.1.1.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Commits](https://github.com/okonet/lint-staged/compare/v8.1.0...v8.1.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-03 10:54:18 +00:00
dependabot[bot]
2895cf5761 Bump danger from 7.0.2 to 7.0.4 (#2884)
Bumps [danger](https://github.com/danger/danger-js) from 7.0.2 to 7.0.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/7.0.2...7.0.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-03 10:52:11 +00:00
Paul Melnikow
b01e466284 Endpoint page: improve formatting (#2907)
Partly addresses #2837 but does not resolve it
2019-02-02 14:10:52 -05:00
dependabot[bot]
89ee5d1cb1 Bump prettier from 1.16.1 to 1.16.3 (#2902)
Bumps [prettier](https://github.com/prettier/prettier) from 1.16.1 to 1.16.3.
- [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.16.1...1.16.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-01 17:20:14 -05:00
Paul Melnikow
3a7bddbc26 Consolidate service definition schema, removing support for previewUrl (#2895)
This removes `LONG_CACHE` and its descendants, which was a feature that added `?maxAge` to the live preview badges in the frontend. Since they are all static that is no longer needed, as the static badges all have longer cache timeouts regardless.
2019-01-30 18:35:11 -06:00
Paul Melnikow
7955f460f3 Move suggest code and rewrite tests (#2886)
The suggest code was an exception to our usual organization pattern. There was a service test, but it's not a service. The code would sometimes regress because it wasn't being tested all the time.

This makes them no longer run as service tests, which is good because they run as part of every build. Some of them are smaller-bracket tests which is good too, because it will make them easier to test, especially as this code grows.

I'd have liked to keep using frisby for the ones that make requests to the server, though I ran into some issues with sequencing of setup that I think will require upstream changes.
2019-01-30 17:48:54 -06:00
Paul Melnikow
f32306d982 Update production DNS access doc (#2899)
* Update production DNS access doc

Thanks @olivierlacan!

* Add link to DNS registrar

* Updates
2019-01-30 17:41:44 -06:00
Paul Melnikow
085c43d42d Remove unused dependencies (#2900) 2019-01-30 17:38:18 -06:00
Paul Melnikow
4fc31cfff9 Add timeouts to some flaky tests (#2896)
* Add timeouts to some flaky tests

* tests: increased timeouts on snyk tests
2019-01-30 17:35:40 -06:00
Olivier Lacan
5af5c480db Fix typos and clarify non-promotional (#2898)
Just noticed this typo and that one of the essential parts of the specification 
could be worded more clearly. It seems like the hardest to enforce with SaaS 
companies, so I don't think the explicitness will hurt.
2019-01-30 16:08:50 -05:00
dependabot[bot]
1a5336385c Bump eslint-plugin-import from 2.15.0 to 2.16.0 (#2897)
Bumps [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import) from 2.15.0 to 2.16.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.15.0...v2.16.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-30 10:43:52 -06:00
Paul Melnikow
eef3d36f52 Convert remaining preview URLs (#2887)
Close #1961
2019-01-29 21:13:15 -06:00
dependabot[bot]
27b053284e Bump snap-shot-it from 6.2.8 to 6.2.9 (#2885)
Bumps [snap-shot-it](https://github.com/bahmutov/snap-shot-it) from 6.2.8 to 6.2.9.
- [Release notes](https://github.com/bahmutov/snap-shot-it/releases)
- [Commits](https://github.com/bahmutov/snap-shot-it/compare/v6.2.8...v6.2.9)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-29 19:37:33 -06:00
Paul Melnikow
027cb4fe31 Fix [conda] service tests and rm some obsolete tests (#2894)
Ref https://circleci.com/gh/badges/daily-tests/119
2019-01-29 19:31:45 -06:00
James Cahill
57badc337a Refactor [lgtm] to new service model and static previews (#2753) 2019-01-29 16:10:47 -06:00
chris48s
a47fb2895d update logo guidance (#2888)
Ref #2510
2019-01-29 15:29:51 -06:00
chris48s
daa06c2026 don't apply logoColor param to multi-coloured logos (#2889)
This stops us from doing this:

![](https://img.shields.io/badge/logo-npm-blue.svg?logo=npm&logoColor=green) - https://img.shields.io/badge/logo-npm-blue.svg?logo=npm&logoColor=green
but still allows us to do this
![](https://img.shields.io/badge/logo-discord-blue.svg?logo=discord&logoColor=green) - https://img.shields.io/badge/logo-discord-blue.svg?logo=discord&logoColor=green
2019-01-29 15:22:28 -06:00
dependabot[bot]
efdb9f3e51 Bump eslint-config-prettier from 3.6.0 to 4.0.0 (#2883)
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 3.6.0 to 4.0.0.
- [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/v3.6.0...v4.0.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-29 11:54:35 -06:00
Paul Melnikow
5b122ddd73 Social badge support for static previews (#2871)
The static previews don't support the social badges. Adding that lets us remove support for `exampleUrl`. Close #2479.

This includes `style` and `namedLogo` in the service-definition export and updates the frontend to use it. To accomplish this, it passes `namedLogo` through `coalesceBadge`. After logo resolution is moved to `makeBadge` this duplication can be removed, as `logo` will no longer be needed in the result of `coalesceBadge`.
2019-01-28 22:44:25 -06:00
Paul Melnikow
e10e8b1b6d Code walkthrough (#2877)
Updated based on comments received in the Google Doc.

Close #2684
2019-01-28 15:03:05 -06:00
chris48s
a9d6809e3f refactor [liberapay] service (#2879) 2019-01-28 20:57:11 +00:00
Paul Melnikow
97e2ec1e60 Refactor [GemDownloads] for readability; improve error messages (#2870)
Close #1960
2019-01-28 11:53:53 -06:00
chris48s
212ac47ec0 refactor [hackage] service (#2878) 2019-01-27 20:32:58 -06:00
chris48s
3e34d98e41 replace telegram logo (#2880) 2019-01-27 18:29:47 +00:00
chris48s
1822a3adfb more icon changes (#2872)
* delete scrutinizer logo
* optimise superuser logo
2019-01-27 18:27:27 +00:00
chris48s
64b8f6ec15 optimise logos (#2873) 2019-01-27 12:55:03 +00:00
chris48s
29379014fe optimise discord logo, change default colour (#2874) 2019-01-26 17:53:23 +00:00
Paul Melnikow
47e8cc3de3 Refactor route functions in BaseService (#2860)
The route helper functions are fairly well isolated from the rest of BaseService, with a few convenient entry points. They are easier to test in isolation.

The way the code was written before, `pathToRegexp` was invoked once for every request, which seems inefficient.

`route` was validated when it was used, though it seems more helpful to validate it up front.

This breaks out `_makeFullUrl`, `_regex`, `_regexFromPath` into new helper functions `makeFullUrl`, `assertValidRoute`, `prepareRoute`, and `namedParamsForMatch`.

It adds validation to route, and updates the services without patterns to include one, in order to pass the new validation rules.
2019-01-26 02:38:12 -05:00
chris48s
bf5438f457 Delete some of our logos (part 1) (#2857)
Refs #2510

I'm going to delete or change some more logos in a further PR or two, but lets start off with the (hopefully) non-controversial ones. I think in all of these cases it is fairly clear-cut that we are not losing anything by removing our icon in favour of simple-icons now that we apply a sensible colour by default.
2019-01-25 12:51:41 -05:00
dependabot[bot]
8777ba1cb1 Bump enzyme-adapter-react-16 from 1.7.1 to 1.8.0 (#2864)
Bumps [enzyme-adapter-react-16](https://github.com/airbnb/enzyme) from 1.7.1 to 1.8.0.
- [Release notes](https://github.com/airbnb/enzyme/releases)
- [Changelog](https://github.com/airbnb/enzyme/blob/master/CHANGELOG.md)
- [Commits](https://github.com/airbnb/enzyme/commits/enzyme-adapter-utils@1.8.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-25 12:33:23 -05:00
dependabot[bot]
b77e2421e3 Bump nock from 11.0.0-beta.4 to 11.0.0-beta.5 (#2865)
Bumps [nock](https://github.com/nock/nock) from 11.0.0-beta.4 to 11.0.0-beta.5.
- [Release notes](https://github.com/nock/nock/releases)
- [Changelog](https://github.com/nock/nock/blob/beta/CHANGELOG.md)
- [Commits](https://github.com/nock/nock/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-25 12:12:20 -05:00
Paul Melnikow
be7cb93773 Refactor service loader (#2861)
This moves the loader code into `core/base-service`, leaving behind in `services/index.js` only the convenience imports.

Ref #2832
2019-01-24 22:55:10 -05:00
Paul Melnikow
23fe3927b2 Refactor _makeBadgeData -> coalesceBadge (#2859)
`base.js` is pretty long and `_makeBadgeData` is one of the most complex
functions in it.

It's a pure function so it's easy to test in isolation. This moves the function into its own module and reorganizes the tests in a way that makes it evaluate what it's doing, and easier to test what is and isn't covered.

Ref https://github.com/badges/shields/pull/2796#discussion_r249251008
2019-01-24 22:48:45 -05:00
dependabot[bot]
2db22abd11 Bump @babel/plugin-proposal-object-rest-spread from 7.3.0 to 7.3.1 (#2853)
Bumps [@babel/plugin-proposal-object-rest-spread](https://github.com/babel/babel) from 7.3.0 to 7.3.1.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.3.0...v7.3.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-24 20:49:58 +00:00
dependabot[bot]
e718ecaeb0 Bump bytes from 3.0.0 to 3.1.0 (#2851)
Bumps [bytes](https://github.com/visionmedia/bytes.js) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/visionmedia/bytes.js/releases)
- [Changelog](https://github.com/visionmedia/bytes.js/blob/master/History.md)
- [Commits](https://github.com/visionmedia/bytes.js/compare/3.0.0...3.1.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-24 20:46:46 +00:00
dependabot[bot]
9cb399a8dc Bump eslint-plugin-import from 2.14.0 to 2.15.0 (#2852)
Bumps [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import) from 2.14.0 to 2.15.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.14.0...v2.15.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-24 01:00:24 -05:00
dependabot[bot]
d03faaa7bb Bump @babel/plugin-proposal-class-properties from 7.2.3 to 7.3.0 (#2841)
Bumps [@babel/plugin-proposal-class-properties](https://github.com/babel/babel) from 7.2.3 to 7.3.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.2.3...v7.3.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-24 00:57:54 -05:00
dependabot[bot]
8c4c5ed6bd Bump @babel/preset-env from 7.2.3 to 7.3.1 (#2843)
Bumps [@babel/preset-env](https://github.com/babel/babel) from 7.2.3 to 7.3.1.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.2.3...v7.3.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-24 00:56:02 -05:00
dependabot[bot]
1cc7be7989 Bump moment from 2.23.0 to 2.24.0 (#2839)
Bumps [moment](https://github.com/moment/moment) from 2.23.0 to 2.24.0.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.23.0...2.24.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-23 21:54:48 -05:00
Caleb Cartwright
8e41e95a4e Update [VisualStudioMarketplace] download calculation for Azure DevOps Extensions (#2748)
* feat: udpate vs marketplace download counts to handle azure devops scenario

* chore: added documentation info to download badge for AzureDevOps on VS Marketplace

* refactor: updated VS Marketplace Downloads badge to better cover Azure DevOps extensions

* feat: added separate service for ADO extension install badges

* refactor: simplifying vs marketplace statistics transform

* refactor: finished refactoring VS Marketplace services

* docs: added inline comment on VS Marketplace service base

* Tweak docs

* refactor: tweaked validation for VS Marketplace response

* chore: added todo in VS Marketplace base

* Tweak comment

* refactor: VS Marketplace base validation cleanup

* refactor: moved rating precision in VS Marketplace
2019-01-23 18:14:26 -06:00
Paul Melnikow
4e9763b4c3 Provide friendlier error messages for [endpoint] (#2858)
Ref https://github.com/badges/shields/issues/2838#issuecomment-456594803
2019-01-23 18:43:38 -05:00
chris48s
a8bedce8a4 clarify cache docs for endpoint badge (#2855) 2019-01-23 22:02:43 +00:00
chris48s
7e473fe72c pre-compute the 3 most common icon styles on server init (#2856)
refs #2833 (comment)
2019-01-23 16:41:10 -05:00
chris48s
eaa64a8dab automatically show light or dark logos when using simple-icons (#2833)
closes #2431
refs #2510
2019-01-23 14:42:08 -05:00
dependabot[bot]
1ac208e656 Bump react-pose from 4.0.5 to 4.0.6 (#2850)
Bumps [react-pose](https://github.com/Popmotion/popmotion) from 4.0.5 to 4.0.6.
- [Release notes](https://github.com/Popmotion/popmotion/releases)
- [Commits](https://github.com/Popmotion/popmotion/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-23 11:01:08 -05:00
dependabot[bot]
b1b92b6654 Bump prettier from 1.16.0 to 1.16.1 (#2849)
Bumps [prettier](https://github.com/prettier/prettier) from 1.16.0 to 1.16.1.
- [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.16.0...1.16.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-23 10:26:58 -05:00
Paul Melnikow
fc12b591db Reorganize BaseService-related modules (#2831)
Ref #2698
2019-01-22 23:52:13 -05:00
Paul Melnikow
bbc10c5a68 Remove unused TokenProvider code (#2844)
The TokenProvider abstraction was refactored away during #1205 and is now obsolete. Other users of token pooling should use TokenPool and TokenPersistence directly.
2019-01-22 21:39:04 -05:00
dependabot[bot]
cd89a4db9e Bump @babel/plugin-proposal-object-rest-spread from 7.2.0 to 7.3.0 (#2842)
Bumps [@babel/plugin-proposal-object-rest-spread](https://github.com/babel/babel) from 7.2.0 to 7.3.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.2.0...v7.3.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-22 08:46:42 -05:00
Paul Melnikow
c7844ca7bb Fix a preview badge (#2836) 2019-01-21 23:04:52 -05:00
Paul Melnikow
0fc3df84d7 [Endpoint] badge (#2473)
This reimplements the idea @bkdotcom came up with in #1519, and took a stab at in #1525. It’s a really powerful way to add all sorts of custom badges, particularly considering [tools like RunKit endpoints and Jupyter Kernel Gateway](https://github.com/badges/shields/issues/2259#issuecomment-444186589), not to mention all the other ways cloud functions can be deployed these days.
2019-01-21 22:55:24 -05:00
Paul Melnikow
6a17210850 Fix production crash (#2835)
`ShieldsRuntimeError` is in `services/errors.js` but not `services/index.js`. Oops!

Close #2834
2019-01-21 22:41:50 -05:00
Paul Melnikow
aac2a4d5ad Move legacy request helpers (#2829)
In #2698 we decided to put legacy helper functions in `core/legacy`. I think that’s a fine idea, though if we’re going to have a bunch of badge helper functions in there, it seems like it is probably better to keep these two important but esoteric helper functions with the core code to which they are most coupled. So I added `legacy-` to the name, and put them in `core/base-service`.
2019-01-21 22:14:22 -05:00
Paul Melnikow
eb390a30c9 Fix Redis integration tests in CI; change 10 to latest (#2830)
* Fix Redis integration tests in CI

* 10 to latest
2019-01-21 15:20:42 -06:00
Paul Melnikow
62810143ac Move coalesce and validate (#2828)
Ref #2698
2019-01-21 16:11:23 -05:00
Paul Melnikow
b13834037f Split integration tests into their own stage (#2825)
These tests fail more often than others, and it's inconvenient to hold up merging when the changes are unrelated.
2019-01-21 15:51:54 -05:00
Paul Melnikow
226fa67a02 Create shortcut for BaseService-related imports (#2809)
Continue to implement #2698:

- Add `core/base-service/index.js` (but hold off on moving the things it imports)
- Add shortcuts in `services/index.js` for Base*Service, errors, and deprecatedService. This file will be streamlined later to avoid cluttering it with rarely used bits.
- Apply consistent ordering of imports and use of `module.exports` in testers.
- Remove some renaming of imports.
- Remove obsolete tests here and there.
2019-01-21 15:41:24 -05:00
Paul Melnikow
8dc8afeb55 Avoid func declarations using function keyword (#2813)
We had only a few function expressions declared with the function keyword; almost everything is using function declarations.

This came up after this discussion: https://github.com/badges/shields/pull/2803#discussion_r249011621 though is actually not related ot that example.

What’s being removed is a third option, which is assigning to a variable a function expression using the `function` keyword. There’s still room for the programmer to choose between arrow function expressions and function declarations.
2019-01-21 15:33:43 -05:00
Felix Becker
18a65fc69c Add directory field to package.json (#2823)
https://github.com/npm/rfcs/blob/latest/accepted/0010-monorepo-subdirectory-declaration.md

This helps tools find this package in the repository.
2019-01-21 20:19:03 +00:00
Paul Melnikow
31f0b8e6d8 Optimize diffing in Danger (#2827) 2019-01-21 20:16:50 +00:00
Paul Melnikow
558576dfb7 Temporarily remove useless npm-install task in CI (#2808)
It still seems worth using workspace caching to properly tackle #1937, though in the meantime we're wasting time with a useless build. This should cut our total build latency roughly by half.
2019-01-21 13:02:35 -05:00
dependabot[bot]
cc2f514d05 Bump eslint-config-prettier from 3.5.0 to 3.6.0 (#2821)
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 3.5.0 to 3.6.0.
- [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/v3.5.0...v3.6.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-21 12:49:52 -05:00
Antoine Boisadam
7face4995f Add [Ansible] quality score badge (#2620)
Adds quality score badge from Ansible, closes #2602
2019-01-21 12:32:28 -05:00
dependabot[bot]
fd41131579 Bump prettier from 1.15.3 to 1.16.0 (#2819)
Bumps [prettier](https://github.com/prettier/prettier) from 1.15.3 to 1.16.0.
- [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.15.3...1.16.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-21 12:29:43 -05:00
dependabot[bot]
b7f0f2fd8e Bump nock from 11.0.0-beta.3 to 11.0.0-beta.4 (#2818)
Bumps [nock](https://github.com/nock/nock) from 11.0.0-beta.3 to 11.0.0-beta.4.
- [Release notes](https://github.com/nock/nock/releases)
- [Changelog](https://github.com/nock/nock/blob/beta/CHANGELOG.md)
- [Commits](https://github.com/nock/nock/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-21 12:23:29 -05:00
dependabot[bot]
a438ea7eee Bump sinon from 7.2.2 to 7.2.3 (#2820)
Bumps [sinon](https://github.com/sinonjs/sinon) from 7.2.2 to 7.2.3.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v7.2.2...v7.2.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-21 12:05:34 -05:00
dependabot[bot]
433f92fc1e Bump eslint from 5.12.0 to 5.12.1 (#2822)
Bumps [eslint](https://github.com/eslint/eslint) from 5.12.0 to 5.12.1.
- [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.12.0...v5.12.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-21 12:00:55 -05:00
Jan Keromnes
36956897e9 Make code contributions easier with Gitpod (#2783)
Ref #2772
2019-01-21 11:44:53 -05:00
chris48s
fba846986a fix logo imports in [github twitter liberapay] (#2817)
this was moved in #2796 but we missed updating some of the imports
2019-01-20 23:19:12 -05:00
Paul Melnikow
26d0495ee6 Add logo support for the endpoint badge and refactor logo functions (#2796) 2019-01-20 20:22:46 +00:00
Paul Melnikow
a8e27d139d Fix Docker build (#2815)
Close #2814
2019-01-20 15:01:07 -05:00
chris48s
7789e80fe5 refactor [packagecontrol] service (#2803) 2019-01-19 14:28:14 -05:00
James Cahill
e3c8508ce4 Added various [Spiget] badges (#2745)
* Spiget Downloads badge

* Spiget Download Size badge

* Spiget Latest version badge

* Add a base class

* Spiget Rating / Stars badges

* Spiget versions badge

* remove useless regex escape

* use renderVersionBadge for rendering

* misc fixes

* use expectJSON when possible

* use the download count color formatter

* merge service classes

* add keywords

* Add tests for non-star ratings

* Add nock tests

* misc fixes

* chore: minor formatting update on spiget dl
2019-01-19 11:24:58 -06:00
Paul Melnikow
94acb92258 Rewrite test of analytics endpoint (#2810)
This test is being weirdly flaky in #2809. The problem seems to be in the test helper code, so I rewrote this using Joi.

I imagine the change has to do with a change to the test ordering. It's a bit puzzling.

However, the new test seems fine (and the endpoint is rarely used; not critical to begin with).
2019-01-18 23:51:07 -05:00
Paul Melnikow
69ced81cd1 Fix integration test pattern (#2811)
Ref #2792
2019-01-18 11:56:04 -06:00
dependabot[bot]
cd8528c30f Bump eslint-plugin-react from 7.12.3 to 7.12.4 (#2804)
Bumps [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) from 7.12.3 to 7.12.4.
- [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.12.3...v7.12.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-18 06:46:46 -05:00
chris48s
653242d004 refactor [itunes] service (#2802) 2019-01-18 06:44:49 -05:00
dependabot[bot]
835c21faf3 Bump react-select from 2.2.0 to 2.3.0 (#2805)
Bumps [react-select](https://github.com/JedWatson/react-select) from 2.2.0 to 2.3.0.
- [Release notes](https://github.com/JedWatson/react-select/releases)
- [Changelog](https://github.com/JedWatson/react-select/blob/master/.sweet-changelogs.js)
- [Commits](https://github.com/JedWatson/react-select/compare/v2.2.0...v2.3.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-18 06:40:43 -05:00
Paul Melnikow
5ff7beb3bf Reorganize token pooling code (#2792)
Ref #2698
2019-01-18 06:18:31 -05:00
Paul Melnikow
4bfc8d3b72 Fix [static] tests (#2797) 2019-01-17 15:24:02 -05:00
Paul Melnikow
328a6b0f9d Set static previews for packagecontrol (#2799) 2019-01-17 15:18:55 -05:00
Paul Melnikow
d927df22c5 Convert more static previews (#2801) 2019-01-17 15:13:31 -05:00
dependabot[bot]
ab5fee2bfd Bump eslint-config-prettier from 3.4.0 to 3.5.0 (#2794)
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 3.4.0 to 3.5.0.
- [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/v3.4.0...v3.5.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-17 20:02:26 +00:00
dependabot[bot]
f2a6569037 Bump got from 9.5.1 to 9.6.0 (#2795)
Bumps [got](https://github.com/sindresorhus/got) from 9.5.1 to 9.6.0.
- [Release notes](https://github.com/sindresorhus/got/releases)
- [Commits](https://github.com/sindresorhus/got/compare/v9.5.1...v9.6.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-17 19:59:28 +00:00
Paul Melnikow
3c98ad38ac test:server -> test:core (#2798)
This renames `npm run test:server` to `npm run test:core` to go along with the reorganization of #2698. `server` has been a bit imprecise, since there's a lot of stuff under test besides the server, and most of the tests don't hit the server itself.

Probably files like `luarocks.spec.js` ought to be run as part of a different target, especially if we build out a separate code-coverage metric for core. Though I'm not in a huge rush to sort that out.
2019-01-17 13:52:47 -05:00
Paul Melnikow
2ece7c4ee2 Wrap HTML in __html in service def export (#2791)
The intention of wrapping HTML in an `__html` is to avoid accidentally unsafe rendering of something that is non-html.

Including this in the definition export solves the problem, and does not seem too onerous for other possible users of that file.

Close #2725
2019-01-17 13:47:23 -05:00
Paul Melnikow
4415a3e94e Reorganize badge URL helper functions (#2790)
Ref #2698
2019-01-17 13:44:46 -05:00
Paul Melnikow
05b9dd46e8 BaseService: Minor stylistic refactor of color computation (#2793)
As I was working on refactoring the logo code, I thought of a way to compute the color in a way more befitting the declarative style of the function.
2019-01-16 23:36:06 -05:00
Caleb Cartwright
576a6c1dee Fix [AzureDevOps] branch specific badges (#2777)
* fix: updated Azure DevOps fetch function to reflect query param name change

* fix: fixed branch filter for azure devops to enable branch name usage

* fix: simplified branch pattern for azure devops badges
2019-01-16 21:16:32 -06:00
Paul Melnikow
bcc9acd18f Disallow redundant example patterns (#2787) 2019-01-16 19:47:10 -05:00
Paul Melnikow
7d4acba5c1 Validate namedParams in examples (#2786)
Fix #2784
2019-01-16 19:38:36 -05:00
Paul Melnikow
97e719f226 Make it harder to accidentally trigger all the service tests (#2789)
It’s happened twice that `[*]` has ended up in a PR title and the full test run has happened inadvertently. Once was me and once was a new contributor.

This raises the bar on doing it accidentally.
2019-01-16 16:58:17 -05:00
Paul Melnikow
18b98a30e3 Reorganize server and service test runner (#2781)
Ref #2698
2019-01-16 16:30:18 -05:00
Paul Melnikow
474b126be6 Fix color again, for legacy badges (#2782)
Ref: https://github.com/badges/shields/pull/2780#issuecomment-454873296
2019-01-16 13:37:48 -05:00
Paul Melnikow
4bf55a7826 Fix numeric colorB (#2780)
Numeric colors weren't properly being handled by `makeBadge` after #2742.

Since this function really does not need to be accepting colors as strings, rather than make the function more lenient to work with Scoutcamp, I coerced the types of the colors on the way in.

Two tests cover the functionality in the modern service. I don't feel strongly that the legacy version needs coverage at this point, though I've added one for the moment on the github languages badge where this manifested.

Fix #2778
2019-01-16 11:55:50 -05:00
Paul Melnikow
8a10279d95 Add static preview to some [GitHub] services (#2766) 2019-01-15 21:43:35 -05:00
Thomas Démoulins
678359bdd6 Fix orange statuses, run tests for [AppveyorCi AzureDevOps Bitbucket CircleCi Gitlab Readthedocs Shippable Wercker] (#2776)
* Fix orange statuses

* Add test for partially succeeded build

* Add service test for partially succeeded builds

* Add service test for partially succeeded builds
2019-01-15 18:56:42 -06:00
Paul Melnikow
4597d77015 Refactor badge color functions (#2742)
- Replace the idea of color schemes with the idea of named colors (since none of our colorschemes have used `colorA`)
- Pass through the normalized color to `_shields_test` to harmonize with BaseService and simplify testing
    - Update service tests
- Move responsibility for color generation into the npm package
- Remove several color helper functions and their tests
- Update gh-badge public API to accept `color` and `labelColor`

This is a precursor to refactoring some of the logo code for #2473.
2019-01-15 16:43:33 -05:00
Paul Melnikow
cab689706f Dynamic cache length overriding (#2755)
For the Endpoint badge: #2473.

`request-handler.js` is such a bear. I’m looking forward to being able to rewrite it when the service refactor is done.
2019-01-15 15:44:39 -05:00
Paul Melnikow
a2eec8c8ec Add more static previews (#2770) 2019-01-15 15:41:38 -05:00
Paul Melnikow
5026221e84 Provide better dev feedback by validating services when they are loaded (#2769)
It's easy to push services that don't validate, because much of the tooling, including the service test runner and the service definition generator, do not validate all the services. This leads to errors that manifest in CI. It would be more helpful to see these errors sooner.

This moves the `validateDefinition()` check to `loadServiceClasses()`, where the services are first loaded, and fixes related validation errors.
2019-01-15 15:39:13 -05:00
Paul Melnikow
a43711fca1 Use simpler regexes in [appveyortests] to address lgtm alert (#2768)
Two of these regexes have triggered a LGTM alert.

https://lgtm.com/rules/1505904457770/

I’m not terribly concerned about it given this is a test, though it’s nice to clear these up, and the new regexes are a bit easier to understand.
2019-01-15 15:36:52 -05:00
Pierre-Yves B
55ce947a35 Extended usage of build-status.js tomore services (#2763)
* Extended usage of build-status.js

* Removed remaining status arguments
2019-01-15 20:27:18 +00:00
Paul Melnikow
22e8510fc7 Remove some unused state to clear lgtm alerts (#2767)
39309c9c20/files/frontend/components/markup-modal/markup-modal-content.js (x9b1573629b59d42e):1
2019-01-15 14:59:02 -05:00
Paul Melnikow
79af2840f3 Fix overriding bind address on CLI (#2773)
This fixes e.g. `node server 8080 0.0.0.0`.

Ref #2772.
2019-01-15 14:38:55 -05:00
Paul Melnikow
a58de54281 Set static previews for [jenkins jenkinsplugin] and tweak tests (#2765) 2019-01-14 22:39:51 -05:00
Paul Melnikow
394a411127 Showcase two of our distinguishing features (#2705) 2019-01-14 18:54:42 -05:00
Paul Melnikow
9b4ff6a567 Unfork path-to-regexp (#2757)
pillarjs/path-to-regexp#176 has been released.
2019-01-14 20:41:48 +00:00
dependabot[bot]
eacb331f11 Bump fast-xml-parser from 3.12.11 to 3.12.12 (#2758)
Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 3.12.11 to 3.12.12.
- [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases)
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-14 20:38:34 +00:00
dependabot[bot]
be3102b08a Bump simple-icons from 1.9.17 to 1.9.18 (#2760)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 1.9.17 to 1.9.18.
- [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>
2019-01-14 20:27:44 +00:00
Pierre-Yves B
3cebe3bbd4 Made tests use isBuildStatus validator from build-status.js (#2762) 2019-01-14 19:39:06 +00:00
dependabot[bot]
e999d9d018 Bump eslint-config-prettier from 3.3.0 to 3.4.0 (#2759)
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 3.3.0 to 3.4.0.
- [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/v3.3.0...v3.4.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-14 11:24:22 -05:00
dependabot[bot]
a6f09913e7 Bump got from 9.5.0 to 9.5.1 (#2761)
Bumps [got](https://github.com/sindresorhus/got) from 9.5.0 to 9.5.1.
- [Release notes](https://github.com/sindresorhus/got/releases)
- [Commits](https://github.com/sindresorhus/got/compare/v9.5.0...v9.5.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-14 11:02:28 -05:00
Caleb Cartwright
dc0e5b3c54 Temporarily deprecate [CoverityScan] (#2756)
* feat: temp. deprecate coverity scan and update deprecated service to take custom messags

* tests: added unit tests for deprecated service definition
2019-01-13 15:50:50 -06:00
Paul Melnikow
5c25dce5fc Validate service data + support labelColor for the endpoint badge (#2740)
Ref #2473
2019-01-13 11:37:39 -05:00
chris48s
796d066930 remove asterisks from examples (#2749) 2019-01-13 12:17:39 +00:00
chris48s
65f075ba31 refactor [dub] service (#2751) 2019-01-13 12:13:00 +00:00
chris48s
0aca8e68ff Refactor [osslifecycle] (#2750)
* move files from osstracker to osslifecycle
* refactor [osslifecycle]
2019-01-13 12:10:28 +00:00
Michael Fyffe
698ff45959 Add pdk badge for puppet forge (#2256)
Closes #2255
2019-01-13 00:24:44 -05:00
James Cahill
4725a8dc13 Refactor the rest of [PyPI] to use static previews (#2752)
* Refactor the rest of [PyPI] to use static previews

* v1.0.0 -> 1.0.0 to match what's passed to render function
2019-01-12 23:13:45 -05:00
Paul Melnikow
ef18429420 Add Github package.json dependency version badge (#2709)
Close #2259 which is mostly about a `package.json` dependency badge.
2019-01-12 17:37:10 -05:00
Paul Melnikow
b985c7b180 Add an issue template for a failing service test (#2746) 2019-01-12 17:24:56 -05:00
Nathan Lowe
fc4ed938a1 [Bitbucket]: Pull Requests: Support Bitbucket Server (#2598)
* New Service: Bitbucket Server: Pull Request Count

* [Bitbucket]: Pull Requests: Add Support for bitbucket-server

* Update examples to use namedParams instead of exampleUrl

* Simplify cloud vs server check

* [Bitbucket]: Add support for bitbucket cloud private repos

* Add additional tests for bitbucket server

* [Bitbucket]: Add tests for basic auth

* [Bitbucket] Format secrets according to style guides

* [Bitbucket] Add link to server REST documentation

* Punt adding VSCode debug task to separate PR

* [Bitbucket] Remove extra truthy check on serverSecrets

* [Bitbucket] Fix credentials after rename

* [Bitbucket] Use query parameters for Bitbucket Server support

* Fix bitbucket creds in secret template

* [Bitbucket] staticExample -> staticPreview

* Remove VSCode specific gitignore entries

* [Bitbucket] Normalize pluralization of PullReqeust(s) to match file name
2019-01-12 14:11:47 -06:00
Paul Melnikow
fb8c7e920d Use create-service-tester shorthand in [EclipseMarketplace] (#2741) 2019-01-12 12:59:37 -05:00
Paul Melnikow
51a19a8ace Update [gemrank] regex to match "1st" (#2743)
See https://circleci.com/gh/badges/shields/34350
2019-01-12 12:34:05 -05:00
chris48s
697ff80dad limit the size of response we will accept (#2726)
limit the size of response we will accept
2019-01-11 21:50:49 +00:00
chris48s
e22934eab0 only display the menu once (#2727)
* only display the menu once
2019-01-11 21:28:18 +00:00
Paul Melnikow
b3606724fd Wildcard to run all service tests [*] (#2739)
Close #2685.
2019-01-11 16:11:46 -05:00
Caleb Cartwright
afcc0e3920 refactor: rename VS Marketplace to Visual Studio Marketplace (#2738) 2019-01-11 15:02:58 -06:00
Paul Melnikow
893071cf2c Add a script used for backing up the production GitHub tokens (#2737) 2019-01-11 14:39:41 -05:00
James Cahill
3f118f8442 TUTORIAL.md - use localhost instead of others (#2735)
Seeing as npm start now uses localhost instead of instead of 127.0.0.1 or [::], just updating it in the tutorial.
2019-01-11 13:57:51 -05:00
Paul Melnikow
eb7ea8499d Fix github auth again (#2736)
This code isn't being run during tests, though let's fix that later as part of #2733. Specifically:

> However _the pool itself_ could be used all the time; there's not a big advantage in turning that off when it doesn't need to be used.

Fix #2728
2019-01-11 13:50:29 -05:00
Paul Melnikow
269fbd056c Optimize [githubsearch] tests by using a smaller repo (#2734)
These seem to run in 300-900 ms.
2019-01-11 13:47:48 -05:00
Paul Melnikow
048291a024 Fix [GitHub] token handling (#2730)
Fix #2728
2019-01-11 13:16:44 -05:00
Caleb Cartwright
ae11905e8d refactor [VSMarketplace] to new service model (#2732)
* feat: refactor vs marketplace to new service model

* chore: fix for prettier

* chore: minor updates to vs marketplace services based on PR feedback
2019-01-11 11:32:43 -06:00
Paul Melnikow
c4efdc8e66 Rewrite and test Github auth logic, separating standard and search quota (#1205)
The end of an era.
2019-01-10 21:30:23 -05:00
Paul Melnikow
a27bef5aa5 Split “quality” into “code coverage” and “analysis” (#2723)
With the menu in place I think having more categories is helping that process because it's grouping more similar things together. Given #2722, improving our discoverability in the analysis area may be particularly useful to developers right now.
2019-01-10 21:18:43 -05:00
Paul Melnikow
6c2b040fa6 Better modal (#2554)
- With examples using `pattern`s, allow building the URL from its component parts, including the query string.
- Provide a button to copy the link, with an animation.

To enable this for other badges, convert them to use a `pattern`: #1961.
2019-01-10 21:04:07 -05:00
Paul Melnikow
da12f00d87 Tweak formatting of [bstats] badge (#2724)
This makes it a bit more consistent with the others.
2019-01-10 15:14:38 -05:00
James Cahill
a8629fe8bd Added [bStats] badges (#2591)
* bStats badges

* Remove inline tutorial comments

* Split tests into seperate files

* use shorthand for tester instantiation

* use Joi.number() for validation

* Misc. fixes

* update to use native api
2019-01-10 10:54:43 -06:00
Paul Melnikow
cd0ff105f6 User color should not override error color (#2693)
Fix #1446.
2019-01-09 16:32:28 -05:00
Paul Melnikow
e528c85ed4 Refactor [GithubContributors] and [NpmCollaborators] and change color (#2715)
See examples in https://github.com/badges/shields/pull/2705#issue-243107694
2019-01-09 16:29:57 -05:00
Marcin Mielnicki
372c1978a1 Unwanted title removed (#2721)
Currently HTML code of shields.io contains two `<title>` elements. This PR removes an extra title element. 

Before change:
```bash
> curl https://shields.io -s | egrep "<title.*/title>" -o 
<title class="next-head">Shields.io: Quality metadata badges for open source projects</title>
<title>My page</title>
```

After change:
```bash
> curl http://localhost:8080 -s | egrep "<title.*/title>" -o
<title class="next-head">Shields.io: Quality metadata badges for open source projects</title>
```
2019-01-09 16:21:26 -05:00
Paul Melnikow
674d9877ad Add calebcartwright to core team 💥 (#2718) 2019-01-09 15:59:12 -05:00
Paul Melnikow
0e11194de5 Validate defaultBadgeData (#2711) 2019-01-09 14:50:42 -05:00
Paul Melnikow
ad1d4ce065 Ask for a specific use case in new badge request (#2716) 2019-01-09 13:04:51 -05:00
Paul Melnikow
06c6f13770 Add category nav menu (#2682)
Adapted from @chris48s’ work from #1842.
2019-01-09 08:46:27 -05:00
dependabot[bot]
7e1b1121a4 Bump eslint-plugin-mocha from 5.2.0 to 5.2.1 (#2712)
Bumps [eslint-plugin-mocha](https://github.com/lo1tuma/eslint-plugin-mocha) from 5.2.0 to 5.2.1.
- [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.2.0...5.2.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-09 00:47:32 -05:00
Paul Melnikow
d1c5378bf0 Integrate new path-to-regexp with trailing optionals (#2644)
Fix #2497

Ref pillarjs/path-to-regexp#176
2019-01-08 18:50:47 -05:00
Maximilian Brandau
4efe8832cf Update [opencollective] error handling (#2707)
Update tests to fit new behavior of upstream API
Update by-tier service to fit new behavior
2019-01-08 17:33:46 -05:00
Maximilian Brandau
ce7bbba028 Use shields instead of open collective badges (#2708) 2019-01-08 17:04:26 -05:00
Paul Melnikow
945272db22 Rm old list of critical services (#2695)
This list was useful when we had to triage service tests, though happily that day is no longer :)
2019-01-08 15:13:47 -05:00
Pierre-Yves B
a158cf858b [Travis-Build] service rewrite, run [travis-php-version] (#2660)
* Rewrote Travis-Build service and separated tests

* Fixed property shorthand

* Strenghtened schema validation

* Implemented keyword remapping
2019-01-08 19:33:14 +00:00
Paul Melnikow
23ed74e850 Readme: Fix dev setup instructions (#2700) 2019-01-08 14:07:10 -05:00
Jan Keromnes
3ab2862922 Fix a few typos (#2697)
* Fix typos (using 'codespell -w')

* Properly capitalize Git and GitHub in TUTORIAL.md
2019-01-08 12:08:50 -05:00
chris48s
7d1a6dd627 fix [gem] rank badge (#2659)
The ranking endpoints return a value for every day. This is rare, but it looks like sometimes this can be `null` (for example if you call http://bestgems.org/api/v1/gems/rack/daily_ranking.json the rank was `null` on `2013-07-02` ) and if the rank has _ever_ been `null` for a package in the past, the schema will fail validating the response.

This modifies the schema to allow a `null` value and adds a case to handle if the rank is `null` today.

closes #2647
2019-01-08 00:36:40 -05:00
Paul Melnikow
84a6d28250 Add instructions for testing Danger locally (#2691) 2019-01-08 00:16:05 -05:00
Paul Melnikow
db365d6085 Rm unnecessary mkdir in Circle config (#2692)
See discussion in badges/daily-tests#4.
2019-01-07 22:43:09 -05:00
Paul Melnikow
ebfd6cf8ee We don't use Docker in production (#2690)
I found an old note to myself to document this.
2019-01-07 22:00:36 -05:00
Paul Melnikow
1e267f891d Document production hosting (#2661) 2019-01-07 20:55:49 -05:00
Paul Melnikow
dcbe1cf906 Prettier: Ignore a couple generated files which aren’t checked in (#2680) 2019-01-07 20:40:24 -05:00
Paul Melnikow
a018bd8475 Fix frontend start script (#2681)
Without this change none of the badges load.
2019-01-07 20:37:31 -05:00
Paul Melnikow
b82d663a6d Unflake GitHub integration test (#2683)
Hopefully this fixes #2663.
2019-01-07 20:31:26 -05:00
Paul Melnikow
8c7404a571 Run Prettier on the rest of the things (#2662) 2019-01-07 18:33:17 -05:00
Paul Melnikow
ec9de03b28 Debug GitHub integration test (#2677)
Ref #2663
2019-01-07 18:26:36 -05:00
Maximilian Brandau
9faa0088bf Replace open collective with shields rendered badges (#2672)
Closes #2498
2019-01-07 15:02:39 -05:00
Maximilian Brandau
00c193a009 Add 4 open collective badges (#2638)
- open collective backers
- open collective sponsors
- open collective backers and sponsors
- open collective members by tier
2019-01-07 13:50:45 -05:00
dependabot[bot]
8b61dc6fbb Bump danger from 7.0.1 to 7.0.2 (#2667)
Bumps [danger](https://github.com/danger/danger-js) from 7.0.1 to 7.0.2.
- [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/7.0.1...7.0.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-07 18:34:45 +00:00
dependabot[bot]
12cf218d8e Bump chalk from 2.4.1 to 2.4.2 (#2665)
Bumps [chalk](https://github.com/chalk/chalk) from 2.4.1 to 2.4.2.
- [Release notes](https://github.com/chalk/chalk/releases)
- [Commits](https://github.com/chalk/chalk/compare/v2.4.1...v2.4.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-07 18:27:33 +00:00
dependabot[bot]
e33cd9bd7c Bump js-yaml from 3.12.0 to 3.12.1 (#2666)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.12.0 to 3.12.1.
- [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.12.0...3.12.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-07 12:40:01 -05:00
dependabot[bot]
25ab3f6add Bump eslint-plugin-react from 7.12.2 to 7.12.3 (#2669)
Bumps [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) from 7.12.2 to 7.12.3.
- [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.12.2...v7.12.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-07 11:41:32 -05:00
dependabot[bot]
e285d0737d Bump eslint from 5.11.1 to 5.12.0 (#2668)
Bumps [eslint](https://github.com/eslint/eslint) from 5.11.1 to 5.12.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.11.1...v5.12.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-07 11:36:30 -05:00
dependabot[bot]
85146db12a Bump eslint-plugin-node from 8.0.0 to 8.0.1 (#2664)
Bumps [eslint-plugin-node](https://github.com/mysticatea/eslint-plugin-node) from 8.0.0 to 8.0.1.
- [Release notes](https://github.com/mysticatea/eslint-plugin-node/releases)
- [Commits](https://github.com/mysticatea/eslint-plugin-node/compare/v8.0.0...v8.0.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-07 11:33:57 -05:00
Caleb Cartwright
ca487ae086 Refactor [SymfonyInsight] to new service model and rename (#2572)
Based on some discussion/feedback here, this PR now contains several changes:

* Renames the `Sensiolabs` badge/service content to `SymfonyInsight` to reflect the rebranding of that product/service
* Refactors the original service to the new service model (using `BaseXmlService`)
* Updates the color scheme of the original/initial badge type (SymfonyInsight Grade) to more closely mirror the colors used by the vendor/service provider
* Adds a new badge type (violation counts/summary) 
* Adds both mocked and live tests (there were none before) for both the grade & violation badges using the new path `symfony/i` as well as a couple tests for the old path `sensiolabs/i` to check for backwards compatibility

Refs #1358
2019-01-07 00:28:45 -05:00
Paul Melnikow
b32f6eab55 Convert some static previews (#2652) 2019-01-06 17:39:27 -05:00
Paul Melnikow
89113eee17 Migrate deprecated staticExample -> staticPreview (#2650) 2019-01-06 17:30:25 -05:00
Paul Melnikow
a614de5fc9 Deprecate [cocoapods] stats badges; split out tests (#2653)
Resolve #2651.
2019-01-06 16:26:38 -05:00
Paul Melnikow
47bb03572b Set redirectUrl for production; rely on NODE_CONFIG_ENV being set earlier (#2656) 2019-01-06 12:56:26 -05:00
Paul Melnikow
bc0be4f619 Fixes for config update (#2655)
Ref #2626 #2654
2019-01-06 12:23:58 -05:00
Paul Melnikow
fa5309400d PaaS, CI, and production-friendly config (#2626)
This implements the configuration mechanism I described in #2621. The heavy lifting is delegated to [node-config](https://github.com/lorenwest/node-config) with a minor assist from [dotenv](https://github.com/motdotla/dotenv).

`private/secret.json` has been replaced with environment variables and/or `config/local.yml`. See `doc/server-secrets.md`.
2019-01-06 10:42:09 -05:00
Paul Melnikow
3ffb3ef5b4 Remove support for exampleUrl (#2640) 2019-01-06 08:31:25 -05:00
chris48s
566b58acba refactor [bower] service (#2646) 2019-01-06 13:25:12 +00:00
chris48s
f7728cdb3c refactor [bintray] service (#2645) 2019-01-06 13:22:30 +00:00
Paul Melnikow
83044ce325 Update more exampleUrls; style tweaks (#2639) 2019-01-06 08:18:19 -05:00
Paul Melnikow
2e1ce1a4ca Fix test:services:trace (#2643) 2019-01-06 05:26:56 -05:00
Caleb Cartwright
85be66bb19 tests: change scrutinizer branch coverage test example (#2641) 2019-01-05 17:39:55 -05:00
Paul Melnikow
c4143b9c23 Convert a bunch of exampleUrls and formats (#2633) 2019-01-05 14:54:34 -05:00
Paul Melnikow
d97a5e4697 Server start time badge [debug] (#2631) 2019-01-04 17:23:30 -05:00
Paul Melnikow
5233a25ddc Remove spurious truthiness checks on serverSecrets (#2634)
`serverSecrets` is always truthy.

Close #2606
2019-01-04 12:49:48 -05:00
dependabot[bot]
9bc2e512b7 Bump nock from 11.0.0-beta.2 to 11.0.0-beta.3 (#2627)
Bumps [nock](https://github.com/nock/nock) from 11.0.0-beta.2 to 11.0.0-beta.3.
- [Release notes](https://github.com/nock/nock/releases)
- [Changelog](https://github.com/nock/nock/blob/beta/CHANGELOG.md)
- [Commits](https://github.com/nock/nock/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-04 12:06:00 -05:00
dependabot[bot]
67f6e2c490 Bump emojic from 1.1.14 to 1.1.15 (#2628)
Bumps [emojic](https://github.com/IonicaBizau/emojic) from 1.1.14 to 1.1.15.
- [Release notes](https://github.com/IonicaBizau/emojic/releases)
- [Commits](https://github.com/IonicaBizau/emojic/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-04 11:49:40 -05:00
Ang YC
f6357da8ee [Date] Relative date badge (#2244)
Close #749
2019-01-04 11:32:38 -05:00
dependabot[bot]
576f30fce5 Bump react from 16.6.3 to 16.7.0 (#2585)
* Bump react from 16.6.3 to 16.7.0

Bumps [react](https://github.com/facebook/react) from 16.6.3 to 16.7.0.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/compare/v16.6.3...v16.7.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Bump react-dom from 16.6.3 to 16.7.0

Bumps [react-dom](https://github.com/facebook/react) from 16.6.3 to 16.7.0.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/compare/v16.6.3...v16.7.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-03 21:18:08 +00:00
dependabot[bot]
b93e3ac26f Bump @babel/polyfill from 7.0.0 to 7.2.5 (#2587)
Bumps [@babel/polyfill](https://github.com/babel/babel) from 7.0.0 to 7.2.5.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.0.0...v7.2.5)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-03 20:59:07 +00:00
dependabot[bot]
dfe2b1cd0a Bump next from 6.1.2 to 7.0.2 (#2508)
Bumps [next](https://github.com/zeit/next.js) from 6.1.2 to 7.0.2.
- [Release notes](https://github.com/zeit/next.js/releases)
- [Commits](https://github.com/zeit/next.js/compare/6.1.2...7.0.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-03 09:52:12 -05:00
dependabot[bot]
191f75b634 Bump eslint-plugin-react from 7.12.1 to 7.12.2 (#2624)
Bumps [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) from 7.12.1 to 7.12.2.
- [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.12.1...v7.12.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-03 09:06:46 -05:00
dependabot[bot]
1502d1aa5b Bump rimraf from 2.6.2 to 2.6.3 (#2623)
Bumps [rimraf](https://github.com/isaacs/rimraf) from 2.6.2 to 2.6.3.
- [Release notes](https://github.com/isaacs/rimraf/releases)
- [Commits](https://github.com/isaacs/rimraf/compare/v2.6.2...v2.6.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-03 01:09:14 -05:00
chris48s
d96d8ae193 Document private/secret.json; affects [bower jira] (#2599)
* don't use a libraries.io token for bower integration

The libraries.io docs claim you need to be authenticated
to make any API request: https://libraries.io/api#authentication

In practice we can call https://libraries.io/api/bower/jquery
just fine with no token and based on chucking a load of
requests at it and examining the `x-ratelimit-remaining`
headers you actually seem to get a better limit with no
authentication.

All of our libraries.io badges in `services/librariesio`
seem to have been running fine with no token for some time.


* change jira auth settings to jira_user, jira_pass

All the other services use servicename_user, servicename_pass

This switches JIRA to use that convention by preference
but supports _username and _password for legacy users.


* add docs for server secrets


* add danger rule for server-secrets.md

this rule prompts users to update server-secrets.md
if 'serverSecrets' is in the diff
2019-01-02 20:49:42 +00:00
Paul Melnikow
5dc25af93c redirectUrl: Update terminology and add a test (#2617) 2019-01-02 13:48:27 -05:00
Paul Melnikow
a9ff282b74 Extend timeout on GitHub integration test (#2618) 2019-01-02 11:24:03 -05:00
Caleb Cartwright
3bbe2482bc Refactor [TeamCity] and add tests (#2601) 2019-01-02 00:19:33 -05:00
Paul Melnikow
a9839845a1 Add some test coverage in frontend/lib (#2615) 2019-01-02 00:12:51 -05:00
Paul Melnikow
7150b37831 Add test of the server entrypoint (#2613)
The server's entrypoint is an important bit of code which is not covered by our tests. This adds a test which should cover it.
2019-01-01 22:58:54 -05:00
Paul Melnikow
f297f68911 Coverage should ignore test helpers (#2614) 2019-01-01 22:49:03 -05:00
dependabot[bot]
84183a3fc9 Bump joi from 14.3.0 to 14.3.1 (#2610)
Bumps [joi](https://github.com/hapijs/joi) from 14.3.0 to 14.3.1.
- [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/v14.3.0...v14.3.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-01 21:54:01 -05:00
dependabot[bot]
e09f5ca034 Bump styled-components from 4.1.2 to 4.1.3 (#2556)
Bumps [styled-components](https://github.com/styled-components/styled-components) from 4.1.2 to 4.1.3.
- [Release notes](https://github.com/styled-components/styled-components/releases)
- [Changelog](https://github.com/styled-components/styled-components/blob/master/CHANGELOG.md)
- [Commits](https://github.com/styled-components/styled-components/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-01 21:40:34 -05:00
dependabot[bot]
860c426a0c Bump eslint-plugin-react from 7.11.1 to 7.12.0 (#2609)
* Bump eslint-plugin-react from 7.11.1 to 7.12.0

Bumps [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) from 7.11.1 to 7.12.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.11.1...v7.12.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Fix lint errors

* Better link

* Re-bump package version and remove lint disable
2019-01-01 21:22:09 -05:00
Caleb Cartwright
97cdc5762f Add timeout for server test setup/teardown (#2612) 2019-01-01 21:16:35 -05:00
dependabot[bot]
02151cb700 Bump husky from 1.2.0 to 1.3.1 (#2608)
Bumps [husky](https://github.com/typicode/husky) from 1.2.0 to 1.3.1.
- [Release notes](https://github.com/typicode/husky/releases)
- [Changelog](https://github.com/typicode/husky/blob/master/CHANGELOG.md)
- [Commits](https://github.com/typicode/husky/compare/v1.2.0...v1.3.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-01 15:54:03 +01:00
dependabot[bot]
38ede19e84 Bump danger from 6.1.12 to 7.0.1 (#2600)
Bumps [danger](https://github.com/danger/danger-js) from 6.1.12 to 7.0.1.
- [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/6.1.12...7.0.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-30 21:44:02 +00:00
dependabot[bot]
e024020258 Bump simple-icons from 1.9.16 to 1.9.17 (#2596)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 1.9.16 to 1.9.17.
- [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-12-30 21:36:43 +00:00
Caleb Cartwright
dcfd84923c fix: fix bug in server-config on allowedOrigin (#2607) 2018-12-30 21:26:41 +00:00
James Cahill
4baf16cbed Visual Studio Code gitignore + recommended extensions (#2581)
* Add vscode to gitignore

* Update gitignore and add recommended extensions
2018-12-29 12:06:01 -05:00
Paul Melnikow
ebe6da23d4 Register missing redirects [static] (#2603) 2018-12-28 14:00:07 -05:00
Paul Melnikow
16491d787c Fix [suggest] (#2604) 2018-12-28 13:51:29 -05:00
dependabot[bot]
27da1aa659 Bump eslint from 5.11.0 to 5.11.1 (#2595)
Bumps [eslint](https://github.com/eslint/eslint) from 5.11.0 to 5.11.1.
- [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.11.0...v5.11.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-28 10:37:37 -05:00
dependabot[bot]
5548027f12 Bump prom-client from 11.2.0 to 11.2.1 (#2583)
Bumps [prom-client](https://github.com/siimon/prom-client) from 11.2.0 to 11.2.1.
- [Release notes](https://github.com/siimon/prom-client/releases)
- [Changelog](https://github.com/siimon/prom-client/blob/master/CHANGELOG.md)
- [Commits](https://github.com/siimon/prom-client/compare/v11.2.0...v11.2.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-26 17:15:56 -05:00
James Cahill
74faf163b7 Use cross-env for environment variables (#2589)
Fix #2580
2018-12-26 17:01:02 -05:00
Manaswini Das
d87ac49b43 Improves CONTRIBUTING.md (#2594) 2018-12-26 21:25:23 +00:00
chris48s
6c01027c63 improve setup instructions (#2592)
* improve setup instructions

* move node/npm install out to pre-requisites section
2018-12-26 21:22:56 +00:00
Caleb Cartwright
6d1c748453 Fix serverHasBeenUpSinceResourceCached test (#2593)
Fixes #2571 (Really fixed this time 😄) 

I attempted a fix in https://github.com/badges/shields/pull/2590 using fake timers but didn't realize how the timestamps being used in `cache-headers` were being created. This approach uses a dynamically generated `if-modified-since` value that will now be 30 minutes ahead of the server time stamp used in the comparison.
2018-12-25 21:07:31 -05:00
dependabot[bot]
892a54cfd5 Bump eslint from 5.10.0 to 5.11.0 (#2586)
Bumps [eslint](https://github.com/eslint/eslint) from 5.10.0 to 5.11.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.10.0...v5.11.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-24 19:30:56 +00:00
dependabot[bot]
c7c82e4fc9 Bump fast-xml-parser from 3.12.10 to 3.12.11 (#2582)
Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 3.12.10 to 3.12.11.
- [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases)
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-24 19:23:54 +00:00
dependabot[bot]
35f9d84701 Bump snap-shot-it from 6.2.7 to 6.2.8 (#2584)
Bumps [snap-shot-it](https://github.com/bahmutov/snap-shot-it) from 6.2.7 to 6.2.8.
- [Release notes](https://github.com/bahmutov/snap-shot-it/releases)
- [Commits](https://github.com/bahmutov/snap-shot-it/compare/v6.2.7...v6.2.8)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-24 19:16:59 +00:00
Caleb Cartwright
09ff426cba tests: add fake timers to cache-headers tests (#2590) 2018-12-24 19:10:11 +00:00
Paul Melnikow
ea0d2fb641 Fix frontend coverage in CI, update dev scripts, adopt npm-run-all (#2569) 2018-12-23 22:06:38 -05:00
Paul Melnikow
57f826962b Use beta release of nock (#2579) 2018-12-23 21:45:15 -05:00
Paul Melnikow
75a0c67562 Update list of prod secrets (#2573) 2018-12-23 11:33:54 -05:00
chris48s
ec3531bbde refactor [shippable] service (#2576) 2018-12-23 16:28:40 +00:00
Paul Melnikow
5c665a70da Overhaul initialization pattern for server + server tests (#2519)
Because `server.js` was long a monolith, there are a bunch of shims in place to facilitate unit testing. A few of the test suites share port 1111 which means if one of them fails to set up, the port won't be freed and other unrelated tests will fail. Some of the tests which trigger server setup include timeouts which were added to give setup code time to run. In one the test suites, we actually modify `process.argv`, which seems completely gross.

This implements a few changes which improve this:

1. Separate the server from the server startup script, splitting out `lib/server.js`.
2. Inject config into the server and validate the config schema.
3. Inject config into the service test runner.
4. Use `portfinder`, a popular utility for grabbing open ports during testing.
5. Switch more of the setup code from callbacks to async-await.

Overall it leaves everything acting more reliably and looking rather cleaner, if in a few places more verbose.

It also fixes the root cause of #1455, a `setTimeout` in `rate-limit`. Off and on during development of this changeset, Mocha would decide not to exit, and that turned out to be the culprit.

Fix #1455
2018-12-23 11:24:22 -05:00
chris48s
7dac325196 refactor [CPAN] service (#2575) 2018-12-23 15:20:50 +00:00
Paul Melnikow
4a976b52ea Fix import issue with [dynamic] badge (#2578)
Ref https://github.com/badges/shields/pull/2519#issuecomment-449511750
2018-12-23 10:13:04 -05:00
Paul Melnikow
227aaa04d8 Update maintainer list 🎉🎉🎉 (#2561)
Please join me in welcoming @calebcartwright to the maintainer team!

Caleb has been doing an incredible job rewriting services, among other things, and we're glad to have him on board!
2018-12-22 20:38:08 -05:00
dependabot[bot]
ad22dfccc5 Bump @babel/core from 7.1.6 to 7.2.2 (#2543)
* Bump @babel/core from 7.1.6 to 7.2.2

Bumps [@babel/core](https://github.com/babel/babel) from 7.1.6 to 7.2.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.1.6...v7.2.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* upgrade the babel plugins
2018-12-21 20:49:05 +00:00
dependabot[bot]
65731f2255 Bump simple-icons from 1.9.15 to 1.9.16 (#2559)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 1.9.15 to 1.9.16.
- [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-12-21 19:37:02 +00:00
dependabot[bot]
a0009aa8b7 Bump react-modal from 3.7.1 to 3.8.1 (#2558)
Bumps [react-modal](https://github.com/reactjs/react-modal) from 3.7.1 to 3.8.1.
- [Release notes](https://github.com/reactjs/react-modal/releases)
- [Changelog](https://github.com/reactjs/react-modal/blob/master/CHANGELOG.md)
- [Commits](https://github.com/reactjs/react-modal/compare/v3.7.1...v3.8.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-21 19:30:02 +00:00
Brendan Abolivier
da5ca7454a Improve [Matrix] badge generation (#2527)
Fixes #2524 

This PR addresses the issues expressed in #2524, in that it:

* checks if a server has advertised a FQDN it can be reached at and if that FQDN hosts Matrix's client APIs
* uses room aliases instead of room IDs, in order to avoid a badge being impossible to generate if the server that created the room leaves it

This includes a breaking change to the badge endpoint.
2018-12-20 17:00:49 -05:00
Caleb Cartwright
2fe61d2c5c Add [Snyk] badges (#2566)
Adds vulnerability badges from Snyk.io, closes #1642 

- [X] Vulnerability badge for GitHub repos
- [x] Vulnerability badge for npm package
2018-12-20 16:28:54 -05:00
Caleb Cartwright
fc41b576f3 Update [Jira] tests to include color validation (#2565)
Augmenting the tests for Jira that were added in #2541 to also validate color scheme
2018-12-20 15:55:15 -05:00
Paul Melnikow
872aede5be Add readme badges to gamify refactoring some more (#2562)
Ref https://github.com/badges/shields/issues/1358#issuecomment-448743020
2018-12-20 15:20:38 -05:00
Paul Melnikow
ebe4a12acc Convert lodash.uniq to native and remove an unused dev dep (#2564) 2018-12-20 15:15:56 -05:00
Paul Melnikow
483aa5a008 Fix frontend coverage and tweak ignores (#2563)
Since we use Babel for the frontend but not the server, I split the coverage config into two separate files, one for the frontend and the other for the server.

Refs:

- https://github.com/istanbuljs/nyc#nyc
- https://github.com/istanbuljs/babel-plugin-istanbul#mocha-on-nodejs-through-nyc

Close #2552
2018-12-19 17:46:09 -05:00
Paul Melnikow
4e5e3c8aee Split up [github] testers (#2560)
- Update github contributors badge for `create-service-tester`.
2018-12-19 17:20:15 -05:00
Paul Melnikow
382af10506 Rewrite [GithubManifest] and [GithubPackageJson] badges (#2470)
Pave the way for #2259 and rewrite #1721 along the way.

Ref: #2320
2018-12-19 16:33:20 -05:00
Caleb Cartwright
6d3798f26f Migrates [Nexus] service to new service model (#2520)
Ports the Nexus service to the new service model. Some related/relevant conversation in #2347 (and closes #2347). Also adds support for authentication which resolves #1699.
2018-12-19 15:45:22 -05:00
dependabot[bot]
63f8b256a7 Bump got from 9.4.0 to 9.5.0 (#2557)
Bumps [got](https://github.com/sindresorhus/got) from 9.4.0 to 9.5.0.
- [Release notes](https://github.com/sindresorhus/got/releases)
- [Commits](https://github.com/sindresorhus/got/compare/v9.4.0...v9.5.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-19 10:56:37 -05:00
Paul Melnikow
5c7d07f5be Rework styling using styled-components (#2517)
The CSS in the project is relatively difficult to change. While it is very DRY, it relies heavily on inheritance. It's difficult to make changes in the markup modal without it also affecting styles elsewhere.
 
[styled-components](https://www.styled-components.com/) is one of the leading CSS-in-JS libraries. By reducing dependency on global state and CSS inheritance, styles become explicit and are easier to inspect and change. It's also convenient that styles can be embedded with the components they modify.

At runtime, the library creates CSS classes, so it's pretty efficient.

We were using a little bit of [styled-jsx](https://github.com/zeit/styled-jsx) before, which ships with Next.js, though styled-components is more widely used and I've had good experiences with it all around.

In a few cases I've duplicated styles where it feels more natural to do that: for example, `text-align: center` is duplicated in `Main` and `MarkupModal`.

Much of this is a refactor, though there are a few visual changes, particularly in the markup modal and the style examples.
2018-12-18 16:44:47 -05:00
Caleb Cartwright
a1150efd25 Migrate [Coverity] to new service model (#2550)
* feat: migrate coverity to new service model
* chore: add coverity ondemand to deprecated services list
2018-12-18 21:19:50 +00:00
Paul Melnikow
b36a9040f3 Add warning banners to legacy services (#2546) 2018-12-18 20:52:17 +00:00
Caleb Cartwright
7d30d86f2b Migrate [Jira] services to new service model (#2541)
Migrates the Jira badge services to the new service model, and also adds tests for those badges. 

I did make one minor changes to the badge labels/messages when the issue or sprint cannot be found. For example: 

With the LegacyService implementation, when an issue was not found the badge would display as 'issue key | inaccessible' such as `KAFKA-2869 | inaccessible` but this changes that behavior to `jira | issue not found`. I personally find this to be a bit more informative of a message, but want to call it out as I know how important backwards compatibility is. However, at first glance I'm also not sure how we'd replicate the old behavior of using the issue key (provided by user as a param) as the badge label when an issue is not found because the API response has a status code of 404 and a different schema than what Joi is expecting/validating. 

Similarly for the sprints, the old format for a sprint not found was `completion | inaccessible` it's now `jira | sprint not found`
2018-12-17 23:30:33 -05:00
Dean Davidson
b0fbe5f76f Refactor [AzureDevOpsCoverage AzureDevOpsTests] to only report on completed builds; test all [azuredevops] (#2549)
This is in response to [this conversation](https://github.com/badges/shields/issues/2237#issuecomment-446812796). The change turned out being even easier than I had anticipated because the [API supports a buildStatus filter](https://docs.microsoft.com/en-us/rest/api/azure/devops/build/builds/list?view=azure-devops-rest-5.0#buildstatus). I did quite a bit of local testing to make sure this is solid. I also ran tests and checked coverage.
2018-12-17 23:12:52 -05:00
Caleb Cartwright
6c9fc0de79 Migrate [Codetally] to new service model (#2548) 2018-12-17 23:07:21 -05:00
dependabot[bot]
b4b29ab0f7 Bump moment from 2.22.2 to 2.23.0 (#2531)
Bumps [moment](https://github.com/moment/moment) from 2.22.2 to 2.23.0.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.22.2...2.23.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-17 12:49:15 -05:00
Caleb Cartwright
09e8c587d9 feat: migrate sourcegraph to new service model and fix tests (#2535) 2018-12-16 22:05:02 +00:00
chris48s
bca7416be7 couple of fixes to service test docs (#2542) 2018-12-16 20:50:07 +00:00
Paul Melnikow
2bf29f97b8 Set up CircleCI test summary [npmcollaborators] (#2526)
See https://circleci.com/docs/2.0/collect-test-data/

This provides a list of failed tests in the Circle UI and a summary of which tests have failed. It should make interpreting test results easier
2018-12-16 15:42:28 -05:00
chris48s
b5ac5d6044 [dynamicyaml f-droid] add yaml base service class (#2540) 2018-12-16 20:29:20 +00:00
chris48s
df22adfba7 remove logos for deprecated services (#2539)
* remove logos for deprecated services
* remove references to gratipay logo in tests
2018-12-16 19:33:27 +00:00
chris48s
e5cacbc73f refactor [CRAN] service (#2538) 2018-12-16 19:25:27 +00:00
Caleb Cartwright
dea35025b1 Deprecate [nsp] service (#2529)
deprecated nsp service and added doc for deprecation
2018-12-16 19:21:22 +00:00
Paul Melnikow
5e50b7bcc4 Fix [npm] badges when a dependency points to a URL (#2525)
Fix #2523
2018-12-13 14:07:33 -05:00
Paul Melnikow
ec35e8de06 Remove unused wait-promise dep (#2521) 2018-12-13 14:05:10 -05:00
dependabot[bot]
73be33226f Bump sinon from 7.2.0 to 7.2.2 (#2522)
Bumps [sinon](https://github.com/sinonjs/sinon) from 7.2.0 to 7.2.2.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v7.2.0...v7.2.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-13 12:37:25 -05:00
Paul Melnikow
b8461aa921 Rewrite [DynamicXml] and [DynamicYaml] badges (#2487)
- A little related cleanup in `server.js`: remove a couple import renames.
2018-12-12 16:52:47 -05:00
Paul Melnikow
a3a52524fc Add [npm] badges for collaborator count and dependency version (#2461)
This adds a badge for collaborator count. When evaluating a library, it can be useful to know that there's not a single-contributor bottleneck for publishing. Having more than one collaborator is a sign of library maturity.

It adds another badge for dependency version of published dependencies, which solves a similar problem as the node-version badge. I will find this useful for making sure dependencies are up to date in a library.
2018-12-12 15:02:37 -05:00
Paul Melnikow
38ca6fc396 Add quality category and sort a couple other badges [scrutinizer] (#2483)
Ref #1905
2018-12-12 14:59:46 -05:00
dependabot[bot]
f6da548dc3 Bump danger from 6.1.11 to 6.1.12 (#2513)
Bumps [danger](https://github.com/danger/danger-js) from 6.1.11 to 6.1.12.
- [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/6.1.11...6.1.12)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-12 19:24:55 +00:00
Pierre-Yves B
029a14681d Improved [MicroBadger] tests speed (#2512) 2018-12-12 19:19:45 +00:00
Antão Almada
a51111e170 Add Azure DevOps logo (#2463) 2018-12-11 16:42:30 -05:00
dependabot[bot]
46064a5f9c Bump react-modal from 3.6.1 to 3.7.1 (#2507)
Bumps [react-modal](https://github.com/reactjs/react-modal) from 3.6.1 to 3.7.1.
- [Release notes](https://github.com/reactjs/react-modal/releases)
- [Changelog](https://github.com/reactjs/react-modal/blob/master/CHANGELOG.md)
- [Commits](https://github.com/reactjs/react-modal/compare/v3.6.1...v3.7.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-11 16:33:35 -05:00
Paul Melnikow
88c8b0ee3e More example urls and static examples [apm waffle] (#2478) 2018-12-11 16:31:01 -05:00
Caleb Cartwright
d74568b9c9 Minor test updates for jenkins coverage and token-pool (#2509) 2018-12-11 21:10:21 +00:00
dependabot[bot]
bd930faf24 Bump sinon from 7.1.1 to 7.2.0 (#2506)
Bumps [sinon](https://github.com/sinonjs/sinon) from 7.1.1 to 7.2.0.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v7.1.1...v7.2.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-11 15:58:01 -05:00
dependabot[bot]
965816f363 Bump got from 9.3.2 to 9.4.0 (#2503)
Bumps [got](https://github.com/sindresorhus/got) from 9.3.2 to 9.4.0.
- [Release notes](https://github.com/sindresorhus/got/releases)
- [Commits](https://github.com/sindresorhus/got/compare/v9.3.2...v9.4.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-11 15:55:43 -05:00
dependabot[bot]
47d56de160 Bump enzyme-adapter-react-16 from 1.7.0 to 1.7.1 (#2504)
Bumps [enzyme-adapter-react-16](https://github.com/airbnb/enzyme) from 1.7.0 to 1.7.1.
- [Release notes](https://github.com/airbnb/enzyme/releases)
- [Changelog](https://github.com/airbnb/enzyme/blob/master/CHANGELOG.md)
- [Commits](https://github.com/airbnb/enzyme/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-11 15:52:15 -05:00
Caleb Cartwright
43faea4561 Add new service for CII Best Practices badges [CIIBestPractices] (#2477) 2018-12-11 19:20:51 +00:00
dependabot[bot]
40ddc26f9b Bump enzyme from 3.7.0 to 3.8.0 (#2505)
Bumps [enzyme](https://github.com/airbnb/enzyme) from 3.7.0 to 3.8.0.
- [Release notes](https://github.com/airbnb/enzyme/releases)
- [Changelog](https://github.com/airbnb/enzyme/blob/master/CHANGELOG.md)
- [Commits](https://github.com/airbnb/enzyme/compare/enzyme@3.7.0...enzyme@3.8.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-11 10:38:43 -05:00
Paul Melnikow
a677c5bbef Add some basic frontend tests (#2490)
The frontend has a few tests in `lib/` but not all of that is covered. The components are not covered at all. It's difficult to make changes to the frontend because you have to manually test that things haven't broken.

This PR uses [Enzyme](https://airbnb.io/enzyme/) to add some [shallow-rendering tests](https://github.com/airbnb/enzyme/blob/master/docs/api/shallow.md), which are essentially unit tests of the components.

This should pave the way for functional tests of the more complex components.
2018-12-10 17:20:01 -05:00
chris48s
0a98bd3121 refactor [dependabot] semver stability service (#2494) 2018-12-10 21:24:18 +00:00
chris48s
9189438a91 refactor [bountysource] service (#2492) 2018-12-10 21:21:39 +00:00
chris48s
b74fe4ed6f refactor [redmine] plugin rating services (#2491) 2018-12-10 20:02:38 +00:00
chris48s
66623644c3 make 'donate' call to action clearer (#2493) 2018-12-10 20:00:16 +00:00
dependabot[bot]
11e9e75e45 Bump danger from 6.1.9 to 6.1.11 (#2501)
Bumps [danger](https://github.com/danger/danger-js) from 6.1.9 to 6.1.11.
- [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/6.1.9...6.1.11)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-10 18:55:12 +00:00
Pierre-Yves B
c89396088d [Wheelmap] service rewrite and tests (#2486) 2018-12-10 18:44:47 +00:00
Paul Melnikow
1649a42a4a Fix whitespace in Codetally test (#2488)
This was caused by #2475 and fixes the mocked test. It's not related to #2480 which is causing the other one to fail.
2018-12-09 16:41:21 -05:00
dependabot[bot]
b08a941490 Bump eslint from 5.9.0 to 5.10.0 (#2484)
Bumps [eslint](https://github.com/eslint/eslint) from 5.9.0 to 5.10.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.9.0...v5.10.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-08 17:33:46 -05:00
dependabot[bot]
0e02f8d05e Bump nock from 10.0.3 to 10.0.4 (#2485)
Bumps [nock](https://github.com/nock/nock) from 10.0.3 to 10.0.4.
- [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/v10.0.3...v10.0.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-08 21:55:28 +00:00
dependabot[bot]
d0bbd1977f Bump icedfrisby-nock from 1.0.0 to 1.1.0 (#2482)
Bumps [icedfrisby-nock](https://github.com/paulmelnikow/icedfrisby-nock) from 1.0.0 to 1.1.0.
- [Release notes](https://github.com/paulmelnikow/icedfrisby-nock/releases)
- [Changelog](https://github.com/paulmelnikow/icedfrisby-nock/blob/master/CHANGELOG.md)
- [Commits](https://github.com/paulmelnikow/icedfrisby-nock/compare/1.0.0...1.1.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-08 21:32:27 +00:00
Paul Melnikow
58b276539a Refactor frontend main page and badge-example code (#2441)
- The goal of this PR is:
    - Consume the new service-definition format. (#2397)
    - Make the frontend more readable.
- Behavior changes:
    - I changed the **Image** field in the markup modal to show only the path.
    - I added another click-to-select field below that shows the complete URL.
    - This made it easier to suppress the live badge preview while it contains placeholders like `:user` or `:gem`, a minor tweak discussed at https://github.com/badges/shields/issues/2427#issuecomment-442972100.
    - The search box now searches all categories, regardless of the current page. (This is an improvement, I would say.)
- I did not deliberately address performance, though I ripped out a bunch of anonymous functions and avoided re-filtering all the examples by category on every render, which I expect will not hurt. I haven't really tested this on a mobile connection and it'd be worth doing that.
- It would be great to have some tests of the components, though getting started with that seemed like a big project and I did not want to make this any larger than it already is.

It's a medium-sized refactor:

1. Replace `BadgeExamples`, `Category` and `Badge` component with a completely rewritten `BadgeExamples` component which renders a table of badges, and `CategoryHeading` and `CategoryHeadings` components.
2. Refactor `ExamplesPage` and `SearchResults` components into a new `Main` component.
3. Rewrite the data flow for `MarkupModal`. Rather than rely on unmounting and remounting the component to copy the badge URL into state, employ the `getDerivedStateFromProps` lifecycle method.
4. Remove `prepareExamples` and `all-badge-examples`.
5. Rewrite the `$suggest` schema to harmonize with the service definition format. It's not backward-compatible which means at deploy time there probably will be 10–20 minutes of downtime on that feature, between the first server deploy and the final gh-pages deploy.  🤷‍♂️ (We could leave the old version in place if it seems worth it.)
6. Added two new functions in `make-badge-url` with tests. I removed _most_ of the uses of the old functions, but there are some in parts of the frontend I didn't touch like the static and dynamic badge generators, and again I didn't want to make this any larger than it already is.
7. Fix a couple bugs in the service-definition export.
2018-12-08 15:26:13 -05:00
Paul Melnikow
8a8311d931 Unify and minimize tester boilerplate (#2472)
I started using this one-line boilerplate a while back and it seems to tidy things up a bit.
2018-12-08 13:15:24 -05:00
Paul Melnikow
3f9ef53899 Prevent bad letter spacing when whitespace surrounds badge text (#2475)
This is a little fix I’ve been meaning to make for a while. Normally it manifests in the codetally badge, but that badge isn’t working right now.

Here’s a static example, where the right text is wrapped in spaces:

https://img.shields.io/badge/foo-%20bar%20-blue.svg

The spaces get included in width computation, though I suppose ignored when the svg renders, resulting in bad letter spacing.

With this fix, it renders the same as

https://img.shields.io/badge/foo-bar-blue.svg
2018-12-08 13:12:02 -05:00
chris48s
2a545b9853 fix swagger example (#2476) 2018-12-07 20:55:17 +00:00
Paul Melnikow
b26ebeb6b2 Modernize chrome web store examples; PR check state -> build (#2474)
`/users` and `/d` are the same so I dropped `/d` and updated `/users`.
2018-12-07 15:39:06 -05:00
Caleb Cartwright
88ca8ca3b5 tests: added some base class override tests (#2471) 2018-12-07 20:03:10 +00:00
Camilo QS
5b5ec38337 Improve [F-droid] support to .yml metadata format (#2377)
closes: #2083
2018-12-07 00:45:19 -05:00
dependabot[bot]
d0c9da03c8 Bump simple-icons from 1.9.14 to 1.9.15 (#2464)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 1.9.14 to 1.9.15.
- [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-12-06 22:16:19 +00:00
dependabot[bot]
ac330af883 Bump danger from 6.1.8 to 6.1.9 (#2460)
Bumps [danger](https://github.com/danger/danger-js) from 6.1.8 to 6.1.9.
- [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/6.1.8...6.1.9)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-06 22:11:20 +00:00
Caleb Cartwright
a5bbe9a8fa Fix Jenkins Cobertura badge and tests (#2468) 2018-12-06 22:07:27 +00:00
Pierre-Yves B
e9b19416e2 Updated Danger server guideline (#2467) 2018-12-06 22:04:15 +00:00
Paul Melnikow
6a737b7b38 Rewrite the DynamicJson badge (#2399)
This starts the rewrite of the dynamic badges. I've pulled into BaseService an initial version of the query param validation from #2325.

I've extended from BaseJsonService to avoid duplicating the deserialization logic, though it means there is a bit of duplicated code among the three dynamic services. The way to unravel this would be to move the logic from `_requestJson` and friends from the base classes into functions so DynamicJson can inherit from BaseDynamic. Would that be worth it?

This introduces a regression of #1446 for this badge.

Close #2345
2018-12-06 16:45:40 -05:00
Caleb Cartwright
b2d5d3ecca Add Leanpub Book Summary Badges [LeanpubBookSummary] (#2458)
* feat: adds LeanPub book summary badges
2018-12-06 21:19:41 +00:00
chris48s
8070f0bef9 add tests for rust [crates] and refactor (#2462)
* add tests for rust [crates] and refactor
2018-12-06 20:24:46 +00:00
M C
9e95020b18 Add [Matrix] Badge (#2417)
* Added matrix badge

* decreased the size of the matrix logo by more than 50%

* returning the size in fetch() instead of an object

* found another way to register a throwaway account (guest account). this one actually works on matrix.org, but I kept the old way as a backup method. also changed the POST from /members to /state because guest accounts didn't work with /members

* updated logo to a recolored version of the official logo

* Removed unnecessary comments.
Added documentation on how to create the badge URL.
Added a test that hits a real room to test for API compliance.
URLs are now obtained from getter functions.
Added JSON schema for the /state API request.
Improved state response filter.
Replaced example URL room ID to a dedicated testing room.
Made some error messages more helpful.

* correctly implemented requested changes

* changed color hex codes to constants
2018-12-06 19:25:59 +00:00
Tyler James Leonhardt
499ea363e0 Add PowerShell Gallery platform support (#2465)
Now that we have [PowerShell Core](https://github.com/powershell/powershell) the cross-plat version of PowerShell... it'd be really cool to have a badge that shows the OS's that your module works on.

On the PowerShell Gallery, users can do this by using the tags `Windows` `MacOS` `Linux`. In this PR, I use the PowerShell Gallery API to grab the tags from that package and display `windows` `macos` `linux` if they exist.

The result is:
![](https://i.imgur.com/auXUkJJ.png)

which aligns with Conda and Cocoapods
2018-12-06 13:23:40 -05:00
Paul Melnikow
daa47f88a6 Fix doc: trailing, not leading (#2459) 2018-12-05 16:42:02 -05:00
Paul Melnikow
477d357286 Sort some badges; add an Activity category (#2448) 2018-12-05 14:17:37 -05:00
Mehmet Seçkin
54569e9668 [AzureDevOpsTests] Refactor unit tests to improve stability (#2454)
* Correct regex generation logic

* Refactor variable name

* Mock Azure DevOps test result summary API

* Add live tests

Updated mocked tests to use expected values for assertion. Added live
tests to test the API. Added `no tests` as an acceptable result for live
tests.

* Declare common nock setup functions to avoid repetition
2018-12-05 11:04:15 -05:00
Paul Melnikow
16c798a65c Fix [travis] php-v tests (#2457)
See failures: https://circleci.com/gh/badges/shields/26998

It looks like the bug is in the original regex: #1372.
2018-12-04 19:37:18 -05:00
chris48s
37d27a8e6a couples of fixes to docs on porting legacy services (#2456)
- use the right issue no and link to it
- fix the trace command example
2018-12-04 22:17:42 +00:00
Paul Melnikow
a35e877391 Modernize some examples teamcity azuredevops travis [uptimerobot vaadin vscode-marketplace] (#2444)
Ref #1961
2018-12-04 16:44:30 -05:00
Paul Melnikow
986d215c18 Modernize some more examples (#2447)
Ref #1961
2018-12-04 16:23:13 -05:00
chris48s
bca9df2560 don't run service tests on master (#2392) 2018-12-04 19:43:17 +00:00
dependabot[bot]
7c0df62706 Bump nock from 10.0.2 to 10.0.3 (#2450)
Bumps [nock](https://github.com/nock/nock) from 10.0.2 to 10.0.3.
- [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/v10.0.2...v10.0.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-04 19:40:54 +00:00
Monica Bui
ec07f23942 Add [StackExchange] monthly questions badge service (#2432)
- Badge shows number of questions for a given library for the previous month (not current month because its in progress)
- Service works for not just the StackOverflow site but for other StackExchange sites also

Close #2378
2018-12-03 20:12:44 -05:00
Paul Melnikow
99e846d2ab Link together some of the documentation (#2446) 2018-12-03 18:05:34 -05:00
Paul Melnikow
809ecf73b9 Examples: Drop deprecated aliases query, urlPattern (#2443) 2018-12-03 16:30:12 -05:00
dependabot[bot]
4f83015732 Bump fast-xml-parser from 3.12.9 to 3.12.10 (#2442)
Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 3.12.9 to 3.12.10.
- [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases)
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-03 21:01:04 +00:00
Paul Melnikow
07d8572ffe Add static examples for [Node] (#2409)
Ref #1961
2018-12-03 15:55:26 -05:00
Paul Melnikow
919eed6c0f Remove longCache from static examples (#2440)
- `longCache` should not be appearing in the displayed URLs for the usage examples.
- `maxAge` is ignored for static badges.
2018-12-03 15:41:44 -05:00
Mehmet Seçkin
e8c411b6f9 Add Azure DevOps tests service (#2412)
Added a test results badge service for an Azure Pipelines build using the ResultSummaryByBuild endpoint. Added basic unit tests for the service.

Close #2411
2018-12-03 08:58:37 -05:00
Paul Melnikow
e3ad57d8fe Add tips for rewriting legacy services (#2429) 2018-12-03 00:27:12 -05:00
Pierre-Yves B
0a6afb4478 Added tests for Sourcegraph service (#2439) 2018-12-02 17:41:01 +00:00
Paul Melnikow
59fdd8a5b0 TokenPool: Add debug logging helper + return correct error (#2400)
Slice another sliver from #1205.
2018-12-02 11:28:21 -05:00
Tair Assimov
88294563cc Deprecate dockbit service - discontinued (#2410)
Ref: #2344
2018-12-02 11:26:10 -05:00
Paul Melnikow
2045489019 Service definition export format (#2397)
Three main goals:

1. In the front end:
      a. Show form fields and automatically assemble badge URLs (#701)
      c. Group together examples for the same service
      b. Show deprecated services
2. Make it easy to changing the schema of `examples`, thanks to 100% validation. One challenge with frameworks is that when there are typos things fail silently which is pretty unfriendly to developers. The validation should really help with that. (This caught one bug in AUR, though I fixed it in #2405 which landed first.)
3. Produce a service definition export for external tool builders. (#776)
4. Build toward harmony between the front-end data structure and the `examples` key in the service classes. I aliased `staticPreview` to `staticExample` which starts this process.

The old format:

- Lacked a consistent machine-readable representation of the fields.
- Flattened multiple examples for the same service were flattened.
- Excluded deprecated services.

The new format improves a few things, too:

- It cleans up the naming. Since this file evolved over time, the names were a bit muddled (i.e. what was an example vs a preview).
- It duplicated information (like `.svg`). (I can imagine dropping the `.svg` from our badge URLs someday, which would make the URLs easier to read and maintain.)
- For a human reading the YAML file, providing the static example as a deconstructed object is more readable.

Here are a couple snippets:

```yml
  - category: build
    name: AppVeyorCi
    isDeprecated: false
    route:
      format: '([^/]+/[^/]+)(?:/(.+))?'
      queryParams: []
    examples:
      - title: AppVeyor
        example: {path: /appveyor/ci/gruntjs/grunt, queryParams: {}}
        preview: {label: build, message: passing, color: brightgreen}
        keywords: []
      - title: AppVeyor branch
        example: {path: /appveyor/ci/gruntjs/grunt/master, queryParams: {}}
        preview: {label: build, message: passing, color: brightgreen}
        keywords: []
  - category: downloads
    name: AmoDownloads
    isDeprecated: false
    examples:
      - title: Mozilla Add-on
        example: {path: /amo/d/dustman, queryParams: {}}
        preview: {path: /amo/d/dustman, queryParams: {}}
        keywords: [amo, firefox]
```
2018-12-02 11:21:30 -05:00
Pierre-Yves B
658086bc46 Tests for [Pub] service (#2436) 2018-12-02 10:08:21 +00:00
Paul Melnikow
74aef34b77 Modernize [AzureDevops] examples (#2406) 2018-12-01 18:01:19 -05:00
chris48s
e20c7c8b14 show dynamic badge examples with a base (#2438)
this makes them a bit nicer to copy & paste
2018-12-01 21:55:18 +00:00
Paul Melnikow
2ec2c00787 Fix [LibrariesioDependencies] for project names containing dots (#2434)
Close #2424
2018-12-01 16:05:54 -05:00
Paul Melnikow
0aee712738 Fix crash in legacy service (#2437)
Bug in #2360
2018-12-01 15:10:32 -05:00
Paul Melnikow
54a36e9474 Refactor cache-header handling and config, create NonMemoryCachingBaseService, rewrite [flip] (#2360)
There's a lot going on in this PR, though it's all interdependent, so the only way I can see to break it up into smaller pieces would be serially.

1. I completely refactored the functions for managing cache headers. These have been added to `services/cache-headers.js`, and in some ways set the stage for the rest of this PR.

    - There are ample higher-level test of the functionality via `request-handler`. Refactoring these tests was deferred. Cache headers were previously dealt with in three places:
        - `request-handler.js`, for the dynamic badges. This function now calls `setCacheHeaders`.
        - `base-static.js`, for the static badges. This method now calls the wordy `serverHasBeenUpSinceResourceCached` and `setCacheHeadersForStaticResource`.
        - The bitFlip badge in `server.js`. 👈 This is what set all this in motion. This badge has been refactored to a new-style service based on a new `NoncachingBaseService` which does not use the Shields in-memory cache that the dynamic badges user.
    - I'm open to clearer names for `NoncachingBaseService`, which is kind of terrible. Absent alternatives, I wrote a short essay of clarification in the docstring. 😝 

2. In the process of writing `NoncachingBaseService`, I discovered it takes several lines of code to instantiate and invoke a service. These would be duplicated in three or four places in production code, and in lots and lots of tests. I kept the line that goes from regex to namedParams (for reasons) and moved the rest into a static method called `invoke()`, which instantiates and invokes the service. This _replaced_ the instance method `invokeHandler`.
    - I gently reworked the unit tests to use `invoke` instead of `invokeHandler`– generally for the better.
    - I made a small change to `BaseStatic`. Now it invokes `handle()` async as the dynamic badges do. This way it could use `BaseService.invoke()`.

3. There was logic in `request-handler` for processing environment variables, validating them, and setting defaults. This could have been lifted whole-hog to `services/cache-headers.js`, though I didn't do that. Instead I moved it to `server-config.js`. Ideally `server-config` is the only module that should access `process.env`. This puts the defaults and config validation in one place, decouples the config schema from the entire rest of the application, and significantly simplifies our ability to test different configs, particularly on small units of code. (We were doing this well enough before in `request-handler.spec`, though it required mutating the environment, which was kludgy.) Some of the `request-handler` tests could be rewritten at a higher level, with lower-level data-driven tests directly against `cache-headers`.
2018-12-01 13:57:34 -05:00
Paul Melnikow
17e57b4155 Add static examples to a few legacy services [travis david coveralls amo] (#2407)
It seems useful to accelerate #1961 even as the badge rewrites are still underway. This introduces a small amount of technical debt by hard-coding the static example, though continuing this work could allow us to eliminate the old ways of specifying examples. It seems like a decent tradeoff.
2018-12-01 13:52:49 -05:00
dependabot[bot]
18b95cba5a Bump snap-shot-it from 6.2.5 to 6.2.7 (#2421)
Bumps [snap-shot-it](https://github.com/bahmutov/snap-shot-it) from 6.2.5 to 6.2.7.
- [Release notes](https://github.com/bahmutov/snap-shot-it/releases)
- [Commits](https://github.com/bahmutov/snap-shot-it/compare/v6.2.5...v6.2.7)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-01 14:50:09 +00:00
dependabot[bot]
41b05b3320 Bump prettier from 1.15.2 to 1.15.3 (#2433)
Bumps [prettier](https://github.com/prettier/prettier) from 1.15.2 to 1.15.3.
- [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.15.2...1.15.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-01 14:40:30 +00:00
anatoly techtonik
07063fd1be TUTORIAL.md: Service handles requests to external APIs (#2422) 2018-11-29 20:08:20 -05:00
Monica Bui
3b3dd9fb1b Fix URL pattern for [StackExchange] Questions and Reputation per PR #2418 (#2430)
* Fix URL pattern for StackExchange Questions and Reputation per #2418

Url patterns have been changed back to their older legacy format.
Tests now run properly with this URL in addition to the examples
showing up on local.

* Make changes per review comments. Also change "q" to "t" parameter to match legacy url for questions
2018-11-29 19:07:31 -05:00
Paul Melnikow
bff4f83818 Rewrite [ElmPackage] (#2403)
Ref #1358
2018-11-29 17:38:49 -05:00
dependabot[bot]
24c0b9c7e7 Bump danger from 6.1.5 to 6.1.8 (#2416)
Bumps [danger](https://github.com/danger/danger-js) from 6.1.5 to 6.1.8.
- [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/6.1.5...6.1.8)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-29 22:29:31 +00:00
dependabot[bot]
4da2fa3aa9 Bump fast-xml-parser from 3.12.8 to 3.12.9 (#2395)
Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 3.12.8 to 3.12.9.
- [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases)
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-29 22:26:51 +00:00
Paul Melnikow
8d19f78363 Rewrite + tweak [Beerpay] (#2404)
Ref #1358
2018-11-29 17:24:29 -05:00
anatoly techtonik
1144dba14a TUTORIAL.md: Mention URL mapping upfront and clarify static meaning (#2425)
* TUTORIAL.md: Mention URL mapping upfront and clarify static meaning

* Be more specific that route is URL

* Explain async without reference to prior knowledge

* Use the same example URL to explain the directory layout

* Clean diff

* `route()` + `static`

- The route includes the base URL, so try to clarify that
- Add some more information about `static`
2018-11-29 14:46:42 -05:00
Monica Bui
9713964812 Port [StackExchange] from legacy to BaseJsonService (#2418)
Per part of issue #2378, convert StackExchange service to the newer
BaseJson class. Refactor also to seperate StackExchange reputation and
questions tag info into new StackExchange subservice files
as the legacy class contained both which may be difficult to keep track
of in the future as the service continues to grow.
More tests have been added to make sure other StackExchange sites besides
StackOverflow will still work with the new badge setup.
2018-11-28 21:40:12 -05:00
Paul Melnikow
43d99f96e6 Fix failing service tests for [bintray npmlicense github crates] (#2401)
Closes #2343 #2348 #2402

Ref: #2345 #1359
2018-11-28 18:54:04 -05:00
Paul Melnikow
77ff19903d Test the notfound routes in server.js (#2398) 2018-11-27 16:36:20 -05:00
Paul Melnikow
c678ca2abd Tweak [AUR] and add static examples (#2405) 2018-11-27 16:34:02 -05:00
Monica Bui
11493d6ab9 Add tests for [StackExchange] (#2414) 2018-11-27 15:55:05 -05:00
dependabot[bot]
1cebdd4bb1 Bump sinon-chai from 3.2.0 to 3.3.0 (#2408)
Bumps [sinon-chai](https://github.com/domenic/sinon-chai) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/domenic/sinon-chai/releases)
- [Commits](https://github.com/domenic/sinon-chai/compare/v3.2.0...3.3.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-27 10:44:35 -05:00
dependabot[bot]
a524658e74 Bump lint-staged from 8.0.5 to 8.1.0 (#2384)
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 8.0.5 to 8.1.0.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Commits](https://github.com/okonet/lint-staged/compare/v8.0.5...v8.1.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-25 21:29:04 +00:00
dependabot[bot]
aed2320d5a Bump joi from 14.0.6 to 14.3.0 (#2393)
Bumps [joi](https://github.com/hapijs/joi) from 14.0.6 to 14.3.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/v14.0.6...v14.3.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-25 21:20:47 +00:00
dependabot[bot]
08546544c8 Bump husky from 1.1.4 to 1.2.0 (#2381)
Bumps [husky](https://github.com/typicode/husky) from 1.1.4 to 1.2.0.
- [Release notes](https://github.com/typicode/husky/releases)
- [Changelog](https://github.com/typicode/husky/blob/master/CHANGELOG.md)
- [Commits](https://github.com/typicode/husky/compare/v1.1.4...v1.2.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-25 21:14:10 +00:00
Marcin Mielnicki
c72e366895 Run service tests on a given (remote) instance; test on [jetbrains] (#2195)
* Allow to run service tests for remote shields instance

* Allow to run service tests for remote shields instance - doc

* Load testedServerUrl from env variable

* Load 'skipIntercepted' flag from env variable
2018-11-25 15:51:57 +01:00
Pierre-Yves B
72955abac7 Added tests for Package Control service (#2390) 2018-11-25 14:33:05 +00:00
Paul Melnikow
b600bde44e The last of the badge examples (#2389)
* Move PowerShell

* Move Choco + Resharper

* Move MyGet and Nuget
2018-11-25 09:14:54 -05:00
Pierre-Yves B
b9f89d63d8 Added tests for OSS Lifecycle service (#2386) 2018-11-24 19:33:21 +00:00
dependabot[bot]
abec14812c Bump react-dom from 16.6.1 to 16.6.3 (#2374)
Bumps [react-dom](https://github.com/facebook/react) from 16.6.1 to 16.6.3.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/compare/v16.6.1...v16.6.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-24 13:18:26 -05:00
dependabot[bot]
1a75790078 Bump fast-xml-parser from 3.12.7 to 3.12.8 (#2385)
Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 3.12.7 to 3.12.8.
- [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases)
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-24 09:40:42 +00:00
dependabot[bot]
a35d528395 Bump danger from 6.1.4 to 6.1.5 (#2380)
Bumps [danger](https://github.com/danger/danger-js) from 6.1.4 to 6.1.5.
- [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/6.1.4...6.1.5)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-24 09:35:53 +00:00
dependabot[bot]
bef82d092f Bump simple-icons from 1.9.13 to 1.9.14 (#2383)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 1.9.13 to 1.9.14.
- [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-11-23 12:19:46 +13:00
Paul Melnikow
da0bf8c57c Remove unused chai-as-promised dependency (#2359) 2018-11-21 17:10:09 -05:00
Paul Melnikow
5c577bf8b7 Circle: Remove obsolete check (#2371)
As discussed at #2314.
2018-11-21 17:07:54 -05:00
Paul Melnikow
705d3dba9d Readme: Update badge label (#2372)
I think this better captures the meaning of this badge, especially from an outsider perspective.
2018-11-21 17:05:37 -05:00
Haythem Tlili
f076b46da8 CircleCI token documentation (#2379) 2018-11-21 10:42:26 -06:00
Haythem Tlili
ce0b492029 Fix CircleCI token example (#2373)
The CircleCI token example contains a redundant fragment `/circleci/circleci/:token`.
2018-11-20 15:35:44 -06:00
dependabot[bot]
5a367efe11 Bump eslint-plugin-node from 7.0.1 to 8.0.0 (#2225)
* Bump eslint-plugin-node from 7.0.1 to 8.0.0

Bumps [eslint-plugin-node](https://github.com/mysticatea/eslint-plugin-node) from 7.0.1 to 8.0.0.
- [Release notes](https://github.com/mysticatea/eslint-plugin-node/releases)
- [Commits](https://github.com/mysticatea/eslint-plugin-node/compare/v7.0.1...v8.0.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Update lockfile

* Temporarily ignore…
2018-11-19 16:15:47 -05:00
dependabot[bot]
7fa8f9dbca Bump react from 16.5.2 to 16.6.3 (#2319)
* Bump react from 16.5.2 to 16.6.3

Bumps [react](https://github.com/facebook/react) from 16.5.2 to 16.6.3.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/compare/v16.5.2...v16.6.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Bump react-dom from 16.5.2 to 16.6.1

Bumps [react-dom](https://github.com/facebook/react) from 16.5.2 to 16.6.1.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/compare/v16.5.2...v16.6.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-19 16:11:10 -05:00
dependabot[bot]
fcd33fec1e Bump @babel/core from 7.1.2 to 7.1.6 (#2318)
Bumps [@babel/core](https://github.com/babel/babel) from 7.1.2 to 7.1.6.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.1.2...v7.1.6)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-19 16:05:00 -05:00
dependabot[bot]
d9f132d865 Bump @babel/preset-env from 7.1.0 to 7.1.6 (#2315)
* Bump @babel/preset-env from 7.1.0 to 7.1.6

Bumps [@babel/preset-env](https://github.com/babel/babel) from 7.1.0 to 7.1.6.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.1.0...v7.1.6)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Update lockfile
2018-11-19 16:02:45 -05:00
Mehmet Seçkin
6b0977be9d Add support for JaCoCo style line coverage (#2369)
JaCoCo uses "Line" as the type name for line coverage metric counter.
Added a condition to accept "Line" as a valid coverage stat label to
support JaCoCo style coverage reports.

See https://www.jacoco.org/jacoco/trunk/coverage/report.dtd for details
2018-11-19 20:47:36 +00:00
Paul Melnikow
ccfac2eab3 Move remaining badge examples into services/ [cpan] (#2349)
Except NuGet; leaving those for the last pass.
2018-11-19 15:25:34 -05:00
dependabot[bot]
c9057266ea Bump concurrently from 4.0.1 to 4.1.0 (#2365)
Bumps [concurrently](https://github.com/kimmobrunfeldt/concurrently) from 4.0.1 to 4.1.0.
- [Release notes](https://github.com/kimmobrunfeldt/concurrently/releases)
- [Commits](https://github.com/kimmobrunfeldt/concurrently/compare/v4.0.1...v4.1.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-19 19:35:23 +00:00
dependabot[bot]
5bbac67869 Bump lint-staged from 7.3.0 to 8.0.5 (#2363)
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 7.3.0 to 8.0.5.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Commits](https://github.com/okonet/lint-staged/compare/v7.3.0...v8.0.5)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-19 19:27:27 +00:00
dependabot[bot]
c4076063d3 Bump joi from 14.0.4 to 14.0.6 (#2361)
Bumps [joi](https://github.com/hapijs/joi) from 14.0.4 to 14.0.6.
- [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/v14.0.4...v14.0.6)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-19 19:22:16 +00:00
chris48s
762245a547 refactor [conda] service (#2353) 2018-11-19 19:11:41 +00:00
Paul Melnikow
b922fca982 Fix regression with double-dash escaping in [StaticBadge] (#2367)
Fix #2366
2018-11-19 06:31:41 -05:00
dependabot[bot]
6305c59a25 Bump snap-shot-it from 6.2.3 to 6.2.5 (#2364)
Bumps [snap-shot-it](https://github.com/bahmutov/snap-shot-it) from 6.2.3 to 6.2.5.
- [Release notes](https://github.com/bahmutov/snap-shot-it/releases)
- [Commits](https://github.com/bahmutov/snap-shot-it/compare/v6.2.3...v6.2.5)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-19 00:48:07 -05:00
dependabot[bot]
cd856ef1e2 Bump husky from 1.1.3 to 1.1.4 (#2362)
Bumps [husky](https://github.com/typicode/husky) from 1.1.3 to 1.1.4.
- [Release notes](https://github.com/typicode/husky/releases)
- [Changelog](https://github.com/typicode/husky/blob/master/CHANGELOG.md)
- [Commits](https://github.com/typicode/husky/compare/v1.1.3...v1.1.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-19 00:35:34 -05:00
Paul Melnikow
842f545207 Coverage: ignore next.config (#2358)
It does not make sense to check coverage for `next.config.js`. This file is run by the frontend build, which seems sufficient.

If that file has logic in it that is complex enough to warrant testing, it should be broken out into a separate file.
2018-11-18 14:26:25 -05:00
Paul Melnikow
a6a1aaeb70 Friendlier test failures when services won’t register (#2350)
Avoids crashes in `server.spec.js` accompanied by this cryptic message:

```
Error: listen EADDRINUSE :::1111
  at Object._errnoException (util.js:1022:11)
  at _exceptionWithHostPort (util.js:1044:20)
  at Camp.setupListenHandle [as _listen2] (net.js:1367:14)
  at listenInCluster (net.js:1408:12)
  at doListen (net.js:1517:7)
  at _combinedTickCallback (internal/process/next_tick.js:141:11)
  at process._tickDomainCallback (internal/process/next_tick.js:218:9)
```

e.g. https://circleci.com/gh/badges/shields/24094
2018-11-18 13:20:08 -05:00
Paul Melnikow
40728f67b3 Examples: Fix queryParams with namedParams (#2339)
These tests clearly should be refactored, though I’d like to get this fix in, in advance of a more involved refactor that shifts most of the responsibility away from this function. Maybe we can even eliminate at least one of these cases in the meantime.
2018-11-18 13:14:38 -05:00
Pierre-Yves B
5ed0f67640 Deprecate [ImageLayers] service (#2352) 2018-11-18 18:08:47 +00:00
Pierre-Yves B
060d7dd484 Moved hhvm tests to right folder (#2351) 2018-11-18 18:05:25 +00:00
chris48s
6f9dd95a18 cut a v2.1.0 release (#2354) 2018-11-18 17:53:08 +00:00
chris48s
dfa1f408d9 fix [bundlephobia] tests (#2355)
closes #2342
2018-11-18 17:47:00 +00:00
Paul Melnikow
282520041d Add [GitlabPipeline] badge (#2325)
There's a lot of demand for the Gitlab badges (#541) and the PR has been lingering, so I thought I'd start off one of the simple ones as a new-style service. This one is SVG-based, so it shouldn't require the API-token logic which could use some more testing and will require us to create an app and configure it on our server.

We don't have any validation in place for `queryParams`. Probably this should be added to BaseService, though for the time being I extracted a helper function.

Thanks to @LVMBDV for getting this work started in #1838!
2018-11-18 10:06:47 -05:00
Paul Melnikow
a7efd88ceb Revert to standard CI image and remove lingering references to fonts (#2326)
Follow-on to #2311.
2018-11-18 09:08:23 -05:00
Paul Melnikow
3ad742e79a Example: Canonicalize urlPattern to pattern (#2341)
Close #2334 

To avoid merge conflicts, I've deferred removing the aliasing logic in `prepareExamples`. That whole function will be refactored momentarily, and there's also #2339 open.
2018-11-18 09:03:33 -05:00
Paul Melnikow
73fcc1ccac Deprecate old [StaticBadge] using a redirect (#2333)
Now that the static badge has been moved in #2284, next in line for cleaning out `server.js` is this “static badge, old format.” I imagine this route is _very, very old_. (I wouldn’t be surprised if it’s not used at all. I’d be curious to see some stats on that endpoint. If it's not regularly getting requests I could see dropping it.)

In the case of URLs which have permanently changed, an approach I’d like to try is issuing a 301 Redirect.

The benefit is that if a user pastes the URL into the address bar while they are previewing or editing it, the browser will replace the address with the corrected URL when it loads. I figure this will cause some people to update their URLs with no effort, simply because they previewed the badge in their browser, and others to change over, if they notice it.

We incur a slight cost, which is a second request. However many browsers cache the 301’s indefinitely, and we can set an effectively infinite cache duration so the CDN and most other downstream caches will keep them a long time. And handling the redirect is extremely cheap.

This is a nice way to preserve backward compatibility of old routes without having to complicate the new route, such as in the case of vso -> azure-devops. For maintenance purposes, the route that redirects can effectively be treated separately.

It’s also a nice, gentle, and confidence-inspiring way to signal that users should update their URLs.

We could generalize this code, though I think this is a good place to start. This route is tricky because it needs to be loaded last, complicating a reusable solution.
2018-11-17 15:22:03 -05:00
chris48s
da388b7079 add a smoke test for BadgeFactory (#2338) 2018-11-17 19:21:24 +00:00
chris48s
d3c454e0dd remove dependency on pdfkit (#2337) 2018-11-17 19:19:01 +00:00
dependabot[bot]
765dfacf72 Bump prom-client from 11.1.2 to 11.2.0 (#2316) 2018-11-17 16:31:34 +00:00
Paul Melnikow
9d77c8afe2 Rewrite [codacy] badges; rm unused svg helpers (#2275) 2018-11-17 09:51:20 -05:00
Paul Melnikow
84a5be3946 Declare static examples using namedParams (#2308)
This continues the work from #2279, by allowing example badges to be specified using `namedParams`. Using an object makes it possible for us to display these in form fields down the line. (#701)

I've called this the "preferred" way, and labeled the other ways deprecated. I've also added some doc to the `examples` property in BaseService. Then I realized we had some doc in the tutorial, though I think it's fine to have a short version in the tutorial, and the gory detail in BaseService.

I've also added a `pattern` keyword, and made `urlPattern` an alias.

Closes #2050.
2018-11-17 09:47:25 -05:00
Paul Melnikow
00d5f87a77 BaseService Only accept valid extension sep, and simplify regex; test on [azuredevops] (#2307) 2018-11-17 09:41:08 -05:00
Paul Melnikow
ff9cd20821 Coverage cleanup (#2328)
- Stop running daily service tests in the main repo (since they're now handled [over here](https://github.com/badges/daily-tests)
- Add coverage and separate daily tests badges with links to coveralls
- Update our coverage ignores
    - Move scripts, which do not need coverage, into `scripts/`
- Split out coverage test for npm package
- Remove spurious env var

Ref: #1584 #2314
2018-11-17 09:37:09 -05:00
Paul Melnikow
547380f794 Allow handle() to return a numeric message (#2332)
This regression from #2284 was causing `{ message: 22 }` to render as `’n/a’`, as in this test run: https://circleci.com/gh/badges/shields/23680
2018-11-17 09:32:57 -05:00
Paul Melnikow
065dd570ad Move [StaticBadge] to own service & add test; also affects [gitter] (#2284)
This picks up @RedSparr0w's work in #1802.

1. The handler for the static badge is moved into its own service with a synchronous handler. Avoiding an async call may make the static badges slightly faster, though it may be worth profiling this if it turns out we want asynchronous static badges in the future. If it doesn't make a performance difference we could make this handler `async` like the others.
2. Most of the custom static-badge logic is in a BaseStaticBadge base class.
3. Rewrite the static Gitter badge to use BaseStaticBadge.
4. A bit of minor cleanup in related functions.
2018-11-16 19:21:48 -05:00
dependabot[bot]
921adc9939 Bump eslint from 5.7.0 to 5.9.0 (#2329)
Bumps [eslint](https://github.com/eslint/eslint) from 5.7.0 to 5.9.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.7.0...v5.9.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-16 22:00:50 +00:00
dependabot[bot]
4c2494f20a Bump danger from 6.0.5 to 6.1.4 (#2324)
Bumps [danger](https://github.com/danger/danger-js) from 6.0.5 to 6.1.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/6.0.5...6.1.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-16 21:52:49 +00:00
dependabot[bot]
0bf8ebea3a Bump fast-xml-parser from 3.12.5 to 3.12.7 (#2322)
Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 3.12.5 to 3.12.7.
- [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases)
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-16 21:47:08 +00:00
Caleb Cartwright
6aa45e756b [AzureDevOpsCoverage] Adds Coverage Badge for Azure DevOps (#2327) 2018-11-16 02:40:52 -05:00
dependabot[bot]
3f0ac63ca7 Bump node-fetch from 2.2.1 to 2.3.0 (#2323)
Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.2.1 to 2.3.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.2.1...v2.3.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-15 18:06:57 -05:00
Paul Melnikow
51897b3c7e Precompute text width using a lookup table (#2311)
This simplifies and further optimizes text-width computation by computing the entire width table in advance, and serializing it in the style of QuickTextMeasurer (#1390). This entirely removes the need for PDFKit at runtime. This has the advantage of fixing #1305 – more generally: producing the same result everywhere – without having to deploy a copy of Verdana.

The lifting is delegated to these three libraries, which are housed in a monorepo: https://github.com/metabolize/anafanafo

I'd be happy to move it into the badges org if folks want to collaborate on maintaining them.

QuickTextMeasurer took kerning pairs into account, whereas this implementation does not. I was thinking kerning would be a necessary refinement, though this seems to work well enough.

I dropped in a binary-search package to traverse the data structure, in part to conserve space. This causes a moderate performance regression, though there is ample room for improving on that: https://github.com/badges/shields/pull/2311#issuecomment-439182704
2018-11-15 17:27:21 -05:00
Paul Melnikow
fe05d00747 Move github examples into services/github (#2309) 2018-11-15 15:57:56 -05:00
Paul Melnikow
5d63effabc Fix a crasher in production (#2313)
When I deployed 5e99aad2de to s0, shortly after Sentry picked up an unhandled error. I'm not sure which of the legacy badges this is in.

The bug was introduced just now, in #2257. Oops!

A test would have caught this, but I don't think it's worth wrapping tests around this difficult-to-test code. It makes more sense I think, to refactor the remaining badges that use it, replace it with something using async/await (maybe based on [node-cache](https://www.npmjs.com/package/node-cache), and test that.
2018-11-15 14:25:46 -05:00
chris48s
b68ac16092 Move NPM package files out of /lib ; affects [resharper nuget myget dub chocolatey github] (#2300)
* move gh-badges files out of /lib

As far as possible, this is just moving files
around and updating paths however there are 2
functional changes in this commit:
- remove use of lib/register-chai-plugins.spec
  in badge-cli.spec.js
- remove use of starRating()
  in text-measurer.spec.js

* update service tests that use colorscheme.json

* split package.json in two

* clean up import

* don't hard-code path

* start a changelog

* put a license file in the package dir

* re-organise documentation 📚

* don't pack test files

* remove favicon from Makefile

* give package its own test command

* link the docs better in README
2018-11-15 18:48:01 +00:00
Emlyn Corrin
aed39bfde9 [Clojars] Add downloads badge (#2305)
Add Clojars downloads badge
2018-11-15 18:32:22 +00:00
dependabot[bot]
83e44b7e7d Bump prettier from 1.15.1 to 1.15.2 (#2321)
* Bump prettier from 1.15.1 to 1.15.2

Bumps [prettier](https://github.com/prettier/prettier) from 1.15.1 to 1.15.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.15.1...1.15.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Run prettier
2018-11-15 09:50:48 -05:00
dependabot[bot]
17716953f2 Bump eslint-config-prettier from 3.1.0 to 3.3.0 (#2304) 2018-11-15 00:44:59 +00:00
dependabot[bot]
81691c5bb3 Bump opn-cli from 3.1.0 to 4.0.0 (#2303) 2018-11-15 00:30:53 +00:00
dependabot[bot]
e46a6fbde1 Bump snap-shot-it from 6.1.10 to 6.2.3 (#2301)
Bumps [snap-shot-it](https://github.com/bahmutov/snap-shot-it) from 6.1.10 to 6.2.3.
- [Release notes](https://github.com/bahmutov/snap-shot-it/releases)
- [Commits](https://github.com/bahmutov/snap-shot-it/compare/v6.1.10...v6.2.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-14 19:19:36 -05:00
Paul Melnikow
5e99aad2de Rewrite [NuGet] badges including [myget chocolatey resharper powershellgallery] (#2257)
The NuGet badge examples are straggling in all-badge-examples. Rather than move them as is, I thought it made more sense to refactor the services and see if they could be generated. I didn't take that on here; this is a straight rewrite of the badges. The old implementations were fairly difficult to follow. The new implementations are complicated too, though I hope much more readable.

Though the NuGet behaviors could be consolidated into a single flag, I split `withTenant` and `withFeed` into separate flags, thinking naming the behaviors makes the implementations easier to understand. I defaulted these to true, thinking that really this is really a MyGet implementation which is generalized to NuGet. Though maybe it makes more sense to have the MyGet style as the default. Probably it doesn't matter much either way.

I added a helper class ServiceUrlBuilder to construct the Shields service URL. It's useful in this complex case where the URL must be built up conditionally. This might be useful in a couple other places.

I also wrote a new service to handle the Powershell badges. They've diverged a little bit from the Nuget v2. There's a bit of shared code which I factored out.

If the XML Nuget APIs are more reliable, we could consider switching everything else over to them, though for now I would like to get this merged and get #2078 fixed.

Fix #2078
2018-11-14 17:28:15 -05:00
Paul Melnikow
510491f376 Try to fix recent CircleCI failures (#2306)
All the recent circle builds are failing and when I re-ran a build on master, I'm seeing the same failure.

```

npm ERR! path /root/repo/node_modules/gh-badges
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall access
npm ERR! enoent ENOENT: no such file or directory, access '/root/repo/node_modules/gh-badges'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-11-12T14_28_41_232Z-debug.log
Exited with code 254
```

After reading https://discuss.circleci.com/t/cant-run-npm-install/19012 I wonder if it's related to the `working_directory` line. That issue suggests not using it.
2018-11-12 12:26:42 -06:00
Tien Pham
29fedc3448 Docs improvement (#2299) 2018-11-11 13:27:37 -06:00
Paul Melnikow
652d2e5611 Remove extra file checked in by mistake (#2298) 2018-11-11 09:48:32 -06:00
Marcin Mielnicki
a039fffe79 Refactor [Jetbrains] service; affects [eclipse-marketplace] (#2232)
* Refactor Jetbrains

* Test that custom parser options are provided

* Code refactoring

* Code refactoring

* url -> route

* package-lock.json updated
2018-11-10 16:05:00 +01:00
chris48s
d0fe97d136 refactor [docker] service (#2263) 2018-11-09 21:57:13 +00:00
chris48s
4b88590619 bump version (#2296) 2018-11-09 21:53:47 +00:00
Paul Melnikow
5dd4ee078b Start on the Github rewrite, with [GithubPullRequestCheckState] (#2253)
The GitHub service family is the largest, and as yet untouched by our service rewrite. I thought I would start the process by tackling one service.

This pull request has a few things going on:

1. Rename pull-request-status to pull-request-check-state. We have another badge called pull request status. It seems like the checks are called one thing in the UI and another thing in the API, which is unfortunate. If other folks have strong feelings about the name, I’ll defer.
2. Move its tests and tighten up the syntax.
3. Move its badge examples including the doc string.
4. Add a new helper `errorMessagesFor` to use in the new services in place of `githubCheckErrorResponse`. It seems like we didn’t really use the `errorMessages` parameter to `githubCheckErrorResponse`, so I pared this down. I’m not sure if this is the function we’ll ultimately want, but it seems like a good place to start.
5. Pull fetch code I _know_ we use in other places into `github-common-fetch`. As in the PR I just opened for azure-devops, this takes a functional approach to the shared code, which is more direct, nimble, and easy to reason about than inheritance.
6. Create `GithubAuthService` which functions identically to BaseJsonService, except for one thing, which is that it uses the token pool. I accomplished this by adding a `_requestFetcher` property to BaseService, which is initialized to `sendAndCacheRequest` in the constructor, and can be overridden in subclasses. Since we weren’t using `_sendAndCacheRequest` directly except in BaseService and tests, I removed that property. I like this approach to patching in the GitHub auth because it’s very simple and creates no new API exposure. However, the way we’re doing the dependency injection feels a bit odd. Maybe the eventual refactor of request-handler would be a godo time to revisit this.

The GitHub requests go through many, many layers of indirection at this point. Later on it would be good to shave some of these off, perhaps once the legacy GitHub services have been converted, or when all the services are done and we can take another look at the base service hierarchy. The work in #2021 and #1205 is also related.
2018-11-09 16:22:48 -05:00
Paul Melnikow
2bc2450d19 Fix hex colors in static examples (#2295)
Fix a regression from #2240 which was noticed here:

https://github.com/badges/shields/pull/2253#issuecomment-437415722
2018-11-09 15:26:03 -05:00
Paul Melnikow
3eac8ebbfb Rework GitHub acceptor and move to its own module (#2021)
Continue to merge the work from #1205.
2018-11-09 15:14:01 -05:00
Paul Melnikow
02ec19fd22 BaseService terminology: Rename url to route (#2278)
The term “url” is overloaded in services, to refer to the Shields route and also the API URL. Calling the Shields URL a “route” is on the whole more descriptive, and makes it clearer and more obvious which one of these we’re talking about. It’s a small thing, though seems like an improvement.

We have a few functions called `buildUrl`. I’ve renamed them to `buildRoute` when they refer to routes, and left them as `buildUrl` when they refer to API URLs.

I included a minor style tweak and some formatting cleanup in `TUTORIAL.md`.
2018-11-09 15:11:03 -05:00
Paul Melnikow
c0f9a88719 Website: Tweak footer and usage (#2285) 2018-11-09 14:47:23 -05:00
Paul Melnikow
e4e5628207 Fix suggest on staging in Firefox (#2277)
Fix #2245
2018-11-09 14:06:13 -05:00
Paul Melnikow
c4af2cac53 Convert a bunch of URL formats to patterns (#2293)
Follow-on to #2279
2018-11-09 14:03:00 -05:00
dependabot[bot]
ec65291a11 Bump simple-icons from 1.9.12 to 1.9.13 (#2294)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 1.9.12 to 1.9.13.
- [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-11-09 17:54:41 +00:00
dependabot[bot]
804c4e4a6f Bump danger from 4.4.8 to 6.0.5 (#2291)
Bumps [danger](https://github.com/danger/danger-js) from 4.4.8 to 6.0.5.
- [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/4.4.8...6.0.5)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-09 16:35:26 +00:00
Paul Melnikow
291f35d4ad Reduce duplication in badge regex/url patterns (#2279)
This reduces duplication in badge regex/url patterns, and reduces the need to understand regexes in order to create badges.

Ref: #2050
2018-11-08 15:05:44 -05:00
Paul Melnikow
611e58e43e Make a few github tests more reliable (#2292)
The version test is failing because the shields repo version is not a dotted version.
2018-11-08 14:48:44 -05:00
dependabot[bot]
e240409033 Bump prettier from 1.14.3 to 1.15.1 (#2289)
* Bump prettier from 1.14.3 to 1.15.1

Bumps [prettier](https://github.com/prettier/prettier) from 1.14.3 to 1.15.1.
- [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.3...1.15.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Run prettier
2018-11-08 14:39:00 -05:00
dependabot[bot]
57e4d82a90 Bump joi from 14.0.3 to 14.0.4 (#2267)
Bumps [joi](https://github.com/hapijs/joi) from 14.0.3 to 14.0.4.
- [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/v14.0.3...v14.0.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-08 19:31:25 +00:00
dependabot[bot]
c600bf4800 Bump node-fetch from 2.2.0 to 2.2.1 (#2276)
Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.2.0 to 2.2.1.
- [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.2.0...v2.2.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-08 19:02:42 +00:00
chris48s
9c658a1345 fix [hexpm] validation (#2282)
closes #2272
2018-11-06 22:28:27 +00:00
chris48s
6199b1a878 add not found tests back in for [depfu hexpm requires] (#2281)
* add not found tests back in for [depfu hexpm requires]
* update the docs
2018-11-06 22:24:50 +00:00
chris48s
33d5f8f772 round [wordpress] rating (#2283)
closes #2280
2018-11-06 22:20:38 +00:00
Paul Melnikow
5019d81642 Add vso keyword to azure badges (#2274) 2018-11-06 16:17:49 -05:00
chris48s
b19d6d0072 refactor [bitbucket] service (#2261)
* refactor [bitbucket] service
2018-11-06 20:27:55 +00:00
dependabot[bot]
88402dd7a8 Bump simple-icons from 1.9.10 to 1.9.12 (#2273)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 1.9.10 to 1.9.12.
- [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-11-06 12:00:09 +13:00
dependabot[bot]
c8ce4fabb4 Bump nock from 10.0.1 to 10.0.2 (#2266)
Bumps [nock](https://github.com/nock/nock) from 10.0.1 to 10.0.2.
- [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/v10.0.1...v10.0.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-05 16:58:19 -05:00
Paul Melnikow
3bb392dfae Remove some duplicated URL generation code (#2240)
I went down a rabbit hole while trying to untangle the bug in the dockbit and bitrise examples https://github.com/badges/shields/pull/2234#pullrequestreview-169997546.

The URL generation code is spaghetti-like, with functions, many of which I wrote, with opaque names, doing similar but not identical things, and making slightly incompatible assumptions about the way query strings are handled.

I got a bit lost and need to take a step back.

Meanwhile, this is a small piece of work I did that’s worth keeping. It doesn’t scratch the surface of the tangle, but it does remove a bit of duplication.

It also makes a minor stylistic ES6 change in the handling of default arguments.

Ref: #2027
2018-11-05 16:55:49 -05:00
Paul Melnikow
e983f7bf3b Rewrite vso, rename to [AzureDevops], validate SVG [readthedocs] (#2252)
1. Add validation to BaseSvgScrapingService and update readthedocs accordingly.
2. Rewrite vso and add more tests. Rename it internally to azure-devops. URLs are still `/vso` for now. Should we make a way to let a service register multiple URL patterns?
3. Handle shared code using a functional pattern instead of inheritance. This comes from a discussion https://github.com/badges/shields/pull/2031#issuecomment-417893819. I like the functional approach because it's more direct, nimble, and easy to reason about; plus it allows services to grow from a family of one to two more easily.
2018-11-05 16:52:53 -05:00
Paul Melnikow
600c369823 Remove some uses of to-be-deprecated url.format and url.parse APIs (#2265)
See #2225
2018-11-05 16:48:04 -05:00
Marcin Mielnicki
ba94610840 package-lock.json aded for files in Now config file (#2264) 2018-11-05 21:07:32 +01:00
Marcin Mielnicki
bc4bd79e90 Metrics with Prometheus (#2069)
* Basic process metrics

* Enable Prometheus by an environment variable

* Code formatting

* Documentation for Prometheus metrics

* Link from README to documentation of Prometheus

* Link from README to documentation of Prometheus

* Link from README to documentation of Prometheus

* Separate module for metrics + tests

* Metrics limited by IP

* Metrics are forbidded for all requets by default

* Code refactoring

* allowedIps passed as a string to PrometheusMetrics

* Handle missing config

* METRICS_PROMETHEUS_ALLOWED_IPS added to documentation

* Log info about enabled metrics

* Unused code removed

* package-lock.json updated

* prom-client updated to 11.1.2

* Code refactoring

* Do not read IP address from X-Forwarder-For header
2018-11-04 18:54:43 +01:00
Thaddée Tyl
1460855d6b Upgrade to camp 17.2.2 (#2260)
This fixes remaining vulnerabilities raised by `npm audit`.

Follow-up to https://github.com/badges/shields/pull/2258.

Related issues from dependencies:

- camp upgrade: https://github.com/espadrine/sc/issues/64
- socket.io vulnerability: https://github.com/get/parsejson/issues/4
2018-11-04 12:00:28 +00:00
Paul Melnikow
d55e1c15a6 Enforce using async-await [f-droid] (#2241)
Close #2028
2018-11-04 00:33:47 -04:00
Paul Melnikow
72768d32d9 Fix some npm audit warnings (bump debug) (#2258)
The only remaining vulnerabilites are in scoutcamp: espadrine/sc#64.
2018-11-04 00:23:37 -04:00
Paul Melnikow
83ac6ff1b3 Enforce use of template literals (#2242)
This is consistent with what we're pretty much already doing, and saves us from making the request during code review.

These were all autofixed and most of them seem easier to read. Some in the legacy services should be rewritten in more legible forms during refactor (ie using intermediate variables, or using request’s qs option). There are some in helper functions and elsewhere that should get rewritten separately. I don't want to change them in this PR because the changes will get lost in this diff, though we could identify them here and fix them before or just after.
2018-11-02 17:11:44 -04:00
dependabot[bot]
4a298cbcb0 Bump husky from 1.1.2 to 1.1.3 (#2254)
Bumps [husky](https://github.com/typicode/husky) from 1.1.2 to 1.1.3.
- [Release notes](https://github.com/typicode/husky/releases)
- [Changelog](https://github.com/typicode/husky/blob/master/CHANGELOG.md)
- [Commits](https://github.com/typicode/husky/compare/v1.1.2...v1.1.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-02 20:39:38 +01:00
Paul Melnikow
8feb75d97d Move more badge examples into services/ (#2247)
Continuing the work from #2234, this creates additional, empty LegacyServices to hold the badge examples for conda and cocoapods. It's an approach we could take to finish emptying out all-badge-examples while the refactoring continues.

On the website badge, even the first URL path component is variable. I didn't think it could be moved, but it can!
2018-11-01 19:39:28 -04:00
Paul Melnikow
cdb4cb36a4 Improve static example validation message (#2246) 2018-11-01 19:36:25 -04:00
dependabot[bot]
52d642cf91 Bump joi from 14.0.2 to 14.0.3 (#2251)
Bumps [joi](https://github.com/hapijs/joi) from 14.0.2 to 14.0.3.
- [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/v14.0.2...v14.0.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-01 20:25:18 +00:00
dependabot[bot]
a5894c5350 Bump sinon from 7.1.0 to 7.1.1 (#2248)
Bumps [sinon](https://github.com/sinonjs/sinon) from 7.1.0 to 7.1.1.
- [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/v7.1.0...v7.1.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-01 20:18:21 +00:00
dependabot[bot]
f6b6b66fc2 Bump simple-icons from 1.9.9 to 1.9.10 (#2249)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 1.9.9 to 1.9.10.
- [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-11-01 20:15:18 +00:00
Paul Melnikow
275805e90c Add BaseSvgScrapingService and rewrite [ReadTheDocs]; also affects [codacy vso] (#2229)
Based on discussion in #2031, this adds an abstract service for SVG badges. I started with Readthedocs and the other services can be done as a follow-on.

I called it **BaseSvgScrapingService** rather than **BaseSvgService** to clarify that it's for badges from svg source data – not svg badges, which is all the badges.

Since I don't expect the svg parsing function to be used anywhere else once the services are refactored, I moved it into the class. I added a default value for `valueMatcher`, which works on Shields-style badges and seems to be used more than once.

The tests are based on XmlBaseService. I added one for valueMatcher, and also moved the SVG parsing badge here. Testing on codacy + vso should ensure the old `fetchFromSvg` is still working.
2018-11-01 15:09:00 -04:00
piekar294
730dc67cdf Migrate babel 6.x to babel 7.1 (#2222)
* Upgrade babel 6.x to babel 7.0
* Next 6.1.1 + additional babel packages needed for Babel 7.0
* Add @babel/register
* use @babel/preset-env in babel.presets to enable babel.env configuration
2018-11-01 15:03:50 -04:00
Paul Melnikow
07b282fa1f Enforce property shorthand (#2243)
I had to track down the right lint rule for this. We have no-useless-rename for destructuring and import/export. The one for object literals is object-shorthand.
2018-11-01 13:46:23 -04:00
Paul Melnikow
b7ecbd0a0d Move build badge examples into services/ (#2234)
all-badge-examples is a common cause of merge conflicts. It’s difficult to adjust the badge categorization in that file – or to understand the diff – because it requires moving a block from one point to another. It’s much easier to edit a badge’s category in one place.

This starts the process of breaking up what’s left of that file, following up on the work from #1931. New-style services can only be in one category, which means legacy service examples have to be split along category lines. I split out separate legacy service classes where I could do so easily, leaving behind the ones which require more work, for one reason or another.
2018-10-31 17:32:35 -04:00
Paul Melnikow
973eeb0ea7 Make bintray test more reliable (#2239)
See https://circleci.com/gh/badges/shields/19875
2018-10-31 17:28:17 -04:00
Paul Melnikow
07c5f47a73 Rework [suggest] code using async/await (#2029) 2018-10-31 17:19:14 -04:00
Pierre-Yves B
cc843946d0 Readme examples (#2233) 2018-10-31 13:47:58 +00:00
Paul Melnikow
94611fb0e4 Rewrite server deploy script (#1793)
To run this requires renaming `private/secret.json` to `private/secret-production.json` in the working tree used for deployment.

Goals:

- Ensure production secrets are not used in development
- Avoid modifying the current working tree
- Avoid branch switching: make sure the current ref gets deployed
    - If something other than `master` is deployed, leave `HEAD` alone; don't reset to `master`
- Ensure the build runs before server deploy (#1941)

This makes use of Git working trees, which is a relatively new but stable feature in Git. I was initially reluctant to use git worktree, mostly because I don't like adding new tooling that isn't necessary. The other alternative I experimented with was copying or re-cloning to an entirely separate working copy. This was messier and more brittle than using `git worktree`.
2018-10-30 17:08:52 -04:00
dependabot[bot]
d22fa6671e Bump snap-shot-it from 6.1.10 to 6.2.2 (#2227)
Bumps [snap-shot-it](https://github.com/bahmutov/snap-shot-it) from 6.1.10 to 6.2.2.
- [Release notes](https://github.com/bahmutov/snap-shot-it/releases)
- [Commits](https://github.com/bahmutov/snap-shot-it/compare/v6.1.10...v6.2.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-10-30 20:31:02 +00:00
dependabot[bot]
f9384d769b Bump react from 16.5.2 to 16.6.0 (#2213)
* Bump react from 16.5.2 to 16.6.0
* Bump react-dom from 16.5.2 to 16.6.0
2018-10-30 20:23:30 +00:00
chris48s
6fc8744bab Give the NPM package some love (#2200)
* define a public interface for NPM package
* move check-node-version to dependencies
* add missing file to package
* update docs
* bump version
* add gh-badges option to issue template
* abstract text measuring from users
* add a DocBlock for BadgeFactory.create()
2018-10-30 18:34:04 +00:00
piekar294
d7a52f3228 Make shippable preview bagde static (#2230) 2018-10-30 18:17:28 +00:00
dependabot[bot]
0a67631f2e Bump joi from 14.0.1 to 14.0.2 (#2235)
Bumps [joi](https://github.com/hapijs/joi) from 14.0.1 to 14.0.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/v14.0.1...v14.0.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-10-30 18:04:39 +00:00
dependabot[bot]
505940e194 Bump eslint from 5.7.0 to 5.8.0 (#2226)
Bumps [eslint](https://github.com/eslint/eslint) from 5.7.0 to 5.8.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.7.0...v5.8.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-10-29 22:22:11 -04:00
Danial
2ee98f92ce bump simple-icons version (#2231)
* bump simple-icons version

* require specific version
2018-10-29 21:58:17 -04:00
Tagan Hoyle
b6c851a377 Refactor [Requires]IO (#2220) 2018-10-28 16:19:39 +00:00
Paul Melnikow
e66d92f835 Add some error messages for the developer when .service.js is malformed (#1894)
Add some error messages for the developer when .service.js is malformed

When loading `.service.js` files which don’t contain services, such as when the export is forgotten, print helpful error messages. This will only occur during development; the unit tests will catch these problems well before code reaches the server.
2018-10-28 15:58:38 +00:00
chris48s
87524976c9 upgrade to Joi 14; affects [elm-package jetbrains npmversion pypi vaadin-directory dynamic-xml] (#2221)
* upgrade to Joi 14
    Joi 14 throws an exception on regexes which use the `g` flag
    see https://github.com/hapijs/joi/issues/1615
    semver-regex uses the `g` flag
    https://github.com/sindresorhus/semver-regex/blob/master/index.js
    so in order to upgrade Joi, I've swapped out semver-regex
    We'll use joi-extension-semver for semver validation now

* use isVPlusDottedVersionNClauses in jetbrains tests
    some of these projects use version numbers like
    v1.7 or
    v3.0.0.141
2018-10-28 15:56:19 +00:00
Paul Melnikow
6e51178e73 Make more consistent use of async/await (#2219)
In #2028 I suggested that we update as much of the code as possible to make consistent use of async await. This snags a bunch of the utility code and attempts to do that.
2018-10-28 11:34:47 -04:00
Tagan Hoyle
60592b8547 Refactor [Wordpress] Service (#2152) 2018-10-27 11:59:43 +01:00
Thomas Démoulins
979a34b831 #2082 Rename VSTS into Azure DevOps + update its documentation (#2206) 2018-10-27 09:54:31 +01:00
dependabot[bot]
c13da3d530 Bump sinon from 7.0.0 to 7.1.0 (#2217)
Bumps [sinon](https://github.com/sinonjs/sinon) from 7.0.0 to 7.1.0.
- [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/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-10-27 09:48:14 +01:00
dependabot[bot]
edde74095a Bump nyc from 13.0.1 to 13.1.0 (#2185)
Bumps [nyc](https://github.com/istanbuljs/nyc) from 13.0.1 to 13.1.0.
- [Release notes](https://github.com/istanbuljs/nyc/releases)
- [Changelog](https://github.com/istanbuljs/nyc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/istanbuljs/nyc/compare/v13.0.1...v13.1.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-10-27 09:43:23 +01:00
dependabot[bot]
59fba5d173 Bump simple-icons from 1.9.7 to 1.9.9 (#2216)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 1.9.7 to 1.9.9.
- [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-10-27 09:32:59 +01:00
Tagan Hoyle
6e8c71b01b Refactor [Swagger] Service (#2215) 2018-10-27 09:30:26 +01:00
chris48s
b866089c64 allow badge maxAge to be set by category; affects [discord] (#2205)
* allow badge maxAge to be set by category
* override default cache length for [discord]
* update maxAge docs
2018-10-26 20:08:02 +01:00
Pierre-Yves B
99ec8fa239 [eclipse-marketplace] License badge (#2212) 2018-10-25 20:53:34 +01:00
chris48s
744ef16009 refactor [depfu] service (#2204) 2018-10-23 18:24:14 +01:00
Pierre-Yves B
efb40fe4c0 Static Code Climate examples (#2201) 2018-10-23 18:12:29 +01:00
chris48s
8ee2701836 refactor [hexpm] service (#2203) 2018-10-23 18:06:57 +01:00
chris48s
aeceb283d8 switch [powershellgallery] to use temp url (#2189) 2018-10-23 18:03:50 +01:00
Anatoli Babenia
9df1da137c Document suggestion API endpoint (#2202) 2018-10-21 14:41:12 +01:00
Lentil Sun
88f10f8079 Fix: colorB override not working for Github Stars (#2171) 2018-10-21 14:33:12 +01:00
piekar294
6c09bc0998 add tests for [cookbook] service (#2197) 2018-10-21 14:21:09 +01:00
Przemo Nowaczyk
95f1b50194 test "static" gitter service behaviour (#2199) 2018-10-20 21:32:40 +02:00
Przemo Nowaczyk
4554f49c1e use most permissive license color (#2196)
* use most permissive license color

* revert to possible non-array licenseToColor argument
2018-10-20 15:15:10 +02:00
Przemo Nowaczyk
6f589a789a [ctan] refactor service (#2194)
* refactor ctan service

* fix service title

* prettier

* add single license test

* move example code to service
2018-10-20 14:51:25 +02:00
piekar294
2bba16c298 Remove use of componentWillReceiveProps() (#2192) 2018-10-20 09:11:36 +01:00
Ted Janeczko
a6fe16c5d1 Add support for private [npm] packages (#2187) 2018-10-20 08:06:36 +01:00
chris48s
32b123671c refactor [ansible] role service (#2158) 2018-10-19 19:23:41 +01:00
chris48s
990a80de49 use FONT_PATH in Dockerfile (#2179) 2018-10-19 19:21:34 +01:00
piekar294
37c317a758 remove react-warning-keys warning in renderNamedLogos (#2193) 2018-10-19 19:18:38 +01:00
Przemo Nowaczyk
999a24320e [ctan] add tests (#2191)
* add ctan tests

* prettier
2018-10-19 11:35:19 +02:00
Marcin Mielnicki
de1eb664ec Precommit hook with Prettier and ESLint (#2178)
* Precommit hook with prettier and eslint added

* Info about running prettier removed from documentation

* Info about a pre-commit hook in documentation
2018-10-19 11:16:30 +02:00
dependabot[bot]
8545d5ae27 Bump sinon from 6.3.5 to 7.0.0 (#2184)
Bumps [sinon](https://github.com/sinonjs/sinon) from 6.3.5 to 7.0.0.
- [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.3.5...v7.0.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-10-18 20:35:54 +01:00
dependabot[bot]
3a5c5a7642 Bump eslint from 5.6.1 to 5.7.0 (#2182)
Bumps [eslint](https://github.com/eslint/eslint) from 5.6.1 to 5.7.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.6.1...v5.7.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-10-18 20:32:16 +01:00
dependabot[bot]
b230b78b74 Bump simple-icons from 1.9.6 to 1.9.7 (#2188)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 1.9.6 to 1.9.7.
- [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-10-18 20:25:18 +01:00
Jowita Mielnicka
204680ec0a lightgrey color in build-unknown scrutinizer (#2172) 2018-10-15 21:50:30 +01:00
Jowita Mielnicka
9b6ba776f0 [bintray] test (#2175) 2018-10-14 20:55:04 +01:00
dependabot[bot]
5fd6686cce Bump danger from 4.4.7 to 4.4.8 (#2169)
Bumps [danger](https://github.com/danger/danger-js) from 4.4.7 to 4.4.8.
- [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/4.4.7...4.4.8)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-10-14 20:37:47 +01:00
Jowita Mielnicka
584fc99f54 [beerpay] test (#2174) 2018-10-14 19:49:26 +01:00
Jowita Mielnicka
fb6e91c3b2 standardize label on [cpan] license badge (#2173) 2018-10-14 19:31:47 +01:00
Jowita Mielnicka
89ff0687af standardize label on [bower] license badge (#2168) 2018-10-14 19:28:54 +01:00
Pyves
16dc2ec3a9 [Jenkins] coverage badges rewrite (#2154) 2018-10-11 21:42:47 +01:00
dependabot[bot]
89ca13a5d6 Bump semver from 5.5.1 to 5.6.0 (#2167)
Bumps [semver](https://github.com/npm/node-semver) from 5.5.1 to 5.6.0.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Commits](https://github.com/npm/node-semver/compare/v5.5.1...v5.6.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-10-11 21:28:45 +01:00
dependabot[bot]
e737666b73 Bump danger from 4.0.2 to 4.4.7 (#2166)
Bumps [danger](https://github.com/danger/danger-js) from 4.0.2 to 4.4.7.
- [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/4.0.2...4.4.7)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-10-11 21:18:35 +01:00
dependabot[bot]
c838067597 Bump snap-shot-it from 6.1.9 to 6.1.10 (#2165)
Bumps [snap-shot-it](https://github.com/bahmutov/snap-shot-it) from 6.1.9 to 6.1.10.
- [Release notes](https://github.com/bahmutov/snap-shot-it/releases)
- [Commits](https://github.com/bahmutov/snap-shot-it/compare/v6.1.9...v6.1.10)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-10-11 19:33:31 +01:00
dependabot[bot]
293767f761 Bump 2x react dependencies from 16.5.1 to 16.5.2 (#2099)
* Bump react-dom from 16.5.1 to 16.5.2
* Bump react from 16.5.1 to 16.5.2
2018-10-10 21:20:15 +01:00
Tagan Hoyle
74b6c4a700 Add [Steam] Service (#2140)
* Add Steam Service
2018-10-11 09:04:17 +13:00
dependabot[bot]
0265d4e429 Bump raven from 2.4.2 to 2.6.4 (#2051)
Bumps [raven](https://github.com/getsentry/raven-js) from 2.4.2 to 2.6.4.
- [Release notes](https://github.com/getsentry/raven-js/releases)
- [Commits](https://github.com/getsentry/raven-js/compare/2.4.2...raven-node@2.6.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-10-10 20:44:05 +01:00
dependabot[bot]
d1233a7676 Bump nock from 10.0.0 to 10.0.1 (#2161)
Bumps [nock](https://github.com/nock/nock) from 10.0.0 to 10.0.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/v10.0.0...v10.0.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-10-10 19:34:20 +01:00
dependabot[bot]
706f17a30a Bump simple-icons from 1.9.4 to 1.9.6 (#2162)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 1.9.4 to 1.9.6.
- [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-10-10 19:27:46 +01:00
chris48s
9d7f27d84e add refactoring report (#2163) 2018-10-10 19:22:30 +01:00
chris48s
a74db34853 Allow [GitHub] tag badge to sort by date (#2157)
* add test for tag-pre
* support /releases-pre (but also allow /all for BC)
* allow GH tags to be sorted by date instead of semver
* fix license badge
2018-10-08 18:29:02 +01:00
chris48s
7ea540d3c6 refactor arch user repositories [aur] service (#2086) 2018-10-06 16:51:15 +01:00
chris48s
dea6df0ded bring back the [PyPI] downloads badges (#2131) 2018-10-06 16:38:41 +01:00
chris48s
819202bcf3 treat label as override in static badge (#2116)
closes #2112
2018-10-06 15:09:59 +01:00
Marcin Mielnicki
1d18e1048f bugfix: [CircleCI] uses 'github' as a default VCS (#2137)
* Circle CI uses 'github' as a default VCS

* Prettier code
2018-10-05 22:46:51 +01:00
Marcin Mielnicki
9b5ca7d0ed License's content and filename changed (#2146) 2018-10-05 22:40:46 +01:00
dependabot[bot]
fb76c7098e Bump snap-shot-it from 6.1.8 to 6.1.9 (#2147)
Bumps [snap-shot-it](https://github.com/bahmutov/snap-shot-it) from 6.1.8 to 6.1.9.
- [Release notes](https://github.com/bahmutov/snap-shot-it/releases)
- [Commits](https://github.com/bahmutov/snap-shot-it/compare/v6.1.8...v6.1.9)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-10-04 19:08:41 +01:00
dependabot[bot]
cb92998d80 Bump simple-icons from 1.9.3 to 1.9.4 (#2148)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 1.9.3 to 1.9.4.
- [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-10-04 18:58:17 +01:00
dependabot[bot]
1d295a5e7e Bump sinon from 6.3.4 to 6.3.5 (#2149)
Bumps [sinon](https://github.com/sinonjs/sinon) from 6.3.4 to 6.3.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.3.4...v6.3.5)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-10-04 18:51:07 +01:00
dependabot[bot]
345d6222fc Bump query-string from 6.1.0 to 6.2.0 (#2141)
Bumps [query-string](https://github.com/sindresorhus/query-string) from 6.1.0 to 6.2.0.
- [Release notes](https://github.com/sindresorhus/query-string/releases)
- [Commits](https://github.com/sindresorhus/query-string/compare/v6.1.0...v6.2.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-10-03 20:30:48 +01:00
dependabot[bot]
ef9f4f9a52 Bump joi from 13.6.0 to 13.7.0 (#2135)
Bumps [joi](https://github.com/hapijs/joi) from 13.6.0 to 13.7.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.6.0...v13.7.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-10-03 20:21:20 +01:00
dependabot[bot]
e84cd1f82f Bump eslint from 5.6.0 to 5.6.1 (#2136)
Bumps [eslint](https://github.com/eslint/eslint) from 5.6.0 to 5.6.1.
- [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.6.0...v5.6.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-10-03 20:03:47 +01:00
dependabot[bot]
5d138e237d Bump simple-icons from 1.9.2 to 1.9.3 (#2142)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 1.9.2 to 1.9.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-10-03 19:35:33 +01:00
Sven Schoenung
c058dbdcd9 Fix: keywords missing from prepared examples (#2143) 2018-10-03 19:08:05 +01:00
chris48s
362db466bb update service tests tutorial (#2075)
* update service tests tutorial
* re-order and re-name tests for clarity
* update documentation examples
* extract boilerplate for testing colours
2018-10-01 20:53:04 +01:00
chris48s
ebe0c71488 require exampleUrl and urlPattern if using staticExample (#2132) 2018-10-01 20:48:05 +01:00
chris48s
aef9a4efd1 remove duplicate PyPI examples (#2133) 2018-10-01 20:44:08 +01:00
chris48s
595212ff78 consistently style Github as GitHub in examples (#2134) 2018-10-01 20:40:39 +01:00
Marcin Mielnicki
4ccd6bf4dc [Dub] downloads badge with available version (#2129)
* Service test for DUB tests the newset version

* Working example of the DUB downloads badge with version
2018-10-01 18:10:43 +02:00
Sven Schoenung
787ab36b6f Add [JenkinsPluginInstalls] service (#2125) 2018-09-30 21:57:53 +01:00
Christian Oliff
33167afa64 correct GitHub capitalization (#2095) 2018-09-30 21:19:34 +01:00
chris48s
10e8232ffa Add multiple issue templates (#2128) 2018-09-30 17:00:09 +01:00
dependabot[bot]
28d75cba81 Bump react-modal from 3.5.1 to 3.6.1 (#2119)
Bumps [react-modal](https://github.com/reactjs/react-modal) from 3.5.1 to 3.6.1.
- [Release notes](https://github.com/reactjs/react-modal/releases)
- [Changelog](https://github.com/reactjs/react-modal/blob/master/CHANGELOG.md)
- [Commits](https://github.com/reactjs/react-modal/compare/v3.5.1...v3.6.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-29 22:10:10 +01:00
dependabot[bot]
a940cb1f11 Bump babel-eslint from 10.0.0 to 10.0.1 (#2126)
Bumps [babel-eslint](https://github.com/babel/babel-eslint) from 10.0.0 to 10.0.1.
- [Release notes](https://github.com/babel/babel-eslint/releases)
- [Commits](https://github.com/babel/babel-eslint/compare/v10.0.0...v10.0.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-29 22:04:56 +01:00
chris48s
264f5e39dc refactor [discord] service (#2107) 2018-09-28 21:00:21 +01:00
dependabot[bot]
4ef2ea757b Bump simple-icons from 1.9.1 to 1.9.2 (#2123)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 1.9.1 to 1.9.2.
- [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-09-27 19:49:19 +01:00
dependabot[bot]
a28ad3ceaf Bump babel-eslint from 9.0.0 to 10.0.0 (#2118)
Bumps [babel-eslint](https://github.com/babel/babel-eslint) from 9.0.0 to 10.0.0.
- [Release notes](https://github.com/babel/babel-eslint/releases)
- [Commits](https://github.com/babel/babel-eslint/compare/v9.0.0...v10.0.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-27 19:42:52 +01:00
dependabot[bot]
b18ea6cc85 Bump chai from 4.1.2 to 4.2.0 (#2124)
Bumps [chai](https://github.com/chaijs/chai) from 4.1.2 to 4.2.0.
- [Release notes](https://github.com/chaijs/chai/releases)
- [Changelog](https://github.com/chaijs/chai/blob/master/History.md)
- [Commits](https://github.com/chaijs/chai/compare/4.1.2...4.2.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-27 19:33:59 +01:00
chris48s
4f47cb348f fixes to [wercker] badge (#2103)
- Fix case where app/branch exists but has no builds or CI runs
- Fix aplicationId/branch regex case
- Issue #2076:
  - `ci/{projectId}` reports the result of a CI run
  - `build/{applicationName}` reports the result of a build
  - `ci/{applicationName}` reports the result of a _build_
    (but isn't documented anywhere) for "backwards compatibility"
2018-09-27 18:47:10 +01:00
chris48s
04290e890b delete snapshots with no corresponding test (#2111) 2018-09-24 21:19:13 +01:00
dependabot[bot]
0b8bfd6895 Bump danger from 4.0.1 to 4.0.2 (#2113)
Bumps [danger](https://github.com/danger/danger-js) from 4.0.1 to 4.0.2.
- [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/4.0.1...4.0.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-24 21:11:42 +01:00
dependabot[bot]
83b100184b Bump eslint-config-prettier from 3.0.1 to 3.1.0 (#2114)
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 3.0.1 to 3.1.0.
- [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/v3.0.1...v3.1.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-24 21:04:33 +01:00
dependabot[bot]
1dadd03f16 Bump simple-icons from 1.9.0 to 1.9.1 (#2115)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 1.9.0 to 1.9.1.
- [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-09-24 20:58:40 +01:00
dependabot[bot]
58b75f5146 Bump snap-shot-it from 5.0.1 to 6.1.8 (#2072)
Bumps [snap-shot-it](https://github.com/bahmutov/snap-shot-it) from 5.0.1 to 6.1.8.
- [Release notes](https://github.com/bahmutov/snap-shot-it/releases)
- [Commits](https://github.com/bahmutov/snap-shot-it/compare/v5.0.1...v6.1.8)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-23 20:45:42 +01:00
dependabot[bot]
3577327243 Bump danger from 3.9.0 to 4.0.1 (#2090)
Bumps [danger](https://github.com/danger/danger-js) from 3.9.0 to 4.0.1.
- [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.9.0...4.0.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-23 20:33:33 +01:00
Pyves
8e963459cd Deprecated libscore (#2105) 2018-09-22 12:28:54 +01:00
Pyves
a4bec27771 Fixed [Codacy] coverage examples and improved unknown coverage handling (#2102) 2018-09-21 22:49:35 +01:00
dependabot[bot]
3c373b58ac Bump prettier from 1.14.2 to 1.14.3 (#2104)
Bumps [prettier](https://github.com/prettier/prettier) from 1.14.2 to 1.14.3.
- [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.2...1.14.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-21 19:50:27 +01:00
dependabot[bot]
0b1ed5130e Bump svgo from 1.0.5 to 1.1.1 (#2094)
Bumps [svgo](https://github.com/svg/svgo) from 1.0.5 to 1.1.1.
- [Release notes](https://github.com/svg/svgo/releases)
- [Changelog](https://github.com/svg/svgo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/svg/svgo/compare/v1.0.5...v1.1.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-21 19:47:04 +01:00
Sam Harwell
ca69099389 Support [nuget myget] packages using SemVer 2 (#2098)
Support NuGet packages using SemVer 2

Fixes #1044
2018-09-20 20:18:30 +01:00
chris48s
edab5385f8 show examples with logos on index page (#2084) 2018-09-19 22:05:38 +01:00
Christian Oliff
863ee4f2e0 HTTPS link to semver.org (#2093) 2018-09-18 16:30:38 +01:00
dependabot[bot]
a1347e5bf2 Bump nock from 9.6.1 to 10.0.0 (#2088)
Bumps [nock](https://github.com/nock/nock) from 9.6.1 to 10.0.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.6.1...v10.0.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-18 16:22:03 +01:00
dependabot[bot]
f75cbf04c8 Bump eslint from 5.5.0 to 5.6.0 (#2089)
Bumps [eslint](https://github.com/eslint/eslint) from 5.5.0 to 5.6.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.5.0...v5.6.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-18 16:12:04 +01:00
dependabot[bot]
ac84735ad4 Bump sinon from 6.3.2 to 6.3.4 (#2097)
Bumps [sinon](https://github.com/sinonjs/sinon) from 6.3.2 to 6.3.4.
- [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.3.2...v6.3.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-18 09:16:19 +01:00
chris48s
d143cac0d7 improve [appveyor] error handling (#2085) 2018-09-18 09:07:20 +01:00
Eugene Zhlobo
c8593c77c4 Handle CircleCI urls with token correctly (#2087) 2018-09-18 09:03:00 +01:00
dependabot[bot]
6d49c762b9 Bump simple-icons from 1.8.3 to 1.9.0 (#2070)
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 1.8.3 to 1.9.0.
- [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-09-16 21:49:26 +01:00
dependabot[bot]
ee2ce3747f Bump 2x react dependencies to 16.5.1 (#2080)
* Bump react-dom from 16.4.2 to 16.5.1
* Bump react from 16.4.2 to 16.5.1
2018-09-14 20:30:18 +01:00
dependabot[bot]
21dd7cdd16 Bump fast-xml-parser from 3.12.0 to 3.12.5 (#2071)
Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 3.12.0 to 3.12.5.
- [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases)
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-14 20:16:32 +01:00
dependabot[bot]
a5943f7207 Bump sinon from 6.2.0 to 6.3.2 (#2081)
Bumps [sinon](https://github.com/sinonjs/sinon) from 6.2.0 to 6.3.2.
- [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.2.0...v6.3.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-14 20:04:15 +01:00
Pyves
006710e16d Fixed [Codacy] badges (#2066) 2018-09-10 20:32:49 +01:00
Thomas Démoulins
2c04a63dc3 Support VSTS badges on newly created build definitions (#2065) 2018-09-10 19:30:47 +01:00
Pyves
bf0496cd64 Made JSON snapshot test pass on Windows (#2061) 2018-09-10 19:27:05 +01:00
Pyves
3e69873930 [aur packagist php-eye travis vaadin-directory github david jitpack twitter] Enforced lowercase badge labels (#2058) 2018-09-09 11:41:10 +01:00
Paul Melnikow
4a847d2b08 [AppVeyorTests] compact format and custom labels (#2000)
This picks up the work from #1321 on top of the work from #1940.

It allows the user to choose a compact tests format, or to override the labels with their own text or symbols.
2018-09-08 09:27:59 -07:00
dependabot[bot]
30dcc1fd41 Bump eslint-plugin-promise from 4.0.0 to 4.0.1 (#2063)
Bumps [eslint-plugin-promise](https://github.com/xjamundx/eslint-plugin-promise) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/xjamundx/eslint-plugin-promise/releases)
- [Changelog](https://github.com/xjamundx/eslint-plugin-promise/blob/master/CHANGELOG.md)
- [Commits](https://github.com/xjamundx/eslint-plugin-promise/compare/v4.0.0...v4.0.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-07 21:55:16 -07:00
Tobias Roeddiger
a265cab354 fixed bug that prevented logo color from being changed (#2059)
closes #2057
2018-09-06 22:11:34 +01:00
dependabot[bot]
322f3ff305 Bump danger from 3.8.9 to 3.9.0 (#2056)
Bumps [danger](https://github.com/danger/danger-js) from 3.8.9 to 3.9.0.
- [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/commits/3.9.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-06 21:11:41 +01:00
Thomas Démoulins
548b509dff [vso] Add support for VSTS releases (#2049) 2018-09-06 19:05:02 +01:00
dependabot[bot]
fc0c785f0e Bump eslint from 5.4.0 to 5.5.0 (#2048)
Bumps [eslint](https://github.com/eslint/eslint) from 5.4.0 to 5.5.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.4.0...v5.5.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-05 22:01:04 +01:00
dependabot[bot]
780d7a2470 Bump sinon from 6.1.5 to 6.2.0 (#2052)
Bumps [sinon](https://github.com/sinonjs/sinon) from 6.1.5 to 6.2.0.
- [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.5...v6.2.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-05 21:54:52 +01:00
dependabot[bot]
636576aa60 Bump chai-string from 1.4.0 to 1.5.0 (#2047)
Bumps [chai-string](https://github.com/onechiporenko/chai-string) from 1.4.0 to 1.5.0.
- [Release notes](https://github.com/onechiporenko/chai-string/releases)
- [Commits](https://github.com/onechiporenko/chai-string/commits/v1.5.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-05 21:48:20 +01:00
chris48s
ef6e601aaa Update tutorial to reflect new service layout (#2042)
update the tutorial for new service class layout
2018-09-05 21:34:41 +01:00
Pyves
7417dc5f6c Delete BaseHTTPService and implement new BaseXmlService (affects [eclipse-marketplace f-droid]; also testing on [uptimerobot circleci]) (#2037) 2018-09-03 19:37:37 +01:00
chris48s
39d05ba817 render category links correctly on initial page load (#2046) 2018-09-02 21:15:07 +01:00
chris48s
4830867a5c add additional test cases for pypi license helper (#2043) 2018-09-02 21:11:28 +01:00
chris48s
bca4c05625 fix wercker examples (#2044) 2018-09-02 21:04:12 +01:00
dependabot[bot]
cc03507875 Bump danger from 3.8.6 to 3.8.9 (#2039)
Bumps [danger](https://github.com/danger/danger-js) from 3.8.6 to 3.8.9.
- [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/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-02 20:59:43 +01:00
Paul Melnikow
1b307864b4 Prettify the files in the project root (#2041)
Follow on to #2009
2018-09-02 12:10:23 -07:00
Nicco Kunzmann
e25e748a03 Obsolete old tutorial and future TODOs (#1983)
This obsoletes the implementation part of the tutorial.
As mentioned in https://github.com/badges/shields/pull/1958#pullrequestreview-149661148, 
old style badges should be avoided and new style badges are preferred.
2018-09-02 11:41:33 -07:00
Y0hy0h
73c954df57 [elm-package] Fix old package name (#2045)
* Update test's package to new name
* Update preview badge's package to new name
2018-09-02 16:20:06 +01:00
Pyves
7153ed0bd1 Deprecate [issuestats] service (#2038) 2018-09-01 20:53:52 +01:00
Sam Lanning
b6ba720fae Add LGTM alerts badge to README (#2035) 2018-09-01 12:33:26 -07:00
Paul Melnikow
454575c4cb Enforce no extensions in require (#1999)
This removes remaining `.js` extensions from `require()` expressions and automatically enforces this rule.
2018-09-01 11:14:01 -07:00
Paul Melnikow
102141123b Unify lint rules and clean lint (#2009)
Now that server.js is emptied out, it makes sense to eliminate the differences between the top-level .js files and everything else.
2018-09-01 11:08:17 -07:00
Paul Melnikow
56bcc04570 Fix unparseable json in [circleci uptimerobot] (#2036)
* Add two tests: one passing, one failing

* Fix the bug
2018-09-01 09:05:14 -07:00
Nicco Kunzmann
11fa6114fe New badge: f-droid (#1965) 2018-08-30 23:02:09 +01:00
tooomm
e37c0b650d tidy danger bot messages (#2013) 2018-08-31 09:51:30 +12:00
Paul Melnikow
9fb540fb28 [pypi]: Fix broken badges (#2023)
- When license is empty, get license from trove classifiers
- Allow empty classifiers array
2018-08-30 14:30:40 -07:00
Paul Melnikow
7ad5eca26e Rewrite deprecated services and add tests (#2018)
I've rewritten the deprecated services using the `deprecatedService` helper from #1922. I added a test for `Deprecated`, and for `enforceDeprecation`, which isn't being used right now, but is there for future use.

This also makes it possible to write services using BaseService which do not have any named parameters (with a test).

Ref: #1358
2018-08-30 10:03:15 -07:00
Paul Melnikow
b602284403 Update coverage scripts (#2008)
As I was testing #1992 I noticed some of the coverage scripts were out of date.
2018-08-29 15:22:38 -07:00
Paul Melnikow
55f4017388 Combined update of eslint dependencies (#2007) 2018-08-29 15:01:25 -07:00
chris48s
7136aac89a update contributing guidance (#2019) 2018-08-29 22:36:24 +01:00
chris48s
17481f144a update logo submission docs (#2020)
add more detail to image submission guidelines
2018-08-29 22:32:46 +01:00
Paul Melnikow
1deeb365a5 Update uri -> url in the front end + examples (#2006)
This continues a consistency update we’ve been making to standardize on URL based on a recommendation from WHATWG: https://url.spec.whatwg.org/#goals

This also helps with copying and pasting between all-badge-examples and new-style services, where it’s otherwise easy to make a mistake.

Ref: #1322 #1341
2018-08-29 14:27:50 -07:00
Paul Melnikow
33fbfb374f Use render helpers in existing new-style services (#1998)
This refactors the render methods in these services to use the new helper functions.
2018-08-29 14:06:36 -07:00
Paul Melnikow
f8f2d88b90 Clean up some alerts detected by LGTM (#2010)
https://lgtm.com/projects/g/badges/shields/alerts/?mode=list
2018-08-29 13:37:43 -07:00
tooomm
15beda32b0 Additional tweaks to deployment bot message (#2011) 2018-08-29 19:09:02 +01:00
tooomm
119357333e tutorial: fix headline (#2014) 2018-08-29 11:22:54 -04:00
tooomm
0619e1072c fix identation (#2012) 2018-08-29 10:22:48 -04:00
Pyves
df30785c4b Improved deployment bot message (#1996) 2018-08-29 09:28:34 +01:00
dependabot[bot]
f4789125a7 Bump nyc from 12.0.1 to 13.0.1 (#1992)
Bumps [nyc](https://github.com/istanbuljs/nyc) from 12.0.1 to 13.0.1.
- [Release notes](https://github.com/istanbuljs/nyc/releases)
- [Changelog](https://github.com/istanbuljs/nyc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/istanbuljs/nyc/compare/v12.0.1...v13.0.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-29 02:52:12 -04:00
dependabot[bot]
16d415769f Bump babel-eslint from 8.2.6 to 9.0.0 (#1991)
Bumps [babel-eslint](https://github.com/babel/babel-eslint) from 8.2.6 to 9.0.0.
- [Release notes](https://github.com/babel/babel-eslint/releases)
- [Commits](https://github.com/babel/babel-eslint/compare/v8.2.6...v9.0.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-28 22:45:23 +01:00
Paul Melnikow
5bc26eaacf Use Joi 13.6.0 on the servers (#1989)
Ref: #1988
2018-08-28 15:16:14 -04:00
chris48s
e294dc4edc refactor [circleci] integration (#1927)
* refactor [circleci] integration
2018-08-28 15:49:43 +01:00
Y0hy0h
edea36dd10 [elm-package] Fix elm package service (#1986) 2018-08-28 10:25:58 -04:00
Paul Melnikow
64d325b002 Reduce boilerplate in a few more service testers [cdnjs continuousphp node shippable wercker gem] (#1957)
Follow up to #1934.
2018-08-27 16:36:35 -04:00
Paul Melnikow
bedba47d77 Move legacy services from server.js into services/ (#1958)
This builds on the work of #1931 by moving the legacy services into `services/`.
2018-08-27 13:29:54 -04:00
dependabot[bot]
f3037c5e15 Bump glob from 7.1.2 to 7.1.3 (#1981)
Bumps [glob](https://github.com/isaacs/node-glob) from 7.1.2 to 7.1.3.
- [Release notes](https://github.com/isaacs/node-glob/releases)
- [Changelog](https://github.com/isaacs/node-glob/blob/master/changelog.md)
- [Commits](https://github.com/isaacs/node-glob/compare/v7.1.2...v7.1.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-27 17:09:41 +01:00
dependabot[bot]
6b3d1ab010 Bump concurrently from 3.6.1 to 4.0.1 (#1980)
Bumps [concurrently](https://github.com/kimmobrunfeldt/concurrently) from 3.6.1 to 4.0.1.
- [Release notes](https://github.com/kimmobrunfeldt/concurrently/releases)
- [Commits](https://github.com/kimmobrunfeldt/concurrently/compare/3.6.1...v4.0.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-27 17:04:46 +01:00
Paul Melnikow
302c8606ff Rewrite [pypi]; affects [npm] (#1922) 2018-08-27 07:46:06 -04:00
tooomm
78bb890b52 danger: highlight service in msg (#1928) 2018-08-26 16:16:21 -04:00
Nicco Kunzmann
504b68ef13 Make wercker preview badge static (#1974) 2018-08-26 15:40:24 +01:00
Pyves
f377443585 Fixed Chrome Web Store examples (#1976) 2018-08-26 09:21:17 +01:00
Nicco Kunzmann
ed85e1cb12 Clarify what is used to run the specific tests (#1973) 2018-08-26 09:12:40 +01:00
Nicco Kunzmann
9428c20418 danger: help users to write server tests (#1970)
* danger: help users to write server tests

- fixes https://github.com/badges/shields/issues/1968
- adds the desired notice

* add trailing comma

https://circleci.com/gh/badges/shields/11866?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link
2018-08-25 17:55:02 +02:00
Pyves
ddb3bf4256 Fixed libraries.io error handling (#1964) 2018-08-24 18:32:28 +01:00
Nicco Kunzmann
dad1b4e4f1 Fix link to service tests (#1969) 2018-08-23 22:38:11 +01:00
tooomm
53cf4c1fe9 Remove gratipay from frontend (#1967) 2018-08-23 22:21:53 +01:00
Nicco Kunzmann
147d0e9bcc add examples for documentation contributions (#1962)
The section for documentation contribution is quite short.
This adds examples of when to make a contribution.
2018-08-23 16:32:11 -04:00
chris48s
ae190c5f07 generate static examples without api call [apm appveyor cdnjs clojars gem npm uptimerobot] (#1740)
* allow service classes to define a static example
* define static example for some services
  (apm, appveyor, cdnjs, clojars, gem, librariesio, npm, uptimerobot)
* add/update tests


This allows us to show an example without making an API call to a live service for better performance.

We can now specify 3 fields in the example definition:

* urlPattern for the version with placeholders e.g: /npm/dw/:package.svg
* ExampleUrl/Uri for the concrete example e.g: /npm/dw/localeval.svg
* PreviewUrl/Uri for the static (or live) image we will actually show
2018-08-23 20:22:24 +01:00
Paul Melnikow
a0c43ed219 Reduce boilerplate for creating new testers [npm appveyor gem uptimerobot clojars] (#1934)
This is a bit of sugar that reduces the boilerplate for creating testers in what I expect will become the standard case: a service in `foo/foo-thing.service.js` with its tests in `foo/foo-thing.tester.js`.

This makes a small stylistic change, which is to name the service by its CamelCase class name rather than an invented snake-case ID. Whereas before the name was specified in `class FooThing extends Base[Json]Service` and a second time in the tester, it now only needs to be specified once.
2018-08-22 18:07:51 -04:00
Paul Melnikow
452affba15 Sort some more badges (#1948)
- Move the Docker Pulls badge from **Other** to **Downloads**.
- Create **Platform & Version Support** for the following:
    - django version support
    - python version support
    - node version support
    - pypi - wheel (waiting to avoid conflict with #1922)
    - pipi - format (waiting to avoid conflict with #1922)
    - pipi - implementation (waiting to avoid conflict with #1922)
    - hhvm
    - cocoapods platform
    - conda
    - php version badges
2018-08-22 15:05:11 -04:00
Paul Melnikow
942466aa92 Allow migrating legacy services to services/ (#1931) 2018-08-21 23:38:12 -04:00
dependabot[bot]
b8f81cf405 Bump semver from 5.5.0 to 5.5.1 (#1952)
Bumps [semver](https://github.com/npm/node-semver) from 5.5.0 to 5.5.1.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Commits](https://github.com/npm/node-semver/compare/v5.5.0...v5.5.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-20 21:28:20 +01:00
chris48s
c19695f628 don't run deploy bot on dependabot PRs (#1924)
Don't run deploy bot on dependabot PRs
2018-08-20 21:13:44 +01:00
Pyves
82bc90cec1 Deprecated VersionEye (#1953) 2018-08-20 20:04:11 +01:00
Paul Melnikow
656326d693 Rewrite [appveyor] tests badge (#1940) 2018-08-20 14:49:59 -04:00
dependabot[bot]
77061fe6af Bump eslint-plugin-promise from 3.8.0 to 4.0.0 (#1950)
Bumps [eslint-plugin-promise](https://github.com/xjamundx/eslint-plugin-promise) from 3.8.0 to 4.0.0.
- [Release notes](https://github.com/xjamundx/eslint-plugin-promise/releases)
- [Changelog](https://github.com/xjamundx/eslint-plugin-promise/blob/master/CHANGELOG.md)
- [Commits](https://github.com/xjamundx/eslint-plugin-promise/compare/v3.8.0...v4.0.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-20 10:00:04 -04:00
dependabot[bot]
fd4637c042 Bump eslint from 5.3.0 to 5.4.0 (#1951)
Bumps [eslint](https://github.com/eslint/eslint) from 5.3.0 to 5.4.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.3.0...v5.4.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-20 09:56:28 -04:00
Paul Melnikow
77b54c8c9a Sort some badges (#1945)
This implements proposals 1, 2, and 4 from #1905:

* Move gem rank from ratings to downloads; tweak title

* Move docker build from other to build

* Move bundlephobia, github file, github repo, imagelayers, and microbadger size + layers badges into new category

* Fill in a couple missing titles
2018-08-19 17:55:20 -04:00
Paul Melnikow
a16d436602 Optionally persist [Github] tokens in Redis (#1939)
This is a fairly simple addition of a Redis-backed TokenPersistence. When GithubConstellation is initialized, it will create a FsTokenPersistence or a RedisTokenPersistence based on configuration. Have added tests of the Redis backend as an integration test, and ensured the server starts up correctly when a `REDIS_URL` is configured.

Ref: #1848
2018-08-19 10:27:23 -04:00
Paul Melnikow
edb7d82500 Change format of [npm] type definitions badge (#1897)
Based on feedback at chalk/chalk#286.
2018-08-19 09:27:23 -04:00
Paul Melnikow
365f2cff5f Run tests by prefix e.g. [librariesio] (#1933)
Close #1923
2018-08-19 00:40:02 -04:00
Paul Melnikow
b10a6a4aa7 Refactor [github] token persistence, again (#1906)
Instead of saving tokens on a timer, save them when they change. Use EventEmitter to keep the components loosely coupled.

This is easier to reason about, much easier to test, and better supports adapting to backends which support atomic operations.

This replaces json-autosave, which was a bit difficult to read and also hard to test, with fsos, the lower-level utility it’s built on.

Ref: #1848
2018-08-18 23:54:53 -04:00
Paul Melnikow
a252239018 Fix and test trace logging in BaseJsonService (#1944)
This fixes a regression introduced in #1929 which was caught by service tests post-merge.
2018-08-18 17:45:46 -04:00
Paul Melnikow
12be1bd747 Service logging tweaks (#1929)
- Log the response when using `test:services:trace`
- Fully log large nested objects

Since the `badgeData` is in a different format from the JSON response, and also doesn't include the title, including this output is helpful. It makes it clearer what the Joi matchers are trying to match.

Sometimes when there's a deep nested structure, it's helpful or necessary to see the entire thing.
2018-08-18 11:25:40 -04:00
Paul Melnikow
544d2c538a Disable CircleCI cache (#1938)
See #1937
2018-08-18 10:34:48 -04:00
Marcin Mielnicki
96188c2f01 Example command for starting server with SENTRY_DSN after sudo (#1935) 2018-08-17 22:50:16 +02:00
Paul Melnikow
85de601024 Avoid warning during linting (#1930)
```
Warning: React version not specified in eslint-plugin-react settings. See https://github.com/yannickcr/eslint-plugin-react#configuration.
```
2018-08-16 21:59:31 -07:00
Pyves
886cde72d5 Rewrite [Wercker] service (#1920) 2018-08-16 22:03:15 +01:00
Paul Melnikow
9119c235a9 Prevent merging exclusive service tests (#1926)
* Remove an .only() left behind previously
2018-08-16 11:06:08 -07:00
dependabot[bot]
30d746653b Bump request from 2.87.0 to 2.88.0 (#1911)
Bumps [request](https://github.com/request/request) from 2.87.0 to 2.88.0.
- [Release notes](https://github.com/request/request/releases)
- [Changelog](https://github.com/request/request/blob/master/CHANGELOG.md)
- [Commits](https://github.com/request/request/compare/v2.87.0...v2.88.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-15 21:44:24 +01:00
dependabot[bot]
97c6795e4e Bump danger from 3.8.4 to 3.8.6 (#1917)
Bumps [danger](https://github.com/danger/danger-js) from 3.8.4 to 3.8.6.
- [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/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-15 21:04:45 +01:00
dependabot[bot]
bcf3aca74e Bump eslint-plugin-react from 7.11.0 to 7.11.1 (#1921)
Bumps [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) from 7.11.0 to 7.11.1.
- [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.11.0...v7.11.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-15 08:33:39 -07:00
Pyves
b0070ff861 [GitHub] Error message customisation for all status codes (#1888) 2018-08-14 18:57:24 +01:00
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
Pyves
da403b7e3a Increased default BADGE_MAX_AGE_SECONDS (#1846)
* Added note about default on website
2018-08-06 22:36:10 -04:00
chris48s
7cd0cb65d7 don't run danger on dependabot PRs (#1843) 2018-08-04 22:53:29 +01:00
dependabot[bot]
c69642a4e5 Bump eslint-plugin-react from 7.7.0 to 7.10.0 (#1837)
Bumps [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) from 7.7.0 to 7.10.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.7.0...v7.10.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-03 19:14:44 +01:00
dependabot[bot]
e20ab7c412 Bump sinon from 6.0.0 to 6.1.4 (#1832)
Bumps [sinon](https://github.com/sinonjs/sinon) from 6.0.0 to 6.1.4.
- [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.0.0...v6.1.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-03 19:13:57 +01:00
dependabot[bot]
4e5b6d077f Bump concurrently from 3.5.1 to 3.6.1 (#1835)
Bumps [concurrently](https://github.com/kimmobrunfeldt/concurrently) from 3.5.1 to 3.6.1.
- [Release notes](https://github.com/kimmobrunfeldt/concurrently/releases)
- [Commits](https://github.com/kimmobrunfeldt/concurrently/compare/3.5.1...3.6.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-03 19:12:54 +01:00
dependabot[bot]
dee9524bd6 Bump check-node-version from 3.1.1 to 3.2.0 (#1828)
Bumps [check-node-version](https://github.com/parshap/check-node-version) from 3.1.1 to 3.2.0.
- [Release notes](https://github.com/parshap/check-node-version/releases)
- [Changelog](https://github.com/parshap/check-node-version/blob/master/CHANGELOG.md)
- [Commits](https://github.com/parshap/check-node-version/compare/v3.1.1...v3.2.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-03 19:08:21 +01:00
dependabot[bot]
89493f0eaf Bump eslint-plugin-import from 2.9.0 to 2.13.0 (#1836)
Bumps [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import) from 2.9.0 to 2.13.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.9.0...v2.13.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-03 19:05:23 +01:00
dependabot[bot]
672631a2d6 Bump eslint-plugin-promise from 3.6.0 to 3.8.0 (#1829)
Bumps [eslint-plugin-promise](https://github.com/xjamundx/eslint-plugin-promise) from 3.6.0 to 3.8.0.
- [Release notes](https://github.com/xjamundx/eslint-plugin-promise/releases)
- [Changelog](https://github.com/xjamundx/eslint-plugin-promise/blob/master/CHANGELOG.md)
- [Commits](https://github.com/xjamundx/eslint-plugin-promise/compare/v3.6.0...v3.8.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-03 19:05:01 +01:00
dependabot[bot]
258fdd0fbc Bump sinon-chai from 3.0.0 to 3.2.0 (#1830)
Bumps [sinon-chai](https://github.com/domenic/sinon-chai) from 3.0.0 to 3.2.0.
- [Release notes](https://github.com/domenic/sinon-chai/releases)
- [Commits](https://github.com/domenic/sinon-chai/compare/v3.0.0...v3.2.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-03 19:02:11 +01:00
chris48s
cdce0b45e0 upgrade react and related dependencies (#1840) 2018-08-03 18:59:54 +01:00
Paul Melnikow
5d102dabb3 Update several lockfile dependencies using npm audit fix (#1833) 2018-08-03 18:46:12 +01:00
Paul Melnikow
2ff71dab6a Start cleaning up github auth routes (#1813)
- Move github token debug route to separate module
- Use crypto.timingSafeEqual
- Rename getTokenDebugInfo -> serializeDebugInfo
2018-08-01 21:58:11 -04:00
dependabot[bot]
2008623ba3 Bump gm from 1.23.0 to 1.23.1 (#1821)
Bumps [gm](https://github.com/aheckmann/gm) from 1.23.0 to 1.23.1.
- [Release notes](https://github.com/aheckmann/gm/releases)
- [Changelog](https://github.com/aheckmann/gm/blob/master/History.md)
- [Commits](https://github.com/aheckmann/gm/compare/1.23.0...1.23.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-01 22:22:39 +01:00
dependabot[bot]
dfdffa599c Bump moment from 2.19.3 to 2.22.2 (#1824)
Bumps [moment](https://github.com/moment/moment) from 2.19.3 to 2.22.2.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.19.3...2.22.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-01 22:19:22 +01:00
dependabot[bot]
d15250afcc Bump danger from 3.7.14 to 3.8.3 (#1822)
Bumps [danger](https://github.com/danger/danger-js) from 3.7.14 to 3.8.3.
- [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/commits/3.8.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-01 22:15:21 +01:00
dependabot[bot]
e4af2d485c Bump pretty-bytes from 5.0.0 to 5.1.0 (#1825)
Bumps [pretty-bytes](https://github.com/sindresorhus/pretty-bytes) from 5.0.0 to 5.1.0.
- [Release notes](https://github.com/sindresorhus/pretty-bytes/releases)
- [Commits](https://github.com/sindresorhus/pretty-bytes/compare/v5.0.0...v5.1.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-01 22:11:06 +01:00
Danial
317e19ea2a Add support for simple-icons, colored icons with ?logoColor (#1810)
* add simple-icons

* handle undefined

* support logoColor param

* our icon > simple-icon

* dont crash 

* return false → undefined

* update test

* add test

* support logoColor on our logos

* cache as base64, pre-load-simple-icons, logo-helper

* add ?logoColor information

* and simple-icons reference, link to github master branch for our logos

* update simple-icons

update to 1.7.1

* Revert "and simple-icons reference, link to github master branch for our logos"

This reverts commit 5e99d5f8db.

* add link to simple-icons

* Add snapshot test

* support dash in place of space for logo name
2018-08-02 09:07:23 +12:00
greenkeeper[bot]
8020ff00e3 Update eslint to the latest version 🚀 (#1746)
* Work around upstream issue https://github.com/standard/standard/issues/1156#issuecomment-400048419
2018-08-01 16:55:42 -04:00
Paul Melnikow
7e04f25fc5 Tweak layout of services to conveniently handle large service families 2018-08-01 16:49:07 -04:00
chris48s
df8877ac71 don't try to run greenkeeper-lockfile-upload in CI build (#1819) 2018-08-01 21:23:47 +01:00
chris48s
7b10ba2f11 update dependabot tests (#1820) 2018-08-01 21:23:36 +01:00
chris48s
901a7b8a43 Split front end into one page per category (#1808)
- Present 'downloads', 'version', etc as pages
- Don't show any badges on the index page,
  just links to categories.
- Tweak search so we can search all badges
  from the index page, but without rendering
  every badge as soon as we press a key.
2018-08-01 21:02:55 +01:00
greenkeeper[bot]
ca01b99e9f Update prettier to the latest version 🚀 (#1814)
* chore(package): update prettier to version 1.14.0

* Update package-lock
2018-08-01 15:11:27 -04:00
Caleb Maclennan
547ea162ab Add Gitlab logo (#1804) 2018-08-01 14:49:00 -04:00
Pyves
9335f607aa [conda] Fixed wrong variable name (#1817) 2018-07-31 22:27:06 +01:00
Danial
3a54b5dc84 eslint enable comma-dangle always-multiline (#1818)
https://eslint.org/docs/rules/comma-dangle
2018-08-01 08:38:04 +12:00
chris48s
241cac7100 Fix [circleci] badge (#1815)
require all jobs in the build to pass in order for the status to be 'passing'
Closes #1792
2018-07-30 17:14:08 +01:00
Danial
c974b1b931 throw if given invalid version, refactor [apm] (#1785)
* throw if given invalid version

* refactor service

* add test

* fixup

* move service

* split up module

* update test

* add keywords

* remove from all-badge-examples

* update category [license → miscellaneous]

* Error → InvalidResponse

* minor style fix

* InvalidResponse

* reduce some code duplication

* fixup

* update category

* invalid → unparseable json response
2018-07-30 14:46:47 +12:00
Danial
409bcd1870 Add logo style badges - popout, popout-square (#1478)
* add logo style badges

add new styles:
- flat-logo
- flat-square-logo

* rename flat-logo -> popout

flat-logo -> popout
flat-square-logo -> popout-square

* default centered, add logoAlign param

* fix test

* logoAlign -> logoPosition

* reverse logoPosition direction

* fixup
2018-07-28 16:35:24 +12:00
Danial
329db7ddab loosely detect semver versions (#1628)
* loosely detect semver versions

* semver loose validity

* add test

* semver compare versions when null

* add comments for loose

* remove console.log, only match semver scheme

* looser version restrictions

* re-sort version tests

comments refered to incorrect test

* add support for pre-release tags

#1682

* support uppercase, lowercase mixed

* make pre-release opt in

* change pre param to object

* add notes
2018-07-27 08:27:48 +12:00
Danial
b216bcc17e Hide left hand of badge if no label (#1585)
* hide left side if no text

* fix whitespace at start of template

* for-the-badge done

* center text

* add logo support

* update snapshot test

* make first - in static badge optional

* add no label support to non static badges

* Add test for label

* update to not allow use of false/0/null

* fixup
2018-07-27 08:27:32 +12:00
Danial
bbfd75a203 increase timeout for colorscheme PNG badge test (#1811) 2018-07-26 17:54:23 +12:00
Paul Melnikow
f850126146 Bump icedfrisby version (#1803) 2018-07-25 13:47:33 -05:00
Paul Melnikow
fd58a5bdd0 Fix [bundlephobia] tests and rm errant inspectJSON (#1798)
I’m guessing something has changed with the way rounding happens in bundlephobia. I don’t expect this to happen again, but if it does we can change this to a regex.
2018-07-25 13:46:14 -05:00
chris48s
d572abff4f re-organise badge examples (#1800)
Re-organise badge examples into categories:

- Build
- Chat
- Dependencies
- Downloads
- Funding
- Issue Tracking
- License
- Rating
- Social
- Version
- Other
2018-07-23 19:36:24 -05:00
Paul Melnikow
6e09a93cf0 Provide a descriptive message when json can’t be parsed (#1796)
* Test handling of invalid JSON on BaseJsonService
* Remove invalidJSON tests from new-style services
2018-07-23 19:35:42 -05:00
Danial
f5fe85cda2 Fix colorB override not working for static badges (#1801) 2018-07-23 18:33:32 -05:00
Paul Melnikow
5a62ed59fe List the named logos in the frontend (#1794)
Fix #1787
2018-07-23 15:19:55 -05:00
Paul Melnikow
5359adfb3f Do not prettify package.json (#1795)
This causes extremely strange failures in CircleCI. `npm install`, oddly, rewrites and reformats package.json. We hash package.json to determine the cache keys, and oddly enough Circle computes a new hash when we write the cache. `npm-install` writes to one cache key. The tasks that follow read from another. Nothing runs.

I'm running into this because I'm using prettier auto-format on another project, and the presence of a `.prettierrc` means it's started trying to format Shields code.

In separate news, I'm loving auto-formatting!
2018-07-23 14:35:52 -05:00
Paul Melnikow
91c3626aac Fix time service (#1791) 2018-07-22 08:26:36 -07:00
Danial
6711119bbb update eslint enable object-curly-spacing (#1789)
https://eslint.org/docs/rules/object-curly-spacing
2018-07-22 14:37:47 +12:00
Paul Melnikow
f9545af81d Fix edge case for service detection in PR titles [cran] [crates] (#1790)
Service detection didn’t work correctly for PR titles with multiple bracketed entries.

https://circleci.com/gh/badges/shields/6797
2018-07-21 09:53:55 -07:00
chris48s
b9db222c8a send longer cache headers by default (#1725)
* tell browsers and downstream caches to cache for
  `env.BADGE_MAX_AGE_SECONDS`, default 0 for dev

* set Cache-Control: no-cache, no-store, must-revalidate if maxAge=0

* add servertime badge to help with cache header debugging

* if service category is 'debug', exclude from examples

* ignore maxAge GET param if less than `env.BADGE_MAX_AGE_SECONDS`
2018-07-20 20:24:02 +01:00
Thaddée Tyl
fd76819c62 Log request data when Travis errors (#1631)
Related: https://sentry.io/shields/shields/issues/503517592/
2018-07-19 19:29:39 -07:00
Paul Melnikow
e39b280d44 Fixes for github deploy (#1774)
This addresses some long-standing comments in https://github.com/badges/shields/issues/1458#issuecomment-368270996

We should also adopt Gatsby, create-react-app, or something similar designed for static sites, to eliminate the unnecessary runtime dependency on Next.js while also letting someone else maintain our front-end tooling. :-D These alternative tools might work just fine in subdirectories without config, and we might be able to leave Jekyll turned on (though we don’t need it). However these git-related changes are orthogonal.

- Don’t check out master, making it possible to deploy the currently checked-out commit
- Disable Jekyll which we don’t need. This allows _next folders to be deployed, and the related URL rewriting to be removed.
- Completely empty the deploy branch’s index before deployment. This prevents errors from broken symlinks, while preserving the commit history in the deploy branch.
- Do the deployment work in a git working tree. This requires Git 2.18 but makes it possible to do the above very safely.
2018-07-18 19:46:27 -07:00
greenkeeper[bot]
6462cc49d5 Update eslint-plugin-node to the latest version 🚀 (#1786)
* chore(package): update eslint-plugin-node to version 7.0.0

* Update lockfile

* Update call to deprecated API
2018-07-18 18:36:54 -07:00
Danial
6a1f0f60b1 handle malformed url [dynamic-json] (#1782) 2018-07-17 12:50:36 +12:00
Hans Brende
3c594e8bcc fix for invalid [jenkins] tests (#1777)
* fix for invalid [jenkins] tests
2018-07-17 11:43:23 +12:00
Pyves
66c678e0dd [appveyor bitbucket buildkite circleci codeship continuousphp docker readthedocs scrutinizer shippable travis] Extracted isBuildStatus test validator (#1767) 2018-07-13 09:21:02 +01:00
Marcin Mielnicki
6f9f723d92 invalidJSON fixture documented (#1755) 2018-07-12 12:01:34 -04:00
greenkeeper[bot]
01f4bab4f6 Update prettier to the latest version 🚀 (#1749)
* chore(package): update prettier to version 1.13.6

* Update lockfile
2018-07-12 11:54:34 -04:00
chris48s
7de10783fa Deprecate [magnumci bithound] (#1770)
* deprecate Magnum CI badge

* deprecate BitHound badges
2018-07-11 23:30:52 -04:00
Brian Quinlan
c76090ac7f Add a reference to pybadges (#1773) 2018-07-11 23:17:54 -04:00
chris48s
0ec35ec9f8 add tests for composer version compare function (#1771) 2018-07-11 23:14:26 -04:00
Paul Melnikow
b3ec3e7a96 Generalized rotating token pool (#1736)
This was designed as part of a rewrite of the Github auth code in #1205 which is stalled because I don't want to deploy it without access to server logs. The need for token rotation came up recently in #541, so I picked up this code, removed the github-specific bits, and pulled it in. Ordinarily I wouldn't merge helper code without a use, though sadly it seems like the best way to move forward this rewrite.
2018-07-11 23:08:56 -04:00
Danial
d8cf836264 Add support for rgb, rgba, hsl, hsla, css named colors (#1635)
* add support for rgb, rgb, css named colors

* add support for hsl, hsla & add color-validate

* update makeBadge test, better coverage

* re-add comment

* add comment for supported colors

* dynamic badge gen, remove 'hex'

* add support for 1.0 opacity & fix 101-109

* fix colorscheme tests

* remove extra tests

* add test for negative values

* add test for uppercase & mixed case colors

* fix mixed case/uppercase test

* allow whitespace around color

* update test error messages

* add comments

* add more uppercase test

* update error message

* default to grey/red if invalid color chosen

default colorscheme:
colorA: grey
colorB: red

* Revert "default to grey/red if invalid color chosen"

This reverts commit 10db0c6d74.
Reverted as this affects the CLI version/when no color specified.

* validColor -> isCSSColor

* assignColor function

* update tests to use sazerac
2018-07-12 10:26:17 +12:00
Marcin Mielnicki
9ca74740fa Using invalidJSON instead of other ways to mock an invalid JSON (#1756) 2018-07-11 22:43:32 +02:00
Thibault Jamet
6f54c1638e Add docker logo (#1750)
* Add docker logo
2018-07-11 13:12:13 +12:00
Marcin Mielnicki
8385f3ad7a Probot uses badges from img.shields.io (#1754) 2018-07-10 19:04:35 +02:00
Stanley Ng
85dd5f0809 Add [Jenkins] Jacoco coverage badge ☘ (#1593)
* Add Jenkins Jacoco coverage badge

* [Jenkins] add service test for jacoco coverage

* Added Jenkins Coverage (Jacoco) in all-badge-examples page

* Defined variables using let/const instead of var

* Used template string for the uri

* Used checkErrorResponse helper function for the error check

* Used NaN method for not a number test

* Prefixed the original Jenkin coverage test with "cobertura:"

* Moved the happy test case at front

* Merge the business logic between jacoco and cobertura

* Fixed lint issue

* Trigger notification
2018-07-10 18:12:26 +12:00
chris48s
036b191996 fix ansible galaxy role name badge (#1763) 2018-07-08 12:50:31 +01:00
chris48s
dc8bc9c5b4 update [bitrise] URL (#1764) 2018-07-08 12:50:19 +01:00
Pyves
8ad3bc7e90 [scrutinizer] Fix #1739, add tests and refactor (#1759)
* Added tests for Scrutinizer service

* Refactored service and fixed NaN bug

* Updated example

* Improved badge regex
2018-07-08 10:32:13 +01:00
chris48s
b05d93c9c1 fix [waffle] labels badge (#1745)
fix [waffle] labels badge

- update URL and parsing code to use /columns endpoint
- add error handling for 'not found' case
- add missing test cases
- update home page example

Closes #1731
2018-07-05 19:06:06 +01:00
Grey Baker
e1e2a2ff2b Rename semver compatibility to semver stability (#1744) 2018-06-25 19:13:05 +01:00
Paul Melnikow
ec6d9031f0 Test in now-released Node 10 instead of Node 9 (#1738)
Also update `engines`.

Closes #1660
2018-06-19 16:37:02 -04:00
chris48s
def1bc331c fix [sonar] legacy/unsupported service tests (#1741) 2018-06-18 17:34:05 +01:00
Grey Baker
ca58d84447 Add [dependabot] SemVer compatibility badge (#1734)
* Add [dependabot] SemVer compatibility badge

* Add dependabot logo

* Clean up and additional tests
2018-06-17 21:32:57 +02:00
Paul Melnikow
028d8d7691 Fix sinon deprecation warning (#1737)
`sandbox.create()` is deprecated. Use default sandbox at `sinon.sandbox` or create new sandboxes with `sinon.createSandbox()`
2018-06-17 12:58:59 -04:00
Ivan de la Beldad Fernandez
4308b60c8f [Travis] Add travis-ci.com support (#1711) 2018-06-17 10:14:00 +02:00
greenkeeper[bot]
7cd3720edc Update prettier to the latest version 🚀 (#1641) 2018-06-16 16:45:02 -04:00
Paul Melnikow
fa61247dba Rewrite [npm] typedefs badge using new-style service (#1735)
For #1358
2018-06-16 16:38:52 -04:00
chris48s
f78e6f1f8a [gem cdnjs appveyor clojars] refactor clojars, establish BaseJsonService (#1702)
* refactor clojars integration

* DRY up services that request data from JSON endpoints
2018-06-16 20:50:14 +01:00
Paul Melnikow
20b8d0c3b8 BaseService: Query params (#1589)
Provide support for query parameters, in parity with the functionality in old-style services.
2018-06-16 13:10:02 -04:00
tooomm
fc3b793155 extend for pr in title (#1720) 2018-06-16 12:33:48 -04:00
greenkeeper[bot]
9612d5c6bb Update sinon to the latest version 🚀 (#1733)
* chore(package): update sinon to version 6.0.0

* update package-lock
2018-06-16 12:32:32 -04:00
Marcin Mielnicki
12e0164182 Probot workflow configuration with deployment status (#1724) 2018-06-15 17:17:20 +02:00
Marcin Mielnicki
2683f74a56 Required files added to now.json config (#1718) 2018-06-15 17:16:22 +02:00
chris48s
1f928281f2 allow 0 in all [cocoapods] download tests (#1728)
It appears this does not only
happen on the weekly stats.
refs https://github.com/badges/shields/pull/1713
2018-06-13 21:03:42 +01:00
chris48s
124748ecde Fix [codeclimate] tests (#1727)
* update nock

The version we were using didn't allow
regex pattern with allowUnmocked option.

Update to latest version which includes this patch:
https://github.com/node-nock/nock/pull/1068

* update codeclimate test to allow any snapshot id on second call

This test was failing because the
snapshot id changed for some reason.

This change allows that to happen
and we will still intercept the
second API call.
2018-06-10 22:20:21 +01:00
chris48s
67eb92e583 fix [dub] service test (#1729)
The version we were testing against
seems to have gone away - spooky 👻
https://code.dlang.org/api/packages/vibe-d/0.7.23/stats

Switch to a version that exists:
https://code.dlang.org/api/packages/vibe-d/0.7.27/stats
2018-06-10 22:18:15 +01:00
chris48s
e8980f70e8 fix 'not found' case in [node] badge (#1730)
NPM changed the error body,
breaking the not found case

Fix this by checking the status
code instead of relying on
the errror message in the body.
2018-06-10 22:17:52 +01:00
Marcin Mielnicki
b418235c7f Standard name in nuget v2 downloads badge (#1726) 2018-06-10 21:36:40 +02:00
Matthias Koch
7f9102dbb5 Add ReSharper gallery badge. (#1722) 2018-06-09 21:51:58 +02:00
chris48s
fa52c04439 allow 0 for cocoapods weekly downloads (#1713) 2018-06-07 20:08:53 +01:00
greenkeeper[bot]
707ada3718 Update snap-shot-it to the latest version 🚀 (#1715)
* chore(package): update snap-shot-it to version 5.0.1

* update package-lock
2018-06-03 15:09:58 +01:00
greenkeeper[bot]
83007a0c43 Update nyc to the latest version 🚀 (#1716)
* chore(package): update nyc to version 12.0.1

* update package-lock
2018-06-03 15:09:31 +01:00
chris48s
f4ea029e52 service tests for Arch Linux [aur] (#1707) 2018-06-02 19:04:23 +01:00
chris48s
e6559a0889 fix typescript regex in [npm] tests (#1712)
- Expect `TypeScript vX.Y | Flow vX.Y`
  instead of `TypeScript vX.Y Flow vX.Y`
- Allow version numbers to have more than >1 digit
  after the point
2018-06-02 19:03:55 +01:00
chris48s
57a1bf2f08 add more rules to dangerfile (#1703)
* upgrade danger.js to latest version

* If PR contains tests using assert, suggest expect syntax

* if PR touches service, check service tester also touched
2018-05-30 18:39:27 +01:00
Marcin Mielnicki
9d90bd1f95 [github] Commit merge status badge (#1709)
* Basic version of commit-status badge added

* Support for case with no common ancestor

* Handle unknown branch

* Service tests with error responses

* Handle unexpected 404 responses from github

* Branch is a base

* Tests reordered

* Using not the newest commit in tests

* Test for checked commit identical with the newest commit in branch

* Code refactoring

* Example for Github commit merge status
2018-05-30 18:51:52 +02:00
Eric Lordahl
7c7c9f5f04 Ensure both docker CMDs are invoked (#1686) 2018-05-30 09:10:58 +01:00
chris48s
de4e527f57 service tests for [libscore], improve error handling (#1706) 2018-05-29 09:41:42 +01:00
chris48s
8ba33d419f [bower clojars] version() should throw on invalid inputs (#1705)
Throw Error in version() on invalid inputs
2018-05-28 20:08:30 +01:00
chris48s
960c5bf72d upgrade sinon (#1697)
update sinon to version 5.0.7
2018-05-22 15:21:11 +01:00
chris48s
5d4ab86b1b upgrade to Joi 13.3.0 (#1696) 2018-05-22 15:20:51 +01:00
chris48s
3ff98bf038 update request (#1695)
update request to version 2.87.0
2018-05-22 15:20:34 +01:00
greenkeeper[bot]
c6b6183ee4 Update pretty-bytes to the latest version 🚀 (#1676)
* fix(package): update pretty-bytes to version 5.0.0

* update package-lock
2018-05-22 10:14:41 +12:00
Sebastian Staudt
498684cf24 Adapt to new JSON API of formulae.brew.sh (#1684) 2018-05-21 19:48:33 +01:00
mattbk
37617c1d4e Add Liberapay logo (#1692)
* Add Liberapay logo.

* Add variations.

* Optimize SVG.

* Remove logo testing variants.
2018-05-19 10:53:24 +12:00
Raziel
c76e221b47 [david] add support for path (#1687)
* Example with a path query parameter

* Support for David path query parameters

* David path not found test

* [david] updated invalid path test
2018-05-18 11:50:04 +12:00
Marcin Mielnicki
d51ae90270 Bugfix: override colorB in [docker] badges (#1690)
* Color fix for Docker Hub automated integration

* Test for overriding colorB in docker stars badge

* Test for overriding colorB in docker pulls badge

* #008bb8 is color of automated docker builds

* Test for overriding colorB in docker build badge

* Overriding colorB in docker stars badge

* Overriding colorB in docker pulls badge

* Overriding colorB in docker automated badge

* Better assertions in docker tests

* The default docker color updated to match the logo
2018-05-16 18:11:26 +02:00
chris48s
bf53e612f5 [cdnjs gem] make exception classes more consistent (#1683)
make exception classes more consistent
2018-05-15 18:57:33 +01:00
Sam Lanning
4f8414c003 Add grade badge for [lgtm] (#1681)
* Add LGTM Grade badge

* Add new tests for LGTM Grade badge

* Add lgtm grade example to homepage
2018-05-12 10:30:48 +01:00
chris48s
b5635bf55a [gem cdnjs appveyor] refactor ruby gems service (#1680)
* allow services to export >1 classes

This change to loadServiceClasses() allows us to define
services which either export a single service class e.g:

module.exports = class Cdnjs extends BaseService {
  //...
}

or more than one. e.g:

module.exports = {
  GemVersion,
  GemDownloads,
  GemOwner,
  GemRank,
}

* refactor ruby gem badges

- move badge code to service classes
- throw exceptions for errors
- use let and const
- change tests to expect 'downloads' label for error badges
- general tidying

* fix typo in tests

* Don't always use class name in example label

This allows (for example) GemVersion and GemDownloads
both to use the example label 'Gem'
2018-05-10 17:32:45 +01:00
Sam Lanning
f43096a2dd replace lgtm logo with improved one (#1679) 2018-05-10 19:19:38 +12:00
Marcin Mielnicki
6dab822a9c checkErrorResponse documented in the tutorial (#1675)
* The most recent code examples in tutorial

* An extra empty line removed

* An extra escapring characters removed

* checkErrorResponse mentioned in tutorial

* Typo fix in tutorial

* Static badges as examples in tutorial

* Missing word in the tutorial added

* Typo fix in tutorial
2018-05-09 18:01:51 +02:00
Pyves
3518b642e7 [MicroBadger] Fixed tests (#1677) 2018-05-07 21:47:36 +01:00
Sam Lanning
726dc9d916 Add LGTM logo (#1673) 2018-05-05 20:39:21 +01:00
chris48s
0ef1c947e2 open badge links in new tab (#1667) 2018-05-05 19:15:21 +01:00
Sam Lanning
45ff94d5a3 Add [LGTM] service (#1672) 2018-05-05 19:14:58 +01:00
chris48s
8fcc13d5bc refactor [cdnjs] integration (#1668)
* pass error object to InvaildResponse()

this prevents us from throwing
TypeError: Cannot read property 'stack' of undefined
when we attempt to parse invalid json

* refactor [cdnjs] integration
2018-05-04 21:55:51 +01:00
Marcin Mielnicki
b126b4ebdc checkErrorResponse documented in service tests (#1670)
* Travis integration uses checkErrorResponse

* checkErrorResponse added to service tests doc
2018-05-02 16:06:09 +02:00
chris48s
714df8fac5 change CC0 example in GH service tests (#1634) 2018-04-28 20:59:27 +01:00
Danial
2e87ed9d46 add codeship logo (#1663)
* add codeship logo

* minify codeship logo
2018-04-28 14:25:56 +12:00
Zsófia Balogh
14bdaf378a [Codeship] fix status checking regexp & add new statuses (#1662)
* [Codeship] fix status checking regexp

we don't need to match the file extension to determine the status

* [Codeship] handle new build statuses

based on https://documentation.codeship.com/general/account/notifications/#webhook
2018-04-27 10:48:05 +12:00
Andrea Peruffo
a24d42a5bc minor links fix (#1658) 2018-04-25 10:05:08 +12:00
Raul Riera
f607ad787e Add [buildkite] service (#1657)
* Support for buildkite

* Added to the examples as well

* Removed the unnecessary label property

* Fixed the example

* Improve the tests

* Made the branch optional and review suggestions

* Added network error test

* Unexpected response test

* PR review suggestions

* Updated test to include all responses

* Forgot one of the tests
2018-04-24 08:13:24 +12:00
Omri
da108966cd Add NPM logo (#1656) 2018-04-23 10:47:16 +12:00
Danial
8fda86fcf1 set expires header corresponding to maxAge (#1651)
* set expires header corresponding to maxAge

* add tests
2018-04-22 13:48:01 +12:00
Thomas Broadley
2ded83f8a6 Documentation typos (#1647) 2018-04-15 20:43:51 +01:00
chris48s
d2a144e80f update [pypi] to use warehouse (closes #1569) (#1648) 2018-04-15 09:46:45 +01:00
Pyves
ac13fdb8d4 [librariesio] Missing try/catch block and tests (#1644) 2018-04-14 08:35:47 +01:00
Binh Bui
e1755df212 [vaadin-directory] Support star and stars endpoints (#1603) 2018-04-09 20:14:21 +01:00
Jacob Tomlinson
d56b6961da Add [dynamic-yaml] badge (#1623)
* Add dynamic yaml badge

* Forgot package lock

* Switch tests to yaml data source

* Add yaml to the dynamic badge maker options

* Reorder to match documentation examples

* Reordered dynamic types to be alphabetical

* Removed regex as pinend commit makes it unnecessary and fixed url

* Removed unused import

* Add more YAML MIME types

* Removed duplicate tests which don't differ between data types
2018-04-08 21:47:28 +02:00
Rafał Pocztarski
47614e5bbc Add Stack Exchange logos (#1636)
* Add Stack Exchange logos

* Optimize Stack Exchange logos with svgomg

closes #1637
2018-04-06 04:07:26 +02:00
Danial
c0bdf54e4b optimize cssColor check regex (#1602)
* optimize cssColor regex

* Add comment & tests

* update test to not export cssColor

* [0-9] -> \d
2018-04-05 00:31:58 +02:00
Pyves
f98d17e00d [SourceForge] Fixes, tests and cleaning up (#1626) 2018-04-02 21:51:41 +01:00
Paul Melnikow
f2efd751b5 Minor refactor of examples preparation (#1632)
This cleans up the work from #1582, clarifying concerns, removing a bit of duplication, and renaming for clarity.
2018-04-02 07:03:52 -05:00
Pyves
a168072cd5 [DotnetStatus] Service deprecation (#1630) 2018-04-02 09:40:50 +01:00
Pyves
3aa21301ff [Ansible] Handle no data responses (#1629) 2018-04-02 09:38:25 +01:00
Paul Melnikow
416d433fa0 [appveyor] Error handling in BaseService (#1590)
Make a clear distinction between programmer errors ("internal errors") and runtime errors, and allow configuring the server to let the programmer errors bubble up in development and unit testing. This saves a huge amount of time because it generates ordinary stack traces when things go wrong. And, if these errors occur in production, we'll catch them, and display **shields | internal error** which is the equivalent of a 500 error.
2018-04-01 22:04:22 -05:00
greenkeeper[bot]
724abd06dc Update svgo to the latest version 🚀 (#1473)
* fix(package): update svgo to version 1.0.5
* Update package-lock
* Update invocation for SVGO 1.x
* Remove helper
2018-04-01 21:57:20 -05:00
Paul Melnikow
f9b0aed8c9 package-lock fixes for glob (#1633)
Missing from #1619
2018-04-01 21:31:43 -05:00
Pyves
dd35739c5c [CodeClimate] Added missing try-catch block (#1613)
* Added missing try-catch block

* Added tests to cover malformed responses
2018-04-01 17:32:43 +02:00
Pyves
c5884b1915 Handled capitalization with empty keys (#1625) 2018-04-01 09:46:13 +01:00
Danial
57008d28a3 Test path escaping - mocha windows fix (#1627) 2018-04-01 08:28:30 +02:00
Marcin Mielnicki
0d5b48bc64 "commits to be deployed" replaced "last deployed" (#1605) 2018-03-30 12:42:10 +02:00
Pyves
66c5d914c7 [CircleCI] Extended existing try-catch block (#1614) 2018-03-30 09:34:20 +01:00
Paul Melnikow
ac7c418222 Extract examples from new-style services (#1582)
Instead of centralizing examples, specify them from within a service.

* Avoid duplication in service loading + refactor
* Avoid duplication in URLs, rename uri -> url in BaseService
2018-03-30 03:07:44 -05:00
Pyves
1dff491a24 Added number support to version text formatter (#1620) 2018-03-29 10:08:23 -07:00
Pyves
16eea6d7db Number support for version color formatter (#1615) 2018-03-29 18:04:42 +01:00
Philip I. Thomas
01646ded72 upgrade glob to be a prod dependency (#1619) 2018-03-28 08:40:25 -07:00
greenkeeper[bot]
7e239f78c0 chore(package): update semver-regex to version 2.0.0 (#1596) 2018-03-27 17:13:15 -07:00
Pyves
ed419b0a77 [microbadger] Fix tests (#1600) 2018-03-27 11:15:51 +01:00
Thaddée Tyl
17ddd180bb Skip Twitter suggestion if URL does not have protocol (#1604)
This resolves the following error occurring in production:

```
TypeError: Cannot read property 'slice' of null
/home/m/shields/lib/suggest.js in twitterPage at line 63:31
  const schema = url.protocol.slice(0, -1);
```
2018-03-26 15:33:59 -07:00
Thaddée Tyl
0a248998f2 Only compute user/repo if suggesting badges for GitHub (#1601)
This resolves the following error occurring in production:

```
TypeError: Cannot read property 'slice' of null
/home/m/shields/lib/suggest.js in findSuggestions at line 40:33
  const userRepo = url.pathname.slice(1).split('/');
```
2018-03-25 14:47:54 -07:00
ayatk
400ae013a7 Add circleci logo (#1595) 2018-03-25 22:31:04 +02:00
Marcin Mielnicki
fe4ac0bf1c Log errors to Sentry (#1422) 2018-03-24 20:30:51 +01:00
Paul Melnikow
ea4b758612 Move service tests alongside code (#1563)
Per discussion in #1543
2018-03-20 18:32:48 -07:00
Paul Melnikow
71ef474afc Add tests for BaseService + fix hex colors (#1581) 2018-03-20 15:04:55 -07:00
Paul Melnikow
e37668b392 We have no more pull requests to adopt (#1587)
We’ve cleared the backlog of pull requests needing adoption and closed the old ones out, so it seems best to remove this from the contributing guidelines.
2018-03-19 20:27:47 -04:00
Paul Melnikow
0654abe2b2 Fix colors for new appveyor badge (#1583) 2018-03-19 20:16:47 -04:00
Darren Labithiotis
a497ccabf7 [dynamic-xml dynamic-json] Set request options for dynamic json badges. (#1575)
* Set request options for dynamic json badges to include accept header of application/json and json:true

* Added headers for XML dynamic badges

* Added tests for dynamic badges to check correct Accept headers are set
2018-03-19 19:23:13 -04:00
Paul Melnikow
5582485dc5 Try to fix greenkeeper-lockfile not updating (#1562) 2018-03-18 21:30:07 -04:00
Paul Melnikow
7d90391b05 Housekeeping after upgrade to Node 8 (#1564) 2018-03-18 13:34:15 -04:00
Ville Skyttä
0710c3b8f4 Spelling fixes (#1580) 2018-03-18 16:30:32 +00:00
Paul Melnikow
3a47bb38ac Searches with regex control characters should not crash (#1579)
Fix #1578
2018-03-17 16:52:41 -04:00
Paul Melnikow
6c2ce413b1 Adopt async-await for most promise-based code (#1565)
* Address todo for Node 8 upgrade
2018-03-15 09:36:40 -04:00
greenkeeper[bot]
2adb0e7d52 Update request to the latest version 🚀 (#1566)
* fix(package): update request to version 2.84.0

* fix(package): update request to version 2.85.0

Closes #1566

* update package-lock
2018-03-14 22:57:24 -04:00
greenkeeper[bot]
3a5563d27f Update query-string to the latest version 🚀 (#1572)
* fix(package): update query-string to version 6.0.0

* update package-lock
2018-03-14 22:57:05 -04:00
Paul Melnikow
6750115b79 Add [npm] type definitions badge (#1541)
Let a package show off its type definitions based on devDependency data in the published npm package.

Close #1252
2018-03-11 18:00:41 -07:00
Paul Melnikow
2d651533aa New API for registering services: #963 #1423 #1425 #1450 #1451 #1544 #1543
This merges the `node-8` branch. The heavy lift was by @Daniel15 with refactoring from me and a patch by @RedSparr0w.

* New API for registering services (#963)
* Disable Node 6 tests on node-8 branch (#1423)
* BaseService: Factor out methods _regex and _namedParamsForMatch (#1425)
    - Adjust test grouping
    - Rename data -> queryParams, text -> message
* BaseService tests: Use Chai (#1450)
* BaseService: make serviceData and badgeData explicit and declarative (#1451)
* fix isValidStyle test (#1544)
* Run tests in Node 9, not Node 6 (#1543)
2018-03-11 17:53:01 -07:00
Eli Perelman
7545dcfe42 Add [Bugzilla] bugstatus badge (#1492) 2018-03-11 21:50:14 +01:00
chris48s
f8d511fae2 Add some more rules to dangerfile (#1560)
* warn if the target branch is not master
* link to the logo guidance if PR modifies a SVG file in /logo/
2018-03-11 20:05:49 +00:00
Paul Melnikow
ae848f38f4 Add snapshot tests for SVG and JSON (#1557)
These tests should fail if something is accidentally changed that affects the SVG or JSON files. In the case of deliberate changes, we can update the snapshots.
2018-03-11 09:07:03 -07:00
chris48s
d5fc786ad3 service tests for [dub] (#1559)
- add tests
- improve error handling
- switch to https
2018-03-09 21:37:33 +00:00
Pyves
276f821317 Update contributing guidelines (#1551)
* Added logo acceptance criteria

* Added repository starring section

* Added logo approval expectation sentence

* Extended to spreading the word section

* Rearranged sections
2018-03-09 19:10:03 +00:00
Florian Munz
54afdc189c Add Depfu dependencies badge (#1537) 2018-03-08 11:42:25 -08:00
Paul Melnikow
8fde79b793 Make tests more resilient to time zone (#1558)
These tests were failing locally and I suspect it’s because I’m in a different time zone.
2018-03-08 11:09:26 -08:00
greenkeeper[bot]
dd90d2aced Update sinon-chai to the latest version 🚀 (#1547)
* chore(package): update sinon-chai to version 3.0.0

* Update package-lock
2018-03-08 09:24:38 -08:00
greenkeeper[bot]
2d5a088d6f Update next to the latest version 🚀 (#1490)
* chore(package): update next to version 5.0.0

* Update package-lock

* Get build + tests passing
2018-03-08 09:18:52 -08:00
Danial
a89b6bb163 remove whitespace from data URIs (#1546)
* remove newlines from datauri

* update test, remove decode

* support multiline datauris

* replace whitespace before checking isDataUri

removed multiline support from regex

* prependPrefix set default as empty string

* update
2018-03-08 03:09:29 +01:00
chris48s
1fab9d70de [gratipay gemnasium snap-ci cauditor] add deprecation helpers, deprecate gemnasium (#1524) 2018-03-07 09:08:51 +00:00
chris48s
06fe43c51f [chocolatey powershellgallery myget nuget] tests for NuGet v3 services (#1542) 2018-03-07 09:08:14 +00:00
Danial
be09cee1f2 User defined XML source badge [dynamic-xml dynamic-json] (#1494)
* add dynamic xml badge support

* add tests

* dynamic badge add tests for query param

* remove try catch

* use `checkErrorResponse()`

* update tests

* [dynamic json] add test for multiple items

* Rebase, [dynamic xml] Add support for multiple items

* 404 response -> resource not found

* multiple results test less greedy regex

still alot of room for improvement to this test

* update dynamic badge gen

* add dynamic xml gen tests

* update tests id & path

* datalist -> select

* uri -> url

kept support for uri, incase of any already existing badges.

* split dynamic gen uri

* update query placeholder
2018-03-06 22:43:02 +01:00
Danial
f4d5c41009 [Cauditor] Replace with error message (#1502)
* Depreciate Cauditor

* explicitly set color to lightgray, update test

* add message for date of badge depreciation
2018-03-05 05:55:52 +01:00
Marcin Mielnicki
0640356f2c Travis service tests from tutorial (#1531)
Service tests for Travis CI from tutorial
2018-03-04 21:03:01 +00:00
Pyves
9b564424ba [Snap-CI] Replace with error message (#1468)
* Depreciated Snap CI

* Updated badge color to light gray
2018-03-04 09:32:02 +00:00
greenkeeper[bot]
22ff288eac Update eslint, eslint-config-standard, and friends to the latest versions 🚀 (#1512) 2018-03-03 20:45:12 -05:00
greenkeeper[bot]
ab5514651f Update eslint-plugin-node to the latest version 🚀 (#1489) 2018-03-03 20:36:46 -05:00
greenkeeper[bot]
4a3f1eda9a Update fetch-ponyfill to the latest version 🚀 (#1488) 2018-03-03 20:25:18 -05:00
Danial
49574df0d1 [README.md] add logos (#1507) 2018-03-03 20:14:04 -05:00
greenkeeper[bot]
af04068ffa chore(package): update node-fetch to version 2.0.0 (#1486) 2018-03-03 19:55:13 -05:00
greenkeeper[bot]
4e5669d2eb Update prettier to the latest version 🚀 (#1528) 2018-03-03 19:44:03 -05:00
Paul Melnikow
3b08d9cb35 [Gratipay] Replace with error message (#1449)
Gratipay is gone :(

For #1359

This failure from https://circleci.com/gh/badges/shields/1411?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

```
  7) Gratipay
       Receiving

	[ GET http://localhost:1111/gratipay/Gratipay.json ]:
     ValidationError: child "value" fails because ["value" with value "invalid" fails to match the required pattern: /^\$[0-9]+(\.[0-9]{2})?\/week/]
      at Object.exports.process (node_modules/joi/lib/errors.js:190:19)
      at internals.Object._validateWithOptions (node_modules/joi/lib/types/any/index.js:669:31)
      at module.exports.internals.Any.root.validate (node_modules/joi/lib/index.js:139:23)
      at Object.pathMatch.matchJSONTypes (node_modules/icedfrisby/lib/pathMatch.js:303:9)
      at node_modules/icedfrisby/lib/icedfrisby.js:703:10
      at IcedFrisbyNock._invokeExpects (node_modules/icedfrisby/lib/icedfrisby.js:1294:33)
      at start (node_modules/icedfrisby/lib/icedfrisby.js:1274:12)
      at Request.runCallback [as _callback] (node_modules/icedfrisby/lib/icedfrisby.js:1232:16)
      at Request.self.callback (node_modules/request/request.js:186:22)
      at Request.<anonymous> (node_modules/request/request.js:1163:10)
      at IncomingMessage.<anonymous> (node_modules/request/request.js:1085:12)
      at endReadableNT (_stream_readable.js:1056:12)
      at _combinedTickCallback (internal/process/next_tick.js:138:11)
      at process._tickDomainCallback (internal/process/next_tick.js:218:9)
```
2018-03-03 19:42:54 -05:00
Pyves
abc6e3f181 [microbadger] Handle no DownloadSize (#1536) 2018-03-02 21:48:12 +00:00
Danial
5ded37b5ff logo data uri encoding (#1527)
* logo datauri encode

no longer need to replace `+` with `%2B`

* add comment & tests for spaces
2018-02-27 21:57:06 +01:00
Marcin Mielnicki
ff24bf3ff8 [travis] Updated an expected value in a service test of Travis PHP version badge (#1526)
* Updated an expected value in a service test of Travis PHP version badge

* Use the isPhpVersionReduction in a service tests of Travis PHP version
2018-02-27 04:11:50 +01:00
Marcin Mielnicki
6b76a6ef24 Use 'default' as default JSON style (#1429)
* Use 'default' as a default JSON style

* Using expect instead of assert

* Assert badge is valid svg in test

* Assert badge is valid json in test
2018-02-26 00:41:30 +01:00
Fuzz Stati0n
3f933594a0 Uncaught TypeError crashes server on numeric or boolean 'link' parameter (#1520) 2018-02-25 22:46:35 +01:00
Thaddee Tyl
0ae322b524 Commit index.html and _next on gh-page deployment
Fixes #1458.
2018-02-25 01:14:26 +01:00
Thaddee Tyl
36a22549e5 Add build folder for gh-pages deployment
Fixes #1458.
2018-02-25 01:14:26 +01:00
Brad Kent
ae6dd7101c [hhvm] #1499 - update hhvm service (#1508)
* closes #1499 - update hhvm service

http://hhvm.h4cc.de... -> https://php-eye.com/api/v1/package...

* fix typo

* add switch breaks

* typo

* const & let vs var

* hhvm service tests

* unused const/var

* alias master & dev-master

* improved status messages - repo not found, branch not found
better tests:  including invalidJSON fixture
2018-02-19 22:53:32 +01:00
Patrick Streule
57c7279540 [Bitbucket] #1509 - Add Bitbucket Pipelines service (#1510)
* [Bitbucket] #1509 - Add Bitbucket Pipelines service

* Use ES6 const and error helper
2018-02-19 21:33:09 +01:00
chris48s
75503ec514 [hackage] switch to the /licenses endpoint (#1506)
* switch to /licenses endpoint to check if package exists

refs #1498

* trim whitespace from version string
2018-02-17 06:00:13 +01:00
Danial
3cb71037fd checkErrorResponse update default (#1501) 2018-02-15 23:34:38 +01:00
chris48s
581546d58e [chocolatey powershellgallery] add service tests for NuGet v2 services (#1487)
* add service tests for NuGet v2 services

* fixup - test the correct endpoint

* remove superfluous try/catch blocks

* test the colors too

* use invalid json fixture
2018-02-13 22:09:04 +01:00
Binh Bui
143ec95bf0 Update [Vaadin-Directory] previewUri in all-badge-examples.js (#1496)
* Changed previewUri in all-badge
2018-02-13 03:18:10 +01:00
Binh Bui
e773a9f47d Added [Vaadin-Directory] badge service (#1474)
* Integrated Vaadin service to server.js & load age from color-formatters lib

* Added 8 tests for Vaadin services

* Added Vaadin badge to main page under Misc

* Used checkErrorResponse() and fix 404 test return value

* Removed maturity from URL field option

* Remove duplicate `age` module import

* Removed comment

* Changed several URI fields and fixed according tests
2018-02-13 00:52:46 +01:00
Marcin Mielnicki
17b4a70411 [npm bountysource cdnjs circleci clojars docker gem homebrew itunes microbadger nexus requires shippable suggest uptimerobot] Service tests for NPM total downloads + invalidJSON helper (#1471)
* Service tests for NPM total downloads

* Spread syntax removed

* service-tests/helpers/mocks.js -> service-tests/helpers/response-fixtures.js

* Another value an invalid JSON in response-fixtures

* Using invalidJSON helper in service tests

* Working example in a service test of microbadger

* isPercentage supports decimal and integer values
2018-02-12 21:36:23 +01:00
Tomek Łaziuk
8ad176d014 [bundlephobia] add badge for the npm package size (#1481)
* Added a shield for calculating npm bundle sizes

* Fix linting errors

* Fixed badges for bundlephobia

* Remove un-required keywords

* Simplified handler based on feedback

* Use isFileSize for validation

* Convert camel-cased error codes to space separated ones

* Updated error format

* Fixed error formatting

* Renamed gzip to minzip

* Fixes lint error

* Remove test that times out

* refactor tests to make it more readable

* meaningless change

* use trim
2018-02-03 08:31:10 -08:00
chris48s
cbb263b102 service tests for [cocoapods] (#1472)
* service tests for [cocoapods]

* Add tests for CocoaPods Endpoints

Bug fixes:
* Call `metrics.cocoapods.org` API endpoints over HTTPs
* Show correct left-side badge text on error in version/platform/license badges
* Handle null doc coverage gracefully
* Add handling for 'not found' responses

* drop last param to checkErrorResponse

* remove redundant line

* set badge label using more terse notation

* specify allowed platform values
2018-02-03 08:11:28 -08:00
chris48s
e4199bc806 service tests for [david] (#1465)
* service tests for [david]

* update 500 handling
2018-02-02 15:11:50 -08:00
greenkeeper[bot]
ef038b8049 Update mocha to the latest version 🚀 (#1459)
* chore(package): update mocha to version 5.0.0

* Update package-lock
2018-02-02 14:58:14 -08:00
greenkeeper[bot]
4ffdd85177 Update semver to the latest version 🚀 (#1457)
* fix(package): update semver to version 5.5.0

* Update package-lock
2018-02-02 14:54:26 -08:00
greenkeeper[bot]
1314258913 Update is-svg to the latest version 🚀 (#1483)
* chore(package): update is-svg to version 3.0.0

* Update package-lock
2018-02-02 14:44:29 -08:00
Paul Melnikow
e6de92c6ba Upgrade to next.js patched for CVE-2018-6184 (#1485)
This clears the GitHub warning for the vulnerability that shows up for maintainers. Note the vulnerability does not affect our deployment, which is static, using `next export`.

https://github.com/zeit/next.js/releases/tag/4.2.3
https://nvd.nist.gov/vuln/detail/CVE-2018-6184
2018-02-02 14:40:59 -08:00
Danial
cec40ad46c update tests (#1482) 2018-02-02 10:10:40 +13:00
Pyves
435903ae4a [CodeClimate] Fix remaining badges (#1387)
* Fixed remaining CodeClimate badges

* Added explicit percentage keyword and dropped top level URL

* Merged the two badge handlers into one

* Removed trailing space

* Switched to "dash" URL style

* Reinstated top-level URL

* Swicthed to use letter as optional keyword

* Updated badge examples

* Cleaned up

* Changed badge label to technical debt

* Switched tests to more mainstream projects as previous ones were deleted

* Rearranged badge URLs and default formats

* Updated examples
2018-02-01 09:33:29 +13:00
chris48s
b7228ae89e update codacy urls (#1477) 2018-02-01 09:24:42 +13:00
George Hopkins
0fd69332bd Add Windows logo (#1467) 2018-01-24 09:54:51 +13:00
chris48s
ec38c2e4da [shippable] add tests for shippable service (#1362)
* add test suite to formalise existing behaviour of shippable service

* throw more descriprive errors, use es6 declarations

* switch from SVG parsing to shippable API

* add test case for unexpected status code

* remove unused import

* link to source for status codes
2018-01-22 19:28:59 -08:00
chris48s
3c551a6156 clarify default for Uptime Robot ratio (#1463)
Fix #1462
2018-01-21 18:01:31 -05:00
Danial
9aafe86247 Show logos by default on social badges (regression fix) (#1456)
* Show logos on social badges

* Revert "Showcase logos in social badges on the front page"

This reverts commit 61fa22b7e4.

* Update footer badges to all be social style

as per reverted commit 61fa22b7e4
2018-01-21 23:57:58 +01:00
chris48s
e3ac9c3db5 service tests for [itunes] (#1464) 2018-01-21 17:50:04 -05:00
Paul Melnikow
1d8926672c Fix PR metadata auth [cran] (#1454)
Match work done in #1453 to our CI setup.
2018-01-16 13:15:15 -05:00
chris48s
7c6723a79d service tests for [docker] (#1428) 2018-01-15 22:03:52 -05:00
Paul Melnikow
eacfc1497a For service tests, get PR metadata from Github API (#1453)
Rather than depend on Shields production, use the GitHub auth info from CI. It's disorienting to have our own CI go down when production is down. It also makes it harder to review PRs when there are ops issues.
2018-01-15 21:53:15 -05:00
Danial
65e1d69f53 [badge/dynamic/json] fix colorscheme on error (#1445)
* [FIX] error colorscheme

* throw error if jsonpath query non existent

* fixup

* show brightgreen badge by default

* update test

* let -> var

* set lightgrey when no uri specified

* update tests

* red color for no uri specified

* dynamic badge use setBadgecolor()
2018-01-16 13:53:30 +13:00
chris48s
e1f0e2598d tests for ruby [gem] service (#1444)
* add tests for ruby gems version badge

* add tests for ruby gems users badge

* add tests for ruby gems rank badge

* add tests for ruby gems downloads badges

* don't allow 0th rank

* move version info to left side of badge
2018-01-15 15:20:48 -05:00
Vladimir Starkov
a681fdaa87 Fix docker run (#1439)
* fix: update nodejs version to latest LTS, to fullfill check-node-version. close #1437

* docs: add docker run example without shields.env file, because there is no such file in a repo and container wont start

* fix: docker build project, clean npm and run production mode. close #1373
2018-01-15 15:19:28 -05:00
Paul Melnikow
6b26affb5f Uptime Robot: Use regex that accepts decimals (#1448)
For #1359

This failure from https://circleci.com/gh/badges/shields/1411?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

```
  26) Uptime Robot
       Uptime Robot: Percentage (valid)
         
  [ GET http://localhost:1111/uptimerobot/ratio/m778918918-3e92c097147760ee39d02d36.json ]:
     ValidationError: child "value" fails because ["value" with value "99.992%" fails to match the required pattern: /^[0-9]+%$/]
      at Object.exports.process (node_modules/joi/lib/errors.js:190:19)
      at internals.Object._validateWithOptions (node_modules/joi/lib/types/any/index.js:669:31)
      at module.exports.internals.Any.root.validate (node_modules/joi/lib/index.js:139:23)
      at Object.pathMatch.matchJSONTypes (node_modules/icedfrisby/lib/pathMatch.js:303:9)
      at node_modules/icedfrisby/lib/icedfrisby.js:703:10
      at IcedFrisbyNock._invokeExpects (node_modules/icedfrisby/lib/icedfrisby.js:1294:33)
      at start (node_modules/icedfrisby/lib/icedfrisby.js:1274:12)
      at Request.runCallback [as _callback] (node_modules/icedfrisby/lib/icedfrisby.js:1232:16)
      at Request.self.callback (node_modules/request/request.js:186:22)
      at Request.<anonymous> (node_modules/request/request.js:1163:10)
      at IncomingMessage.<anonymous> (node_modules/request/request.js:1085:12)
      at endReadableNT (_stream_readable.js:1056:12)
      at _combinedTickCallback (internal/process/next_tick.js:138:11)
      at process._tickDomainCallback (internal/process/next_tick.js:218:9)

  27) Uptime Robot
       Uptime Robot: Percentage (valid, with numberOfDays param)
         
  [ GET http://localhost:1111/uptimerobot/ratio/7/m778918918-3e92c097147760ee39d02d36.json ]:
     ValidationError: child "value" fails because ["value" with value "99.967%" fails to match the required pattern: /^[0-9]+%$/]
      at Object.exports.process (node_modules/joi/lib/errors.js:190:19)
      at internals.Object._validateWithOptions (node_modules/joi/lib/types/any/index.js:669:31)
      at module.exports.internals.Any.root.validate (node_modules/joi/lib/index.js:139:23)
      at Object.pathMatch.matchJSONTypes (node_modules/icedfrisby/lib/pathMatch.js:303:9)
      at node_modules/icedfrisby/lib/icedfrisby.js:703:10
      at IcedFrisbyNock._invokeExpects (node_modules/icedfrisby/lib/icedfrisby.js:1294:33)
      at start (node_modules/icedfrisby/lib/icedfrisby.js:1274:12)
      at Request.runCallback [as _callback] (node_modules/icedfrisby/lib/icedfrisby.js:1232:16)
      at Request.self.callback (node_modules/request/request.js:186:22)
      at Request.<anonymous> (node_modules/request/request.js:1163:10)
      at IncomingMessage.<anonymous> (node_modules/request/request.js:1085:12)
      at endReadableNT (_stream_readable.js:1056:12)
      at _combinedTickCallback (internal/process/next_tick.js:138:11)
      at process._tickDomainCallback (internal/process/next_tick.js:218:9)
```
2018-01-15 15:15:23 -05:00
Paul Melnikow
e358ebe6b3 Refactor LRU cache test asserts (#1418) 2018-01-15 14:15:27 -05:00
greenkeeper[bot]
b422e880c1 Update prettier to the latest version 🚀 (#1434) 2018-01-15 14:14:08 -05:00
Paul Melnikow
606946f24a Log + fail tests on unhandled promise rejections (#1424) 2018-01-14 16:57:40 -05:00
chris48s
be3bc45d66 service tests for [homebrew] (#1443)
* add tests and 'not found' handling for homebrew service

* add test with mocked response
2018-01-14 16:51:24 -05:00
Thaddee Tyl
09a2ca144d Tweak IP and badge type rate limits 2018-01-13 18:34:48 +01:00
Thaddee Tyl
61fa22b7e4 Showcase logos in social badges on the front page 2018-01-13 15:33:41 +01:00
Vladimir Starkov
db39093fa7 fix: add missing git to apk installation script. close #1435 (#1436) 2018-01-11 16:55:33 -05:00
Paul Melnikow
864b194e5c Add Joi to greenkeeper ignore (#1430) 2018-01-09 11:50:43 -05:00
Thaddee Tyl
ac8935cecb Add rate limiting
We now rate limit IPs, referers and badge type.
2018-01-09 02:35:51 +01:00
Thaddee Tyl
0da212b7de Upgrade to camp 17.2.1 2018-01-09 01:25:10 +01:00
Paul Melnikow
7c1a3fef69 Adopt Chai for assertions (#1419) 2018-01-08 14:18:07 -07:00
chris48s
2de53ce7bd add tests for [hackage] (#1416)
* add tests for hackage, handle 'not found'

* add 'not found' case for hackage-deps

* use es6 declarations

* change badge label to 'dependencies'
2018-01-06 22:02:34 -07:00
Michael
a55ab15de2 fix inline image path (#1427) 2018-01-06 08:44:11 -07:00
greenkeeper[bot]
2013968990 Update danger to the latest version 🚀 (#1414) 2018-01-05 22:09:25 -07:00
chris48s
e614d19355 service tests for [uptimerobot] (#1426)
* use the same error handling on /status and /ratio endpoints

* add service tests for uptime robot
2018-01-05 20:51:05 -07:00
Daniel Lo Nigro
02683afd04 Don't crash when logo passed as integer (#1319) 2018-01-04 17:11:59 -07:00
chris48s
e91c9fc7ab Add tests for Circle-CI (#1421) 2018-01-05 12:16:25 +13:00
Paul Melnikow
ccb3eb8fdf Fix January unit test (#1417) 2018-01-03 20:37:35 -07:00
chris48s
9cb9d5984d [requires] add tests for requires.io service, review error handling (#1361) 2018-01-02 20:13:10 -07:00
Danial
503618443e Add Discord logo (#1413) 2018-01-03 10:09:01 +13:00
Sebastian Staudt
e62c085922 Update URL for Homebrew formula versions (#1408)
braumeister.org is now part of Homebrew and available at formulae.brew.sh.
2018-01-01 17:40:05 -05:00
chris48s
e2ee997f07 service tests for [clojars] (#1410) 2018-01-01 17:15:55 -05:00
chris48s
21b1ad73e7 Service tests for [cdnjs] (#1409) 2018-01-01 17:14:16 -05:00
chris48s
438e47adfb Add tests for codeship service (#1411) 2018-01-01 17:10:02 -05:00
Paul Melnikow
60959bf7e7 Use github auth in php-v badges (#1403)
To fix service test that fails in CI (due to no github auth) https://github.com/badges/shields/issues/1359#issuecomment-354184074

- DRY getPhpReleases()
- Pass named options to regularUpdate
    - Add json option
- php-version: Move helpers before functions, and move exports to end
2017-12-28 21:30:30 -05:00
Paul Melnikow
84c60c8730 Optimization + cleanup in makeBadge (#1405)
- Avoid mutating the inputs
- Declare all the input and output keys
- Avoid recomputing escapeXml on the same values
- Capitalize social badge labels before measuring
2017-12-28 21:28:47 -05:00
Danial
3281005c26 Add [twitter] tests (#1394)
* twitter | add error text

inaccessable = 404 etc
invalid user = no data returned from endpoint
invalid = error thrown

* Twitter add tests

* add test for twitter url badge
2017-12-29 09:54:08 +13:00
Paul Melnikow
09cf211786 Fix tests for [suggest] endpoint (#1398) 2017-12-28 14:21:16 -05:00
Peter Gribanov
f719705518 Get tested PHP version from PHP-Eye (#1372) 2017-12-28 13:44:50 -05:00
Paul Melnikow
cc9a6db853 Speed up font-width computation in most cases (#1390)
Ref: #1379

This takes a naive approach to font-width computation, the most compute-intensive part of rendering badges.

1. Add the widths of the individual characters.
    - These widths are measured on startup using PDFKit.
2. For each character pair, add a kerning adjustment
    - The difference between the width of each character pair, and the sum of the characters' separate widths.
    - These are computed for each character pair on startup using PDFKit.
3. For a string with characters outside the printable ASCII character set, fall back to PDFKit.

This branch averaged 0.041 ms in `makeBadge`, compared to 0.144 ms on master, a speedup of 73%. That was on a test of 10,000 consecutive requests (using the `benchmark-performance.sh` script, now checked in).

The speedup applies to badges containing exclusively printable ASCII characters. It wouldn't be as dramatic on non-ASCII text. Though, we could add some frequently used non-ASCII characters to the cached set.
2017-12-26 23:57:46 -05:00
Paul Melnikow
105e383d93 Improve search performance (#1393)
Add a class which applies display: none to badges we don’t want to see. This is accomplished by passing a `shouldDisplay` function along with each badge, which pulls the current query through a closure and applies it.

A bit roundabout, but it works.

The rest of the changes are refactors to avoid code duplication.

I decreased the debouce rate to 50, which seems to work well.

Fix #1314
2017-12-26 23:53:15 -05:00
Paul Melnikow
0a2a80415c Increase the timeout on a test that often runs out of time (#1392)
e.g. #1391
2017-12-26 16:24:14 -05:00
Paul Melnikow
46a05e42b8 Add list of critical services (#1386)
I have a branch going to automatically generate stats on which services have tests, and make a line chart over time. I'm having a lot of fun with that so I'll keep at it.

Meanwhile, here is my subjective list of critical services, for #1358.
2017-12-25 22:21:37 -05:00
Pravdomil
e4fed8d178 Copyedit and add link in footer (#1366) 2017-12-21 18:34:48 -05:00
Danial
b48091a198 [FIX] Bower service tests (#1383) 2017-12-22 12:02:04 +13:00
Paul Melnikow
78bb20dc6a Danger: badge examples are not lib/ + wordsmith (#1381) 2017-12-20 21:11:59 -05:00
Zhmayev Yaroslav
2f9307ae2c Add Scrutinizer CI logo (#1380) 2017-12-21 11:24:11 +13:00
Marcin Mielnicki
cc84240b61 Prettier updated to 1.9.2 in package-lock (#1375) 2017-12-19 13:26:44 -05:00
Pyves
9c2645b41e Fixed Code Climate coverage and maintainability score badges (#1368) 2017-12-18 18:20:29 +13:00
Pyves
32671dfd87 Removal of hasPrefix function in badge-data.js (#1376)
* Removed hasPrefix method and added tests to cover prependPrefix
2017-12-18 17:58:28 +13:00
Daniel Cazzulino
432024db30 Added TFS/VSO logo (#1369)
Extracted from the TFS built-in badges that are already SVG.
2017-12-13 11:08:35 +01:00
greenkeeper[bot]
31fb96e4ac chore(package): update prettier to version 1.9.2 (#1367) 2017-12-11 22:47:38 -05:00
Thaddée Tyl
ea405e04e6 Default to not logging GitHub token debugging (#1364)
As argued for in
https://github.com/badges/shields/issues/1314#issuecomment-350564524.

It populates large quantities of text in the logs, where I wish to only
see errors.
2017-12-10 13:02:03 -05:00
Paul Melnikow
b35cb71ed6 Upgrade IcedFrisby (#1360)
IcedFrisby/IcedFrisby#71 will allow us to set a per-test `timeout()` and per-test `retry()`, which should allow us to keep flaky tests green most of the time.

A slough of service tests are failing locally, though they are also failing in master and seem unrelated to these changes. (#1359)

IcedFrisby is maturing toward a 2.0 API. There's been one breaking change to the way dependencies are installed, and probably more changes to come in the API itself. Shields uses such a small part of that API that 2.0, when it's released, may not even affect us.
2017-12-09 12:03:57 -05:00
Paul Melnikow
ec3971b984 Update contributing guidelines (#1357) 2017-12-09 12:02:45 -05:00
chris48s
20c29db7a6 [bountysource] tests and fixes for bountysource service integration (#1354)
* Add service tests for bountysource badge
* switch to use ES6 style variable declarations
* Fail cleanly on bad responses.
2017-12-08 14:34:33 -05:00
Paul Melnikow
d97f07c263 Install Danger (#1352)
… so we can stop saying "you forgot to…" in code review. 😀

This idea has come up a number of times. If we can write code to detect a contributor guideline, this tool will message the contributor automatically in a pull request. This lets people fix their own problems, relieves maintainers and reviewers from nagging, and keeps anyone from having to constantly ask for more tests.

For futher reading:

- [How to use Danger well](http://danger.systems/js/usage/culture.html)
- [Examples of the kind of thing it can do](http://danger.systems/js/)
- [Dangerfile reference](http://danger.systems/js/reference.html)
2017-12-08 10:38:41 -05:00
Krutov Alexander
b1ca6391d0 Add MicroBadger (#1340) 2017-12-07 17:30:42 -05:00
Danial
a087b28d06 [vscode-marketplace] Update to be more consistent with other badges (#1284)
* fix vs market colors

* fix tests & update formatting

Fix tests
Update tests file formatting to be consistant with other tests

* update tests labels

* switch case formatting

* add stars rating

* add tests for stars
2017-12-08 11:07:40 +13:00
Paul Melnikow
847d178f9e Remove Travis leftovers after move to Circle (#1353) 2017-12-07 13:10:10 -05:00
Danial
e243959420 add spacing between badges in footer (#1347) 2017-12-07 10:28:34 +13:00
Paul Melnikow
81560cb0c6 Set up CircleCI (including [github] tests) (#1338)
I don’t like that our build goes red on master all the time due to flaky service tests. I thought I’d look into other CI services that would make it possible to run the scheduled tests nightly without causing those messages to show up.

CircleCI, Heroku CI, and Codeship were obvious choices. Heroku CI wasn’t free and I didn’t have any experience with Codeship, so I looked into CircleCI. I’ve used their 1.0 system a lot though this was my first time on their 2.0 system. As with earlier versions, they’ve put a lot of work into making the build fast – perhaps more than any other CI system I’ve seen.

I had such good results, my goal shifted from scheduled daily builds (that don’t litter our commit history with red builds) to improving the CI experience as a whole.

This change made a big impact:

- Build logs load much, much faster. In the test I just ran, 22 seconds to < 2 seconds, a 90% improvement.
- Status of each step shows up right in the GitHub UI, which makes it much faster to see exactly what’s failed.
- Builds run about 50-75% faster on account of parallelism.
- GitHub service tests are fixed. This has been a long-standing issue.
- Ability to ssh into a build container to debug failures.

Here’s what I did:

- Created custom Docker images with our dependencies. To be honest, I’m not even sure these are necessary, only to install the greenkeeper-lockfile. We could get dejavu from npm. They make startup very fast.
- Created an npm-install stage which loads all dependencies into node_modules and caches them.
- Created separate stages for our main tests, service tests, and frontend tests, and stages to run the main tests and service tests in Node 6. These run in parallel, up to four at a time.
- Separated service test ID output from the service test results themselves. (I check these often during the PR process, when I confirm that service tests actually ran. Because the production Shields server caches the title, after updating it you can’t tell whether the update is taking effect.)
- Added a personal access token for the shields-ci user. This should actually fix the long-standing issue #979. CircleCI provides an option to “Pass secrets to builds from forked pull requests,” which means unlike Travis, they’ll give us enough rope to shoot ourselves in the foot.
- Schedule a daily build, which runs all the service tests.
2017-12-06 15:45:09 -05:00
Paul Melnikow
212903d0e1 Fix dynamic badge URL generator (#1344)
Fix #1339
2017-12-06 14:38:41 -05:00
chris48s
350a9819cd check status code before parsing body (#1343) 2017-12-06 14:03:32 -05:00
Paul Melnikow
5527d9d642 Fix validateDOMNesting warning (#1342)
Using fix from mapbox/react-click-to-select#15.

From #1273
2017-12-06 13:04:03 -05:00
tooomm
b33b8d5b53 uri --> url (#1341) 2017-12-06 11:05:18 -05:00
Peter Gribanov
962cf61b82 PHP version from .travis.yml (#1258)
Reference: #819
2017-12-06 11:04:24 -05:00
Danial
18f6d44e8d remove extra whitespace in social style badge (#1337) 2017-12-06 17:05:55 +13:00
mattbk
2028251ca0 Add [Liberapay] (#1251) 2017-12-05 23:01:02 -05:00
greenkeeper[bot]
8bdd5b90d2 chore(package): update prettier to version 1.9.1 (#1335) 2017-12-05 19:22:18 -05:00
Paul Melnikow
7c1b1fc621 Fix style picker in markup modal (#1331)
- Restore correct list of styles to markup modal
- DRY lists of styles

Fix #1330
2017-12-05 18:08:13 -05:00
Krutov Alexander
81b38e6069 Update TUTORIAL.md (#1333)
Fix a couple of misspellings
2017-12-05 17:43:11 -05:00
Eric Berry
3581efe5e1 Add [Discourse] status/stats shield (#1326)
Close #1325
2017-12-05 17:34:59 -05:00
Marcin Mielnicki
0570a9e920 License badge colour corresponding to license type (#1190) 2017-12-05 16:43:29 -05:00
chris48s
433d69b684 Fixes and tests for BitBucket + GitHub (#1315)
* Add test suite for BitBucket service integration
* Present BitBucket issues as a metric (for consistency with BitBucket PR endpoint and GitHub endpoints)
* Factor out a shared regex
* Fail cleanly if count is `undefined`
2017-12-05 15:39:08 -05:00
greenkeeper[bot]
58437ec72e Update dependencies to enable Greenkeeper 🌴 (#1328) 2017-12-05 11:49:12 -05:00
Paul Melnikow
8014aa351a Upgrade jsonpath (#1327) 2017-12-05 11:23:58 -05:00
tooomm
f700502c4f webpage: add missing titles + more badge previews (#1305) 2017-12-05 11:17:46 -05:00
Paul Melnikow
342e71ee65 Update docs re production builds (#1316) 2017-12-04 19:08:48 -05:00
Paul Melnikow
9882a44e56 Configure for deployment with zeit now (#1308)
I'm experimenting with Zeit Now as another hosting option. These changes enable a working deployment.
2017-12-04 18:25:16 -05:00
Paul Melnikow
1eedd458b8 Fix and refactor front-end URL generation (#1322)
- Fix issue in Firefox 57 when run from static build
- Fix color parameter in dynamic badge maker
- Correctly apply maxAge in usage badges
- Follow the WHATWG lead and begin to standardize on URL, not URI (https://url.spec.whatwg.org/#goals)
2017-12-04 10:08:54 -05:00
chris48s
8f7f16d7f1 improve test suite for packagist service integration 2017-12-03 21:02:24 -05:00
Danial
ad00f5cde5 Fix depcheck's in Windows (#1320)
Both of the depcheck's are throwing errors

OS: `Windows 10`
Node: `v8.7.0`

Current Output:
```cmd
npm run frontend-depcheck

> gh-badges@1.3.0 frontend-depcheck C:\Users\Dan\Documents\GitHub\shields
> check-node-version --node '>= 8.0'

C:\Users\Dan\Documents\GitHub\shields\node_modules\semver\semver.js:678
    throw new TypeError('Invalid comparator: ' + comp);
    ^

TypeError: Invalid comparator: '
    at Comparator.parse (C:\Users\Dan\Documents\GitHub\shields\node_modules\semver\semver.js:678:11)
    at new Comparator (C:\Users\Dan\Documents\GitHub\shields\node_modules\semver\semver.js:662:8)
    at C:\Users\Dan\Documents\GitHub\shields\node_modules\semver\semver.js:828:12
    at Array.map (<anonymous>)
    at Range.parseRange (C:\Users\Dan\Documents\GitHub\shields\node_modules\semver\semver.js:827:13)
    at Range.<anonymous> (C:\Users\Dan\Documents\GitHub\shields\node_modules\semver\semver.js:769:17)
    at Array.map (<anonymous>)
    at new Range (C:\Users\Dan\Documents\GitHub\shields\node_modules\semver\semver.js:768:40)
    at C:\Users\Dan\Documents\GitHub\shields\node_modules\check-node-version\index.js:119:32
    at module.exports (C:\Users\Dan\Documents\GitHub\shields\node_modules\map-values\index.js:9:18)

npm ERR! Windows_NT 10.0.16299
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Dan\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "frontend-depcheck"
npm ERR! node v8.7.0
npm ERR! npm  v4.3.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gh-badges@1.3.0 frontend-depcheck: `check-node-version --node '>= 8.0'`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gh-badges@1.3.0 frontend-depcheck script 'check-node-version --node '>= 8.0''.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the gh-badges package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     check-node-version --node '>= 8.0'
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs gh-badges
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls gh-badges
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Dan\AppData\Roaming\npm-cache\_logs\2017-12-04T00_30_04_974Z-debug.log
```

```cmd
npm run server-depcheck

> gh-badges@1.3.0 server-depcheck C:\Users\Dan\Documents\GitHub\shields
> check-node-version --node '>= 6.0 < 9.0'

The system cannot find the file specified.

npm ERR! Windows_NT 10.0.16299
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Dan\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "server-depcheck"
npm ERR! node v8.7.0
npm ERR! npm  v4.3.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gh-badges@1.3.0 server-depcheck: `check-node-version --node '>= 6.0 < 9.0'`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gh-badges@1.3.0 server-depcheck script 'check-node-version --node '>= 6.0 < 9.0''.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the gh-badges package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     check-node-version --node '>= 6.0 < 9.0'
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs gh-badges
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls gh-badges
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Dan\AppData\Roaming\npm-cache\_logs\2017-12-04T00_32_13_243Z-debug.log
```

Looks like its due to `'` being used around the version rather than `"`.

This PR Output:
```cmd
npm run frontend-depcheck

> gh-badges@1.3.0 frontend-depcheck C:\Users\Dan\Documents\GitHub\shields
> check-node-version --node ">= 8.0"
```
```cmd
npm run server-depcheck

> gh-badges@1.3.0 server-depcheck C:\Users\Dan\Documents\GitHub\shields
> check-node-version --node ">= 6.0 < 9.0"
```
2017-12-03 19:46:52 -05:00
Paul Melnikow
33690c5555 Fix missing whitespace in usage + footer
Use Fragment support added in React 16.2:

https://reactjs.org/blog/2017/11/28/react-v16.2.0-fragment-support.html
2017-12-03 15:12:22 -05:00
Paul Melnikow
1d313bdd19 Github admin endpoint: use basic auth password instead of username (#1317) 2017-12-03 15:07:58 -05:00
Thaddee Tyl
7e668c74b6 Add monitoring platform 2017-12-03 19:06:02 +01:00
Thaddee Tyl
9cb9113a34 Add endpoint to obtain logs
It goes through a WebSocket; the secret is sent, and if valid, the logs
are sent back.
2017-12-03 18:48:31 +01:00
Thaddee Tyl
e61373e739 Add system endpoint to fetch network information
This is part of an effort to set up an admin monitoring platform.
2017-12-03 18:48:31 +01:00
Paul Melnikow
8d0b1347d7 Fix markup modal when baseUri is unset (#1307) 2017-12-01 16:51:15 -05:00
Paul Melnikow
2be271c22b Frontend: Allow BASE_URL to be unset (#1306)
- Do not use bogus `'undefined'` as base URI
2017-12-01 16:34:31 -05:00
chris48s
56b82e1665 [pypi] Add badge for django version support (#1286)
Closes #1018
2017-12-01 16:10:34 -05:00
Paul Melnikow
aecec144fd Use a better OpenCollective link 2017-12-01 10:09:41 -05:00
Paul Melnikow
6f632224c1 Fix some example and preview URLs 2017-12-01 09:42:19 -05:00
Paul Melnikow
ce2ca922b2 Readme: Fix logo link
For #1301
2017-12-01 09:28:21 -05:00
tooomm
cda9dd35a1 readme: fix link (#1300)
- fixed link to github contributors from Open Collective template
- adjusted brackets around [contribute] to match style for backers and sponsors
2017-12-01 09:10:37 -05:00
Pyves
bf13792633 Optimisation of makeBadge key width computation (#1298)
* Added cache to text width for badge keys.
2017-11-30 22:25:08 -05:00
Paul Melnikow
af0799a312 Use template strings in make-badge (#1296)
c.f. https://github.com/badges/shields/pull/1167#discussion_r145313407
2017-11-30 17:16:08 -05:00
Paul Melnikow
8fa751d0c5 Activating Open Collective (#1295)
See comments in #1250. Gratipay is shutting down.
2017-11-30 14:19:50 -05:00
Paul Melnikow
127b46aef8 Github auth admin endpoint and logging (#1267)
- Periodically log github auth information
    - Tokens are hashed which reduces the security risk inherent in the logs
        - A consistent hash is used so tokens can be correlated across the three data structures and across the three servers
- Add an admin endpoint for github auth information
    - Tokens are returned as-is to enable troubleshooting (e.g. comparing our reqRemaining to github’s)
2017-11-30 13:21:27 -05:00
Paul Melnikow
f403c2b5d3 Configure frontend tests (#1293)
While working on #1288 I configured frontend tests. I'm going in a different direction with that, though it seems worth keeping the test configuration. I added tests for one of the helper methods.
2017-11-29 18:19:05 -05:00
Paul Melnikow
c5e31b5de1 Fix frontend deploy and Heroku staging (#1288)
- Heroku reads the Node version from package.json. We're about to upgrade to Node 8 so this change to `engines` is only pre-emptive. It won't have any effect on the production servers.
- The production deploy scripts were missing the frontend files. This fixes that.
- This modifies the build setup to allow `BASE_URL=/`, which makes all requests relative to the page itself. That simplifies deploying the "debugging" frontend to the production servers, and makes it easy to host the frontend on Heroku.
2017-11-29 17:59:01 -05:00
Paul Melnikow
f3965ae9a5 Upgrade moment (#1294)
Fix moment/moment#4163.
2017-11-29 15:47:17 -05:00
chris48s
a579d2eaec Add test suite for PyPi service (#1289) 2017-11-29 15:22:12 -05:00
Paul Melnikow
9d1efae47f Upgrade check-node-version and print error in Node 9 (#1291)
Refs:

- https://github.com/parshap/check-node-version/issues/18
- https://github.com/badges/shields/issues/1290
- https://github.com/espadrine/sc/issues/65
2017-11-29 13:11:25 -05:00
Paul Melnikow
4b5bf03fea Rewrite frontend in React (#1273)
I rewrote the frontend in React using a module bundler. It's matched feature-for-feature with the current frontend, with only slight changes in the styling. I did not fuss about making the styling identical; the badge popup looks particularly different.

This makes the front end much easier to develop. I'm really looking forward to implementing #701, to which this paves the way.

This makes light use of Next.js, which provides webpack config and dev/build tooling. We’ll probably replace it with create-react-app or our own webpack setup because unfortunately it comes with a lot of runtime overhead (the build is 400k).

Let’s open new issues for bugs and features, and track other follow-ups here: https://github.com/badges/shields/projects/1
2017-11-28 11:34:17 -05:00
Paul Melnikow
a0cd93080e Upgrade sazerac
Fix https://github.com/mikec/sazerac/pull/12
2017-11-27 17:47:54 -05:00
Paul Melnikow
f0e6181ec4 CONTRIBUTING: Add code review to ways to help (#1269) 2017-11-25 21:05:54 -05:00
Paul Melnikow
1af1f497bb Allow configuring allowed CORS origins for suggest (#1282)
- Support single-server testing and a local dev server (like Next) that is on a different port from the shields server
- Refactor config schema

With this change, the suggestions work locally in #1273.
2017-11-25 18:27:02 -05:00
Danial
a4bce73da6 For-the-badge | Convert labels to string then uppercase (#1281) 2017-11-22 23:35:33 -05:00
Vladimir Starkov
e588bef199 Support custom npm registry URLs (#1277) 2017-11-20 19:22:42 -05:00
Danial
ea061e55c6 Add Travis-CI logo (#1276) 2017-11-20 10:05:07 +13:00
Paul Melnikow
bca6d15728 Upgrade camp
The version in Shields goes back to last August. I reviewed the commits and didn't see any obvious incompatibilities. Hopefully @espadrine can weigh in!
2017-11-17 18:26:19 -06:00
Paul Melnikow
d91b904b82 Redirect the root only when configured (#1270)
- Fix `’INFOSITE' is not recognized` in `npm start` on Windows

Close #1259
2017-11-17 13:42:38 -06:00
Hiram Levitch
1a36054b46 Add Bitcoin + PayPal Logo (#1217)
* Add Minimized Bitcoin Logo And Minimized Blue PayPal Logo

* Center The PayPal Logo

xMinYMin → xMidYMid
2017-11-15 10:01:34 +13:00
PyvesB
b61a3968ef Cleaned up Elm Package version text and colour 2017-11-12 12:14:42 -05:00
Pyves
7039e68018 Consistent version formatting (#1246)
Provide greater consistency for badges related to versions. Fix #1181.

- the `version` function in `color-formatters` was previously returning the colour of the badge, but also its text with a leading _v_. It was broken down into two separate functions and the text formatting part was moved to `text-formatters`, where it really belongs.

- unit tests were added for these two functions in `color-formatters.spec` and `text-formatters.spec`, using Sazerac.

- as discussed in #1181, the leading _v_ was omitted  for _xxxx-yy-zz_ date patterns. Any future exceptions can easily be added to the `ignoredVersionPatterns` pattern.

- the badge colour was previously switched to orange if a hyphen was found in the version string. This didn't seem ideal, instead pattern matching is done to find keywords such as `beta`, `alpha` or `snapshot`. Of course, this list can easily be extended.

- all badges related to versions now use the `versionText` and `versionColor` functions. There are a few rare exceptions, for instance in cases where the data returned by the service's API allows to figure things out without relying on any parsing/pattern matching (eg. `badgeData.colorscheme = prerelease ? 'orange' : 'blue';`, where `prerelease` is determined from an API's response).
2017-11-11 17:54:38 -05:00
Danial
8c2de04d99 [sonar] support new SonarQube api (#1239)
* update sonarqube

* parse value as int

* Add tests

* Update example & Add depreciated API example

* eslint

* tidyup & depreciated -> legacy
2017-11-12 09:26:15 +13:00
rnons
178376ddf0 add [elm-package] badge 2017-11-11 14:17:30 -05:00
Thaddee Tyl
59c0662874 Fix bug saving GitHub tokens from other servers
This fixes a bug introduced in 076cb14, wherein we discarded tokens received
from other servers, and wherein we could save tokens with invalid
identification.

The bug was raised by Paul Melnikow.
2017-11-11 10:27:24 +01:00
Pyves
28947dc89e Add Eclipse logo (#1257)
* Added Eclipse logo

* Optimised Eclipse logo further
2017-11-11 09:15:28 +13:00
Paul Melnikow
8733a8b8f2 Use GitHub token rotation in production :P (#1266) 2017-11-10 13:51:39 -05:00
tooomm
9e864f1660 fix "flat-square" style badge example 2017-11-10 13:10:37 -05:00
Peter Gribanov
0d3d33bf1b Get PHP version from [Packagist] (#1256) 2017-11-10 12:46:52 -05:00
George
4ec806e6e5 Spec: Fix "Open Sans" space typo 2017-11-09 23:37:54 -05:00
Danial
ab9be32f35 Update Homepage - Styles & Badge Size (#1242)
* Add social & for-the-badge to dropdown list

* badge minimum height 20px
2017-11-09 11:51:14 +13:00
Tyler Nickerson
632c70b6b5 Added support for new Code Climate scores (#1236) 2017-11-06 18:53:40 -05:00
Tatsuya Saito
6788a31ed5 Adds new badge for [Redmine] plugin rating (#1247) 2017-11-06 10:59:26 -05:00
Paul Melnikow
4d22799962 Fix Github base url again
Fix #1243.
2017-11-02 10:35:22 -04:00
Paul Melnikow
7ca2e97155 Use sazerac for our data-driven tests (#1228)
Sazerac is a library for data-driven tests, where a series of tests asserts that the return value of a function matches the expected value. It provides nice syntax for tightening this up.

https://hackernoon.com/sazerac-data-driven-testing-for-javascript-e3408ac29d8c

This converts our tests to use it, and replaces some similar home-grown code.

I fixed one bug I encountered along the way: mikec/sazerac#12.
2017-11-01 20:15:19 -04:00
Paul Melnikow
a2f5cbb03a Push frontend to production servers at /index.html (#1222)
* Push frontend to production servers at /index.html

Local production builds will use local server instead of img.shields.io, to support local testing

* Restore https://img.shields.io to example URIs
2017-11-01 20:48:01 +01:00
Danial
ebcfb105a0 [badge/dynamic/json] User defined JSON source badge (#820)
* Add User Defined URL support

* Add test

* eslint fixes

* 100% coverage

* use JSONpath

* update try.html

* Update tests, restore prefix & suffix

* order dependencies alphabetically

* update jsonpath version dependency

* update url structure & move to query strings

* update error handling & remove xml refrences

* fix eslint errors

* update tests

* update dynamic badge generator

* url -> uri & decode uri

Allow an encoded url to be used.
needed for any uri that requires params in the address

* resolve conflicts

* update for new page generation

* check uri is defined

* add query params to `request-handler.js`

* eslint fixes

* add test for no uri specified

* move query params to be local to dynamic badge

* update tests

* dynamic badge gen use same base url as static badge
2017-11-01 17:02:37 +13:00
Pyves
12dcdc14da Consistent overriding of labels set by the user (#1218)
This piece of work makes sure preference is given to the user defined value if any, by adding missing calls to `getLabel` when the value of `badgeData.text[0]` is reassigned.
2017-10-31 23:16:02 -04:00
Paul Melnikow
7eb9bb5209 Promisify svg2img 2017-10-31 23:13:23 -04:00
Paul Melnikow
550012a09c Fix a couple badge examples 2017-10-31 23:12:50 -04:00
Paul Melnikow
c22e8965f8 Revert "github issue/pr support labels with spaces (#1240)"
This reverts commit 0d1e4c0923.
2017-10-31 23:12:07 -04:00
Danial
0d1e4c0923 github issue/pr support labels with spaces (#1240) 2017-11-01 12:08:40 +13:00
freezy
ad4a8b4406 [bitrise] Added new build service Bitrise.io (#1227)
Close #574.
2017-10-31 13:23:33 -04:00
Paul Melnikow
37fbef5504 Clean up the outer scope of server.js (#1235) 2017-10-31 13:21:43 -04:00
Paul Melnikow
b458faee1a Change makeBadge() to a synchronous function 2017-10-31 00:10:45 -04:00
Paul Melnikow
a54338afa8 Rename badge() -> makeBadge() (#1232) 2017-10-30 22:08:33 -04:00
Paul Melnikow
91eaa2958c Move gh-badges CLI into lib/ 2017-10-30 21:46:50 -04:00
Paul Melnikow
905a148d66 Add documentation for gh_token when self-hosting (#1230)
Close #747.
2017-10-30 19:36:54 -04:00
RealCerealKiller
8ae30f9d47 Add Telegram Logo 2017-10-30 19:04:19 -04:00
Paul Melnikow
b16122d9a4 When a global gh_token is configured, always use it (#1118)
If I configure a global gh_token, I expect it to be used all the time. I expect to see predictable failures when that token is exhausted.
2017-10-29 22:36:39 -04:00
Paul Melnikow
090454a828 Cache keys should not be the same (#1223)
Fix the cache bug introduced in #1186 that blocked today's deploy.
2017-10-29 22:11:10 -04:00
Paul Melnikow
9d84d2fec1 Fix Sourcegraph preview URI 2017-10-29 21:29:22 -04:00
Paul Melnikow
05402ef45c Fix Herkou staging deploy
- Dangerous semver range (>) in engines.node
https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
2017-10-28 16:13:47 -04:00
Paul Melnikow
3c37dbd3dc [maven-metadata] Add support for maven-metadata.xml (#1214)
Based on ArsenArsen's work in #953.
2017-10-28 15:12:44 -04:00
Paul Melnikow
9f918dbee1 Use destructuring 2017-10-28 14:32:11 -04:00
Paul Melnikow
bde4d925f2 Retire try.html and create new dev + prod builds (#1194)
- Followup from #1163
- Retire try.html
- Separate build config for dev and production
    - Move config for badge examples into the JS build
- Move the prod transform into npm scripts
    - In the future this could be handled using a bundler plugin
- make website builds production build as before
- Run the production build in CI to make sure it’s working
- Build the frontend on Heroku
2017-10-28 14:02:45 -04:00
freezy
cf14ab1464 Added Funding category 2017-10-28 11:07:35 -04:00
Kieran Hunt
d9860991ed Fix style issue with iTunes App Store on homepage (#1211)
References:
- https://en.wikipedia.org/wiki/ITunes
- https://www.apple.com/itunes/
2017-10-28 08:03:55 +13:00
Marcin Mielnicki
f89b317542 Latest tag with any prefix + tests (#1188) 2017-10-26 16:31:13 -04:00
Pyves
ffb6fdb884 [eclipse-marketplace] New last updated Eclipse badge (#1204)
Implement a fifth Eclipse Marketplace badge, which displays the "date" when the plugin was last updated on the marketplace.
2017-10-25 22:23:22 -04:00
Paul Melnikow
446d4ce21e Correct cache behavior for custom query parameters (#1186)
I developed this for #820 to provide the correct cache behavior when a service wants to use custom parameters from the query string.

For safety, only the declared parameters (and the global parameters) are provided to the service. Consequently, failure to declare a parameter results in the parameter not working at all (undesirable, but easy to debug) rather than indeterminate behavior that depends on the cache state (undesirable, but hard to debug).
2017-10-24 23:00:23 -04:00
Paul Melnikow
7153490ef9 Use the npm lock file (#1182) 2017-10-24 22:41:34 -04:00
古永忠 (Yung-Chung Ku)
c5cde67991 Create postgresql.svg
The svg file is taken and optimized from https://wiki.postgresql.org/wiki/Logo
2017-10-24 20:22:00 -04:00
Paul Melnikow
366c939cdc Fix downloads and commit activity badges showing zero (#1201)
- `isMetric` tests must be > 0 to pass.
- Fix downloads badge bug introduced in #1140. (So much for [being clever](https://github.com/badges/shields/pull/1140#discussion_r143544396)!)
- Fix 1 week activity badge by returning the previous week instead of the current week.
2017-10-22 10:42:10 -04:00
Paul Melnikow
a3b5dcbee8 Fix more badge links in the production build 2017-10-22 09:42:49 -04:00
Paul Melnikow
ef86288eab Fix production build for quoting style of generated frontend
The quoting style chnaged in b411f08.

This is to fix the production build, in which image links were all broken because they pointed to shields.io instead of img.shields.io.
2017-10-22 09:39:09 -04:00
Tesla Ice Zhang
f7cecf7eda Add JetBrains plugin version to the front page (#1197) 2017-10-21 12:06:41 -04:00
Paul Melnikow
6aae294b28 Avoid errors when offline 2017-10-21 11:29:30 -04:00
Paul Melnikow
6c9a91a6b0 Fix Bower service test (#1187)
- Fix failing test
- Tidy up test titles (no need to repeat what is in the assertion)
2017-10-21 01:46:04 -04:00
Pyves
5a1e994296 Better test coverage of text formatters + fix thousand case (#1185) 2017-10-20 21:25:04 -04:00
Paul Melnikow
b411f08ad1 Generate badge examples from data + code (#1163)
This pull request sets us up to generate the badge examples dynamically from data and code.

Right now, try.html is still checked in, mostly for the benefit of reading this diff, though it should be removed on the next pass to avoid unnecessary complexity at merge time.
2017-10-20 17:33:12 -04:00
piekar294
8ac0605e12 [Coveralls] Bitbucket support + service tests (#1189)
Close #793
2017-10-20 12:45:48 -04:00
Paul Melnikow
f52385f16d Test on Node 8 2017-10-19 12:17:19 -04:00
Paul Melnikow
748f80b438 Add new maintainer and update history
Based on info in https://github.com/badges/shields/pull/1129#discussion_r144972746
2017-10-18 15:10:21 -04:00
Mikko Piuhola
396fd494b1 Support for Jenkins plugin version (#1158)
Add simple badge for Jenkins plugins: shows latest version published to Jenkins' repository (fetched from: https://updates.jenkins.io/update-center.actual.json).

Jenkins usually publishes plugin updates one to two times a day, so 4 hours is a reasonable timeout for this large payload.

Close #622
2017-10-18 13:00:50 -04:00
Paul Melnikow
dc44ba7725 Clean up request-handler, github-auth, and analytics; upgrade to Mocha 4 (#1142)
- Add tests to request-handler to prepare for some tweaks to caching for #820
- Clean up code in request-handler: renames, DRY, arrows, imports
- Allow for clean shutdown of `setInterval` code. This requires the ability to cancel autosaving.
- Upgrade to Mocha 4, and clean up so the process exits on its own (see mochajs/mocha#3044)
- Better encapsulate analytics
2017-10-17 22:01:46 -04:00
Marcin Mielnicki
f371c8fb07 On [Github] issues badge, add quotes around multi-word labels (#1178)
- Fix an alt name in readme
2017-10-17 18:11:27 -04:00
Paul Melnikow
6edb198334 Optimize standard npm start script for dev usage (#1157)
- `make setup` (i.e. `make`) in the dev tutorial seems an unnecessary step. Badges will load from my local server after a clone, as long as I open try.html.
2017-10-16 23:41:27 -04:00
RedSparr0w
a83d43a485 Add link support for all badges
Add link support to the following badges:
- flat
- flat-square
- plastic
Adjust social badge
- if only 1 link supplied the whole badge will use that link
- only use hover effects if badge contains a link
2017-10-16 23:30:31 -04:00
Pyves
7fa38c3335 More precise star display with test (#1179) 2017-10-16 16:30:40 -04:00
Paul Melnikow
4020929482 Upgrade dot (#1168)
Reviewing the commits, it doens’t appear anything of significance has changed.
2017-10-16 20:15:05 +02:00
Pyves
81b9f6ac53 [dotnetstatus github gratipay hexpm wordpress] General test improvements (#1177)
* Extended usage of the metric validators
* Fixed incorrect Worldpress test data
* Removed usages of Joi.equal for bare string literals
* Switched to proper star formatting and made tests more robust
* Removed debug
2017-10-15 16:58:54 -04:00
Danial
c026ebf235 for the badge style badges (#1166)
https://forthebadge.com/ style of badges, with link support

Close #818
2017-10-15 16:52:28 -04:00
Danial
3465e7a17b Use shields.io for the fork badge & use objects for social badges (#1173)
- use objects for social badges (excl examples)
    - change from <a><img> -> <object>
- use shields.io for the github badge instead of ghbtns.com
- update twitter
2017-10-15 09:25:34 -04:00
Pyves
66dbc04bdb [eclipse-marketplace] Eclipse marketplace integration (#1175)
Close #1165
2017-10-14 18:44:09 -04:00
Paul Melnikow
8e47ae93d4 Refactor and test the SVG badge parser (#1147)
- Add one todo
2017-10-14 15:41:56 -04:00
Paul Melnikow
5fbdc5e773 Docs: Cosmetic, link fixes, and copyedits (#1176) 2017-10-14 15:01:45 -04:00
Paul Melnikow
16045fdff8 Update documentation (#1129)
I wrote a new readme and contributing guidelines, and took a rough pass through the rest of the documentation.
2017-10-14 11:43:52 -04:00
Pyves
b0f2eed0cb [GitHub] Repository size badge (#1174) 2017-10-14 11:38:28 -04:00
tooomm
14286e14d1 Expand documentation of querystring parameters (#1171)
Close #1170
2017-10-13 16:32:11 -04:00
Daniel Bankhead
a073a2b9a4 [NSP] badge with tests (#1156)
A continuation of #803. Scoped to `nsp/npm/:package:format` for future-proofing.
2017-10-13 11:58:47 -04:00
Jared Nance
25115ae738 Add [dotnetstatus] integration (#1028) 2017-10-12 22:55:42 -04:00
Danial
7945db8f57 Fix letter spacing on Windows Firefox, Badge padding to spec (#1161)
Update of #1132
Fix #746 #848
2017-10-12 18:35:29 -04:00
Tesla Ice Zhang
8e180a0cc5 [JetBrains] Plugin version badge (#1164)
Close #1162
2017-10-12 17:56:01 -04:00
Paul Melnikow
c5a8087ceb Node version for scoped packages and tags (#1144)
This is a rewrite of #1084.

Also touches the implementation of `npm/v` to keep the implementations more consistent with each other.

Clean lint in master.

Closes #723.
2017-10-12 16:06:28 -04:00
Paul Melnikow
7f385fb361 Upgrade dev dependencies, clean lint (#1151)
Looks like eslint 4 adds `no-useless-escape` and `no-self-compare` to `eslint:recommended`.
2017-10-12 15:57:29 -04:00
Paul Melnikow
200bb11ed3 Upgrade dependencies (#1149)
These don’t appear to make any API changes that affect us.
2017-10-12 15:55:29 -04:00
Marcin Mielnicki
a7ed4b244f [suggest] Badge suggestions show incorrect license (#1159)
Fix #821
2017-10-12 15:54:34 -04:00
Pyves
71531b81ef [GitHub] Top language, languages count and code size badges (#1160)
Close #1139
2017-10-12 15:16:10 -04:00
Paul Melnikow
e375406b9a Set up Heroku review apps (#1155)
This will allow us to create a review app for a pull request. A review app is a transient deploy of Shields with a unique URI. We can use it to interactively test new PRs without needing to run the branch locally.

Review apps would be especially useful, in conjunction with something like Netlify (#960), to test issues affecting SVG badge rendering on different browsers (#1132).

For the review app to be helpful for layout purposes, we're going to need Verdana on the CI machine. The font there is not measuring text correctly.
2017-10-12 14:41:33 -04:00
Paul Melnikow
37bcddb23e Revert letter spacing adjustment until we can track down the problem (#1154)
See #1132
2017-10-11 14:14:03 -04:00
Paul Melnikow
4f48031551 Upgrade coverage CLI from istanbul to nyc (#1148)
Per a note posted to the istanbul readme in May, this version of istanbul is deprecated.

https://github.com/gotwarlost/istanbul
2017-10-11 13:53:24 -04:00
Sihan Li
134efb864a Add Slack logo. (#1153)
The svg file is taken and optimized from Slack_Mark_Monochrome_White.svg on https://brandfolder.com/slack
2017-10-11 10:36:34 -04:00
Delgan
088f307ddf [ReadTheDocs] Add initial support (#1150)
Close #136
2017-10-10 12:11:24 -04:00
Paul Melnikow
6f24a1ec5c Github: Fix issue label in example badges 2017-10-10 11:20:40 -04:00
Paul Melnikow
d48ebe2636 Upgrade IcedFrisby to version supporting only() (#1143) 2017-10-10 11:19:47 -04:00
Ben Gundersen
8f802f6230 Add [Wordpress] theme support (#1138)
- Added badges for Wordpress theme downloads (total) and theme rating
- Add missing dev dependency (minimist)

Close #869
2017-10-10 11:02:42 -04:00
abal
af0f338373 Attempt to show [Discord]-provided error message (#1145)
The Discord API occasionally returns Cloudflare HTML errors or invalid JSON, so in those cases it will fallback to the standard 'inaccessible' message. Some of the returned errors have uppercase letters, so toLowerCase() is used to stay consistent with the rest of shields.

Close #981
2017-10-09 21:31:23 -04:00
Danial
7db325c640 Fix enlarged text when min-font-size is enabled (#1132)
Fixes #746 
Fixes #848 

Works by making the font-size `110px` instead of `11px` so the browser doesnt enforce the minimum font size and then scales the text down to 10%.

Also fixes the padding issue on Firefox.
2017-10-09 15:29:08 -04:00
Marcin Mielnicki
848422c645 [Github] download count for latest pre-release (#1140)
Implements #1113.

Removed extra space in 2 cases (failing tests without this change):

  1) Github downloads for latest release 
	[ GET http://localhost:1111/github/downloads/photonstorm/phaser/latest/total.json ]:
     ValidationError: child "value" fails because ["value" with value "63k " fails to match the required pattern: /^[0-9]+[kMGTPEZY]?$/]
--
  2) Github downloads-pre for latest release 
	[ GET http://localhost:1111/github/downloads-pre/photonstorm/phaser/latest/total.json ]:
     ValidationError: child "value" fails because ["value" with value "34 " fails to match the required pattern: /^[0-9]+[kMGTPEZY]?$/]
--
  3) Github downloads for specific asset from latest release 
	[ GET http://localhost:1111/github/downloads/atom/atom/latest/atom-amd64.deb.json ]:
     ValidationError: child "value" fails because ["value" with value "3k  &#x5b;atom-amd64.deb&#x5d;" fails to match the required pattern: /^[0-9]+[kMGTPEZY]? \[atom-amd64\.deb\]$/]
--
  4) Github downloads-pre for specific asset from latest release 
	[ GET http://localhost:1111/github/downloads-pre/atom/atom/latest/atom-amd64.deb.json ]:
     ValidationError: child "value" fails because ["value" with value "372  &#x5b;atom-amd64.deb&#x5d;" fails to match the required pattern: /^[0-9]+[kMGTPEZY]? \[atom-amd64\.deb\]$/]
2017-10-09 15:21:22 -04:00
Paul Melnikow
c579ed71e8 [Github] issues: Accommodate multi-word labels (#1135)
Fix #1134
2017-10-09 15:03:05 -04:00
Paul Melnikow
271bb4b99c Add tests for [npm] version (#1128) 2017-10-09 14:52:52 -04:00
Paul Melnikow
40f7147037 Exclude tests from coverage (#1136)
Also, include `lib/suggest.js` which is part of the server, and rename `vendor` to `service-tests` to match the renames which occurred during the review of #937.
2017-10-09 14:52:10 -04:00
Paul Melnikow
2809ff6888 Configure prettier and eslint-config-standard (#1123) 2017-10-09 14:46:30 -04:00
Paul Melnikow
c3636e7549 Clean up service tests (#1127)
- Consolidate regexes
- Use slimmer syntax where possible
- Fix bug caught by failing amo tests
2017-10-09 14:41:18 -04:00
Paul Melnikow
08524b639b Document named logos
From #1092.
2017-10-09 14:38:21 -04:00
Ritwick Dey
c1087c6162 " => ' 2017-10-06 15:55:33 -04:00
Ritwick Dey
2d157b3928 [GitHub] badge for (pre-)release date (#1133) 2017-10-06 15:18:25 -04:00
Paul Melnikow
f3a03c379a Get pull request metadata from shields.io (#1120)
Use the endpoint on img.shields.io added in #1114 to fetch the PR title.

This sidesteps the authentication requirement, and helps with #979 – except for PRs that need to run the Github service tests, which will need a separate solution.
2017-10-06 14:09:21 -04:00
Paul Melnikow
dbe3ce9759 Run service tests in a separate Travis job (#1116)
With this patch, the service tests run in a separate Travis job. That makes it easy to see whether a PR failure is resulting from unit tests/lint failures, or service tests, which are inherently flakier.

By running these in a single build stage, they will both run, even if the unit tests + lint fail. This is good, because it's helpful to see the result of a failed integration test, even when there's a lint or unit test failure.
2017-10-06 14:08:11 -04:00
Paul Melnikow
5a3516c687 Clean up some helpers (#1117)
Address comments from #1109 and make several code-quality fixes which were caught by a local run of eslint-config-standard.
2017-10-06 13:11:29 -04:00
Ritwick Dey
e7f1f57b6b [GitHub] Latest release badge (#1122)
Reopen of #905.
2017-10-04 10:21:52 -04:00
Stefan M
67cbf4ada9 Fix colorscheme link 2017-10-03 14:51:25 -04:00
Thaddee Tyl
95ef1da7a5 Change BASE_URL to img.shields.io
It seems like a mistake from #870. Indeed, the code in that patch
defaults to shields.io for BASE_URL, but the author mentions they
think it defaults to img.shields.io: https://github.com/badges/shields/pull/870#discussion_r115143960
The correct value to maintain the behavior that was present prior
to the patch in question was indeed img.shields.io.
2017-10-03 00:21:17 +02:00
Thaddee Tyl
39a084d7c6 Log GitHub OAuth authentication failure 2017-10-02 23:50:16 +02:00
Ritwick Dey
7ae29932a5 [Github] Commits since latest release (#1115)
Close #993.
2017-10-02 14:17:41 -04:00
Paul Melnikow
bb66a99a66 [GitHub] Issue and pull request detail and check state (#1114)
This adds badges for Github issues and pull requests. You can display the state, title, username, number of comments, age, time since last update, and state of checks.

Provides an endpoint the Shields CI can use to fetch PR titles for #979 and resolves #1011.
2017-10-02 13:26:42 -04:00
Paul Melnikow
8e08b374a4 [Github] Last commit date and commit activity (#1112)
Reopen of #928 by mskonovalov. Closes #897.
2017-10-02 10:47:14 -04:00
Paul Melnikow
c62534b5fd Move remaining helper functions to lib/ (#1109)
- Clear the regular update cache between unit tests
2017-10-01 22:08:30 -04:00
Paul Melnikow
f271b82670 Nudge forward style checks a la eslint-config-standard (#1082)
Because I despise nitpicking stuff like indentation and spacing in pull request comments, I'd like to nudge forward our automated style checking, at least for new files being added.

I don't want to totally rewrite server.js just to get automated style checking… the blame tracking is just too useful. So let's it's just take care of that when we start splitting it out.

More discussion in #948.
2017-10-01 21:09:43 -04:00
Paul Melnikow
820b72c4c4 Always allow overriding the label (#1108)
Audit all the badges with test coverage, looking for badges which assign `badgeData.text[0]`.
2017-10-01 20:20:13 -04:00
Paul Melnikow
0068f31af2 In PR's, exclusively run the designated service tests e.g. [cran discord] (#1111)
The intended behavior of the bracketed [github], [bower], [discord] service names in the pull request title is to trigger the designated service tests. That way, affected services can be proven working during code review, without needing to run tests on a dev machine, nor running all the slow (and flaky) service tests.

Example pull request titles:

- [Travis] Fix timeout issues
- [Travis Sonar] Support user token authentication
- [CRAN CPAN CTAN] Add test coverage

The observed behavior is that, whenever bracketed service names are provided, all of the service tests run.

This is due to a Mocha limitation, which is that exclusive tests (it.only and describe.only) can only be applied synchronously. In other words, if we try to fetch the PR title and then add exclusive tests in the callback, all the tests will run anyway. This is true even when using _mocha --delay, as we are, and is true whether I use request or node-fetch.

Undoubtedly this could be fixed, though it's not worth it. The problem is obscure and therefore low priority for Mocha, which is quite backlogged.

And, there is an easy workaround, which is to generate the list of services to test in a separate process.

The pull request script test:services:pr is now split into two parts. First the :prepare script infers the pull request context, fetches the PR title, and writes the list of affected services to a file. Then the :run script reads the list of affected services and runs the appropriate tests.

In addition to sidestepping the Mocha bug, this setup makes it easier to reason about and debug these two steps of the test runner on a dev machine, and since I can't get pipefail to work – and want to be able to run the steps separately – I'm not using Node's built in pre scripts.

Overall, separating these concerns this makes the test runner easier to reason about.
2017-10-01 20:03:29 -04:00
Paul Melnikow
5d68488426 New http endpoint for [Codecov] badges (#1037) 2017-10-01 19:56:12 -04:00
Danial
31afb007d9 [Github] manifest/package.json version support (#739) 2017-10-01 18:39:23 -04:00
Paul Melnikow
d1906598dd /ansible/role-download -> /ansible/role/d + update try.html 2017-09-30 17:42:33 -04:00
Federico Capoano
32c5ec8a6e Added ansible-galaxy role download count badge + tests #1004
Closes #1004.
2017-09-30 17:42:16 -04:00
Ritwick Dey
f6a2e2c9e3 [Bower] Add tests and prerelease badge (#1099) 2017-09-30 12:10:37 -04:00
Roman Vaughan
ea107fc76e Add AppVeyor tests badge + new tests (#1065) 2017-09-30 12:07:21 -04:00
Ritwick Dey
79174d4cfc [waffle] colorB fixes & test added (#1110)
Close #1008
2017-09-29 12:49:46 -04:00
Paul Melnikow
47ba81a007 Support named logos and omit logos by default (#1092)
- Except for social badges, omit logos by default (#983)
- Omit the logo from a social badge using the query string: `?logo=`
  (#983)
- Opt in to named logos using the query string: `?logo=appveyor`
- Provide custom logo data as before: `?logo=data:image/png;base64,...`
- Rewrite badge data functions, with unit tests

Unit tests are covering the new code very well, though the underlying
functionality (logos) is untested.

Close #983
2017-09-28 10:47:39 -04:00
Paul Melnikow
450d861ee5 Fix Github rate limiting in CI, again
The test harness calls out to Github too.
2017-09-28 10:04:03 -04:00
Mike Kobit
949c50d328 Add in text snippet for AsciiDoc image macro
closes https://github.com/badges/shields/issues/1104
2017-09-27 21:33:31 -04:00
James Z.M. Gao
e2ee910383 Add support for sonatype nexus (#1017)
Close #783
2017-09-27 20:48:51 -04:00
Paul Melnikow
6287c65104 mkdir first 2017-09-28 10:42:57 +10:00
Paul Melnikow
254c55f630 Fix Github rate limits in CI
Close #979
2017-09-28 10:42:57 +10:00
Marcin Mielnicki
5278816229 Badge to show downloads count from [jetbrains] plugin repository v2 (#1025)
Close #895
2017-09-27 20:39:13 -04:00
Danial
f8829475e7 [chrome-web-store] Add tests, update labels (#1100)
- Update 'downloads'->'users' as label,
- added `/u/` as option
- kept `/d/` as an option for backwards compatibility
- moved example from 'Downloads'->'Misc' section

Closes #1016
2017-09-27 20:34:15 -04:00
RedSparr0w
76a963369a Fix Windows coverage errors
Provide relative path to `_mocha`
2017-09-27 20:22:31 -04:00
Pierre Tomasina
6e20ca20c7 fix(continuousphp) link badge example 2017-09-27 20:05:12 -04:00
Ritwick Dey
c1425e6f44 Discord social button added at very bottom of the page (#1096)
Close #985
2017-09-26 23:30:59 -04:00
Thaddee Tyl
fa499da05f Remove automatic Travis CI email notification 2017-09-26 21:12:04 +02:00
Ritwick Dey
8476024c6c fixed ColorB issue for Docker Badge 2017-09-26 11:00:22 -04:00
Ritwick Dey
3e6ba16265 Add badge for Visual Studio Marketplace (#1074) 2017-09-25 23:05:18 -04:00
Danial
557269304c [amo] Custom labels & tests (#1090)
Add tests

Fix #996 #1026
2017-09-25 22:54:11 -04:00
un.def
4104f822fd [LuaRocks] package version badge (#1087) 2017-09-25 20:28:14 -04:00
Danial
65d6dc27cd Fix maintenance badge (#1089)
Solves #1073
Add test
2017-09-25 18:57:22 -04:00
Thaddee Tyl
ea6acb0c5e Mention loss of service for download PyPI badges
As suggested by
https://github.com/badges/shields/issues/716#issuecomment-301335162
2017-09-24 22:50:29 +02:00
Paul Melnikow
8e6fe01d20 Add test for measure-text 2017-09-24 22:36:14 +02:00
Thaddee Tyl
3d39cda984 Detail open / close on raw GitHub badges 2017-09-24 22:30:56 +02:00
Thaddee Tyl
8046a44842 Merge branch 'github-fullsupport' 2017-09-24 22:13:27 +02:00
Thaddee Tyl
26093d86d3 Add raw GitHub badges for closed issues and pr 2017-09-24 22:13:19 +02:00
Dag Wieers
4f2623aea4 Get rid of repeated "closed"
This PR includes:
- Getting rid of the option that includes 2x closed
- Using -closed-raw is no longer useful
2017-09-24 22:05:38 +02:00
Kevin Yap
c1a8166af2 Fix [crates] license badge (#1062)
License data was moved to crate versions in rust-lang/crates.io#803.
2017-09-23 23:36:34 -04:00
triggerman722
20ab540fb2 Added [codetally] (#1069) 2017-09-23 21:08:50 -04:00
Dag Wieers
22694e6cb7 Add the label to the badge when not using -raw
As requested, we now add the GitHub label to the badge, only if not
specifying `-raw` in the URL.
2017-09-23 10:05:05 +02:00
Dag Wieers
e0ecadd9fe Github: Support PR/issues with labels, full count
The original code has been simplified as well, but commented out.
I don't think we need the original code using the issues API, as it has
some limitations (no label support, only up to 30, or 100 issues).
2017-09-23 10:04:24 +02:00
Réda Housni Alaoui
13502b3a22 [maven-central] Add the ability to filter by version prefix (#1014) 2017-09-22 15:16:51 -04:00
Paul Melnikow
8ec2b6be51 Populate Github service tests (#976)
Work by webcaetano (cherry-picked by paulmelnikow)
2017-09-22 14:29:57 -04:00
Paul Melnikow
eefca67f14 Avoid inadvertently invoking unwrapped request in vendor helper functions (#924)
- Tweak a couple names to improve readability
2017-09-22 14:08:45 -04:00
Nico Schlömer
60105e1099 github "star" -> "stars" 2017-09-22 13:57:24 -04:00
Theodore Dubois
56566efd57 Add GitHub search hit counter badge 2017-09-22 13:41:49 -04:00
Abdelkrime Aries
0f65d86486 Add JitPack version badge; fixes #900 2017-09-22 13:35:10 -04:00
Christophe Bliard
cafb66bd93 Add fallback font and missing libs for .png generation
If Verdana.ttf can't be loaded, the font file pointed by the
FALLBACK_FONT_PATH environment variable will be loaded.

This fixes width computation errors that can occur with non-latin
characters when running with Docker.
2017-09-22 13:27:59 -04:00
Pascal Paulis
c7b782b014 Add [continuousphp] integration (#1051) 2017-09-22 13:19:55 -04:00
teppeis
9a3bbcdb2a fix: contributors for GitHub Enterprise 2017-09-22 01:11:50 -04:00
Paul Melnikow
852784b1a2 Fetch Bower data using libraries.io (#919)
- Avoid downloading bower packages via git
- Service is well resourced: https://libraries.io/team
- Same service used by https://bower.io/search/
2017-09-17 23:55:07 +02:00
Igor Šarčević
bce78921c8 Changing 'semaphoreapp.com' to 'semaphoreci.com' 2017-09-10 15:45:11 -07:00
Andre Caetano
46072e641d file-size path fix 2017-09-10 15:40:56 -07:00
Thaddee Tyl
fc6c5852b2 Use a ternary statement in logging code
See https://github.com/badges/shields/pull/1040#discussion_r136196343.

Closes #1040.
2017-09-03 20:04:41 +02:00
Thaddee Tyl
d032090038 Use a custom logging mechanism
This mechanism eases knowing when a message was logged while keeping the
simplicity of the logging mechanism.
2017-08-30 22:03:30 +02:00
mattbk
c023e23e0f Change Gratipay 'tips' to 'receives'
Pull request: #1053.
2017-08-30 21:58:08 +02:00
Elmar Pruesse
10566c3c0d Add Conda unit tests 2017-08-23 21:27:43 -07:00
Elmar Pruesse
94baa3a298 Cleanup conda shields
- use `const` instead of `var` where possible
 - use `'` instead of `"` consistently
 - replace `forEach` loop with `reduce` call

Thanks to @Daniel15 for review!
2017-08-23 21:27:43 -07:00
Elmar Pruesse
43b39c05c3 Add conda badges 2017-08-23 21:27:43 -07:00
Simone Vittori
2aeed7e2a9 Add tests for hex.pm integration 2017-08-13 15:51:05 -07:00
Andres Villarroel
f24093d287 Update INSTALL.md
documentation says secret.example.env file is named shields.example.env, update documentation.
2017-08-05 14:59:30 -07:00
Marcin Mielnicki
38b1168e8e Removed info about index.html
index.html has been removed
2017-07-09 18:05:42 -07:00
Tair Assimov
6534a2a1a8 Add dockbit.com badge (#1022)
* Add dockbit.com badge

* Add missing semicolon

* Remove empty and unneeded tags in SVG file

* Use ES6 consts and template string

* Add Dockbit badge tests and handle server error
2017-07-02 12:59:30 -07:00
Daniel Shumway
31aad05943 fix(gratipay): distinguish between anonymous and 0 dollar projects (#1007)
* fix(gratipay): distinguish between anonymous and 0 dollar projects

* test(gratipay): add service test

* test(gratipay): test $0
2017-07-01 22:43:11 -07:00
Marcin Mielnicki
59c91ef967 Up-to-date ServiceTester's constructor in example (#1023) 2017-07-01 22:37:19 -07:00
Eugene Bekker
ce0eb7b336 Adding support for PowerShell Gallery (#1024)
* Adding support for PowerShell Gallery

PS Gallery is nuget v2 based.  Fixes #1013.

* Updating examples with PowerShell Gallery
2017-07-01 22:35:30 -07:00
Dave Cross
79c24c569b MetaCPAN API v0 has been switched off. Change to use v1. 2017-06-14 13:50:50 +02:00
Thaddee Tyl
42a5de9cab Return when a vendor request fails
Otherwise, this creates cryptic error messages in the server logs.
2017-06-02 20:41:02 +02:00
David Tolnay
66635c510c Eliminate padding on social badges if rhs is empty (#998) 2017-06-01 23:35:56 +02:00
Adriaan Groenenboom
15f24fbcce Improve Docker run (envsubst, Alpine, documented env file) (#870)
* Add template for secret.json

- Move to faster and lighter Alpine base image

* Update documentation

* Update documentation

* Fix Github token config for secret.json

* Extend env file for Docker runtime configuration

- Update documentation
- Add gh_token for GH personal access token to secret template

* Change http to https in infoSite

* Update .dockerignore

* Update .gitignore

* Update dockerignore

* Remove ENV directive from Dockerfile

- Environment is needed at runtime, not at buildtime

* Docker: contain secret.json in private/

- Incorporates fix from 7c8b0e3d

* Use localhost in example env

* Use baseUrl in GitHub redirect

* Move GH personal token retrieval up

- To remove duplicate Promise.then()

* Typo in shields.example.env
2017-05-07 11:13:02 -07:00
Rohan Pai
f97d5a6bd4 add Sourcegraph.com badge (#828) 2017-05-05 21:30:38 -07:00
Nathan Rennie-Waldock
6031711180 Support [GitHub] releases containing a / in the tag (#756)
- Add tests for download counts
2017-05-04 16:34:44 -04:00
Paul Melnikow
80ace97bb0 Bump icedfrisby-nock to stable release (#986) 2017-05-04 09:47:13 -07:00
Daniel Lo Nigro
896b2aab2f Add Discord badge to README 2017-05-01 14:30:44 -04:00
Andre Caetano
a6d81f2391 [Github] File size badge (#745)
Closes #730
2017-05-01 14:28:45 -04:00
Daniel Lo Nigro
87af3bf672 Add [Discord] badge (#977)
Add Discord badge
2017-04-30 21:54:36 -07:00
Paul Melnikow
653f79fbde Tests: Convert to ES6, use node-fetch, refactor, and clean up style (#971) 2017-04-30 10:51:18 -04:00
Fabrizio Cucci
138c1ea4d5 [maven-central] Maven Central badge based on repo1.maven.org rather than search.maven.org (#957)
According to http://central.sonatype.org/pages/ossrh-guide.html#releasing-to-central:

> Upon release, your component will be published to Central: this typically occurs within 10 minutes, though updates to search can take up to two hours.

So, besides the delay, if the indexing jobs for search.maven.org are paused (see https://issues.sonatype.org/browse/OSSRH-27247), it may take quite some time to see the last artifact version even though it has been actually released on Maven Central.

This uses 'latest' version instead of 'release' version. According to the Maven documentation of the maven-metadata.xml (http://maven.apache.org/ref/3.2.5/maven-repository-metadata/repository-metadata.html):
- 'latest': what the latest version in the directory is, including snapshots;
- 'release': what the latest version in the directory is, of the releases only.

Using the 'release' version would imply altering the behavior of the badge, i.e. getting the release version instead of the latest version, which could also be a snapshot version.

Fixes #846.
2017-04-30 10:11:56 -04:00
Fabrizio Cucci
0c477524a5 Fix regexp used for matching services in pull requests (#978)
According to the [Mozilla documentation about regular expressions](https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions), the special character '\w' is equivalent to '[A-Za-z0-9_]', which does not include the hyphen character (i.e. '-'). This cause the matching of services containing a hyphen to fail (e.g. 'maven-central').
2017-04-30 10:01:37 -04:00
Paul Melnikow
8233a0ba38 Fix service coverage script and linting (#975)
* Fix "callback is not a function" in coverage:test:services

* Don't lint /coverage
2017-04-29 17:31:07 -07:00
drdamour
02fc1a1a21 [sonar] Invert colors for public_documented_api_density (#974)
Fix the logic from #724.
2017-04-29 13:54:39 -04:00
Thaddee Tyl
e17c15c00b Set the coverage npm script to use current specs
The coverage script was introduced in 5c147b8d91,
and the spec files were moved in c3ef232bf7.

Also, correct a small typo.
2017-04-28 16:39:17 -04:00
drdamour
a086dca4de [sonar] Support public_documented_api_density metric as a percentage (#724)
See http://docs.sonarqube.org/display/SONAR/Metric+Definitions
2017-04-28 16:19:39 -04:00
Paul Melnikow
bd8a04141e Record minimum Node version 2017-04-28 21:16:08 +02:00
anatoly techtonik
6c34191fcf Add logo to AppVeyor badge and change logo color (#812)
Fixes #507
2017-04-28 01:35:19 -04:00
Paul Melnikow
f47aa968cd Prepare to modify / refactor analytics (#970)
- Move analytics into their own file
- Add test of analytics endpoint
2017-04-28 01:06:06 -04:00
Paul Melnikow
c3ef232bf7 Place tests alongside their code (#969)
Reorg of the tests: move them just alongside their code. The principle relates to grouping by coupling, not by function and is established in best-practice documents (e.g. https://github.com/focusaurus/express_code_structure#underlying-principles-and-motivations), despite its break from the tradition of a separate `test/` tree. All of today's tools can handle tests spread through the repository.

There are some good, if subtle consequences of this change:

- Since files are close at hand, friction is reduced at development time, which encourages that new tests are written to cover new behaviors.
- It's easier to find the tests that cover a particular piece of functionality.
- It's easier to see which code has tests and which doesn't.
2017-04-28 00:55:15 -04:00
Saugat Acharya
df9bbbf11b Add npm weekly and npm yearly downloads badge (#958)
Add new badges npm weekly and npm yearly
2017-04-27 21:51:05 -07:00
Paul Melnikow
5c147b8d91 Service tests (#937)
- Eliminate manual testing which is error-prone and time consuming, and must be repeated many times through the PR review process
- Make contributing more fun. For many, fixing bugs and making new badges is faster and more satisfying with automated tests than with manual testing.
- Push out the work of testing new badges to a much broader net. The PR originator could write tests, but so could any other contributor who wants to push review along.
- Detect badge failures resulting from changes in vendor contracts without waiting for user reports.
- Detect and prevent regressions in the code.
- Be runnable, readable, writable, and editable by as many developers as possible, including those who may not be familiar with JavaScript test tools.

-- @paulmelnikow, @niccokunzmann, @Daniel15
2017-04-27 23:13:14 -04:00
Thaddee Tyl
a0663d8da5 Reduce page jumping while all the badges are loading
Commit c486c0dcd1 missed a large number of badges
on the webpage. This includes all relevant badges.
2017-04-27 13:14:01 -04:00
Paul Melnikow
112669e074 Remove unused / unnecessary test fixtures (#951)
`server-test.js` is not used anymore, and `gh-badge.js` can be used directly.
2017-04-26 14:26:30 -04:00
Georges Dupéron
db2aafaf2a Removed ability to specify the badge's label for the “website” service, as this is already possible with ?label=some-text 2017-04-26 14:25:15 -04:00
anatoly techtonik
65fc2a7f56 Update request to 2.81.0 (#961)
Fix deprecated uuid warning
2017-04-25 23:47:48 -04:00
Thaddee Tyl
182018be76 Redirect root to https://shields.io
The website relies on GitHub Pages. When created, that did not support
TLS. However, last year, support for TLS was added, as detailed
in the following blog post:
https://github.com/blog/2186-https-for-github-pages
2017-04-25 23:43:09 -04:00
Paul Melnikow
cca46b7e94 Generate index.html only on gh-pages when deploying
- Build index.html at deploy time
- Update corresponding documentation references
- Since index.html is untracked, git add needs -f
- Clarify gh-pages generated commit message
- Improve Makefile dependencies related to website generation

As discussed in #936, tracking the index.html causes makes PRs longer / noisier
and causes extra merge conflicts. More importantly, it causes contributors to
inadvertently edit the wrong file, which causes extra work (#949) or
contributions to be lost (#898).

Since there's no need for index.html in development (everything uses try.html) a
logical solution is to generate and commit the index.html at deploy time.

Recording compiled or generated files in a deploy commit is a reasonable
practice for git-based deploys (Heroku, gh-pages, and others).

The old version of this was slightly "unsafe" for my taste, in that it depended
on the local copy of gh-pages (if it existed) and master. The new version just
replaces gh-pages with master + the new commit.

Closes #936.

Fixes #954 (the PR).
2017-04-25 23:40:08 +02:00
G. Roggemans
9b8c1c806d GitHub (pre-)releases (#959)
Added the `/github/release/user/repo/all.svg` endpoint that shows the latest release, including pre-releases.
2017-04-25 12:16:28 -04:00
Daniel Lo Nigro
ccbdad69ba Split various utilities into standalone files (#952) 2017-04-24 18:37:22 -04:00
Thibaud Lepretre
108533e08e [SonarQube] Support user token authentication (#854)
- new secret: `sonarqube_token`
2017-04-24 11:21:09 -04:00
Georges Dupéron
832aaaf11d Added installation steps for Node.js 6 2017-04-20 14:38:05 -04:00
Georges Dupéron
571f46f16a Website badge: Fix color and subdirs, allow specifying label (#949) 2017-04-20 14:21:27 -04:00
Cr@zy
a079b682e3 Add badges for Uptime Robot (#947)
* numberOfDays optional (default 30) for Uptime Robot ratio
* Require a monitor key, not a user key
* Update gitignore for Jetbrains
2017-04-20 09:31:03 -04:00
Daniel Lo Nigro
c5bd4a4f5a Add badge for NuGet download count, again (#945)
Switched from SearchAutocompleteService to SearchQueryService as this service also provides download counts.

Closes #678.
2017-04-20 09:26:56 -04:00
Georges Dupéron
c6f4f57cd1 Closes #946 “maintenance badge doesn't need a question mark” (#950) 2017-04-19 19:14:56 +02:00
Paul Melnikow
07cedee321 Update index.html for recent changes 2017-04-19 00:04:56 -04:00
Georges Dupéron
26847dca80 Fix website badge for deep links (#720)
Works: https://img.shields.io/website/http/github.com.svg
Does not work: https://img.shields.io/website/http/github.com/badges.svg

Regexp was too greedy and included the beginning of the path in the protocol
2017-04-18 23:55:19 -04:00
Maël Nison
5a8b565ebb Fix NPM license badge for scoped packages (#796)
Closes #757
2017-04-18 22:42:14 -04:00
Paul Melnikow
1ffd5d949c Build branches
When merging someone else's PR with edits, it's helpful to to push a branch
and make sure the tests are also passing in CI.
2017-04-17 14:51:49 +02:00
Paul Melnikow
a3429a316a Add cauditor.org badge (#704) 2017-04-16 23:44:30 -04:00
Paul Melnikow
1ff0d9217f Fix express repository owner name (#721)
Closes #721
2017-04-13 15:48:58 -04:00
Paul Melnikow
64f8f11026 Allow specifying the key and cert for SSL (#844) 2017-04-13 15:30:30 -04:00
Paul Melnikow
59ec4a420c Check explicitly that license is an array 2017-04-13 08:17:47 +02:00
Paul Melnikow
1ae490a218 Improve CTAN error handling and fix non-svg 404 badges
Fix #921
2017-04-13 08:17:47 +02:00
Paul Melnikow
ee9ba82969 Run tests even if lint fails 2017-04-13 00:03:38 +02:00
Paul Melnikow
c7c92f12fd Clarify that secrets are optional
- Quit witih an error when secrets can’t be loaded
- Refactor duplicated code

Resolves #894
2017-04-13 00:02:18 +02:00
Paul Melnikow
9e4476d1b6 Use standard version color for clojars 2017-04-12 23:58:37 +02:00
Paul Melnikow
64e9d13e76 Disallow unused variables and turn on a few recommended rules 2017-04-12 23:55:13 +02:00
Paul Melnikow
de18dce94a Add more test helpers
While working on some tests, I was having a tricky problem in a test suite. Eventually I tracked it down to an interaction between tests. I suspected the test library, but once I tried to make an isolated test case, I realized the test library was working fine. It turns out it was the server’s request cache. The fix is to clear the cache between tests.

Not needed for this PR, though I’m adding it to this branch because it conflicts with this change.
2017-04-12 23:13:16 +02:00
Paul Melnikow
5a45003bc3 Test server logic for img2svg error, and run the server in-process
Running the server in process is necessary for the mock to work. This is an approach I’ve taken in the past. I experimented with this setup quite a bit when I was playing around with a test suite, and it seemed to work well enough. Setting `process.argv` is a admitedly a bit gross, though a cleaner approach would require more involved changes to `server.js`.
2017-04-12 23:13:16 +02:00
Paul Melnikow
8b77d16a72 Always call the callback + reliable erroring
Fixes #914
2017-04-12 23:13:16 +02:00
Paul Melnikow
0760d17d82 Return data from svg2img via callback
Given the chunks coming from imagemagick are getting stored memory and
then tucked into a cache, this function could as easily return a buffer
via callback. Streaming is just making it more complex. (And trickier to
test!)
2017-04-12 23:13:16 +02:00
Paul Melnikow
ad1e419d42 Add tests for svgToImg 2017-04-12 23:13:16 +02:00
Paul Melnikow
3905424d1c Add a test for badge.js and refactor 2017-04-12 23:13:16 +02:00
Thaddee Tyl
2d71e844a2 Store raster badges in the LRU cache
In ef1a5159, the switch to using imagemagick made a faulty use of the library by
listening for an 'end' event that is never raised. As a result, the cache was
never populated.

In d985f81f, a fix that takes care of the fact that the previously mentioned
dead code relies on a non-existent variable caused it to kill the server when a
raster badge is requested twice, as what it stored in the cache was the pipe
transmitting chunks, not the chunks themselves, and the pipe (a Socket object)
cannot be subsequently sent through a pipe. The following error occured instead:

    events.js:163
          throw er; // Unhandled 'error' event
          ^

    TypeError: Invalid non-string/buffer chunk
        at chunkInvalid (_stream_readable.js:395:10)
        at readableAddChunk (_stream_readable.js:150:12)
        at DataStream.Readable.push (_stream_readable.js:136:10)
        at DataStream._read (/home/m/shields/lib/svg-to-img.js:45:21)
        at DataStream.Readable.read (_stream_readable.js:350:10)
        at resume_ (_stream_readable.js:739:12)
        at _combinedTickCallback (internal/process/next_tick.js:80:11)
        at process._tickDomainCallback (internal/process/next_tick.js:128:9)
2017-04-12 23:13:16 +02:00
Paul Melnikow
6e07fd0098 Update index.html with recent changes 2017-04-10 14:42:09 -04:00
Javier González
aa981cba84 iTunes app store version (#840) 2017-04-10 14:40:16 -04:00
Olivier Lacan
6f4c1fc3e3 Add more Shields users [ci skip] 2017-04-08 02:33:51 +02:00
Olivier Lacan
99c4c52f03 Create list of notable OSS projects using Shields
Talk about a proud daddy moment...
2017-04-08 02:27:46 +02:00
Paul Melnikow
9669c9cacf Disambiguate provider vs package: Package Control
Correctly apply changes from #898, and update build of index.html.
2017-04-07 08:28:13 -04:00
Eddie Webb
b791ffda09 Add Docker Hub build status (#856) 2017-04-07 08:07:26 -04:00
Markus Wamser
3febfe234e Add support for CRAN/METACRAN (#837) 2017-04-05 17:30:47 -04:00
Paul Melnikow
5a1e53254e Update website for April 2 deploy of 522e09f 2017-04-03 15:17:47 -04:00
Casey Webb
d462111370 Enable npm version for specific tag (#926)
* Enable npm version for specific tag
* Show tag in badge
2017-04-02 01:01:46 -04:00
Thaddee Tyl
522e09f509 Add missing var
It was fogotten when rebasing 5f945d48.
2017-03-30 23:40:49 +02:00
Nicco Kunzmann
21a3aef427 Add tutorial on how to add a new service (#889) 2017-03-30 11:46:10 -04:00
Kevin Locke
ced7f16645 [PATCH v2] Add support for swagger.io validator
The OpenAPI Specification (formerly known as the Swagger RESTful API
Documentation Specification) defines a format for describing RESTful
APIs.  The Swagger project provides a set of tools for working with this
format, including a hosted validator which provides a validation badge
and JSON result.[1]  This commit adds shields.io support for this badge.

The service currently only provides validation of files conforming to
version 2.0 of the OpenAPI Specification.  This commit adds a path
component for specifying the version under the assumption that the
validator may support version 3.0 or later as they are released.

It accepts the URL to validate as two path components, a scheme followed
by the rest of the URL, to match the convention used for the JIRA host
and webpage online shields.

Changes in v2:
- Use bitbucket in try.html example for clarity.
- Change /v/ in URL to /valid/ to avoid conflict with v=version.

1.  https://github.com/swagger-api/validator-badge

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2017-03-30 11:41:21 -04:00
Pavel Djundik
84e2d6d7e3 Use spaces in "up to date" and "out of date" statuses 2017-03-30 00:04:37 -04:00
Peter Dave Hello
75f7f047a2 Add link in cdnjs badge example 2017-03-29 22:35:16 -04:00
Thaddee Tyl
a0e6a6aeba Use new Buffer() instead of Buffer()
The following warning is emitted by Node.js:

> DeprecationWarning: Using Buffer without `new` will soon stop working. Use `new
> Buffer()`, or preferably `Buffer.from()`, `Buffer.allocUnsafe()` or
> `Buffer.alloc()` instead.

This patch removes this warning.
2017-03-29 18:28:48 -04:00
Paul Melnikow
1930d9fdd9 Change some .on to .once to make tests less flaky 2017-03-30 00:18:30 +02:00
Paul Melnikow
076bd384d5 Use a glob pattern instead of hard-coding filenames 2017-03-30 00:18:30 +02:00
Paul Melnikow
6985a778a0 Prevent lint errors 2017-03-30 00:18:30 +02:00
Paul Melnikow
5f945d4856 Use Mocha to make tests more reliable 2017-03-30 00:18:30 +02:00
Peter Dave Hello
2e4721ea1f Migrate to the new container based infra on Travis-ci
Use the "apt" add-on to install apt packages instead of using "apt-get"
command directly, and then move to the new container-based
infrastructure, which can speed up the build process.

PS: package "g++" removed from the list since it's already the
dependency of package "build-essential", no need to duplicate it.

Reference:
 - https://docs.travis-ci.com/user/ci-environment/
 - https://docs.travis-ci.com/user/installing-dependencies/
 - https://github.com/travis-ci/apt-package-whitelist/
2017-03-29 23:55:52 +02:00
Paul Melnikow
b410b0b7e7 Remove Talk.ai which no longer exists
No response at guest.talk.ai talk.ai, and nothing in google either
2017-03-29 20:14:26 +02:00
Paul Melnikow
d985f81f8e Disallow undefined variables 2017-03-29 20:09:30 +02:00
Paul Melnikow
5a83b6c4a6 Show correct hostname and port in try.html URL 2017-03-29 19:58:14 +02:00
Paul Melnikow
7c4b2b67e6 Add github standard node gitignores 2017-03-29 19:49:19 +02:00
Sebastian Hoß
7fad7268ef use greater-equals for SonarQube tech_debt colors
Projects that have '0' technical debt would otherwise receive a
lightgrey badge instead of a brightgreen one.

Signed-off-by: Sebastian Hoß <mail@shoss.de>
2017-03-29 13:24:39 -04:00
Akihiro Uchida
7eeef988ba Fix imagelayers.io badges (#706)
Resolves #712
2017-03-28 00:30:32 -04:00
Paul Melnikow
e8988a985c Clean lint from #1275 2017-03-27 17:18:50 -04:00
Michael Howell
3dd0f96f77 Add docs.rs as a standard-compliant service
![mio on docs.rs](https://docs.rs/mio/badge.svg)
2017-03-27 17:05:17 -04:00
Pavel Djundik
c486c0dcd1 Reduce page jumping while all the badges are loading 2017-03-27 17:00:59 -04:00
Danial
7843331f5f Add badge "404 | badge not found"
For invalid url specified ending in "svg, png, gif, jpg or json"
2017-03-27 16:58:24 -04:00
Frode Knutsen
2133ff9d1f fix default value for githubUserTokens 2017-03-27 16:56:58 -04:00
Nicco Kunzmann
499c3ea724 add format documentation links
Problem: I wanted to know what color schema is available
Solution: Add links to directly reach the predefined schemes and templates
2017-03-27 16:56:10 -04:00
Francisco Lourenço
9b24ef7dbe Disambiguate provider vs package: Package Control
Spent some time trying to figure out how this was supposed to work :P
2017-03-27 16:54:39 -04:00
Paul Melnikow
0def6470a7 Disallow variable redeclaration 2017-03-26 20:02:56 -04:00
Thaddee Tyl
5dd58142cb Fix LRU cache index stalling
The old LRU implementation stored a list's indices to reference items in that
list, but deletions from the list made indices point to the wrong slot.

Functionally, it meant that deleted slots were not guaranteed to be the oldest
slot.

Using a linked list fixes that.
2017-03-26 23:00:31 +02:00
Thaddee Tyl
11b6e06f2f Organize local modules in lib 2017-03-26 22:57:55 +02:00
Paul Melnikow
47a8bf51dc First pass for linting on PRs 2017-03-20 16:54:27 -04:00
Thaddee Tyl
ecd30480de Update maintenance badge for 2017 2017-02-26 20:57:35 +01:00
Thaddee Tyl
076cb14b3b Perform constant equal comparison for shared Shields secret
This should prevent timing attacks.
2017-02-25 18:20:07 +01:00
Thaddee Tyl
2f97be9118 Pre-compress badge templates with SVGO
Prior to this patch, time spend in badge.js (computing text width and
compressing the SVG with SVGO) averaged 8.4 ms.

After this patch, it clocks at 2.4 ms on average.

Assuming this is the CPU bottleneck, it means that servers used to only be able
to handle 119 req/s (empirically, it is closer to 100 req/s). It should now
handle 416 req/s (although a better guess is at 1/0.004 = 250 req/s).
2017-02-25 18:20:07 +01:00
Thaddee Tyl
38cf7a60b5 Use path.extname() to fetch template file name extension 2017-02-19 22:59:41 +01:00
Thaddee Tyl
bf373d11cd Fix incorrect sendBadge() parameter order 2017-02-18 22:58:46 +01:00
Thaddee Tyl
4d937d859a Fix readme logo path 2017-02-16 23:19:33 +01:00
Thaddee Tyl
0758595b57 website: bitbucket open pull requests
Part of #790.
2017-02-15 23:57:19 +01:00
Thaddee Tyl
982bcf62aa Add s2 server
Part of #868.
2017-02-13 00:54:23 +01:00
Thaddee Tyl
a4a46b070c Foolproof Bitbucket pull request
- Use metric() for the displayed number
- Use encodeURI() for API parameters
- Explicitly use a condition expression instead of a number where a boolean is expected

Part of #790.
2017-02-11 00:09:44 +01:00
Thaddee Tyl
4c2b2f4852 Merge branch 'bitbucket' 2017-02-10 23:50:41 +01:00
chapulina
976e5f2ee0 Bitbucket open pull requests 2017-02-10 23:50:34 +01:00
Thaddee Tyl
6ebd626973 Fix Shield.io (should be Shields.io)
Fixes #871.
2017-02-08 00:21:02 +01:00
Thaddee Tyl
7c8b0e3d32 Contain all private files in private/ 2017-02-05 16:24:35 +01:00
Thaddee Tyl
efc9ce8eed Ensure that logo.svg is at the root
That is necessary for GitHub's gh-pages website to work.
2017-02-05 16:24:15 +01:00
Thaddee Tyl
6258968d66 Restrain public files to the public/ folder
As raised by Adriaan (@agboom), the .github-user-tokens.json file was
incorrectly exposed, causing the risk of users' GitHub tokens to be used
by other entities for the purpose of increasing their rate limits by
pretending to be shields.io.
2017-02-05 13:40:06 +01:00
Thaddee Tyl
8272913d5e website: Jenkins format extension 2017-02-02 23:39:39 +01:00
Thaddee Tyl
bc34b6060d Merge branch 'nuget' 2017-02-01 23:59:51 +01:00
Thaddee Tyl
7f79712f0d Set Nuget version endpoint update to 42 minutes 2017-02-01 23:59:08 +01:00
Maarten Balliauw
361a6e344a Update NuGet v3 implementation to not show unlisted versions
Fixes #795.
2017-02-01 23:58:10 +01:00
Thaddee Tyl
f834bbbb88 Merge branch 'jenkins' 2017-01-30 23:34:25 +01:00
Thaddee Tyl
5eb9eb2bb5 Improve consistency of spacing in code 2017-01-30 23:34:15 +01:00
Thaddee Tyl
eb74626f52 Resize PNG images correctly 2017-01-29 19:14:31 +01:00
Federico Zivolo
8dccc153cf preserve transparent background 2017-01-29 19:14:31 +01:00
Federico Zivolo
ef1a51590e Use gm instead of phantom to create pngs 2017-01-29 19:14:31 +01:00
Thaddee Tyl
79eb256b75 Twitter badge: allow ?colorB override 2017-01-27 23:36:51 +01:00
Thaddee Tyl
225ed98663 Mention the need to minimize .svg images
As suggested by https://github.com/badges/shields/pull/861#discussion_r96729020.
2017-01-24 23:03:12 +01:00
Masahiro Fujiwara
32f4d6d4da Update Jenkins job path to contain ‘/‘ in try.html examples. 2017-01-17 06:43:25 +09:00
Masahiro Fujiwara
70efc96b11 Take ’/job’ prefix out only if ‘/‘ appears. For backward compatibility. 2017-01-17 06:36:48 +09:00
Masahiro Fujiwara
7ac216456a Fix regexp for Jenkins build badges to allow “/“ in the job name. 2017-01-17 06:07:05 +09:00
Thaddee Tyl
21ae49ad85 Merge remote-tracking branch 'aspyker/master'
Fixes #741.
2017-01-11 23:57:10 +01:00
Thaddee Tyl
4924bd6098 website: JIRA sprint 2017-01-10 23:54:03 +01:00
Thaddee Tyl
62ecc175ca Merge branch 'jira-sprint'
Fixes #770.
2017-01-09 23:56:37 +01:00
Thomas VIAL
83da3fefef Added JIRA agile sprint completion 2017-01-09 23:56:09 +01:00
Thaddee Tyl
8d5e18e727 Mention that colorA/B only allow hex colors in URL 2017-01-08 17:39:24 +01:00
Thaddee Tyl
a440c0840b Register colorA/B as part of the cache index 2017-01-08 17:26:26 +01:00
Thaddee Tyl
2ba7ded391 Prioritize colorA/B over colorscheme colors
The wrong priority order was made in 29a4803e4b.
When a user enters ?colorB=007ec6, they want that color to override the default.
2017-01-08 17:21:35 +01:00
Thaddee Tyl
9816a5010f Allow CORS for suggestions on https://shields.io
Issue raised here: https://twitter.com/igoradamenko_/status/818095292146941952
2017-01-08 16:48:02 +01:00
Thaddee Tyl
78494dd6ff Fix blurry rounded corners on WebKit
WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=135616
Fixes #732
2016-12-15 02:09:07 +01:00
Thaddee Tyl
036107c30e Fix the size of the Shields.io logo 2016-12-14 22:44:33 +01:00
Thaddee Tyl
c9d94aaf1a More compressed logo
Courtesy of Oleg Kikin: https://news.ycombinator.com/item?id=13139573
2016-12-09 21:47:58 +01:00
Thaddee Tyl
da6dd3cbfe website: chrome web store, mozilla add-ons 2016-11-25 23:29:59 +01:00
Thaddee Tyl
052740ff15 Improve Chrome Web Store: price with currency, rating over 5 2016-11-25 00:08:49 +01:00
Thaddee Tyl
1b699773ba Factorize star rating string generation
There was duplicated code in d10764a8f5.

Related to #831.
2016-11-24 23:56:31 +01:00
RedSparr0w
868c7f8a5a update try.html 2016-11-24 23:54:49 +01:00
RedSparr0w
d10764a8f5 add 5 star ratings 2016-11-24 23:54:49 +01:00
Thaddee Tyl
2b63d62242 Re-remove the ass testing dependency
It was mistakenly added by 2cb82a4a.
2016-11-20 18:53:51 +01:00
Thaddee Tyl
10e49ac743 website: Mozilla add-ons, colorA/B 2016-11-01 20:05:27 +01:00
Thaddee Tyl
29a4803e4b Support combining colorA and colorscheme 2016-10-30 15:36:10 +01:00
Konstantin Zudov
52b0369c14 Allow specifying the color of left/right part
Specifying `colorA`/`colorB` parameters allows
to change the background color of the left/right
part of the badge.
2016-10-30 15:36:05 +01:00
Thaddee Tyl
7403b61e25 Mozilla Add-ons: say "add-on" instead of addon
Mozilla's website uses that format.

Also, show star-rating as "4/5" instead of "4 stars" (which looks verbose, less
informative, and grammatically incorrect if there is a single star).
2016-10-30 10:51:52 +01:00
Józef Sokołowski
2cb82a4ab3 Add Mozilla Addons support 2016-10-30 10:47:56 +01:00
Danial
3edd0df04c CircleCI: show vendor error messages on badges
example:
https://github.com/badges/shields/pull/798#issuecomment-255621160
2016-10-26 00:10:44 +02:00
Thaddee Tyl
6e5904df0a Match CircleCI project host with trailing /
This prevents from misparsing /circleci/project/githubuser/repo.svg as user
"user".

Related to #798.
2016-10-23 17:26:47 +02:00
Thaddee Tyl
dce818a7d2 Merge remote-tracking branch 'redsparrow/Circle_CI' 2016-10-23 17:23:18 +02:00
RedSparr0w
2b0d688d09 Update With Changes 2016-10-22 22:56:40 +13:00
Thaddee Tyl
20407267ad Merge remote-tracking branch 'david-a-wheeler/cii' 2016-10-16 11:28:58 +02:00
Thaddee Tyl
9e66a48621 Merge remote-tracking branch 'tomav/fix-dockerfile' 2016-10-16 10:47:27 +02:00
Peter Dave Hello
251c792d74 Add CDNJS version integration 2016-10-15 23:16:25 +08:00
Thaddee Tyl
1996a5399f Ensure GitHub contributors can have a metric prefix 2016-10-15 16:38:43 +02:00
Thaddee Tyl
670867098d Send false instead of Nan to GitHub contributors-anon 2016-10-15 16:35:39 +02:00
Thaddee Tyl
18bc0be3e5 Merge remote-tracking branch 'qzb/bugfix/contributors-badge' 2016-10-15 16:34:33 +02:00
Thaddee Tyl
ef0d53d444 Merge remote-tracking branch 'nishanthvijayan/chrome-label' 2016-10-15 15:47:21 +02:00
Thaddee Tyl
8c6fb7088d Merge remote-tracking branch 'peterdavehello/bumpDependencies' 2016-10-15 15:30:05 +02:00
Thaddee Tyl
37740cc648 website: Twitter follow, style selector fix 2016-10-15 15:21:13 +02:00
Thaddee Tyl
f0273ff797 Merge remote-tracking branch 'techtonik/patch-1' 2016-10-15 15:15:26 +02:00
Thaddee Tyl
2b44bcc7c2 Use maintainer's twitter account 2016-10-15 14:48:43 +02:00
Peter Dave Hello
6c21450c46 bump dependencies 2016-10-10 16:52:01 +08:00
RedSparr0w
e31f9ac2bd Fix Circle CI Integration 2016-09-27 11:16:18 +13:00
Thaddee Tyl
b74107eb3d Stop using a link for default badge template
npm cannot handle links.
See https://github.com/npm/npm/issues/13884.
2016-09-08 23:23:43 +01:00
Nishanth Vijayan
25fb85e397 Allow label overriding in all Chrome web store badges 2016-09-06 16:46:41 +05:30
anatoly techtonik
64c01c3c1f Also correctly strip maxAge from initial link 2016-08-30 14:24:08 +03:00
anatoly techtonik
9ba76602c1 Fix badge preview on style change
This was broken by 89affa49fe
2016-08-30 13:06:20 +03:00
Thomas VIAL
e374eeab80 Fixed Dockerfile and improved doc regarding secret.json. 2016-08-18 13:28:37 +02:00
Józef Sokołowski
dfb4804973 Fix contributors badge
Fixes #764
2016-08-16 10:52:49 +02:00
David A. Wheeler
4dc16c3019 Add CII Best Practices
Add a link to the Linux Foundation Core Infrastructure Initiative (CII)
  best practices badge, which uses the shields.io spec.
  To see this, visit: https://bestpractices.coreinfrastructure.org/
  and select "Projects".
2016-08-12 10:52:01 -04:00
Andrew Spyker
925c314ffd add NetflixOSS OSSMETADATA osslifecycle support 2016-07-09 20:57:35 -07:00
Andrew Spyker
8754cdc7e3 fix docker command 2016-07-09 19:54:27 -07:00
1023 changed files with 90086 additions and 10521 deletions

View File

@@ -1,2 +0,0 @@
https://github.com/mojodna/heroku-buildpack-cairo.git
https://github.com/heroku/heroku-buildpack-nodejs.git

415
.circleci/config.yml Normal file
View File

@@ -0,0 +1,415 @@
version: 2
main_steps: &main_steps
steps:
- checkout
- restore_cache:
keys:
- v2-dependencies-{{ checksum "package-lock.json" }}
# https://github.com/badges/shields/issues/1937
- v2-dependencies-
- run:
name: Install dependencies
command: npm ci
- save_cache:
paths:
- node_modules
key: v2-dependencies-{{ checksum "package-lock.json" }}
- run:
name: Linter
when: always
command: npm run lint
- run:
name: Core tests
when: always
environment:
mocha_reporter: mocha-junit-reporter
MOCHA_FILE: junit/core/results.xml
command: npm run test:core
- run:
name: Entrypoint tests
when: always
environment:
mocha_reporter: mocha-junit-reporter
MOCHA_FILE: junit/entrypoint/results.xml
command: npm run test:entrypoint
- store_test_results:
path: junit
- run:
name: 'Prettier check (quick fix: `npm run prettier`)'
when: always
command: npm run prettier:check
integration_steps: &integration_steps
steps:
- checkout
- restore_cache:
keys:
- v2-dependencies-{{ checksum "package-lock.json" }}
# https://github.com/badges/shields/issues/1937
- v2-dependencies-
- run:
name: Install dependencies
command: npm ci
- run:
name: Integration tests
when: always
environment:
mocha_reporter: mocha-junit-reporter
MOCHA_FILE: junit/integration/results.xml
command: npm run test:integration
- store_test_results:
path: junit
services_steps: &services_steps
steps:
- checkout
- restore_cache:
keys:
- v2-dependencies-{{ checksum "package-lock.json" }}
# https://github.com/badges/shields/issues/1937
- v2-dependencies-
- run:
name: Install dependencies
command: npm ci
- run:
name: Identify services tagged in the PR title
command: npm run test:services:pr:prepare
- run:
name: Run tests for tagged services
environment:
mocha_reporter: mocha-junit-reporter
MOCHA_FILE: junit/services/results.xml
command: npm run test:services:pr:run
- store_test_results:
path: junit
run_package_tests: &run_package_tests
when: always
command: |
# https://discuss.circleci.com/t/switch-nodejs-version-on-machine-executor-solved/26675/3
set +e
export NVM_DIR="/opt/circleci/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm install $NODE_VERSION
nvm use $NODE_VERSION
node --version
npm run test:package
package_steps: &package_steps
steps:
- checkout
- restore_cache:
keys:
- v2-dependencies-{{ checksum "package-lock.json" }}
# https://github.com/badges/shields/issues/1937
- v2-dependencies-
- run:
name: Install dependencies
command: |
set +e
export NVM_DIR="/opt/circleci/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm install v12
nvm use v12
npm install -g npm
npm ci
# Run the package tests on each currently supported node version. See:
# https://github.com/badges/shields/blob/master/gh-badges/README.md#node-version-support
- run:
<<: *run_package_tests
environment:
mocha_reporter: mocha-junit-reporter
MOCHA_FILE: junit/gh-badges/v8/results.xml
NODE_VERSION: v8
name: Run package tests on Node 8
- run:
<<: *run_package_tests
environment:
mocha_reporter: mocha-junit-reporter
MOCHA_FILE: junit/gh-badges/v10/results.xml
NODE_VERSION: v10
name: Run package tests on Node 10
- run:
<<: *run_package_tests
environment:
mocha_reporter: mocha-junit-reporter
MOCHA_FILE: junit/gh-badges/v11/results.xml
NODE_VERSION: v11
name: Run package tests on Node 11
- run:
<<: *run_package_tests
environment:
mocha_reporter: mocha-junit-reporter
MOCHA_FILE: junit/gh-badges/v12/results.xml
NODE_VERSION: v12
name: Run package tests on Node 12
- store_test_results:
path: junit
jobs:
npm-install:
docker:
- image: circleci/node:8
steps:
- checkout
- restore_cache:
keys:
- v2-dependencies-{{ checksum "package-lock.json" }}
# fallback to using the latest cache if no exact match is found
- v2-dependencies-
- run:
name: Install dependencies
command: npm ci
- save_cache:
paths:
- node_modules
key: v2-dependencies-{{ checksum "package-lock.json" }}
main:
docker:
- image: circleci/node:8
<<: *main_steps
main@node-latest:
docker:
- image: circleci/node:latest
<<: *main_steps
integration:
docker:
- image: circleci/node:8
- image: redis
<<: *integration_steps
integration@node-latest:
docker:
- image: circleci/node:latest
- image: redis
<<: *integration_steps
danger:
docker:
- image: circleci/node:8
steps:
- checkout
- restore_cache:
keys:
- v2-dependencies-{{ checksum "package-lock.json" }}
# https://github.com/badges/shields/issues/1937
- v2-dependencies-
- run:
name: Install dependencies
command: npm ci
- run:
name: Danger
when: always
environment:
# https://github.com/gatsbyjs/gatsby/pull/11555
NODE_ENV: test
command: npm run danger ci
frontend:
docker:
- image: circleci/node:8
steps:
- checkout
- restore_cache:
keys:
- v2-dependencies-{{ checksum "package-lock.json" }}
# https://github.com/badges/shields/issues/1937
- v2-dependencies-
- run:
name: Install dependencies
command: npm ci
- run:
name: Prepare frontend tests
command: npm run defs && npm run features
- run:
name: Frontend unit tests
environment:
mocha_reporter: mocha-junit-reporter
MOCHA_FILE: junit/frontend/results.xml
command: npm run test:frontend
- store_test_results:
path: junit
- run:
name: Frontend build completes successfully
when: always
command: npm run build
package:
machine: true
<<: *package_steps
services:
docker:
- image: circleci/node:8
<<: *services_steps
services@node-latest:
docker:
- image: circleci/node:latest
<<: *services_steps
e2e:
docker:
- image: cypress/base:8
steps:
- checkout
- restore_cache:
keys:
- v2-dependencies-{{ checksum "package-lock.json" }}
# https://github.com/badges/shields/issues/1937
- v2-dependencies-
- run:
name: Install dependencies
command: npm ci
- run:
name: Frontend build
command: GATSBY_BASE_URL=http://localhost:8080 npm run build
- run:
name: Run tests
environment:
CYPRESS_REPORTER: junit
MOCHA_FILE: junit/e2e/results.xml
command: npm run e2e-on-build
- store_test_results:
path: junit
- store_artifacts:
path: cypress/videos
- store_artifacts:
path: cypress/screenshots
workflows:
version: 2
on-commit:
jobs:
- main:
filters:
branches:
ignore: gh-pages
- main@node-latest:
filters:
branches:
ignore: gh-pages
- integration@node-latest:
filters:
branches:
ignore: gh-pages
- frontend:
filters:
branches:
ignore: gh-pages
- package:
filters:
branches:
ignore: gh-pages
- services:
filters:
branches:
ignore:
- master
- gh-pages
- services@node-latest:
filters:
branches:
ignore:
- master
- gh-pages
- danger:
filters:
branches:
ignore:
- master
- gh-pages
- /dependabot\/.*/
- e2e:
filters:
branches:
ignore: gh-pages
# on-commit-with-cache:
# jobs:
# - npm-install:
# filters:
# branches:
# ignore: gh-pages
# - main:
# requires:
# - npm-install
# - main@node-latest:
# requires:
# - npm-install
# - frontend:
# requires:
# - npm-install
# - services:
# requires:
# - npm-install
# filters:
# branches:
# ignore: master
# - services@node-latest:
# requires:
# - npm-install
# filters:
# branches:
# ignore: master
# - danger:
# requires:
# - npm-install
# filters:
# branches:
# ignore: /dependabot\/.*/

11
.dependabot/config.yml Normal file
View File

@@ -0,0 +1,11 @@
version: 1
update_configs:
# shields.io dependencies
- package_manager: 'javascript'
directory: '/'
update_schedule: 'weekly'
# gh-badges package dependencies
- package_manager: 'javascript'
directory: '/gh-badges'
update_schedule: 'weekly'

8
.dockerignore Normal file
View File

@@ -0,0 +1,8 @@
node_modules/
shields.env
.git/
.gitignore
.vscode/
# Improve layer cacheability.
Dockerfile

5
.eslintignore Normal file
View File

@@ -0,0 +1,5 @@
/build
/coverage
/__snapshots__
/public
gh-badges/node_modules/

28
.eslintrc-frontend.yml Normal file
View File

@@ -0,0 +1,28 @@
env:
browser: true
plugins:
- import
- react-hooks
parser: 'babel-eslint'
parserOptions:
sourceType: 'module'
extends:
- 'standard-jsx'
- 'standard-react'
- './.eslintrc.yml'
settings:
react:
version: '16.4'
rules:
no-console: 'error'
import/extensions: ['error', 'never', { 'json': 'always', 'yml': 'always' }]
react/jsx-sort-props: 'error'
react-hooks/rules-of-hooks: 'error'
react-hooks/exhaustive-deps: 'error'

84
.eslintrc.yml Normal file
View File

@@ -0,0 +1,84 @@
extends:
- standard
- prettier
env:
node: true
mocha: true
parserOptions:
# Override eslint-config-standard, which incorrectly sets this to "module",
# though that setting is only for ES6 modules, not CommonJS modules.
sourceType: 'script'
overrides:
- files:
- gatsby-browser.js
parserOptions:
sourceType: 'module'
- files:
- 'core/base-service/**/*.js'
- 'services/**/*.js'
rules:
sort-class-members/sort-class-members:
[
'error',
{
order:
[
'name',
'category',
'isDeprecated',
'route',
'examples',
'_cacheLength',
'defaultBadgeData',
'render',
'constructor',
'fetch',
'transform',
'handle',
],
},
]
plugins:
- mocha
- no-extension-in-require
- chai-friendly
- sort-class-members
rules:
# Disable some rules from eslint:recommended.
no-console: 'off'
no-empty: ['error', { 'allowEmptyCatch': true }]
# Allow unused parameters. In callbacks, removing them seems to obscure
# what the functions are doing.
no-unused-vars: ['error', { 'args': 'none' }]
# These should be disabled by eslint-config-prettier, but are not.
spaced-comment: 'off'
standard/object-curly-even-spacing: 'off'
one-var: 'off'
# Shields additions.
no-var: 'error'
prefer-const: 'error'
strict: 'error'
arrow-body-style: ['error', 'as-needed']
no-extension-in-require/main: 'error'
object-shorthand: ['error', 'properties']
prefer-template: 'error'
promise/prefer-await-to-then: 'error'
func-style: ['error', 'declaration', { 'allowArrowFunctions': true }]
new-cap: ['error', { 'capIsNew': true }]
import/order: ['error', { 'newlines-between': 'never' }]
# Mocha-related.
mocha/no-exclusive-tests: 'error'
mocha/no-mocha-arrows: 'error'
mocha/prefer-arrow-callback: 'error'
# Chai friendly.
no-unused-expressions: 'off'
chai-friendly/no-unused-expressions: 'error'

1
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1 @@
open_collective: shields

28
.github/ISSUE_TEMPLATE/1_Bug_report.md vendored Normal file
View File

@@ -0,0 +1,28 @@
---
name: 🐛 Bug Report
about: Report errors and problems
---
Are you experiencing an issue with...
- [ ] [shields.io](https://shields.io/#/)
- [ ] My own instance
- [ ] [gh-badges NPM package](https://www.npmjs.com/package/gh-badges)
:beetle: **Description**
<!-- A clear and concise description of the problem. -->
:link: **Link to the badge**
<!--
If you are reporting a problem with a specific badge on shields.io,
provide a link to a badge demonstrating the error
-->
:bulb: **Possible Solution**
<!--- Optional: only if you have suggestions on a fix/reason for the bug -->
<!-- Love Shields? Please consider donating $10 to sustain our activities:
👉 https://opencollective.com/shields -->

View File

@@ -0,0 +1,35 @@
---
name: 💚 Failing service test
about: Note failing service tests
---
:clock11: **When did the problem start?**
<!-- Indicate when the problem started -->
:camera: **Live badge**
<!-- Provide a link to the live badge in plain text and markdown. -->
![]( url goes here )
:wrench: **Is the live badge working?**
<!-- Indicate whether or not the live badge is working. -->
:link: **CircleCI link**
<!-- Provide a link to the failing test in CircleCI. -->
:beetle: **Stack trace**
```
<!-- Provide the complete stack trace from the CircleCI test summary. -->
```
:bulb: **Possible solution**
<!--- Optional: only if you have suggestions on a fix/reason for the bug -->
<!-- Love Shields? Please consider donating $10 to sustain our activities:
👉 https://opencollective.com/shields -->

View File

@@ -0,0 +1,36 @@
---
name: 💡 Badge Request
about: Ideas for new badges
---
:clipboard: **Description**
<!--
A clear and concise description of the new badge.
- Which service is this badge for e.g: GitHub, Travis CI
- What sort of information should this badge show?
Provide an example in plain text e.g: "version | v1.01" or as a static badge
(static badge generator can be found at https://shields.io)
-->
:link: **Data**
<!--
Where can we get the data from?
- Is there a public API?
- Does the API requires an API key?
- Link to the API documentation.
-->
:microphone: **Motivation**
<!--
Please explain why this feature should be implemented and how it would be used.
- What is the specific use case?
-->
<!-- Love Shields? Please consider donating $10 to sustain our activities:
👉 https://opencollective.com/shields -->

View File

@@ -0,0 +1,11 @@
---
name: 💡 Feature Request
about: Ideas for other new features or improvements
---
:clipboard: **Description**
<!-- A clear and concise description of the new feature. -->
<!-- Love Shields? Please consider donating $10 to sustain our activities:
👉 https://opencollective.com/shields -->

View File

@@ -0,0 +1,16 @@
---
name: ❓ Support Question
about: Ask a question about shields.io
---
:question: **Question**
<!--
Ask your question clearly and concisely.
#support on our [Discord](https://discordapp.com/invite/HjJCwm5)
is also a great place to ask questions and get help
-->
<!-- Love Shields? Please consider donating $10 to sustain our activities:
👉 https://opencollective.com/shields -->

10
.github/probot.js vendored Normal file
View File

@@ -0,0 +1,10 @@
on('pull_request.closed')
.filter(context => context.payload.pull_request.merged)
.filter(
context =>
context.payload.pull_request.head.ref.slice(0, 11) !== 'dependabot/'
)
.filter(context => context.payload.pull_request.base.ref === 'master')
.comment(`This pull request was merged to [{{ pull_request.base.ref }}]({{ repository.html_url }}/tree/{{ pull_request.base.ref }}) branch. This change is now waiting for deployment, which will usually happen within a few days. Stay tuned by joining our \`#ops\` channel on [Discord](https://discordapp.com/invite/HjJCwm5)!
After deployment, changes are copied to [gh-pages]({{ repository.html_url }}/tree/gh-pages) branch: ![](https://img.shields.io/github/commit-status/{{ repository.full_name }}/gh-pages/{{ pull_request.merge_commit_sha }}.svg?label=deploy%20status)`)

99
.gitignore vendored
View File

@@ -4,11 +4,10 @@
/coverage.html
/redis
/ServerScript
/secret.json
/.github-user-tokens.json
# Installed npm modules
node_modules
/private
/index.html
/shields.env
gh-badges/package-lock.json
# Folder view configuration files
.DS_Store
@@ -18,6 +17,96 @@ Desktop.ini
._*
Thumbs.db
# Visual Studio Code User Settings
.vscode/settings.json
# eclipse
.project
.settings
# Files that might appear on external disks
.Spotlight-V100
.Trashes
# Jetbrains
/.idea
# Created by https://www.gitignore.io/api/node
### Node ###
# Logs
logs
*.log
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Typescript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
# Temporary build artifacts.
/build
.next
badge-examples.json
supported-features.json
service-definitions.yml
# Local runtime configuration.
/config/local*.yml
# Template for the local runtime configuration.
!/config/local*.template.yml
# Gatsby
/.cache
/public
# Cypress
/cypress/videos/
/cypress/screenshots/

5
.gitpod.yml Normal file
View File

@@ -0,0 +1,5 @@
ports:
- port: 8080
tasks:
- init: npm ci && npm run build
command: node server 8080 0.0.0.0

6
.mocharc-frontend.yml Normal file
View File

@@ -0,0 +1,6 @@
reporter: mocha-env-reporter
require:
- '@babel/polyfill'
- '@babel/register'
- mocha-yaml-loader
- frontend/mocha-ignore-pngs

1
.mocharc.yml Normal file
View File

@@ -0,0 +1 @@
reporter: mocha-env-reporter

30
.nowignore Normal file
View File

@@ -0,0 +1,30 @@
*
!frontend/
!gh-badges/
!lib/
!core/
!logo/
!pages/
!public/
!templates/
!services/
!package-lock.json
!/*.js
!scripts/export-*.js
!config/
config/local*.yml
*.spec.js
*~
.env
.circleci
.github
.vscode
__snapshots__
.buildpacks
.eslint*
.editorconfig
.nycrc*
.gitpod*
.prettier*
CONTRIBUTING.md
Dockerfile

10
.nycrc-frontend.json Normal file
View File

@@ -0,0 +1,10 @@
{
"reporter": ["lcov"],
"all": false,
"silent": true,
"clean": false,
"sourceMap": false,
"instrument": false,
"include": ["frontend/**/*.js"],
"exclude": ["**/*.spec.js", "**/mocha-*.js"]
}

24
.nycrc.json Normal file
View File

@@ -0,0 +1,24 @@
{
"reporter": ["lcov"],
"all": true,
"silent": true,
"clean": false,
"exclude": [
"**/*.spec.js",
"**/*.integration.js",
"**/test-helpers.js",
"**/*-test-helpers.js",
"**/*-fixtures.js",
"dangerfile.js",
"gatsby-*.js",
"core/service-test-runner",
"services/**/*.tester.js",
"services/test-validators.js",
"services/tester.js",
"core/base-service/loader-test-fixtures",
"scripts",
"coverage",
"build",
".github"
]
}

14
.prettierignore Normal file
View File

@@ -0,0 +1,14 @@
package.json
package-lock.json
/__snapshots__
/.next
/.cache
/build
/public
/coverage
private/*.json
/.nyc_output
analytics.json
gh-badges/templates/default-template.json
supported-features.json
service-definitions.yml

5
.prettierrc.yml Normal file
View File

@@ -0,0 +1,5 @@
semi: false
singleQuote: true
trailingComma: es5
bracketSpacing: true
endOfLine: lf

View File

@@ -1,18 +0,0 @@
before_install:
- sudo apt-get update -myqq
- sudo apt-get install libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++
language: node_js
node_js:
- 6
branches:
only:
- master
notifications:
email:
- thaddee.tyl@gmail.com
irc: "irc.freenode.org#shields"
git:
depth: 10

7
.vscode/extensions.json vendored Normal file
View File

@@ -0,0 +1,7 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"EditorConfig.EditorConfig",
"dbaeumer.vscode-eslint"
]
}

13
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,13 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Node: Nodemon",
"processId": "${command:PickProcess}",
"restart": true,
"protocol": "inspector"
}
]
}

1
CNAME
View File

@@ -1 +0,0 @@
shields.io

View File

@@ -1,65 +1,141 @@
# Contribution Guidelines
# Contributing to Shields
This is the home of Shields.io, home to the badge design specification, API documentation, and server code for Badges as a Service.
Shields is a community project. We invite your participation through
financial contributions, issues, and pull requests!
We invite participation through [GitHub Issues][], which we use much like a discussion forum. This repository should only contain non-implementation specific topics: specifications, design, and the web site.
## Ways you can help
## This implementation
### Financial contributions
Please see [INSTALL.md][] for information on how to start contributing code to
shields.io.
We welcome financial contributions in full transparency on our
[open collective](https://opencollective.com/shields). Anyone can file an
expense. If the expense makes sense for the development of the community, it
will be "merged" into the ledger of our open collective by the core
contributors and the person who filed the expense will be reimbursed.
[INSTALL.md]: ./INSTALL.md
### Contributing code
Note that the root gets redirected to <http://shields.io>.
For testing purposes, you can go to `http://localhost/try.html`.
You should modify that file. The "real" root, `http://localhost/index.html`,
gets generated from the `try.html` file with a `make website`.
This project has quite a backlog of suggestions! If you're new to the project,
maybe you'd like to open a pull request to address one of them:
## Ground rules
[![GitHub issues by-label](https://img.shields.io/github/issues/badges/shields/good%20first%20issue.svg)](https://github.com/badges/shields/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
### Contributing documentation
You can help by improving the project's usage and developer instructions.
- When you read the documentation, you can fix mistakes and add your own thoughts.
- When your pull request follows the documentation but the practice changed,
consider pointing this out and change the documentation for the next person.
### Helping others
You can help with code review, which reduces bugs, and over time has a
wonderful side effect of making the code more readable and therefore more
approachable. It's also a great way to teach and learn. Feel free to jump in!
Be welcoming, appreciative, and helpful. You can perform first reviews of
simple changes, like badge additions. These are usually tagged with
[service badge][service badge pr tag].
Please review [these impeccable guidelines][code review guidelines].
You can monitor [issues][] and the [chat room][], and help other people who
have questions about contributing to Shields, or using it for their projects.
Feel free to reach out to one of the [maintainers][]
if you need help getting started.
[service badge pr tag]: https://github.com/badges/shields/pulls?q=is%3Apr+is%3Aopen+label%3Aservice-badge
[code review guidelines]: https://kickstarter.engineering/a-guide-to-mindful-communication-in-code-reviews-48aab5282e5e
[issues]: https://github.com/badges/shields/issues
[chat room]: https://discordapp.com/invite/HjJCwm5
[maintainers]: https://github.com/badges/shields#project-leaders
### Suggesting improvements
There are _a lot_ of suggestions on file. You can help by weighing in on these
suggestions, which helps convey community need to other contributors who might
pick them up.
There is no need to post a new comment. Just add a :thumbsup: or :heart: to
the top post.
If you have a suggestion of your own, [search the open issues][issues]. If you
don't see it, feel free to [open a new issue][open an issue].
[open an issue]: https://github.com/badges/shields/issues/new/choose
### Spreading the word
Feel free to star the repository. This will help increase the visibility of the project, therefore attracting more users and contributors to Shields!
We're also asking for [one-time \$10 donations](https://opencollective.com/shields) from developers who use and love Shields, please spread the word!
## Getting help
There are three places to get help:
1. If you're new to the project, a good place to start is the [tutorial][].
2. If you need help getting started or implementing a change, [open an issue][]
with your question. We promise it's okay to do that. If there is already an
issue open for the feature you're working on, you can post there.
3. You can also join the [chat room][] and ask your question there.
[tutorial]: doc/TUTORIAL.md
## Badge guidelines
- Shields.io hosts integrations for services which are primarily
used by developers or which are widely used by developers
- The left-hand side of a badge should not advertise. It should be a lowercase _noun_
succinctly describing the meaning of the right-hand side.
- Except for badges using the `social` style, logos should be _turned off by
default_.
## Badge URLs
- The left-hand side of a badge should not advertize. It should be a noun
describing succinctly the meaning of the right-hand-side data.
- New query parameters (such as `?label=` or `?style=`) should apply to any
requested badge. They must be registered in the cache (see `LruCache` in
`server.js`).
- The format of new badges should be of the form
`/VENDOR/SUBVENDOR-BADGE-SPECIFIC/PARAMETERS.format`. For instance,
`https://img.shields.io/gitter/room/nwjs/nw.js.svg`. The vendor is gitter, the
`/SERVICE/NOUN/PARAMETERS/QUALIFIERS.format`. For instance,
`/gitter/room/nwjs/nw.js.svg`. The vendor is gitter, the
badge is for rooms, the parameter is nwjs/nw.js, and the format is svg.
- For services which require a hostname, the badge should be of the form
`/SERVICE/SCHEME/HOST/NOUN/PARAMETERS/QUALIFIERS.format`. For instance,
`/discourse/https/discourse.example.com/topics.svg`.
## Implementations
## Coding guidelines
The main implementation, available at <http://shields.io>, has its code located in this repository.
### Prettier
Other systems that produce badges following the same design, hosted elsewhere, are listed below.
This project formats its source code using Prettier. The most enjoyable way to
use Prettier is to let it format code for you when you save. You can [integrate
it into your editor][integrate prettier].
| website / AP | language | issues |
| --------------------------------- | ---------- | ---------------------------- |
| shielded | JavaScript | [shielded][shielded issues] |
| [buckler.repl.ca][] | Go | [buckler][buckler issues] |
| old img.shields.io (discontinued) | Python | [img.shields.io-old][] |
| DotBadge | C# | [DotBadge](https://github.com/rebornix/DotBadge/issues) |
Whether you integrate it into your editor or not, a pre-commit hook will run
Prettier before a commit by default.
Please report **bugs** and discuss implementation specific concerns (performance characteristics, etc.) in the repository for the respective implementation.
[integrate prettier]: https://prettier.io/docs/en/editors.html
## Adding support for a service
### Tests
Please [open an issue][new issue] if you'd like to use Shields badges for a project that isn't yet supported.
When adding or changing a service [please write tests][service-tests].
When opening a pull request, include your service name in brackets in the pull
request title. That way, those service tests will run in CI.
[shields.io]: http://shields.io/
[website]: https://github.com/badges/shields/tree/gh-pages
[GitHub Issues]: https://github.com/badges/shields/issues
[new issue]: https://github.com/badges/shields/issues/new
e.g. **[Travis] Fix timeout issues**
[img.shields.io]: http://img.shields.io/
[gh-badges issues]: https://github.com/badges/shields/issues
[primary]: https://github.com/badges/shields/issues/94
When changing other code, please add unit tests.
[shielded issues]: https://github.com/badges/shielded/issues
To run the integration tests, you must have redis installed and in your PATH.
Use `brew install redis`, `yum install redis`, etc. The test runner will
start the server automatically.
[buckler.repl.ca]: http://buckler.repl.ca/
[buckler issues]: https://github.com/badges/buckler/issues
[service-tests]: https://github.com/badges/shields/blob/master/doc/service-tests.md
[img.shields.io-old]: https://github.com/badges/img.shields.io-old/issues
### Code organization
There is a [High-level code walkthrough](doc/code-walkthrough.md) describing the layout of the project.
### Logos
We have [documentation for logo usage](doc/logos.md) which includes [contribution guidance](doc/logos.md#contributing-logos)

View File

@@ -1,3 +1,26 @@
FROM node:0.12-onbuild
ENV INFOSITE http://shields.io
FROM node:8-alpine
RUN apk add --no-cache gettext imagemagick librsvg git
RUN mkdir -p /usr/src/app
RUN mkdir /usr/src/app/private
WORKDIR /usr/src/app
COPY package.json package-lock.json /usr/src/app/
# Without the gh-badges package.json and CLI script in place, `npm ci` will fail.
COPY gh-badges /usr/src/app/gh-badges/
# We need dev deps to build the front end.
RUN NODE_ENV=development npm ci
COPY . /usr/src/app
RUN npm run build
RUN npm prune --production
RUN npm cache clean --force
# Run the server using production configs.
ENV NODE_ENV production
CMD node server
EXPOSE 80

View File

@@ -1,170 +0,0 @@
# GitHub badges in SVG format
[![npm version](http://img.shields.io/npm/v/gh-badges.svg)](https://npmjs.org/package/gh-badges)
![coverage](https://rawgithub.com/badges/shields/master/coverage.svg)
[![build status](http://img.shields.io/travis/badges/gh-badges.svg)](https://travis-ci.org/badges/gh-badges)
Make your own badges [here][badges]! (Quick guide: `https://img.shields.io/badge/left-right-f39f37.svg`.)
[badges]: <http://shields.io/#your-badge>
# Install the API
```bash
npm install gh-badges
```
```js
var badge = require('gh-badges');
// Optional step, to have accurate text width computation.
badge.loadFont('/path/to/Verdana.ttf', function(err) {
badge({ text: ["build", "passed"], colorscheme: "green", template: "flat" },
function(svg, err) {
// svg is a String of your badge.
});
});
```
# Use the CLI
```bash
npm install -g gh-badges
badge build passed :green .png > mybadge.png
# Stored a PNG version of your badge on disk.
```
# Start the Server
To run the server you will need the following executables on your Path:
- [PhantomJS](http://www.phantomjs.org/)
On an OS X machine, [Homebrew](brew.sh) is a good package manager that will
allow you to install that.
On Ubuntu / Debian: `sudo apt-get install phantomjs`.
```bash
git clone https://github.com/badges/shields.git
cd shields
npm install # You may need sudo for this.
sudo node server
```
The server uses port 80 by default, which requires `sudo` permissions.
There are two ways to provide an alternate port:
```bash
PORT=8080 node server
node server 8080
```
The root gets redirected to <http://shields.io>.
For testing purposes, you can go to `http://localhost/try.html`.
You should modify that file. The "real" root, `http://localhost/index.html`,
gets generated from the `try.html` file.
# Format
The format is the following:
```js
{
/* Textual information shown, in order. */
"text": [ "build", "passed" ],
"format": "svg", // Also supports "json".
"colorscheme": "green",
/* … Or… */
"colorA": "#555",
"colorB": "#4c1",
/* See template/ for a list of available templates.
Each offers a different visual design. */
"template": "flat"
}
```
# Defaults
If you want to add a colorscheme, head to `colorscheme.json`. Each scheme has a
name and a [CSS/SVG color][] for the color used in the first box (for the first
piece of text, field `colorA`) and for the one used in the second box (field
`colorB`).
[CSS/SVG color]: http://www.w3.org/TR/SVG/types.html#DataTypeColor
```js
"green": {
"colorB": "#4c1"
}
```
Both `colorA` and `colorB` have default values. Usually, the first box uses the
same dark grey, so you can rely on that default value by not providing a
`"colorA"` field (such as above).
You can also use the `"colorA"` and `"colorB"` fields directly in the badges if
you don't want to make a color scheme for it. In that case, remove the
`"colorscheme"` field altogether.
# Making your Heroku badge server
Once you have installed the [Heroku Toolbelt][]:
[Heroku Toolbelt]: https://toolbelt.heroku.com/
```bash
heroku login
heroku create your-app-name
heroku config:set BUILDPACK_URL=https://github.com/mojodna/heroku-buildpack-multi.git#build-env
cp /path/to/Verdana.ttf .
make deploy
heroku open
```
# Docker
You can build and run the server locally using Docker. First build an image:
```console
$ docker build -t shields ./
Sending build context to Docker daemon 3.923 MB
Step 0 : FROM node:0.12.7-onbuild
Removing intermediate container c4678889953f
Successfully built 4471b442c220
```
Then run the container:
```console
$ docker run --rm -p 8080:80 shields
> gh-badges@1.1.2 start /usr/src/app
> node server.js
http://[::1]:80/try.html
```
Assuming Docker is running locally, you should be able to get to the application at http://localhost:8080/try.html. If you run Docker in a virtual machine (such as boot2docker or Docker Machine) then you will need to replace `localhost` with the actual IP address of that virtual machine.
# Main Server Sysadmin
- DNS round-robin between https://vps197850.ovh.net/try.html and https://vps244529.ovh.net/try.html.
- Self-signed TLS certificates, but `img.shields.io` is behind CloudFlare, which provides signed certificates.
- Using node v0.12.7 because later versions, combined with node-canvas, give inaccurate badge measurements.
- Using forever (the node monitor) to automatically restart the server when it crashes.
See https://github.com/badges/ServerScript for helper admin scripts.
# Links
See <https://github.com/h5bp/lazyweb-requests/issues/150> for a story of the
project's inception.
This is also available as a gem `badgerbadgerbadger`, [code here][gem].
[gem]: https://github.com/badges/badgerbadgerbadger
# License
All work here is licensed CC0.

116
LICENSE Normal file
View File

@@ -0,0 +1,116 @@
CC0 1.0 Universal
Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator and
subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").
Certain owners wish to permanently relinquish those rights to a Work for the
purpose of contributing to a commons of creative, cultural and scientific
works ("Commons") that the public can reliably and without fear of later
claims of infringement build upon, modify, incorporate in other works, reuse
and redistribute as freely as possible in any form whatsoever and for any
purposes, including without limitation commercial purposes. These owners may
contribute to the Commons to promote the ideal of a free culture and the
further production of creative, cultural and scientific works, or to gain
reputation or greater distribution for their Work in part through the use and
efforts of others.
For these and/or other purposes and motivations, and without any expectation
of additional consideration or compensation, the person associating CC0 with a
Work (the "Affirmer"), to the extent that he or she is an owner of Copyright
and Related Rights in the Work, voluntarily elects to apply CC0 to the Work
and publicly distribute the Work under its terms, with knowledge of his or her
Copyright and Related Rights in the Work and the meaning and intended legal
effect of CC0 on those rights.
1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights ("Copyright and
Related Rights"). Copyright and Related Rights include, but are not limited
to, the following:
i. the right to reproduce, adapt, distribute, perform, display, communicate,
and translate a Work;
ii. moral rights retained by the original author(s) and/or performer(s);
iii. publicity and privacy rights pertaining to a person's image or likeness
depicted in a Work;
iv. rights protecting against unfair competition in regards to a Work,
subject to the limitations in paragraph 4(a), below;
v. rights protecting the extraction, dissemination, use and reuse of data in
a Work;
vi. database rights (such as those arising under Directive 96/9/EC of the
European Parliament and of the Council of 11 March 1996 on the legal
protection of databases, and under any national implementation thereof,
including any amended or successor version of such directive); and
vii. other similar, equivalent or corresponding rights throughout the world
based on applicable law or treaty, and any national implementations thereof.
2. Waiver. To the greatest extent permitted by, but not in contravention of,
applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and
unconditionally waives, abandons, and surrenders all of Affirmer's Copyright
and Related Rights and associated claims and causes of action, whether now
known or unknown (including existing as well as future claims and causes of
action), in the Work (i) in all territories worldwide, (ii) for the maximum
duration provided by applicable law or treaty (including future time
extensions), (iii) in any current or future medium and for any number of
copies, and (iv) for any purpose whatsoever, including without limitation
commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes
the Waiver for the benefit of each member of the public at large and to the
detriment of Affirmer's heirs and successors, fully intending that such Waiver
shall not be subject to revocation, rescission, cancellation, termination, or
any other legal or equitable action to disrupt the quiet enjoyment of the Work
by the public as contemplated by Affirmer's express Statement of Purpose.
3. Public License Fallback. Should any part of the Waiver for any reason be
judged legally invalid or ineffective under applicable law, then the Waiver
shall be preserved to the maximum extent permitted taking into account
Affirmer's express Statement of Purpose. In addition, to the extent the Waiver
is so judged Affirmer hereby grants to each affected person a royalty-free,
non transferable, non sublicensable, non exclusive, irrevocable and
unconditional license to exercise Affirmer's Copyright and Related Rights in
the Work (i) in all territories worldwide, (ii) for the maximum duration
provided by applicable law or treaty (including future time extensions), (iii)
in any current or future medium and for any number of copies, and (iv) for any
purpose whatsoever, including without limitation commercial, advertising or
promotional purposes (the "License"). The License shall be deemed effective as
of the date CC0 was applied by Affirmer to the Work. Should any part of the
License for any reason be judged legally invalid or ineffective under
applicable law, such partial invalidity or ineffectiveness shall not
invalidate the remainder of the License, and in such case Affirmer hereby
affirms that he or she will not (i) exercise any of his or her remaining
Copyright and Related Rights in the Work or (ii) assert any associated claims
and causes of action with respect to the Work, in either case contrary to
Affirmer's express Statement of Purpose.
4. Limitations and Disclaimers.
a. No trademark or patent rights held by Affirmer are waived, abandoned,
surrendered, licensed or otherwise affected by this document.
b. Affirmer offers the Work as-is and makes no representations or warranties
of any kind concerning the Work, express, implied, statutory or otherwise,
including without limitation warranties of title, merchantability, fitness
for a particular purpose, non infringement, or the absence of latent or
other defects, accuracy, or the present or absence of errors, whether or not
discoverable, all to the greatest extent permissible under applicable law.
c. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without limitation
any person's Copyright and Related Rights in the Work. Further, Affirmer
disclaims responsibility for obtaining any necessary consents, permissions
or other rights required for any use of the Work.
d. Affirmer understands and acknowledges that Creative Commons is not a
party to this document and has no duty or obligation with respect to this
CC0 or use of the Work.
For more information, please see
<http://creativecommons.org/publicdomain/zero/1.0/>

View File

@@ -1,33 +0,0 @@
# DEDICATED TO THE PUBLIC DOMAIN
Shields has been dedicated to the public domain. It is protected by the Creative Commons CC0 Universal Public Domain Dedication license. You can read the entire license below or at http://creativecommons.org/publicdomain/zero/1.0/deed.en.
# CC0 UNIVERSAL PUBLIC DOMAIN DEDICATION LICENSE
## Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer exclusive Copyright and Related Rights (defined below) upon the creator and subsequent owner(s) (each and all, an "owner") of an original work of authorship and/or a database (each, a "Work").
Certain owners wish to permanently relinquish those rights to a Work for the purpose of contributing to a commons of creative, cultural and scientific works ("Commons") that the public can reliably and without fear of later claims of infringement build upon, modify, incorporate in other works, reuse and redistribute as freely as possible in any form whatsoever and for any purposes, including without limitation commercial purposes. These owners may contribute to the Commons to promote the ideal of a free culture and the further production of creative, cultural and scientific works, or to gain reputation or greater distribution for their Work in part through the use and efforts of others.
For these and/or other purposes and motivations, and without any expectation of additional consideration or compensation, the person associating CC0 with a Work (the "Affirmer"), to the extent that he or she is an owner of Copyright and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and publicly distribute the Work under its terms, with knowledge of his or her Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those rights.
1. Copyright and Related Rights. A Work made available under CC0 may be protected by copyright and related or neighboring rights ("Copyright and Related Rights"). Copyright and Related Rights include, but are not limited to, the following:
a. the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work;
b. moral rights retained by the original author(s) and/or performer(s);
c. publicity and privacy rights pertaining to a person's image or likeness depicted in a Work;
rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(a), below;
d. rights protecting the extraction, dissemination, use and reuse of data in a Work;
e. database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); and
f. other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof.
2. Waiver. To the greatest extent permitted by, but not in contravention of, applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and unconditionally waives, abandons, and surrenders all of Affirmer's Copyright and Related Rights and associated claims and causes of action, whether now known or unknown (including existing as well as future claims and causes of action), in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each member of the public at large and to the detriment of Affirmer's heirs and successors, fully intending that such Waiver shall not be subject to revocation, rescission, cancellation, termination, or any other legal or equitable action to disrupt the quiet enjoyment of the Work by the public as contemplated by Affirmer's express Statement of Purpose.
3. Public License Fallback. Should any part of the Waiver for any reason be judged legally invalid or ineffective under applicable law, then the Waiver shall be preserved to the maximum extent permitted taking into account Affirmer's express Statement of Purpose. In addition, to the extent the Waiver is so judged Affirmer hereby grants to each affected person a royalty-free, non transferable, non sublicensable, non exclusive, irrevocable and unconditional license to exercise Affirmer's Copyright and Related Rights in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "License"). The License shall be deemed effective as of the date CC0 was applied by Affirmer to the Work. Should any part of the License for any reason be judged legally invalid or ineffective under applicable law, such partial invalidity or ineffectiveness shall not invalidate the remainder of the License, and in such case Affirmer hereby affirms that he or she will not (i) exercise any of his or her remaining Copyright and Related Rights in the Work or (ii) assert any associated claims and causes of action with respect to the Work, in either case contrary to Affirmer's express Statement of Purpose.
4. Limitations and Disclaimers.
a. No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or otherwise affected by this document.
b. Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law.
c. Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person's Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work.
d. Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work.

116
Makefile
View File

@@ -1,72 +1,70 @@
all: website favicon test
SHELL:=/bin/bash
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
SED=sed -r
NEWLINE=$\n
endif
ifeq ($(UNAME_S),Darwin)
SED=sed -E
NEWLINE=$$'\n'
endif
SERVER_TMP=${TMPDIR}shields-server-deploy
FRONTEND_TMP=${TMPDIR}shields-frontend-deploy
favicon:
node gh-badge.js '' '' '#bada55' .png > favicon.png
# This branch is reserved for the deploy process and should not be used for
# development. The deploy script will clobber it. To avoid accidentally
# pushing secrets to GitHub, this branch is configured to reject pushes.
WORKING_BRANCH=server-deploy-working-branch
website:
cat try.html | $(SED) "s,(<img src=')(/[^'\?]+)',\1https://img.shields.io\2?maxAge=2592000'," \
| $(SED) "s,(<img src=')(/[^'\?]+\?[^']+)',\1https://img.shields.io\2\&maxAge=2592000'," \
| $(SED) "s,<span id='imgUrlPrefix'>,&https://img.shields.io," \
| $(SED) "s,var origin = '';,var origin = 'https://img.shields.io';," \
| $(SED) "s,<style>,<!-- WARNING: THIS FILE WAS GENERATED FROM try.html -->\\"$(NEWLINE)"<style>," > index.html
all: test
deploy: deploy-s0 deploy-s1 deploy-gh-pages
deploy: deploy-s0 deploy-s1 deploy-s2 clean-server-deploy deploy-gh-pages deploy-gh-pages-clean
deploy-s0:
git add -f Verdana.ttf
git add -f secret.json
git commit -m'MUST NOT BE ON GITHUB'
git push -f s0 HEAD:master
git reset HEAD~1
git checkout master
deploy-s0: prepare-server-deploy push-s0
deploy-s1: prepare-server-deploy push-s1
deploy-s2: prepare-server-deploy push-s2
deploy-s1:
git add -f Verdana.ttf
git add -f secret.json
git commit -m'MUST NOT BE ON GITHUB'
git push -f s1 HEAD:master
git reset HEAD~1
git checkout master
prepare-server-deploy:
# Ship a copy of the front end to each server for debugging.
# https://github.com/badges/shields/issues/1220
INCLUDE_DEV_PAGES=false \
npm run build
rm -rf ${SERVER_TMP}
git worktree prune
git worktree add -B ${WORKING_BRANCH} ${SERVER_TMP}
cp -r public ${SERVER_TMP}
git -C ${SERVER_TMP} add -f public/
git -C ${SERVER_TMP} commit --no-verify -m '[DEPLOY] Add frontend for debugging'
cp config/local-shields-io-production.yml ${SERVER_TMP}/config/
git -C ${SERVER_TMP} add -f config/local-shields-io-production.yml
git -C ${SERVER_TMP} commit --no-verify -m '[DEPLOY] MUST NOT BE ON GITHUB'
clean-server-deploy:
rm -rf ${SERVER_TMP}
git worktree prune
push-s0:
git push -f s0 ${WORKING_BRANCH}:master
push-s1:
git push -f s1 ${WORKING_BRANCH}:master
push-s2:
git push -f s2 ${WORKING_BRANCH}:master
deploy-gh-pages:
(git checkout -B gh-pages && \
git merge master && \
git push -f origin gh-pages:gh-pages) || git checkout master
git checkout master
rm -rf ${FRONTEND_TMP}
git worktree prune
GATSBY_BASE_URL=https://img.shields.io \
INCLUDE_DEV_PAGES=false \
npm run build
git worktree add -B gh-pages ${FRONTEND_TMP}
git -C ${FRONTEND_TMP} ls-files | xargs git -C ${FRONTEND_TMP} rm
git -C ${FRONTEND_TMP} commit --no-verify -m '[DEPLOY] Completely clean the index'
cp -r public/* ${FRONTEND_TMP}
echo shields.io > ${FRONTEND_TMP}/CNAME
touch ${FRONTEND_TMP}/.nojekyll
git -C ${FRONTEND_TMP} add .
git -C ${FRONTEND_TMP} commit --no-verify -m '[DEPLOY] Add built site'
git push -f origin gh-pages
deploy-heroku:
git add -f Verdana.ttf
git add -f secret.json
git commit -m'MUST NOT BE ON GITHUB'
git push -f heroku HEAD:master
git reset HEAD~1
(git checkout -B gh-pages && \
git merge master && \
git push -f origin gh-pages:gh-pages) || git checkout master
git checkout master
setup:
curl http://download.redis.io/releases/redis-2.8.8.tar.gz >redis.tar.gz \
&& tar xf redis.tar.gz \
&& rm redis.tar.gz \
&& mv redis-2.8.8 redis \
&& cd redis \
&& make
redis:
./redis/src/redis-server
deploy-gh-pages-clean:
rm -rf ${FRONTEND_TMP}
git worktree prune
test:
npm test
.PHONY: all favicon website deploy deploy-s0 deploy-s1 deploy-gh-pages deploy-heroku setup redis test
.PHONY: all deploy prepare-server-deploy clean-server-deploy deploy-s0 deploy-s1 deploy-s2 push-s0 push-s1 push-s2 deploy-gh-pages deploy-gh-pages-clean deploy-heroku setup redis test

1
Procfile Normal file
View File

@@ -0,0 +1 @@
web: npm run start:server:prod

307
README.md
View File

@@ -1,96 +1,241 @@
<p align="center">
<img src="https://rawgit.com/badges/shields/master/logo.svg"
height="130">
<img src="./frontend/images/logo.svg"
height="130">
</p>
<p align="center">
<a href="https://www.gratipay.com/Shields/">
<img src="https://img.shields.io/gratipay/team/shields.svg"
alt="Gratipay">
</a>
<a href="https://npmjs.org/package/gh-badges">
<img src="https://img.shields.io/npm/v/gh-badges.svg"
alt="npm version">
</a>
<a href="https://travis-ci.org/badges/shields">
<img src="https://img.shields.io/travis/badges/shields.svg"
alt="build status">
</a>
<a href="https://github.com/badges/shields/graphs/contributors" alt="Contributors">
<img src="https://img.shields.io/github/contributors/badges/shields.svg" /></a>
<a href="#backers" alt="Backers on Open Collective">
<img src="https://img.shields.io/opencollective/backers/shields.svg" /></a>
<a href="#sponsors" alt="Sponsors on Open Collective">
<img src="https://img.shields.io/opencollective/sponsors/shields.svg" /></a>
<a href="https://github.com/badges/shields/pulse" alt="Activity">
<img src="https://img.shields.io/github/commit-activity/m/badges/shields.svg" /></a>
<a href="https://circleci.com/gh/badges/shields/tree/master">
<img src="https://img.shields.io/circleci/project/github/badges/shields/master.svg" alt="build status"></a>
<a href="https://circleci.com/gh/badges/daily-tests">
<img src="https://img.shields.io/circleci/project/github/badges/daily-tests.svg?label=service%20tests"
alt="service-test status"></a>
<a href="https://coveralls.io/github/badges/shields">
<img src="https://img.shields.io/coveralls/github/badges/shields.svg"
alt="coverage"></a>
<a href="https://lgtm.com/projects/g/badges/shields/alerts/">
<img src="https://img.shields.io/lgtm/alerts/g/badges/shields.svg"
alt="Total alerts"/></a>
<a href="https://github.com/badges/shields/compare/gh-pages...master">
<img src="https://img.shields.io/github/commits-since/badges/shields/gh-pages.svg?label=commits%20to%20be%20deployed"
alt="commits to be deployed"></a>
<a href="https://discord.gg/HjJCwm5">
<img src="https://img.shields.io/discord/308323056592486420.svg?logo=discord"
alt="chat on Discord"></a>
<a href="https://twitter.com/intent/follow?screen_name=shields_io">
<img src="https://img.shields.io/twitter/follow/shields_io.svg?style=social&logo=twitter"
alt="follow on Twitter"></a>
</p>
<p align="center"><sup><strong>An image server for legible and concise information. Our <a href="http://shields.io/">Homepage</a> | <a href="https://twitter.com/shields_io">Twitter</a></strong></sup></p>
* **[INSTALL](INSTALL.md)** installation instructions.
* **[CONTRIBUTING](CONTRIBUTING.md)** project contribution guidelines.
* **[SPECIFICATION](spec/SPECIFICATION.md)** spec for the visual design of Shields badges.
* **[LICENSE](LICENSE.md)** public domain dedication.
This is home to [Shields.io][shields.io], a service for concise, consistent,
and legible badges in SVG and raster format, which can easily be included in
GitHub readmes or any other web page. The service supports dozens of
continuous integration services, package registries, distributions, app
stores, social networks, code coverage services, and code analysis services.
Every month it serves over 470 million images.
Make your own badges [here][badges]! (Quick guide: `https://img.shields.io/badge/left-right-f39f37.svg`.)
This repo hosts:
[badges]: <http://shields.io/#your-badge>
- The [Shields.io][shields.io] frontend and server code
- An [NPM library for generating badges][gh-badges]
- [documentation][gh-badges-docs]
- [changelog][gh-badges-changelog]
- The [badge design specification][badge-spec]
## Solving the problem
Many GitHub repositories sport badges for things like:
<table>
<tr>
<td><a href="https://travis-ci.org/"><strong>Travis CI</strong></a><p><sup>(build status)</sup></p></td>
<td><img src="http://f.cl.ly/items/2H233M0I0T43313c3h0C/Screen%20Shot%202013-01-30%20at%202.45.30%20AM.png" alt="Travis CI badge"></td>
</tr>
<tr>
<td><a href="https://gemnasium.com/"><strong>Gemnasium</strong></a><p><sup>(dependency checks)</sup></p></td>
<td><img src="http://f.cl.ly/items/2j1D2R0q2C3s1x2y3k09/Screen%20Shot%202013-01-30%20at%202.46.10%20AM.png" alt="Gemnasium badge"></td>
</tr>
<tr>
<td><a href="http://codeclimate.com"><strong>Code Climate</strong></a><p><sup>(static analysis)</sup></p></td>
<td><img src="http://f.cl.ly/items/0H2O1A3q2b3j1D2i0M3j/Screen%20Shot%202013-01-30%20at%202.46.47%20AM.png" alt="Code Climate badge"></td>
</tr>
<tr>
<td><a href="http://rubygems.org"><strong>RubyGems</strong></a><p><sup>(released gem version)</sup></p></td>
<td><img src="http://f.cl.ly/items/443X21151h1V301s2s3a/Screen%20Shot%202013-01-30%20at%202.47.10%20AM.png" alt="RubyGems badge"></td>
</tr>
</table>
As you can see from the zoomed 400% versions of these badges above, nobody is (really) using the same badge file and at normal size, they're hardly legible. Worst of all, they're completely inconsistent. The information provided isn't of the same kind on each badge. The context is blurry, which doesn't make for a straightforward understanding of how these badges are relevant to the project they're attached to and what information they provide.
## The Shields solution
As you can see below, without increasing the footprint of these badges, I've tried to increase legibility and coherence, removing useless text to decrease the horizontal length in the (likely) scenario that more of these badge thingies crop up on READMEs all across the land.
![Badge design](spec/proportions.png)
This badge design corresponds to an old and now deprecated version which has since been replaced by beautiful and scalable SVG versions that can be found on [shields.io](http://shields.io).
[shields.io]: https://shields.io/
[gh-badges]: https://www.npmjs.com/package/gh-badges
[badge-spec]: https://github.com/badges/shields/tree/master/spec
[gh-badges-docs]: https://github.com/badges/shields/tree/master/gh-badges/README.md
[gh-badges-changelog]: https://github.com/badges/shields/tree/master/gh-badges/CHANGELOG.md
## Examples
What kind of metadata can you convey using badges?
* test build status: `build | failing`
* code coverage percentage: `coverage | 80%`
* stable release version: `version | 1.2.3`
* package manager release: `gem | 1.2.3`
* status of third-party dependencies: `dependencies | out-of-date`
* static code analysis GPA: `code climate | 3.8`
* [SemVer](http://semver.org/) version observance: `semver | 2.0.0`
* amount of [Gratipay](http://gratipay.com) donations per week: `tips | $2/week`
## Services using the Shields standard
* [Badger](https://github.com/badges/badgerbadgerbadger)
* [badges2svg](https://github.com/bfontaine/badges2svg)
* [Codacy](https://www.codacy.com)
* [Code Climate](https://codeclimate.com/changelog/510d4fde56b102523a0004bf)
* [Coveralls](https://coveralls.io/)
* [Forkability](http://basicallydan.github.io/forkability/)
* [Gemnasium](http://support.gemnasium.com/forums/236528-general/suggestions/5518400-use-svg-for-badges-so-they-still-look-sharp-on-r)
* [GoDoc](https://godoc.org/)
* [PHPPackages](https://phppackages.org)
* [Read the Docs](https://readthedocs.org/)
* [reposs](https://github.com/rexfinn/reposs)
* [ruby-gem-downloads-badge](https://github.com/bogdanRada/ruby-gem-downloads-badge/)
* [Scrutinizer](https://scrutinizer-ci.com/)
* [Semaphore](https://semaphoreapp.com)
* [Travis CI](https://github.com/travis-ci/travis-ci/issues/630#issuecomment-38054967)
* [Version Badge](http://badge.fury.io/)
* [VersionEye](https://www.versioneye.com/)
- code coverage percentage: ![coverage](https://img.shields.io/badge/coverage-80%25-yellowgreen.svg?cacheSeconds=2592000)
- stable release version: ![version](https://img.shields.io/badge/version-1.2.3-blue.svg?cacheSeconds=2592000)
- package manager release: ![gem](https://img.shields.io/badge/gem-2.2.0-blue.svg?cacheSeconds=2592000)
- status of third-party dependencies: ![dependencies](https://img.shields.io/badge/dependencies-out%20of%20date-orange.svg?cacheSeconds=2592000)
- static code analysis grade: ![codacy](https://img.shields.io/badge/codacy-B-green.svg?cacheSeconds=2592000)
- [SemVer](https://semver.org/) version observance: ![semver](https://img.shields.io/badge/semver-2.0.0-blue.svg?cacheSeconds=2592000)
- amount of [Liberapay](https://liberapay.com/) donations per week: ![receives](https://img.shields.io/badge/receives-2.00%20USD%2Fweek-yellow.svg?cacheSeconds=2592000)
- Python package downloads: ![downloads](https://img.shields.io/badge/downloads-13k%2Fmonth-brightgreen.svg?cacheSeconds=2592000)
- Chrome Web Store extension rating: ![rating](https://img.shields.io/badge/rating-★★★★☆-brightgreen.svg?cacheSeconds=2592000)
- [Uptime Robot](https://uptimerobot.com) percentage: ![uptime](https://img.shields.io/badge/uptime-100%25-brightgreen.svg?cacheSeconds=2592000)
# Legal
[Make your own badges!][custom badges]
(Quick example: `https://img.shields.io/badge/left-right-f39f37.svg`)
All assets and code are under the [CC0 LICENSE](LICENSE.md) and in the public
Browse a [complete list of badges][shields.io].
[custom badges]: http://shields.io/#your-badge
## Contributing
Shields is a community project. We invite your participation through issues
and pull requests! You can peruse the [contributing guidelines][contributing].
When adding or changing a service [please add tests][service-tests].
This project has quite a backlog of suggestions! If you're new to the project,
maybe you'd like to open a pull request to address one of them:
[![GitHub issues by-label](https://img.shields.io/github/issues/badges/shields/good%20first%20issue.svg)](https://github.com/badges/shields/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
You can read a [tutorial on how to add a badge][tutorial].
[service-tests]: https://github.com/badges/shields/blob/master/doc/service-tests.md
[tutorial]: doc/TUTORIAL.md
[contributing]: CONTRIBUTING.md
## Development
1. Install Node 8 or later. You can use the [package manager][] of your choice.
Tests need to pass in Node 8 and 10.
2. Clone this repository.
3. Run `npm ci` to install the dependencies.
4. Run `npm start` to start the badge server and the frontend dev server.
5. Open `http://localhost:3000/` to view the frontend.
When server source files change, the badge server should automatically restart
itself (using [nodemon][]). When the frontend files change, the frontend dev
server (`gatsby dev`) should also automatically reload. However the badge
definitions are built only before the server first starts. To regenerate those,
either run `npm run defs` or manually restart the server.
To debug a badge from the command line, run `npm run badge -- /npm/v/nock.svg`.
It also works with full URLs like
`npm run badge -- https://img.shields.io/npm/v/nock.svg`.
Use `npm run debug:server` to start server in debug mode.
[This recipe][nodemon debug] shows how to debug Node.js application in [VS Code][].
Shields has experimental support for [Gitpod Beta][gitpod], a pre-configured development
environment that runs in your browser. To use Gitpod, click the button below and
sign in with GitHub. Gitpod also offers a browser add-on, though it is not required.
Please report any Gitpod bugs, questions, or suggestions in issue
[#2772](https://github.com/badges/shields/issues/2772).
[![Edit with Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/badges/shields)
[Snapshot tests][] ensure we don't inadvertently make changes that affect the
SVG or JSON output. When deliberately changing the output, run
`SNAPSHOT_DRY=1 npm run test:js:server` to preview changes to the saved
snapshots, and `SNAPSHOT_UPDATE=1 npm run test:js:server` to update them.
The server can be configured to use [Sentry][] ([configuration][sentry configuration]) and [Prometheus][] ([configuration][prometheus configuration]).
Daily tests, including a full run of the service tests and overall code coverage, are run via [badges/daily-tests][daily-tests].
[package manager]: https://nodejs.org/en/download/package-manager/
[gitpod]: https://www.gitpod.io/
[snapshot tests]: https://glebbahmutov.com/blog/snapshot-testing/
[prometheus]: https://prometheus.io/
[prometheus configuration]: doc/self-hosting.md#prometheus
[sentry]: https://sentry.io/
[sentry configuration]: doc/self-hosting.md#sentry
[daily-tests]: https://github.com/badges/daily-tests
[nodemon]: https://nodemon.io/
[nodemon debug]: https://github.com/Microsoft/vscode-recipes/tree/master/nodemon
[vs code]: https://code.visualstudio.com/
## Hosting your own server
There is documentation about [hosting your own server][self-hosting].
[self-hosting]: doc/self-hosting.md
## History
b.adge.me was the original website for this service. Heroku back then had a
thing which made it hard to use a toplevel domain with it, hence the odd
domain. It used code developed in 2013 from a library called
[gh-badges][old-gh-badges], both developed by [Thaddée Tyl][espadrine].
The project merged with shields.io by making it use the b.adge.me code
and closed b.adge.me.
The original badge specification was developed in 2013 by
[Olivier Lacan][olivierlacan]. It was inspired by the Travis CI and similar
badges (there were a lot fewer, back then). In 2014 Thaddée Tyl redesigned
it with help from a Travis CI employee and convinced everyone to switch to
it. The old design is what today is called the plastic style; the new one
is the flat style.
You can read more about [the project's inception][thread],
[the motivation of the SVG badge specification][motivation], and
[the specification itself][spec].
[olivierlacan]: https://github.com/olivierlacan
[espadrine]: https://github.com/espadrine
[old-gh-badges]: https://github.com/badges/gh-badges
[motivation]: spec/motivation.md
[spec]: spec/SPECIFICATION.md
[thread]: https://github.com/h5bp/lazyweb-requests/issues/150
## Project leaders
Maintainers:
- [calebcartwright](https://github.com/calebcartwright) (core team)
- [chris48s](https://github.com/chris48s) (core team)
- [Daniel15](https://github.com/Daniel15) (core team)
- [espadrine](https://github.com/espadrine) (core team)
- [paulmelnikow](https://github.com/paulmelnikow) (core team)
- [platan](https://github.com/platan) (core team)
- [PyvesB](https://github.com/PyvesB) (core team)
- [RedSparr0w](https://github.com/RedSparr0w) (core team)
Operations:
- [espadrine](https://github.com/espadrine) (sysadmin)
- [paulmelnikow](https://github.com/paulmelnikow) (limited access)
Alumni:
- [olivierlacan](https://github.com/olivierlacan)
## Related projects
- [badgerbadgerbadger gem][gem]
- [pybadges python library][pybadges]
[gem]: https://github.com/badges/badgerbadgerbadger
[pybadges]: https://github.com/google/pybadges
## License
All assets and code are under the [CC0 LICENSE](LICENSE) and in the public
domain unless specified otherwise.
The assets in `logo/` are trademarks of their respective companies and are under
their terms and license.
The assets in `logo/` are trademarks of their respective companies and are
under their terms and license.
## Contributors
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
<a href="https://github.com/badges/shields/graphs/contributors"><img src="https://opencollective.com/shields/contributors.svg?width=890" /></a>
## Backers
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/shields#backer)]
<a href="https://opencollective.com/shields#backers" target="_blank"><img src="https://opencollective.com/shields/backers.svg?width=890"></a>
## Sponsors
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/shields#sponsor)]
<a href="https://opencollective.com/shields/sponsor/0/website" target="_blank"><img src="https://opencollective.com/shields/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/shields/sponsor/1/website" target="_blank"><img src="https://opencollective.com/shields/sponsor/1/avatar.svg"></a>
<a href="https://opencollective.com/shields/sponsor/2/website" target="_blank"><img src="https://opencollective.com/shields/sponsor/2/avatar.svg"></a>
<a href="https://opencollective.com/shields/sponsor/3/website" target="_blank"><img src="https://opencollective.com/shields/sponsor/3/avatar.svg"></a>
<a href="https://opencollective.com/shields/sponsor/4/website" target="_blank"><img src="https://opencollective.com/shields/sponsor/4/avatar.svg"></a>
<a href="https://opencollective.com/shields/sponsor/5/website" target="_blank"><img src="https://opencollective.com/shields/sponsor/5/avatar.svg"></a>
<a href="https://opencollective.com/shields/sponsor/6/website" target="_blank"><img src="https://opencollective.com/shields/sponsor/6/avatar.svg"></a>
<a href="https://opencollective.com/shields/sponsor/7/website" target="_blank"><img src="https://opencollective.com/shields/sponsor/7/avatar.svg"></a>
<a href="https://opencollective.com/shields/sponsor/8/website" target="_blank"><img src="https://opencollective.com/shields/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/shields/sponsor/9/website" target="_blank"><img src="https://opencollective.com/shields/sponsor/9/avatar.svg"></a>

View File

@@ -0,0 +1,19 @@
exports['The badge generator SVG should always produce the same SVG (unless we have changed something!) 1'] = `
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="90" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="90" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h45v20H0z"/><path fill="#4c1" d="M45 0h45v20H45z"/><path fill="url(#b)" d="M0 0h90v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="235" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="350">cactus</text><text x="235" y="140" transform="scale(.1)" textLength="350">cactus</text><text x="665" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="350">grown</text><text x="665" y="140" transform="scale(.1)" textLength="350">grown</text></g> </svg>
`
exports['The badge generator badges with logos should always produce the same badge shields GitHub logo custom color (whitesmoke) 1'] = `
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="113" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="113" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h54v20H0z"/><path fill="#4c1" d="M54 0h59v20H54z"/><path fill="url(#b)" d="M0 0h113v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"><image x="5" y="3" width="14" height="14" xlink:href="github"/> <text x="365" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="270">label</text><text x="365" y="140" transform="scale(.1)" textLength="270">label</text><text x="825" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="490">message</text><text x="825" y="140" transform="scale(.1)" textLength="490">message</text></g> </svg>
`
exports['The badge generator badges with logos should always produce the same badge shields GitHub logo default color (#333333) 1'] = `
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="113" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="113" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h54v20H0z"/><path fill="#4c1" d="M54 0h59v20H54z"/><path fill="url(#b)" d="M0 0h113v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"><image x="5" y="3" width="14" height="14" xlink:href="github"/> <text x="365" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="270">label</text><text x="365" y="140" transform="scale(.1)" textLength="270">label</text><text x="825" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="490">message</text><text x="825" y="140" transform="scale(.1)" textLength="490">message</text></g> </svg>
`
exports['The badge generator badges with logos should always produce the same badge simple-icons javascript logo custom color (rgba(46,204,113,0.8)) 1'] = `
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="113" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="113" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h54v20H0z"/><path fill="#4c1" d="M54 0h59v20H54z"/><path fill="url(#b)" d="M0 0h113v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"><image x="5" y="3" width="14" height="14" xlink:href="javascript"/> <text x="365" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="270">label</text><text x="365" y="140" transform="scale(.1)" textLength="270">label</text><text x="825" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="490">message</text><text x="825" y="140" transform="scale(.1)" textLength="490">message</text></g> </svg>
`
exports['The badge generator badges with logos should always produce the same badge simple-icons javascript logo default color (#F7DF1E) 1'] = `
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="113" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="113" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h54v20H0z"/><path fill="#4c1" d="M54 0h59v20H54z"/><path fill="url(#b)" d="M0 0h113v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"><image x="5" y="3" width="14" height="14" xlink:href="javascript"/> <text x="365" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="270">label</text><text x="365" y="140" transform="scale(.1)" textLength="270">label</text><text x="825" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="490">message</text><text x="825" y="140" transform="scale(.1)" textLength="490">message</text></g> </svg>
`

24
app.json Normal file
View File

@@ -0,0 +1,24 @@
{
"name": "Shields",
"description": "Concise, consistent, and legible badges in SVG and raster format.",
"keywords": ["badge", "github", "svg", "status"],
"website": "https://shields.io/",
"repository": "https://github.com/badges/shields",
"logo": "http://shields.io/favicon.png",
"env": {
"WHEELMAP_TOKEN": {
"description": "Configure the token to be used for the Wheelmap service.",
"required": false
},
"GH_TOKEN": {
"description": "Configure the token to be used for the GitHub services.",
"required": false
}
},
"formation": {
"web": {
"quantity": 1,
"size": "free"
}
}
}

102
badge.js
View File

@@ -1,102 +0,0 @@
var fs = require('fs');
var path = require('path');
var SVGO = require('svgo');
var dot = require('dot');
var measureTextWidth = require('./measure-text');
// cache templates.
var templates = {};
var templateFiles = fs.readdirSync(path.join(__dirname, 'templates'));
dot.templateSettings.strip = false; // Do not strip whitespace.
templateFiles.forEach(function(filename) {
if (filename[0] === '.') { return; }
var templateData = fs.readFileSync(
path.join(__dirname, 'templates', filename)).toString();
var extension = filename.split('.').pop();
var style = filename.slice(0, -(('-template.' + extension).length));
templates[style + '-' + extension] = dot.template(templateData);
});
function escapeXml(s) {
return s.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&apos;');
}
function capitalize(s) {
return s[0].toUpperCase() + s.slice(1);
}
function addEscapers(data) {
data.escapeXml = escapeXml;
data.capitalize = capitalize;
}
var colorscheme = require(path.join(__dirname, 'colorscheme.json'));
function optimize(string, callback) {
var svgo = new SVGO();
svgo.optimize(string, callback);
}
function makeImage(data, cb) {
if (data.format !== 'json') {
data.format = 'svg';
}
if (!(data.template + '-' + data.format in templates)) {
data.template = 'default';
}
if (data.colorscheme) {
var pickedColorscheme = colorscheme[data.colorscheme];
if (!pickedColorscheme) {
pickedColorscheme = colorscheme.red;
}
data.colorA = pickedColorscheme.colorA;
data.colorB = pickedColorscheme.colorB;
}
// Logo.
data.logoWidth = +data.logoWidth || (data.logo? 14: 0);
data.logoPadding = (data.logo? 3: 0);
// String coercion.
data.text[0] = '' + data.text[0];
data.text[1] = '' + data.text[1];
if (data.text[0].length === 0) {
data.logoPadding = 0;
}
var textWidth1 = (measureTextWidth(data.text[0])|0);
var textWidth2 = (measureTextWidth(data.text[1])|0);
// Increase chances of pixel grid alignment.
if (textWidth1 % 2 === 0) { textWidth1++; }
if (textWidth2 % 2 === 0) { textWidth2++; }
data.widths = [
textWidth1 + 10 + data.logoWidth + data.logoPadding,
textWidth2 + 10,
];
if (data.links === undefined) {
data.links = ['', ''];
} else {
for (var i = 0; i < data.links.length; i++) {
data.links[i] = escapeXml(data.links[i]);
}
}
var template = templates[data.template + '-' + data.format];
addEscapers(data);
try {
var result = template(data);
} catch(e) {
cb('', e);
return;
}
if (data.format === 'json') {
cb(result);
} else {
// Run the SVG through SVGO.
optimize(result, function(object) { cb(object.data); });
}
}
module.exports = makeImage;
module.exports.loadFont = measureTextWidth.loadFont;

View File

@@ -1,13 +0,0 @@
{
"brightgreen": { "colorB": "#4c1" },
"green": { "colorB": "#97CA00" },
"yellow": { "colorB": "#dfb317" },
"yellowgreen": { "colorB": "#a4a61d" },
"orange": { "colorB": "#fe7d37" },
"red": { "colorB": "#e05d44" },
"blue": { "colorB": "#007ec6" },
"grey": { "colorB": "#555" },
"gray": { "colorB": "#555" },
"lightgrey": { "colorB": "#9f9f9f" },
"lightgray": { "colorB": "#9f9f9f" }
}

View File

@@ -0,0 +1,64 @@
public:
bind:
address: 'BIND_ADDRESS'
port: 'PORT'
metrics:
prometheus:
enabled: 'METRICS_PROMETHEUS_ENABLED'
ssl:
isSecure: 'HTTPS'
key: 'HTTPS_KEY'
cert: 'HTTPS_CRT'
redirectUri: 'REDIRECT_URI'
cors:
allowedOrigin:
__name: 'ALLOWED_ORIGIN'
__format: 'json'
persistence:
dir: 'PERSISTENCE_DIR'
redisUrl: 'REDIS_URL'
services:
github:
baseUri: 'GITHUB_URL'
debug:
enabled: 'GITHUB_DEBUG_ENABLED'
intervalSeconds: 'GITHUB_DEBUG_INTERVAL_SECONDS'
trace: 'TRACE_SERVICES'
profiling:
makeBadge: 'PROFILE_MAKE_BADGE'
cacheHeaders:
defaultCacheLengthSeconds: 'BADGE_MAX_AGE_SECONDS'
rateLimit: 'RATE_LIMIT'
fetchLimit: 'FETCH_LIMIT'
private:
azure_devops_token: 'AZURE_DEVOPS_TOKEN'
bintray_user: 'BINTRAY_USER'
bintray_apikey: 'BINTRAY_API_KEY'
drone_token: 'DRONE_TOKEN'
gh_client_id: 'GH_CLIENT_ID'
gh_client_secret: 'GH_CLIENT_SECRET'
gh_token: 'GH_TOKEN'
jenkins_user: 'JENKINS_USER'
jenkins_pass: 'JENKINS_PASS'
jira_user: 'JIRA_USER'
jira_pass: 'JIRA_PASS'
nexus_user: 'NEXUS_USER'
nexus_pass: 'NEXUS_PASS'
npm_token: 'NPM_TOKEN'
sentry_dsn: 'SENTRY_DSN'
shields_secret: 'SHIELDS_SECRET'
sl_insight_userUuid: 'SL_INSIGHT_USER_UUID'
sl_insight_apiToken: 'SL_INSIGHT_API_TOKEN'
sonarqube_token: 'SONARQUBE_TOKEN'
wheelmap_token: 'WHEELMAP_TOKEN'

38
config/default.yml Normal file
View File

@@ -0,0 +1,38 @@
public:
bind:
address: '::'
metrics:
prometheus:
enabled: false
ssl:
isSecure: false
cors:
allowedOrigin: []
persistence:
dir: './private'
services:
github:
baseUri: 'https://api.github.com/'
debug:
enabled: false
intervalSeconds: 200
trace: false
profiling:
makeBadge: false
cacheHeaders:
defaultCacheLengthSeconds: 120
rateLimit: true
handleInternalErrors: true
fetchLimit: '10MB'
private: {}

10
config/development.yml Normal file
View File

@@ -0,0 +1,10 @@
public:
bind:
address: 'localhost'
cors:
allowedOrigin: ['http://localhost:3000']
rateLimit: false
handleInternalErrors: false

View File

@@ -0,0 +1,10 @@
private:
bintray_user: ...
bintray_apikey: ...
gh_client_id: ...
gh_client_secret: ...
sentry_dsn: ...
shields_secret: ...
sl_insight_userUuid: ...
sl_insight_apiToken: ...
wheelmap_token: ...

View File

@@ -0,0 +1,8 @@
# Copy this file to `config/local.yml` and fill it in! It will be gitignored.
private:
# The possible values are documented in `doc/server-secrets.md`. Note that
# you can also set these values through environment variables, which may be
# preferable for self hosting.
gh_token: '...'
wheelmap_token: '...'

3
config/production.yml Normal file
View File

@@ -0,0 +1,3 @@
public:
bind:
address: '0.0.0.0'

View File

@@ -0,0 +1,16 @@
public:
metrics:
prometheus:
enabled: true
ssl:
isSecure: true
cors:
allowedOrigin: ['http://shields.io', 'https://shields.io']
redirectUrl: 'https://shields.io/'
private:
# These are not really private; they should be moved to `public`.
shields_ips: ['192.99.59.72', '51.254.114.150', '149.56.96.133']

10
config/test.yml Normal file
View File

@@ -0,0 +1,10 @@
public:
bind:
address: 'localhost'
port: 1111
rateLimit: false
redirectUrl: 'http://badge-server.example.com'
handleInternalErrors: false

View File

@@ -0,0 +1,144 @@
'use strict'
const queryString = require('query-string')
const pathToRegexp = require('path-to-regexp')
function badgeUrlFromPath({
baseUrl = '',
path,
queryParams,
style,
format = 'svg',
longCache = false,
}) {
const outExt = format.length ? `.${format}` : ''
const outQueryString = queryString.stringify({
cacheSeconds: longCache ? '2592000' : undefined,
style,
...queryParams,
})
const suffix = outQueryString ? `?${outQueryString}` : ''
return `${baseUrl}${path}${outExt}${suffix}`
}
function badgeUrlFromPattern({
baseUrl = '',
pattern,
namedParams,
queryParams,
style,
format = 'svg',
longCache = false,
}) {
const toPath = pathToRegexp.compile(pattern, {
strict: true,
sensitive: true,
})
const path = toPath(namedParams)
return badgeUrlFromPath({
baseUrl,
path,
queryParams,
style,
format,
longCache,
})
}
function encodeField(s) {
return encodeURIComponent(s.replace(/-/g, '--').replace(/_/g, '__'))
}
function staticBadgeUrl({
baseUrl = '',
label,
message,
color = 'lightgray',
style,
namedLogo,
format = 'svg',
}) {
const path = [label, message, color].map(encodeField).join('-')
const outQueryString = queryString.stringify({
style,
logo: namedLogo,
})
const suffix = outQueryString ? `?${outQueryString}` : ''
return `${baseUrl}/badge/${path}.${format}${suffix}`
}
function queryStringStaticBadgeUrl({
baseUrl = '',
label,
message,
color,
labelColor,
style,
namedLogo,
logoColor,
logoWidth,
logoPosition,
format = 'svg',
}) {
// schemaVersion could be a parameter if we iterate on it,
// for now it's hardcoded to the only supported version.
const schemaVersion = '1'
const suffix = `?${queryString.stringify({
label,
message,
color,
labelColor,
style,
logo: namedLogo,
logoColor,
logoWidth,
logoPosition,
})}`
return `${baseUrl}/static/v${schemaVersion}.${format}${suffix}`
}
function dynamicBadgeUrl({
baseUrl,
datatype,
label,
dataUrl,
query,
prefix,
suffix,
color,
style,
format = 'svg',
}) {
const queryParams = {
label,
url: dataUrl,
query,
style,
}
if (color) {
queryParams.color = color
}
if (prefix) {
queryParams.prefix = prefix
}
if (suffix) {
queryParams.suffix = suffix
}
const outQueryString = queryString.stringify(queryParams)
return `${baseUrl}/badge/dynamic/${datatype}.${format}?${outQueryString}`
}
module.exports = {
badgeUrlFromPath,
badgeUrlFromPattern,
encodeField,
staticBadgeUrl,
queryStringStaticBadgeUrl,
dynamicBadgeUrl,
}

View File

@@ -0,0 +1,159 @@
'use strict'
const { test, given } = require('sazerac')
const {
badgeUrlFromPath,
badgeUrlFromPattern,
encodeField,
staticBadgeUrl,
queryStringStaticBadgeUrl,
dynamicBadgeUrl,
} = require('./make-badge-url')
describe('Badge URL generation functions', function() {
test(badgeUrlFromPath, () => {
given({
baseUrl: 'http://example.com',
path: '/npm/v/gh-badges',
style: 'flat-square',
longCache: true,
}).expect(
'http://example.com/npm/v/gh-badges.svg?cacheSeconds=2592000&style=flat-square'
)
})
test(badgeUrlFromPattern, () => {
given({
baseUrl: 'http://example.com',
pattern: '/npm/v/:packageName',
namedParams: { packageName: 'gh-badges' },
style: 'flat-square',
longCache: true,
}).expect(
'http://example.com/npm/v/gh-badges.svg?cacheSeconds=2592000&style=flat-square'
)
})
test(encodeField, () => {
given('foo').expect('foo')
given('').expect('')
given('happy go lucky').expect('happy%20go%20lucky')
given('do-right').expect('do--right')
given('it_is_a_snake').expect('it__is__a__snake')
})
test(staticBadgeUrl, () => {
given({
label: 'foo',
message: 'bar',
color: 'blue',
style: 'flat-square',
}).expect('/badge/foo-bar-blue.svg?style=flat-square')
given({
label: 'foo',
message: 'bar',
color: 'blue',
style: 'flat-square',
format: 'png',
namedLogo: 'github',
}).expect('/badge/foo-bar-blue.png?logo=github&style=flat-square')
given({
label: 'Hello World',
message: 'Привет Мир',
color: '#aabbcc',
}).expect(
'/badge/Hello%20World-%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82%20%D0%9C%D0%B8%D1%80-%23aabbcc.svg'
)
given({
label: '123-123',
message: 'abc-abc',
color: 'blue',
}).expect('/badge/123--123-abc--abc-blue.svg')
given({
label: '123-123',
message: '',
color: 'blue',
style: 'social',
}).expect('/badge/123--123--blue.svg?style=social')
given({
label: '',
message: 'blue',
color: 'blue',
}).expect('/badge/-blue-blue.svg')
})
test(queryStringStaticBadgeUrl, () => {
// the query-string library sorts parameters by name
given({
label: 'foo',
message: 'bar',
color: 'blue',
style: 'flat-square',
}).expect(
'/static/v1.svg?color=blue&label=foo&message=bar&style=flat-square'
)
given({
label: 'foo Bar',
message: 'bar Baz',
color: 'blue',
style: 'flat-square',
format: 'png',
namedLogo: 'github',
}).expect(
'/static/v1.png?color=blue&label=foo%20Bar&logo=github&message=bar%20Baz&style=flat-square'
)
given({
label: 'Hello World',
message: 'Привет Мир',
color: '#aabbcc',
}).expect(
'/static/v1.svg?color=%23aabbcc&label=Hello%20World&message=%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82%20%D0%9C%D0%B8%D1%80'
)
})
test(dynamicBadgeUrl, () => {
const dataUrl = 'http://example.com/foo.json'
const query = '$.bar'
const prefix = 'value: '
given({
baseUrl: 'http://img.example.com',
datatype: 'json',
label: 'foo',
dataUrl,
query,
prefix,
style: 'plastic',
}).expect(
[
'http://img.example.com/badge/dynamic/json.svg',
'?label=foo',
`&prefix=${encodeURIComponent(prefix)}`,
`&query=${encodeURIComponent(query)}`,
'&style=plastic',
`&url=${encodeURIComponent(dataUrl)}`,
].join('')
)
const suffix = '<- value'
const color = 'blue'
given({
baseUrl: 'http://img.example.com',
datatype: 'json',
label: 'foo',
dataUrl,
query,
suffix,
color,
style: 'plastic',
}).expect(
[
'http://img.example.com/badge/dynamic/json.svg',
'?color=blue',
'&label=foo',
`&query=${encodeURIComponent(query)}`,
'&style=plastic',
`&suffix=${encodeURIComponent(suffix)}`,
`&url=${encodeURIComponent(dataUrl)}`,
].join('')
)
})
})

View File

@@ -0,0 +1,21 @@
'use strict'
// Escapes `t` using the format specified in
// <https://github.com/espadrine/gh-badges/issues/12#issuecomment-31518129>
function escapeFormat(t) {
return (
t
// Inline single underscore.
.replace(/([^_])_([^_])/g, '$1 $2')
// Leading or trailing underscore.
.replace(/([^_])_$/, '$1 ')
.replace(/^_([^_])/, ' $1')
// Double underscore and double dash.
.replace(/__/g, '_')
.replace(/--/g, '-')
)
}
module.exports = {
escapeFormat,
}

View File

@@ -0,0 +1,43 @@
'use strict'
// See available emoji at http://emoji.muan.co/
const emojic = require('emojic')
const BaseService = require('./base')
const trace = require('./trace')
const { InvalidResponse } = require('./errors')
class BaseJsonService extends BaseService {
_parseJson(buffer) {
const logTrace = (...args) => trace.logTrace('fetch', ...args)
let json
try {
json = JSON.parse(buffer)
} catch (err) {
logTrace(emojic.dart, 'Response JSON (unparseable)', buffer)
throw new InvalidResponse({
prettyMessage: 'unparseable json response',
underlyingError: err,
})
}
logTrace(emojic.dart, 'Response JSON (before validation)', json, {
deep: true,
})
return json
}
async _requestJson({ schema, url, options = {}, errorMessages = {} }) {
const mergedOptions = {
...{ headers: { Accept: 'application/json' } },
...options,
}
const { buffer } = await this._request({
url,
options: mergedOptions,
errorMessages,
})
const json = this._parseJson(buffer)
return this.constructor._validate(json, schema)
}
}
module.exports = BaseJsonService

View File

@@ -0,0 +1,134 @@
'use strict'
const Joi = require('joi')
const { expect } = require('chai')
const sinon = require('sinon')
const BaseJsonService = require('./base-json')
const dummySchema = Joi.object({
requiredString: Joi.string().required(),
}).required()
class DummyJsonService extends BaseJsonService {
static get category() {
return 'cat'
}
static get route() {
return {
base: 'foo',
}
}
async handle() {
const { requiredString } = await this._requestJson({
schema: dummySchema,
url: 'http://example.com/foo.json',
})
return { message: requiredString }
}
}
describe('BaseJsonService', function() {
describe('Making requests', function() {
let sendAndCacheRequest
beforeEach(function() {
sendAndCacheRequest = sinon.stub().returns(
Promise.resolve({
buffer: '{"some": "json"}',
res: { statusCode: 200 },
})
)
})
it('invokes _sendAndCacheRequest', async function() {
await DummyJsonService.invoke(
{ sendAndCacheRequest },
{ handleInternalErrors: false }
)
expect(sendAndCacheRequest).to.have.been.calledOnceWith(
'http://example.com/foo.json',
{ headers: { Accept: 'application/json' } }
)
})
it('forwards options to _sendAndCacheRequest', async function() {
class WithOptions extends DummyJsonService {
async handle() {
const { value } = await this._requestJson({
schema: dummySchema,
url: 'http://example.com/foo.json',
options: { method: 'POST', qs: { queryParam: 123 } },
})
return { message: value }
}
}
await WithOptions.invoke(
{ sendAndCacheRequest },
{ handleInternalErrors: false }
)
expect(sendAndCacheRequest).to.have.been.calledOnceWith(
'http://example.com/foo.json',
{
headers: { Accept: 'application/json' },
method: 'POST',
qs: { queryParam: 123 },
}
)
})
})
describe('Making badges', function() {
it('handles valid json responses', async function() {
const sendAndCacheRequest = async () => ({
buffer: '{"requiredString": "some-string"}',
res: { statusCode: 200 },
})
expect(
await DummyJsonService.invoke(
{ sendAndCacheRequest },
{ handleInternalErrors: false }
)
).to.deep.equal({
message: 'some-string',
})
})
it('handles json responses which do not match the schema', async function() {
const sendAndCacheRequest = async () => ({
buffer: '{"unexpectedKey": "some-string"}',
res: { statusCode: 200 },
})
expect(
await DummyJsonService.invoke(
{ sendAndCacheRequest },
{ handleInternalErrors: false }
)
).to.deep.equal({
isError: true,
color: 'lightgray',
message: 'invalid response data',
})
})
it('handles unparseable json responses', async function() {
const sendAndCacheRequest = async () => ({
buffer: 'not json',
res: { statusCode: 200 },
})
expect(
await DummyJsonService.invoke(
{ sendAndCacheRequest },
{ handleInternalErrors: false }
)
).to.deep.equal({
isError: true,
color: 'lightgray',
message: 'unparseable json response',
})
})
})
})

View File

@@ -0,0 +1,70 @@
'use strict'
const makeBadge = require('../../gh-badges/lib/make-badge')
const BaseService = require('./base')
const { setCacheHeaders } = require('./cache-headers')
const { makeSend } = require('./legacy-result-sender')
const coalesceBadge = require('./coalesce-badge')
const { prepareRoute, namedParamsForMatch } = require('./route')
// Badges are subject to two independent types of caching: in-memory and
// downstream.
//
// Services deriving from `NonMemoryCachingBaseService` are not cached in
// memory on the server. This means that each request that hits the server
// triggers another call to the handler. When using badges for server
// diagnostics, that's useful!
//
// In contrast, The `handle()` function of most other `BaseService`
// subclasses is wrapped in onboard, in-memory caching. See `lib /request-
// handler.js` and `BaseService.prototype.register()`.
//
// All services, including those extending NonMemoryCachingBaseServices, may
// be cached _downstream_. This is governed by cache headers, which are
// configured by the service, the user's request, and the server's default
// cache length.
module.exports = class NonMemoryCachingBaseService extends BaseService {
static register({ camp, requestCounter }, serviceConfig) {
const { cacheHeaders: cacheHeaderConfig } = serviceConfig
const { _cacheLength: serviceDefaultCacheLengthSeconds } = this
const { regex, captureNames } = prepareRoute(this.route)
const serviceRequestCounter = this._createServiceRequestCounter({
requestCounter,
})
camp.route(regex, async (queryParams, match, end, ask) => {
const namedParams = namedParamsForMatch(captureNames, match, this)
const serviceData = await this.invoke(
{},
serviceConfig,
namedParams,
queryParams
)
const badgeData = coalesceBadge(
queryParams,
serviceData,
this.defaultBadgeData,
this
)
// The final capture group is the extension.
const format = match.slice(-1)[0]
badgeData.format = format
const svg = makeBadge(badgeData)
setCacheHeaders({
cacheHeaderConfig,
serviceDefaultCacheLengthSeconds,
queryParams,
res: ask.res,
})
makeSend(format, ask.res, end)(svg)
serviceRequestCounter.inc()
})
}
}

View File

@@ -0,0 +1,66 @@
'use strict'
const makeBadge = require('../../gh-badges/lib/make-badge')
const BaseService = require('./base')
const {
serverHasBeenUpSinceResourceCached,
setCacheHeadersForStaticResource,
} = require('./cache-headers')
const { makeSend } = require('./legacy-result-sender')
const coalesceBadge = require('./coalesce-badge')
const { prepareRoute, namedParamsForMatch } = require('./route')
module.exports = class BaseStaticService extends BaseService {
static register({ camp, requestCounter }, serviceConfig) {
const {
profiling: { makeBadge: shouldProfileMakeBadge },
} = serviceConfig
const { regex, captureNames } = prepareRoute(this.route)
const serviceRequestCounter = this._createServiceRequestCounter({
requestCounter,
})
camp.route(regex, async (queryParams, match, end, ask) => {
if (serverHasBeenUpSinceResourceCached(ask.req)) {
// Send Not Modified.
ask.res.statusCode = 304
ask.res.end()
return
}
const namedParams = namedParamsForMatch(captureNames, match, this)
const serviceData = await this.invoke(
{},
serviceConfig,
namedParams,
queryParams
)
const badgeData = coalesceBadge(
queryParams,
serviceData,
this.defaultBadgeData,
this
)
// The final capture group is the extension.
const format = match.slice(-1)[0]
badgeData.format = format
if (shouldProfileMakeBadge) {
console.time('makeBadge total')
}
const svg = makeBadge(badgeData)
if (shouldProfileMakeBadge) {
console.timeEnd('makeBadge total')
}
setCacheHeadersForStaticResource(ask.res)
makeSend(format, ask.res, end)(svg)
serviceRequestCounter.inc()
})
}
}

View File

@@ -0,0 +1,57 @@
'use strict'
// See available emoji at http://emoji.muan.co/
const emojic = require('emojic')
const BaseService = require('./base')
const trace = require('./trace')
const { InvalidResponse } = require('./errors')
const defaultValueMatcher = />([^<>]+)<\/text><\/g>/
const leadingWhitespace = /(?:\r\n\s*|\r\s*|\n\s*)/g
class BaseSvgScrapingService extends BaseService {
static valueFromSvgBadge(svg, valueMatcher = defaultValueMatcher) {
if (typeof svg !== 'string') {
throw new TypeError('Parameter should be a string')
}
const stripped = svg.replace(leadingWhitespace, '')
const match = valueMatcher.exec(stripped)
if (match) {
return match[1]
} else {
throw new InvalidResponse({
prettyMessage: 'unparseable svg response',
underlyingError: Error(`Can't get value from SVG:\n${svg}`),
})
}
}
async _requestSvg({
schema,
valueMatcher,
url,
options = {},
errorMessages = {},
}) {
const logTrace = (...args) => trace.logTrace('fetch', ...args)
const mergedOptions = {
...{ headers: { Accept: 'image/svg+xml' } },
...options,
}
const { buffer } = await this._request({
url,
options: mergedOptions,
errorMessages,
})
logTrace(emojic.dart, 'Response SVG', buffer)
const data = {
message: this.constructor.valueFromSvgBadge(buffer, valueMatcher),
}
logTrace(emojic.dart, 'Response SVG (before validation)', data, {
deep: true,
})
return this.constructor._validate(data, schema)
}
}
module.exports = BaseSvgScrapingService

View File

@@ -0,0 +1,167 @@
'use strict'
const { expect } = require('chai')
const sinon = require('sinon')
const Joi = require('joi')
const makeBadge = require('../../gh-badges/lib/make-badge')
const BaseSvgScrapingService = require('./base-svg-scraping')
function makeExampleSvg({ label, message }) {
return makeBadge({ text: ['this is the label', 'this is the result!'] })
}
const schema = Joi.object({
message: Joi.string().required(),
}).required()
class DummySvgScrapingService extends BaseSvgScrapingService {
static get category() {
return 'cat'
}
static get route() {
return {
base: 'foo',
}
}
async handle() {
return this._requestSvg({
schema,
url: 'http://example.com/foo.svg',
})
}
}
describe('BaseSvgScrapingService', function() {
const exampleLabel = 'this is the label'
const exampleMessage = 'this is the result!'
const exampleSvg = makeExampleSvg({
label: exampleLabel,
message: exampleMessage,
})
describe('valueFromSvgBadge', function() {
it('should find the correct value', function() {
expect(BaseSvgScrapingService.valueFromSvgBadge(exampleSvg)).to.equal(
exampleMessage
)
})
})
describe('Making requests', function() {
let sendAndCacheRequest
beforeEach(function() {
sendAndCacheRequest = sinon.stub().returns(
Promise.resolve({
buffer: exampleSvg,
res: { statusCode: 200 },
})
)
})
it('invokes _sendAndCacheRequest with the expected header', async function() {
await DummySvgScrapingService.invoke(
{ sendAndCacheRequest },
{ handleInternalErrors: false }
)
expect(sendAndCacheRequest).to.have.been.calledOnceWith(
'http://example.com/foo.svg',
{ headers: { Accept: 'image/svg+xml' } }
)
})
it('forwards options to _sendAndCacheRequest', async function() {
class WithCustomOptions extends DummySvgScrapingService {
async handle() {
const { message } = await this._requestSvg({
schema,
url: 'http://example.com/foo.svg',
options: {
method: 'POST',
qs: { queryParam: 123 },
},
})
return { message }
}
}
await WithCustomOptions.invoke(
{ sendAndCacheRequest },
{ handleInternalErrors: false }
)
expect(sendAndCacheRequest).to.have.been.calledOnceWith(
'http://example.com/foo.svg',
{
method: 'POST',
headers: { Accept: 'image/svg+xml' },
qs: { queryParam: 123 },
}
)
})
})
describe('Making badges', function() {
it('handles valid svg responses', async function() {
const sendAndCacheRequest = async () => ({
buffer: exampleSvg,
res: { statusCode: 200 },
})
expect(
await DummySvgScrapingService.invoke(
{ sendAndCacheRequest },
{ handleInternalErrors: false }
)
).to.deep.equal({
message: exampleMessage,
})
})
it('allows overriding the valueMatcher', async function() {
class WithValueMatcher extends BaseSvgScrapingService {
static get route() {
return {}
}
async handle() {
return this._requestSvg({
schema,
valueMatcher: />([^<>]+)<\/desc>/,
url: 'http://example.com/foo.svg',
})
}
}
const sendAndCacheRequest = async () => ({
buffer: '<desc>a different message</desc>',
res: { statusCode: 200 },
})
expect(
await WithValueMatcher.invoke(
{ sendAndCacheRequest },
{ handleInternalErrors: false }
)
).to.deep.equal({
message: 'a different message',
})
})
it('handles unparseable svg responses', async function() {
const sendAndCacheRequest = async () => ({
buffer: 'not svg yo',
res: { statusCode: 200 },
})
expect(
await DummySvgScrapingService.invoke(
{ sendAndCacheRequest },
{ handleInternalErrors: false }
)
).to.deep.equal({
isError: true,
color: 'lightgray',
message: 'unparseable svg response',
})
})
})
})

View File

@@ -0,0 +1,43 @@
'use strict'
// See available emoji at http://emoji.muan.co/
const emojic = require('emojic')
const fastXmlParser = require('fast-xml-parser')
const BaseService = require('./base')
const trace = require('./trace')
const { InvalidResponse } = require('./errors')
class BaseXmlService extends BaseService {
async _requestXml({
schema,
url,
options = {},
errorMessages = {},
parserOptions = {},
}) {
const logTrace = (...args) => trace.logTrace('fetch', ...args)
const mergedOptions = {
...{ headers: { Accept: 'application/xml, text/xml' } },
...options,
}
const { buffer } = await this._request({
url,
options: mergedOptions,
errorMessages,
})
const validateResult = fastXmlParser.validate(buffer)
if (validateResult !== true) {
throw new InvalidResponse({
prettyMessage: 'unparseable xml response',
underlyingError: validateResult.err,
})
}
const xml = fastXmlParser.parse(buffer, parserOptions)
logTrace(emojic.dart, 'Response XML (before validation)', xml, {
deep: true,
})
return this.constructor._validate(xml, schema)
}
}
module.exports = BaseXmlService

View File

@@ -0,0 +1,165 @@
'use strict'
const Joi = require('joi')
const { expect } = require('chai')
const sinon = require('sinon')
const BaseXmlService = require('./base-xml')
const dummySchema = Joi.object({
requiredString: Joi.string().required(),
}).required()
class DummyXmlService extends BaseXmlService {
static get category() {
return 'cat'
}
static get route() {
return {
base: 'foo',
}
}
async handle() {
const { requiredString } = await this._requestXml({
schema: dummySchema,
url: 'http://example.com/foo.xml',
})
return { message: requiredString }
}
}
describe('BaseXmlService', function() {
describe('Making requests', function() {
let sendAndCacheRequest
beforeEach(function() {
sendAndCacheRequest = sinon.stub().returns(
Promise.resolve({
buffer: '<requiredString>some-string</requiredString>',
res: { statusCode: 200 },
})
)
})
it('invokes _sendAndCacheRequest', async function() {
await DummyXmlService.invoke(
{ sendAndCacheRequest },
{ handleInternalErrors: false }
)
expect(sendAndCacheRequest).to.have.been.calledOnceWith(
'http://example.com/foo.xml',
{ headers: { Accept: 'application/xml, text/xml' } }
)
})
it('forwards options to _sendAndCacheRequest', async function() {
class WithCustomOptions extends BaseXmlService {
static get route() {
return {}
}
async handle() {
const { requiredString } = await this._requestXml({
schema: dummySchema,
url: 'http://example.com/foo.xml',
options: { method: 'POST', qs: { queryParam: 123 } },
})
return { message: requiredString }
}
}
await WithCustomOptions.invoke(
{ sendAndCacheRequest },
{ handleInternalErrors: false }
)
expect(sendAndCacheRequest).to.have.been.calledOnceWith(
'http://example.com/foo.xml',
{
headers: { Accept: 'application/xml, text/xml' },
method: 'POST',
qs: { queryParam: 123 },
}
)
})
})
describe('Making badges', function() {
it('handles valid xml responses', async function() {
const sendAndCacheRequest = async () => ({
buffer: '<requiredString>some-string</requiredString>',
res: { statusCode: 200 },
})
expect(
await DummyXmlService.invoke(
{ sendAndCacheRequest },
{ handleInternalErrors: false }
)
).to.deep.equal({
message: 'some-string',
})
})
it('parses XML response with custom parser options', async function() {
const customParserOption = { trimValues: false }
class DummyXmlServiceWithParserOption extends DummyXmlService {
async handle() {
const { requiredString } = await this._requestXml({
schema: dummySchema,
url: 'http://example.com/foo.xml',
parserOptions: customParserOption,
})
return { message: requiredString }
}
}
const sendAndCacheRequest = async () => ({
buffer:
'<requiredString>some-string with trailing whitespace </requiredString>',
res: { statusCode: 200 },
})
expect(
await DummyXmlServiceWithParserOption.invoke(
{ sendAndCacheRequest },
{ handleInternalErrors: false }
)
).to.deep.equal({
message: 'some-string with trailing whitespace ',
})
})
it('handles xml responses which do not match the schema', async function() {
const sendAndCacheRequest = async () => ({
buffer: '<unexpectedAttribute>some-string</unexpectedAttribute>',
res: { statusCode: 200 },
})
expect(
await DummyXmlService.invoke(
{ sendAndCacheRequest },
{ handleInternalErrors: false }
)
).to.deep.equal({
isError: true,
color: 'lightgray',
message: 'invalid response data',
})
})
it('handles unparseable xml responses', async function() {
const sendAndCacheRequest = async () => ({
buffer: 'not xml',
res: { statusCode: 200 },
})
expect(
await DummyXmlService.invoke(
{ sendAndCacheRequest },
{ handleInternalErrors: false }
)
).to.deep.equal({
isError: true,
color: 'lightgray',
message: 'unparseable xml response',
})
})
})
})

View File

@@ -0,0 +1,49 @@
'use strict'
const emojic = require('emojic')
const yaml = require('js-yaml')
const BaseService = require('./base')
const { InvalidResponse } = require('./errors')
const trace = require('./trace')
class BaseYamlService extends BaseService {
async _requestYaml({
schema,
url,
options = {},
errorMessages = {},
encoding = 'utf8',
}) {
const logTrace = (...args) => trace.logTrace('fetch', ...args)
const mergedOptions = {
...{
headers: {
Accept:
'text/x-yaml, text/yaml, application/x-yaml, application/yaml, text/plain',
},
},
...options,
}
const { buffer } = await this._request({
url,
options: mergedOptions,
errorMessages,
})
let parsed
try {
parsed = yaml.safeLoad(buffer.toString(), encoding)
} catch (err) {
logTrace(emojic.dart, 'Response YAML (unparseable)', buffer)
throw new InvalidResponse({
prettyMessage: 'unparseable yaml response',
underlyingError: err,
})
}
logTrace(emojic.dart, 'Response YAML (before validation)', parsed, {
deep: true,
})
return this.constructor._validate(parsed, schema)
}
}
module.exports = BaseYamlService

View File

@@ -0,0 +1,158 @@
'use strict'
const Joi = require('joi')
const { expect } = require('chai')
const sinon = require('sinon')
const BaseYamlService = require('./base-yaml')
const dummySchema = Joi.object({
requiredString: Joi.string().required(),
}).required()
class DummyYamlService extends BaseYamlService {
static get category() {
return 'cat'
}
static get route() {
return {
base: 'foo',
}
}
async handle() {
const { requiredString } = await this._requestYaml({
schema: dummySchema,
url: 'http://example.com/foo.yaml',
})
return { message: requiredString }
}
}
const expectedYaml = `
---
requiredString: some-string
`
const unexpectedYaml = `
---
unexpectedKey: some-string
`
const invalidYaml = `
---
foo: bar
foo: baz
`
describe('BaseYamlService', function() {
describe('Making requests', function() {
let sendAndCacheRequest
beforeEach(function() {
sendAndCacheRequest = sinon.stub().returns(
Promise.resolve({
buffer: expectedYaml,
res: { statusCode: 200 },
})
)
})
it('invokes _sendAndCacheRequest', async function() {
await DummyYamlService.invoke(
{ sendAndCacheRequest },
{ handleInternalErrors: false }
)
expect(sendAndCacheRequest).to.have.been.calledOnceWith(
'http://example.com/foo.yaml',
{
headers: {
Accept:
'text/x-yaml, text/yaml, application/x-yaml, application/yaml, text/plain',
},
}
)
})
it('forwards options to _sendAndCacheRequest', async function() {
class WithOptions extends DummyYamlService {
async handle() {
const { requiredString } = await this._requestYaml({
schema: dummySchema,
url: 'http://example.com/foo.yaml',
options: { method: 'POST', qs: { queryParam: 123 } },
})
return { message: requiredString }
}
}
await WithOptions.invoke(
{ sendAndCacheRequest },
{ handleInternalErrors: false }
)
expect(sendAndCacheRequest).to.have.been.calledOnceWith(
'http://example.com/foo.yaml',
{
headers: {
Accept:
'text/x-yaml, text/yaml, application/x-yaml, application/yaml, text/plain',
},
method: 'POST',
qs: { queryParam: 123 },
}
)
})
})
describe('Making badges', function() {
it('handles valid yaml responses', async function() {
const sendAndCacheRequest = async () => ({
buffer: expectedYaml,
res: { statusCode: 200 },
})
expect(
await DummyYamlService.invoke(
{ sendAndCacheRequest },
{ handleInternalErrors: false }
)
).to.deep.equal({
message: 'some-string',
})
})
it('handles yaml responses which do not match the schema', async function() {
const sendAndCacheRequest = async () => ({
buffer: unexpectedYaml,
res: { statusCode: 200 },
})
expect(
await DummyYamlService.invoke(
{ sendAndCacheRequest },
{ handleInternalErrors: false }
)
).to.deep.equal({
isError: true,
color: 'lightgray',
message: 'invalid response data',
})
})
it('handles unparseable yaml responses', async function() {
const sendAndCacheRequest = async () => ({
buffer: invalidYaml,
res: { statusCode: 200 },
})
expect(
await DummyYamlService.invoke(
{ sendAndCacheRequest },
{ handleInternalErrors: false }
)
).to.deep.equal({
isError: true,
color: 'lightgray',
message: 'unparseable yaml response',
})
})
})
})

424
core/base-service/base.js Normal file
View File

@@ -0,0 +1,424 @@
'use strict'
const decamelize = require('decamelize')
// See available emoji at http://emoji.muan.co/
const emojic = require('emojic')
const Joi = require('joi')
const { assertValidCategory } = require('./categories')
const checkErrorResponse = require('./check-error-response')
const coalesceBadge = require('./coalesce-badge')
const {
NotFound,
InvalidResponse,
Inaccessible,
InvalidParameter,
Deprecated,
} = require('./errors')
const { validateExample, transformExample } = require('./examples')
const {
makeFullUrl,
assertValidRoute,
prepareRoute,
namedParamsForMatch,
getQueryParamNames,
} = require('./route')
const { assertValidServiceDefinition } = require('./service-definitions')
const trace = require('./trace')
const validate = require('./validate')
const defaultBadgeDataSchema = Joi.object({
label: Joi.string(),
color: Joi.string(),
labelColor: Joi.string(),
namedLogo: Joi.string(),
}).required()
const optionalStringWhenNamedLogoPrsent = Joi.alternatives().when('namedLogo', {
is: Joi.string().required(),
then: Joi.string(),
})
const optionalNumberWhenAnyLogoPresent = Joi.alternatives()
.when('namedLogo', { is: Joi.string().required(), then: Joi.number() })
.when('logoSvg', { is: Joi.string().required(), then: Joi.number() })
const serviceDataSchema = Joi.object({
isError: Joi.boolean(),
label: Joi.string().allow(''),
// While a number of badges pass a number here, in the long run we may want
// `render()` to always return a string.
message: Joi.alternatives(Joi.string().allow(''), Joi.number()).required(),
color: Joi.string(),
link: Joi.array()
.items(Joi.string().uri())
.single()
.max(2),
// Generally services should not use these options, which are provided to
// support the Endpoint badge.
labelColor: Joi.string(),
namedLogo: Joi.string(),
logoSvg: Joi.string(),
logoColor: optionalStringWhenNamedLogoPrsent,
logoWidth: optionalNumberWhenAnyLogoPresent,
logoPosition: optionalNumberWhenAnyLogoPresent,
cacheSeconds: Joi.number()
.integer()
.min(0),
style: Joi.string(),
})
.oxor('namedLogo', 'logoSvg')
.required()
module.exports = class BaseService {
/**
* Name of the category to sort this badge into (eg. "build"). Used to sort
* the badges on the main shields.io website.
*/
static get category() {
throw new Error(`Category not set for ${this.name}`)
}
static get isDeprecated() {
return false
}
/**
* Returns an object:
* - base: (Optional) The base path of the routes for this service. This is
* used as a prefix.
* - format: Regular expression to use for routes for this service's badges
* - capture: Array of names for the capture groups in the regular
* expression. The handler will be passed an object containing
* the matches.
* - queryParamSchema: (Optional) A Joi schema (`Joi.object({ ... }).required()`)
* for the query param object. If you know a parameter
* will never receive a numeric string, you can use
* `Joi.string()`. Because of quirks in Scoutcamp and Joi,
* alphanumeric strings should be declared using
* `Joi.alternatives().try(Joi.string(), Joi.number())`,
* otherwise a value like `?success_color=999` will fail.
* A parameter requiring a numeric string can use
* `Joi.number()`. A parameter that receives only non-numeric
* strings can use `Joi.string()`. A parameter that never
* receives numeric can use `Joi.string()`. A boolean
* parameter should use `Joi.equal('')` and will receive an
* empty string on e.g. `?compact_message` and undefined
* when the parameter is absent. (Note that in,
* `examples.queryParams` boolean query params should be given
* `null` values.)
*/
static get route() {
throw new Error(`Route not defined for ${this.name}`)
}
/**
* Example URLs for this service. These should use the format
* specified in `route`, and can be used to demonstrate how to use badges for
* this service.
*
* The preferred way to specify an example is with `namedParams` which are
* substituted into the service's compiled route pattern. The rendered badge
* is specified with `staticPreview`.
*
* For services which use a route `format`, the `pattern` can be specified as
* part of the example.
*
* title: Descriptive text that will be shown next to the badge. The default
* is to use the service class name, which probably is not what you want.
* namedParams: An object containing the values of named parameters to
* substitute into the compiled route pattern.
* queryParams: An object containing query parameters to include in the
* example URLs. For alphanumeric query parameters, specify a string value.
* For boolean query parameters, specify `null`.
* pattern: The route pattern to compile. Defaults to `this.route.pattern`.
* staticPreview: A rendered badge of the sort returned by `handle()` or
* `render()`: an object containing `message` and optional `label` and
* `color`. This is usually generated by invoking `this.render()` with some
* explicit props.
* keywords: Additional keywords, other than words in the title. This helps
* users locate relevant badges.
* documentation: An HTML string that is included in the badge popup.
*/
static get examples() {
return []
}
static get _cacheLength() {
const cacheLengths = {
build: 30,
license: 3600,
version: 300,
debug: 60,
}
return cacheLengths[this.category]
}
/**
* Default data for the badge. Can include label, logo, and color. These
* defaults are used if the value is neither included in the service data
* from the handler nor overridden by the user via query parameters.
*/
static get defaultBadgeData() {
return {}
}
static render(props) {
throw new Error(`render() function not implemented for ${this.name}`)
}
static validateDefinition() {
assertValidCategory(this.category, `Category for ${this.name}`)
assertValidRoute(this.route, `Route for ${this.name}`)
Joi.assert(
this.defaultBadgeData,
defaultBadgeDataSchema,
`Default badge data for ${this.name}`
)
this.examples.forEach((example, index) =>
validateExample(example, index, this)
)
}
static getDefinition() {
const { category, name, isDeprecated } = this
const { base, format, pattern } = this.route
const queryParams = getQueryParamNames(this.route)
const examples = this.examples.map((example, index) =>
transformExample(example, index, this)
)
let route
if (pattern) {
route = { pattern: makeFullUrl(base, pattern), queryParams }
} else if (format) {
route = { format, queryParams }
} else {
route = undefined
}
const result = { category, name, isDeprecated, route, examples }
assertValidServiceDefinition(result, `getDefinition() for ${this.name}`)
return result
}
constructor({ sendAndCacheRequest }, { handleInternalErrors }) {
this._requestFetcher = sendAndCacheRequest
this._handleInternalErrors = handleInternalErrors
}
async _request({ url, options = {}, errorMessages = {} }) {
const logTrace = (...args) => trace.logTrace('fetch', ...args)
logTrace(emojic.bowAndArrow, 'Request', url, '\n', options)
const { res, buffer } = await this._requestFetcher(url, options)
logTrace(emojic.dart, 'Response status code', res.statusCode)
return checkErrorResponse(errorMessages)({ buffer, res })
}
static _validate(
data,
schema,
{
prettyErrorMessage = 'invalid response data',
includeKeys = false,
allowAndStripUnknownKeys = true,
} = {}
) {
return validate(
{
ErrorClass: InvalidResponse,
prettyErrorMessage,
includeKeys,
traceErrorMessage: 'Response did not match schema',
traceSuccessMessage: 'Response after validation',
allowAndStripUnknownKeys,
},
data,
schema
)
}
/**
* Asynchronous function to handle requests for this service. Take the route
* parameters (as defined in the `route` property), perform a request using
* `this._sendAndCacheRequest`, and return the badge data.
*/
async handle(namedParams, queryParams) {
throw new Error(`Handler not implemented for ${this.constructor.name}`)
}
_handleError(error) {
if (error instanceof NotFound || error instanceof InvalidParameter) {
trace.logTrace('outbound', emojic.noGoodWoman, 'Handled error', error)
return {
isError: true,
message: error.prettyMessage,
color: 'red',
}
} else if (
error instanceof InvalidResponse ||
error instanceof Inaccessible ||
error instanceof Deprecated
) {
trace.logTrace('outbound', emojic.noGoodWoman, 'Handled error', error)
return {
isError: true,
message: error.prettyMessage,
color: 'lightgray',
}
} else if (this._handleInternalErrors) {
if (
!trace.logTrace(
'unhandledError',
emojic.boom,
'Unhandled internal error',
error
)
) {
// This is where we end up if an unhandled exception is thrown in
// production. Send the error to the logs.
console.log(error)
}
return {
isError: true,
label: 'shields',
message: 'internal error',
color: 'lightgray',
}
} else {
trace.logTrace(
'unhandledError',
emojic.boom,
'Unhandled internal error',
error
)
throw error
}
}
static async invoke(
context = {},
config = {},
namedParams = {},
queryParams = {}
) {
trace.logTrace('inbound', emojic.womanCook, 'Service class', this.name)
trace.logTrace('inbound', emojic.ticket, 'Named params', namedParams)
trace.logTrace('inbound', emojic.crayon, 'Query params', queryParams)
const serviceInstance = new this(context, config)
let serviceError
const { queryParamSchema } = this.route
let transformedQueryParams
if (queryParamSchema) {
try {
transformedQueryParams = validate(
{
ErrorClass: InvalidParameter,
prettyErrorMessage: 'invalid query parameter',
includeKeys: true,
traceErrorMessage: 'Query params did not match schema',
traceSuccessMessage: 'Query params after validation',
},
queryParams,
queryParamSchema
)
trace.logTrace(
'inbound',
emojic.crayon,
'Query params after validation',
queryParams
)
} catch (error) {
serviceError = error
}
} else {
transformedQueryParams = {}
}
let serviceData
if (!serviceError) {
try {
serviceData = await serviceInstance.handle(
namedParams,
transformedQueryParams
)
Joi.assert(serviceData, serviceDataSchema)
} catch (error) {
serviceError = error
}
}
if (serviceError) {
serviceData = serviceInstance._handleError(serviceError)
}
trace.logTrace('outbound', emojic.shield, 'Service data', serviceData)
return serviceData
}
static _createServiceRequestCounter({ requestCounter }) {
if (requestCounter) {
const { category, serviceFamily, name } = this
const service = decamelize(name)
return requestCounter.labels(category, serviceFamily, service)
} else {
// When metrics are disabled, return a mock counter.
return { inc: () => {} }
}
}
static register(
{ camp, handleRequest, githubApiProvider, requestCounter },
serviceConfig
) {
const { cacheHeaders: cacheHeaderConfig, fetchLimitBytes } = serviceConfig
const { regex, captureNames } = prepareRoute(this.route)
const queryParams = getQueryParamNames(this.route)
const serviceRequestCounter = this._createServiceRequestCounter({
requestCounter,
})
camp.route(
regex,
handleRequest(cacheHeaderConfig, {
queryParams,
handler: async (queryParams, match, sendBadge, request) => {
const namedParams = namedParamsForMatch(captureNames, match, this)
const serviceData = await this.invoke(
{
sendAndCacheRequest: request.asPromise,
sendAndCacheRequestWithCallbacks: request,
githubApiProvider,
},
serviceConfig,
namedParams,
queryParams
)
const badgeData = coalesceBadge(
queryParams,
serviceData,
this.defaultBadgeData,
this
)
// The final capture group is the extension.
const format = match.slice(-1)[0]
sendBadge(format, badgeData)
serviceRequestCounter.inc()
},
cacheLength: this._cacheLength,
fetchLimitBytes,
})
)
}
}

View File

@@ -0,0 +1,485 @@
'use strict'
const Joi = require('joi')
const { expect } = require('chai')
const sinon = require('sinon')
const trace = require('./trace')
const {
NotFound,
Inaccessible,
InvalidResponse,
InvalidParameter,
Deprecated,
} = require('./errors')
const BaseService = require('./base')
require('../register-chai-plugins.spec')
const queryParamSchema = Joi.object({
queryParamA: Joi.string(),
})
.rename('legacyQueryParamA', 'queryParamA', {
ignoreUndefined: true,
override: true,
})
.required()
class DummyService extends BaseService {
static get category() {
return 'other'
}
static get route() {
return {
base: 'foo',
pattern: ':namedParamA',
queryParamSchema,
}
}
static get examples() {
return [
{
pattern: ':world',
namedParams: { world: 'World' },
staticPreview: this.render({ namedParamA: 'foo', queryParamA: 'bar' }),
keywords: ['hello'],
},
]
}
static get defaultBadgeData() {
return { label: 'cat', namedLogo: 'appveyor' }
}
static render({ namedParamA, queryParamA }) {
return {
message: `Hello namedParamA: ${namedParamA} with queryParamA: ${queryParamA}`,
}
}
async handle({ namedParamA }, { queryParamA }) {
return this.constructor.render({ namedParamA, queryParamA })
}
}
describe('BaseService', function() {
const defaultConfig = { handleInternalErrors: false }
it('Invokes the handler as expected', async function() {
expect(
await DummyService.invoke(
{},
defaultConfig,
{ namedParamA: 'bar.bar.bar' },
{ queryParamA: '!' }
)
).to.deep.equal({
message: 'Hello namedParamA: bar.bar.bar with queryParamA: !',
})
})
it('Validates query params', async function() {
expect(
await DummyService.invoke(
{},
defaultConfig,
{ namedParamA: 'bar.bar.bar' },
{ queryParamA: ['foo', 'bar'] }
)
).to.deep.equal({
color: 'red',
isError: true,
message: 'invalid query parameter: queryParamA',
})
})
describe('Required overrides', function() {
it('Should throw if render() is not overridden', function() {
expect(() => BaseService.render()).to.throw(
'render() function not implemented for BaseService'
)
})
it('Should throw if route is not overridden', async function() {
try {
await BaseService.invoke({}, {}, {})
expect.fail('Expected to throw')
} catch (e) {
expect(e.message).to.equal('Route not defined for BaseService')
}
})
class WithRoute extends BaseService {
static get route() {
return {}
}
}
it('Should throw if handle() is not overridden', async function() {
try {
await WithRoute.invoke({}, {}, {})
expect.fail('Expected to throw')
} catch (e) {
expect(e.message).to.equal('Handler not implemented for WithRoute')
}
})
it('Should throw if category is not overridden', function() {
expect(() => BaseService.category).to.throw(
'Category not set for BaseService'
)
})
})
describe('Logging', function() {
let sandbox
beforeEach(function() {
sandbox = sinon.createSandbox()
})
afterEach(function() {
sandbox.restore()
})
beforeEach(function() {
sandbox.stub(trace, 'logTrace')
})
it('Invokes the logger as expected', async function() {
await DummyService.invoke(
{},
defaultConfig,
{ namedParamA: 'bar.bar.bar' },
{ queryParamA: '!' }
)
expect(trace.logTrace).to.be.calledWithMatch(
'inbound',
sinon.match.string,
'Service class',
'DummyService'
)
expect(trace.logTrace).to.be.calledWith(
'inbound',
sinon.match.string,
'Named params',
{ namedParamA: 'bar.bar.bar' }
)
expect(trace.logTrace).to.be.calledWith(
'inbound',
sinon.match.string,
'Query params after validation',
{ queryParamA: '!' }
)
})
})
describe('Service data validation', function() {
it('Allows a link array', async function() {
const message = 'hello'
const link = ['https://example.com/', 'https://other.example.com/']
class LinkService extends DummyService {
async handle() {
return { message, link }
}
}
const serviceData = await LinkService.invoke(
{},
{ handleInternalErrors: false },
{ namedParamA: 'bar.bar.bar' }
)
expect(serviceData).to.deep.equal({
message,
link,
})
})
it('Throws a validation error on invalid data', async function() {
class ThrowingService extends DummyService {
async handle() {
return {
some: 'nonsense',
}
}
}
try {
await ThrowingService.invoke(
{},
{ handleInternalErrors: false },
{ namedParamA: 'bar.bar.bar' }
)
expect.fail('Expected to throw')
} catch (e) {
expect(e.name).to.equal('ValidationError')
expect(e.details.map(({ message }) => message)).to.deep.equal([
'"message" is required',
])
}
})
})
describe('Error handling', function() {
it('Handles internal errors', async function() {
class ThrowingService extends DummyService {
async handle() {
throw Error("I've made a huge mistake")
}
}
expect(
await ThrowingService.invoke(
{},
{ handleInternalErrors: true },
{ namedParamA: 'bar.bar.bar' }
)
).to.deep.equal({
isError: true,
color: 'lightgray',
label: 'shields',
message: 'internal error',
})
})
describe('Handles known subtypes of ShieldsInternalError', function() {
it('handles NotFound errors', async function() {
class ThrowingService extends DummyService {
async handle() {
throw new NotFound()
}
}
expect(
await ThrowingService.invoke({}, {}, { namedParamA: 'bar.bar.bar' })
).to.deep.equal({
isError: true,
color: 'red',
message: 'not found',
})
})
it('handles Inaccessible errors', async function() {
class ThrowingService extends DummyService {
async handle() {
throw new Inaccessible()
}
}
expect(
await ThrowingService.invoke({}, {}, { namedParamA: 'bar.bar.bar' })
).to.deep.equal({
isError: true,
color: 'lightgray',
message: 'inaccessible',
})
})
it('handles InvalidResponse errors', async function() {
class ThrowingService extends DummyService {
async handle() {
throw new InvalidResponse()
}
}
expect(
await ThrowingService.invoke({}, {}, { namedParamA: 'bar.bar.bar' })
).to.deep.equal({
isError: true,
color: 'lightgray',
message: 'invalid',
})
})
it('handles Deprecated', async function() {
class ThrowingService extends DummyService {
async handle() {
throw new Deprecated()
}
}
expect(
await ThrowingService.invoke({}, {}, { namedParamA: 'bar.bar.bar' })
).to.deep.equal({
isError: true,
color: 'lightgray',
message: 'no longer available',
})
})
it('handles InvalidParameter errors', async function() {
class ThrowingService extends DummyService {
async handle() {
throw new InvalidParameter()
}
}
expect(
await ThrowingService.invoke({}, {}, { namedParamA: 'bar.bar.bar' })
).to.deep.equal({
isError: true,
color: 'red',
message: 'invalid parameter',
})
})
})
})
describe('ScoutCamp integration', function() {
const expectedRouteRegex = /^\/foo\/([^/]+?)\.(svg|png|gif|jpg|json)$/
let mockCamp
let mockHandleRequest
beforeEach(function() {
mockCamp = {
route: sinon.spy(),
}
mockHandleRequest = sinon.spy()
DummyService.register(
{ camp: mockCamp, handleRequest: mockHandleRequest },
defaultConfig
)
})
it('registers the service', function() {
expect(mockCamp.route).to.have.been.calledOnce
expect(mockCamp.route).to.have.been.calledWith(expectedRouteRegex)
})
it('handles the request', async function() {
expect(mockHandleRequest).to.have.been.calledOnce
const {
queryParams: serviceQueryParams,
handler: requestHandler,
} = mockHandleRequest.getCall(0).args[1]
expect(serviceQueryParams).to.deep.equal([
'queryParamA',
'legacyQueryParamA',
])
const mockSendBadge = sinon.spy()
const mockRequest = {
asPromise: sinon.spy(),
}
const queryParams = { queryParamA: '?' }
const match = '/foo/bar.svg'.match(expectedRouteRegex)
await requestHandler(queryParams, match, mockSendBadge, mockRequest)
const expectedFormat = 'svg'
expect(mockSendBadge).to.have.been.calledOnce
expect(mockSendBadge).to.have.been.calledWith(expectedFormat, {
text: ['cat', 'Hello namedParamA: bar with queryParamA: ?'],
color: 'lightgrey',
template: undefined,
namedLogo: undefined,
logo: undefined,
logoWidth: undefined,
logoPosition: undefined,
links: [],
labelColor: undefined,
cacheLengthSeconds: undefined,
})
})
})
describe('getDefinition', function() {
it('returns the expected result', function() {
const {
category,
name,
isDeprecated,
route,
examples,
} = DummyService.getDefinition()
expect({
category,
name,
isDeprecated,
route,
}).to.deep.equal({
category: 'other',
name: 'DummyService',
isDeprecated: false,
route: {
pattern: '/foo/:namedParamA',
queryParams: ['queryParamA', 'legacyQueryParamA'],
},
})
// The in-depth tests for examples reside in examples.spec.js
expect(examples).to.have.lengthOf(1)
})
})
describe('validate', function() {
const dummySchema = Joi.object({
requiredString: Joi.string().required(),
}).required()
it('throws error for invalid responses', async function() {
try {
DummyService._validate(
{ requiredString: ['this', "shouldn't", 'work'] },
dummySchema
)
expect.fail('Expected to throw')
} catch (e) {
expect(e).to.be.an.instanceof(InvalidResponse)
}
})
})
describe('request', function() {
let sandbox
beforeEach(function() {
sandbox = sinon.createSandbox()
})
afterEach(function() {
sandbox.restore()
})
beforeEach(function() {
sandbox.stub(trace, 'logTrace')
})
it('logs appropriate information', async function() {
const sendAndCacheRequest = async () => ({
buffer: '',
res: { statusCode: 200 },
})
const serviceInstance = new DummyService(
{ sendAndCacheRequest },
defaultConfig
)
const url = 'some-url'
const options = { headers: { Cookie: 'some-cookie' } }
await serviceInstance._request({ url, options })
expect(trace.logTrace).to.be.calledWithMatch(
'fetch',
sinon.match.string,
'Request',
url,
'\n',
options
)
expect(trace.logTrace).to.be.calledWithMatch(
'fetch',
sinon.match.string,
'Response status code',
200
)
})
it('handles errors', async function() {
const sendAndCacheRequest = async () => ({
buffer: '',
res: { statusCode: 404 },
})
const serviceInstance = new DummyService(
{ sendAndCacheRequest },
defaultConfig
)
try {
await serviceInstance._request({})
expect.fail('Expected to throw')
} catch (e) {
expect(e).to.be.an.instanceof(NotFound)
expect(e.message).to.equal('Not Found')
expect(e.prettyMessage).to.equal('not found')
}
})
})
})

View File

@@ -0,0 +1,115 @@
'use strict'
const assert = require('assert')
const Joi = require('joi')
const coalesce = require('./coalesce')
const serverStartTimeGMTString = new Date().toGMTString()
const serverStartTimestamp = Date.now()
const isOptionalNonNegativeInteger = Joi.number()
.integer()
.min(0)
const queryParamSchema = Joi.object({
cacheSeconds: isOptionalNonNegativeInteger,
maxAge: isOptionalNonNegativeInteger,
})
.oxor('cacheSeconds', 'maxAge')
.unknown(true)
.required()
function overrideCacheLengthFromQueryParams(queryParams) {
try {
const {
cacheSeconds: overrideCacheLength,
maxAge: legacyOverrideCacheLength,
} = Joi.attempt(queryParams, queryParamSchema)
return coalesce(overrideCacheLength, legacyOverrideCacheLength)
} catch (e) {
return undefined
}
}
function coalesceCacheLength({
cacheHeaderConfig,
serviceDefaultCacheLengthSeconds,
serviceOverrideCacheLengthSeconds,
queryParams,
}) {
const { defaultCacheLengthSeconds } = cacheHeaderConfig
// The config returns a number so this should never happen. But this logic
// would be completely broken if it did.
assert(defaultCacheLengthSeconds !== undefined)
const cacheLength = coalesce(
serviceDefaultCacheLengthSeconds,
defaultCacheLengthSeconds
)
// Overrides can apply _more_ caching, but not less. Query param overriding
// can request more overriding than service override, but not less.
const candidateOverrides = [
serviceOverrideCacheLengthSeconds,
overrideCacheLengthFromQueryParams(queryParams),
].filter(x => x !== undefined)
return Math.max(cacheLength, ...candidateOverrides)
}
function setHeadersForCacheLength(res, cacheLengthSeconds) {
const now = new Date()
const nowGMTString = now.toGMTString()
// Send both Cache-Control max-age and Expires in case the client implements
// HTTP/1.0 but not HTTP/1.1.
let cacheControl, expires
if (cacheLengthSeconds === 0) {
// Prevent as much downstream caching as possible.
cacheControl = 'no-cache, no-store, must-revalidate'
expires = nowGMTString
} else {
cacheControl = `max-age=${cacheLengthSeconds}`
expires = new Date(now.getTime() + cacheLengthSeconds * 1000).toGMTString()
}
res.setHeader('Date', nowGMTString)
res.setHeader('Cache-Control', cacheControl)
res.setHeader('Expires', expires)
}
function setCacheHeaders({
cacheHeaderConfig,
serviceDefaultCacheLengthSeconds,
serviceOverrideCacheLengthSeconds,
queryParams,
res,
}) {
const cacheLengthSeconds = coalesceCacheLength({
cacheHeaderConfig,
serviceDefaultCacheLengthSeconds,
serviceOverrideCacheLengthSeconds,
queryParams,
})
setHeadersForCacheLength(res, cacheLengthSeconds)
}
const staticCacheControlHeader = `max-age=${24 * 3600}` // 1 day.
function setCacheHeadersForStaticResource(res) {
res.setHeader('Cache-Control', staticCacheControlHeader)
res.setHeader('Last-Modified', serverStartTimeGMTString)
}
function serverHasBeenUpSinceResourceCached(req) {
return (
serverStartTimestamp <= new Date(req.headers['if-modified-since']).getTime()
)
}
module.exports = {
coalesceCacheLength,
setCacheHeaders,
setHeadersForCacheLength,
setCacheHeadersForStaticResource,
serverHasBeenUpSinceResourceCached,
}

View File

@@ -0,0 +1,241 @@
'use strict'
const { test, given } = require('sazerac')
const chai = require('chai')
const { expect } = require('chai')
const sinon = require('sinon')
const httpMocks = require('node-mocks-http')
const {
coalesceCacheLength,
setHeadersForCacheLength,
setCacheHeaders,
setCacheHeadersForStaticResource,
serverHasBeenUpSinceResourceCached,
} = require('./cache-headers')
chai.use(require('chai-datetime'))
describe('Cache header functions', function() {
let res
beforeEach(function() {
res = httpMocks.createResponse()
})
describe('coalesceCacheLength', function() {
const cacheHeaderConfig = { defaultCacheLengthSeconds: 777 }
test(coalesceCacheLength, () => {
given({ cacheHeaderConfig, queryParams: {} }).expect(777)
given({
cacheHeaderConfig,
serviceDefaultCacheLengthSeconds: 900,
queryParams: {},
}).expect(900)
given({
cacheHeaderConfig,
serviceDefaultCacheLengthSeconds: 900,
queryParams: { cacheSeconds: 1000 },
}).expect(1000)
given({
cacheHeaderConfig,
serviceDefaultCacheLengthSeconds: 900,
queryParams: { cacheSeconds: 1000, other: 'here', maybe: 'bogus' },
}).expect(1000)
given({
cacheHeaderConfig,
serviceDefaultCacheLengthSeconds: 900,
queryParams: { cacheSeconds: 400 },
}).expect(900)
given({
cacheHeaderConfig,
serviceDefaultCacheLengthSeconds: 900,
queryParams: { cacheSeconds: '-1000' },
}).expect(900)
given({
cacheHeaderConfig,
serviceDefaultCacheLengthSeconds: 900,
queryParams: { cacheSeconds: '' },
}).expect(900)
given({
cacheHeaderConfig,
serviceDefaultCacheLengthSeconds: 900,
queryParams: { cacheSeconds: 'not a number' },
}).expect(900)
given({
cacheHeaderConfig,
serviceDefaultCacheLengthSeconds: 900,
// Legacy name.
queryParams: { maxAge: 1000 },
}).expect(1000)
given({
cacheHeaderConfig,
serviceDefaultCacheLengthSeconds: 900,
// Both legacy and new name provided -> both ignored.
queryParams: { maxAge: 1000, cacheSeconds: 1000 },
}).expect(900)
given({
cacheHeaderConfig,
serviceDefaultCacheLengthSeconds: 900,
serviceOverrideCacheLengthSeconds: 400,
queryParams: {},
}).expect(900)
given({
cacheHeaderConfig,
serviceOverrideCacheLengthSeconds: 400,
queryParams: {},
}).expect(777)
given({
cacheHeaderConfig,
serviceOverrideCacheLengthSeconds: 900,
queryParams: {},
}).expect(900)
given({
cacheHeaderConfig,
serviceOverrideCacheLengthSeconds: 800,
queryParams: { cacheSeconds: 500 },
}).expect(800)
given({
cacheHeaderConfig,
serviceOverrideCacheLengthSeconds: 900,
queryParams: { cacheSeconds: 800 },
}).expect(900)
})
})
describe('setHeadersForCacheLength', function() {
let sandbox
beforeEach(function() {
sandbox = sinon.createSandbox()
sandbox.useFakeTimers()
})
afterEach(function() {
sandbox.restore()
sandbox = undefined
})
it('should set the correct Date header', function() {
// Confidence check.
expect(res._headers.date).to.equal(undefined)
// Act.
setHeadersForCacheLength(res, 123)
// Assert.
const now = new Date().toGMTString()
expect(res._headers.date).to.equal(now)
})
context('cacheLengthSeconds is zero', function() {
beforeEach(function() {
setHeadersForCacheLength(res, 0)
})
it('should set the expected Cache-Control header', function() {
expect(res._headers['cache-control']).to.equal(
'no-cache, no-store, must-revalidate'
)
})
it('should set the expected Expires header', function() {
expect(res._headers.expires).to.equal(new Date().toGMTString())
})
})
context('cacheLengthSeconds is nonzero', function() {
beforeEach(function() {
setHeadersForCacheLength(res, 123)
})
it('should set the expected Cache-Control header', function() {
expect(res._headers['cache-control']).to.equal('max-age=123')
})
it('should set the expected Expires header', function() {
const expires = new Date(Date.now() + 123 * 1000).toGMTString()
expect(res._headers.expires).to.equal(expires)
})
})
})
describe('setCacheHeaders', function() {
it('sets the expected fields', function() {
const expectedFields = ['date', 'cache-control', 'expires']
expectedFields.forEach(field =>
expect(res._headers[field]).to.equal(undefined)
)
setCacheHeaders({
cacheHeaderConfig: { defaultCacheLengthSeconds: 1234 },
serviceDefaultCacheLengthSeconds: 567,
queryParams: { cacheSeconds: 999999 },
res,
})
expectedFields.forEach(field =>
expect(res._headers[field])
.to.be.a('string')
.and.have.lengthOf.at.least(1)
)
})
})
describe('setCacheHeadersForStaticResource', function() {
beforeEach(function() {
setCacheHeadersForStaticResource(res)
})
it('should set the expected Cache-Control header', function() {
expect(res._headers['cache-control']).to.equal(`max-age=${24 * 3600}`)
})
it('should set the expected Last-Modified header', function() {
const lastModified = res._headers['last-modified']
expect(new Date(lastModified)).to.be.withinTime(
// Within the last 60 seconds.
new Date(Date.now() - 60 * 1000),
new Date()
)
})
})
describe('serverHasBeenUpSinceResourceCached', function() {
// The stringified req's are hard to understand. I thought Sazerac
// provided a way to override the describe message, though I can't find it.
context('when there is no If-Modified-Since header', function() {
it('returns false', function() {
const req = httpMocks.createRequest()
expect(serverHasBeenUpSinceResourceCached(req)).to.equal(false)
})
})
context('when the If-Modified-Since header is invalid', function() {
it('returns false', function() {
const req = httpMocks.createRequest({
headers: { 'If-Modified-Since': 'this-is-not-a-date' },
})
expect(serverHasBeenUpSinceResourceCached(req)).to.equal(false)
})
})
context(
'when the If-Modified-Since header is before the process started',
function() {
it('returns false', function() {
const req = httpMocks.createRequest({
headers: { 'If-Modified-Since': '2018-02-01T05:00:00.000Z' },
})
expect(serverHasBeenUpSinceResourceCached(req)).to.equal(false)
})
}
)
context(
'when the If-Modified-Since header is after the process started',
function() {
it('returns true', function() {
const modifiedTimeStamp = new Date(Date.now() + 1800000)
const req = httpMocks.createRequest({
headers: { 'If-Modified-Since': modifiedTimeStamp.toISOString() },
})
expect(serverHasBeenUpSinceResourceCached(req)).to.equal(true)
})
}
)
})
})

View File

@@ -0,0 +1,19 @@
'use strict'
const Joi = require('joi')
const categories = require('../../services/categories')
const isRealCategory = Joi.equal(categories.map(({ id }) => id)).required()
const isValidCategory = Joi.alternatives()
.try(isRealCategory, Joi.equal('debug', 'dynamic', 'static').required())
.required()
function assertValidCategory(category, message = undefined) {
Joi.assert(category, isValidCategory, message)
}
module.exports = {
isValidCategory,
assertValidCategory,
}

View File

@@ -0,0 +1,37 @@
'use strict'
const { NotFound, InvalidResponse, Inaccessible } = require('./errors')
const defaultErrorMessages = {
404: 'not found',
}
module.exports = function checkErrorResponse(errorMessages = {}) {
return async function({ buffer, res }) {
let error
errorMessages = { ...defaultErrorMessages, ...errorMessages }
if (res.statusCode === 404) {
error = new NotFound({ prettyMessage: errorMessages[404] })
} else if (res.statusCode !== 200) {
const underlying = Error(
`Got status code ${res.statusCode} (expected 200)`
)
const props = { underlyingError: underlying }
if (errorMessages[res.statusCode] !== undefined) {
props.prettyMessage = errorMessages[res.statusCode]
}
if (res.statusCode >= 500) {
error = new Inaccessible(props)
} else {
error = new InvalidResponse(props)
}
}
if (error) {
error.response = res
error.buffer = buffer
throw error
} else {
return { buffer, res }
}
}
}

View File

@@ -0,0 +1,113 @@
'use strict'
const { expect } = require('chai')
const { NotFound, InvalidResponse, Inaccessible } = require('./errors')
const checkErrorResponse = require('./check-error-response')
describe('async error handler', function() {
const buffer = Buffer.from('some stuff')
context('when status is 200', function() {
it('passes through the inputs', async function() {
const res = { statusCode: 200 }
expect(await checkErrorResponse()({ res, buffer })).to.deep.equal({
res,
buffer,
})
})
})
context('when status is 404', function() {
const buffer = Buffer.from('some stuff')
const res = { statusCode: 404 }
it('throws NotFound', async function() {
try {
await checkErrorResponse()({ res, buffer })
expect.fail('Expected to throw')
} catch (e) {
expect(e).to.be.an.instanceof(NotFound)
expect(e.message).to.equal('Not Found')
expect(e.prettyMessage).to.equal('not found')
expect(e.response).to.equal(res)
expect(e.buffer).to.equal(buffer)
}
})
it('displays the custom not found message', async function() {
const notFoundMessage = 'no goblins found'
try {
await checkErrorResponse({ 404: notFoundMessage })({ res, buffer })
expect.fail('Expected to throw')
} catch (e) {
expect(e).to.be.an.instanceof(NotFound)
expect(e.message).to.equal('Not Found: no goblins found')
expect(e.prettyMessage).to.equal('no goblins found')
}
})
})
context('when status is 4xx', function() {
it('throws InvalidResponse', async function() {
const res = { statusCode: 499 }
try {
await checkErrorResponse()({ res, buffer })
expect.fail('Expected to throw')
} catch (e) {
expect(e).to.be.an.instanceof(InvalidResponse)
expect(e.message).to.equal(
'Invalid Response: Got status code 499 (expected 200)'
)
expect(e.prettyMessage).to.equal('invalid')
expect(e.response).to.equal(res)
expect(e.buffer).to.equal(buffer)
}
})
it('displays the custom error message', async function() {
const res = { statusCode: 403 }
try {
await checkErrorResponse({ 403: 'access denied' })({ res })
expect.fail('Expected to throw')
} catch (e) {
expect(e).to.be.an.instanceof(InvalidResponse)
expect(e.message).to.equal(
'Invalid Response: Got status code 403 (expected 200)'
)
expect(e.prettyMessage).to.equal('access denied')
}
})
})
context('when status is 5xx', function() {
it('throws Inaccessible', async function() {
const res = { statusCode: 503 }
try {
await checkErrorResponse()({ res, buffer })
expect.fail('Expected to throw')
} catch (e) {
expect(e).to.be.an.instanceof(Inaccessible)
expect(e.message).to.equal(
'Inaccessible: Got status code 503 (expected 200)'
)
expect(e.prettyMessage).to.equal('inaccessible')
expect(e.response).to.equal(res)
expect(e.buffer).to.equal(buffer)
}
})
it('displays the custom error message', async function() {
const res = { statusCode: 500 }
try {
await checkErrorResponse({ 500: 'server overloaded' })({ res, buffer })
expect.fail('Expected to throw')
} catch (e) {
expect(e).to.be.an.instanceof(Inaccessible)
expect(e.message).to.equal(
'Inaccessible: Got status code 500 (expected 200)'
)
expect(e.prettyMessage).to.equal('server overloaded')
}
})
})
})

View File

@@ -0,0 +1,174 @@
'use strict'
const {
decodeDataUrlFromQueryParam,
prepareNamedLogo,
} = require('../../lib/logos')
const { svg2base64 } = require('../../lib/svg-helpers')
const coalesce = require('./coalesce')
const toArray = require('./to-array')
// Translate modern badge data to the legacy schema understood by the badge
// maker. Allow the user to override the label, color, logo, etc. through the
// query string. Provide support for most badge options via `serviceData` so
// the Endpoint badge can specify logos and colors, though allow that the
// user's logo or color to take precedence. A notable exception is the case of
// errors. When the service specifies that an error has occurred, the user's
// requested color does not override the error color.
//
// Logos are resolved in this manner:
//
// 1. When `?logo=` contains the name of one of the Shields logos, or contains
// base64-encoded SVG, that logo is used. In the case of a named logo, when
// a `&logoColor=` is specified, that color is used. Otherwise the default
// color is used. `logoColor` will not be applied to a custom
// (base64-encoded) logo; if a custom color is desired the logo should be
// recolored prior to making the request. The appearance of the logo can be
// customized using `logoWidth`, and in the case of the popout badge,
// `logoPosition`. When `?logo=` is specified, any logo-related parameters
// specified dynamically by the service, or by default in the service, are
// ignored.
// 2. The second precedence is the dynamic logo returned by a service. This is
// used only by the Endpoint badge. The `logoColor` can be overridden by the
// query string.
// 3. In the case of the `social` style only, the last precedence is the
// service's default logo. The `logoColor` can be overridden by the query
// string.
module.exports = function coalesceBadge(
overrides,
serviceData,
// These two parameters were kept separate to make tests clearer.
defaultBadgeData,
{ category, _cacheLength: defaultCacheSeconds } = {}
) {
// The "overrideX" naming is based on services that provide badge
// parameters themselves, which can be overridden by a query string
// parameter. (For a couple services, the dynamic badge and the
// query-string-based static badge, the service never sets a value
// so the query string overrides are the _only_ way to configure
// these badge parameters.
const {
style: overrideStyle,
label: overrideLabel,
logo: overrideLogo,
logoColor: overrideLogoColor,
link: overrideLink,
colorB: legacyOverrideColor,
colorA: legacyOverrideLabelColor,
} = overrides
let {
logoWidth: overrideLogoWidth,
logoPosition: overrideLogoPosition,
color: overrideColor,
labelColor: overrideLabelColor,
} = overrides
// Only use the legacy properties if the new ones are not provided
if (typeof overrideColor === 'undefined') {
overrideColor = legacyOverrideColor
}
if (typeof overrideLabelColor === 'undefined') {
overrideLabelColor = legacyOverrideLabelColor
}
// Scoutcamp converts numeric query params to numbers. Convert them back.
if (typeof overrideColor === 'number') {
overrideColor = `${overrideColor}`
}
if (typeof overrideLabelColor === 'number') {
overrideLabelColor = `${overrideLabelColor}`
}
overrideLogoWidth = +overrideLogoWidth || undefined
overrideLogoPosition = +overrideLogoPosition || undefined
const {
isError,
label: serviceLabel,
message: serviceMessage,
color: serviceColor,
labelColor: serviceLabelColor,
logoSvg: serviceLogoSvg,
namedLogo: serviceNamedLogo,
logoColor: serviceLogoColor,
logoWidth: serviceLogoWidth,
logoPosition: serviceLogoPosition,
link: serviceLink,
cacheSeconds: serviceCacheSeconds,
style: serviceStyle,
} = serviceData
const {
color: defaultColor,
namedLogo: defaultNamedLogo,
label: defaultLabel,
labelColor: defaultLabelColor,
} = defaultBadgeData
const style = coalesce(overrideStyle, serviceStyle)
let namedLogo, namedLogoColor, logoWidth, logoPosition, logoSvgBase64
if (overrideLogo) {
// `?logo=` could be a named logo or encoded svg.
const overrideLogoSvgBase64 = decodeDataUrlFromQueryParam(overrideLogo)
if (overrideLogoSvgBase64) {
logoSvgBase64 = overrideLogoSvgBase64
} else {
namedLogo = overrideLogo
// If the logo has been overridden it does not make sense to inherit the
// original color.
namedLogoColor = overrideLogoColor
}
// If the logo has been overridden it does not make sense to inherit the
// original width or position.
logoWidth = overrideLogoWidth
logoPosition = overrideLogoPosition
} else {
if (serviceLogoSvg) {
logoSvgBase64 = svg2base64(serviceLogoSvg)
} else {
namedLogo = coalesce(
serviceNamedLogo,
style === 'social' ? defaultNamedLogo : undefined
)
namedLogoColor = coalesce(overrideLogoColor, serviceLogoColor)
}
logoWidth = coalesce(overrideLogoWidth, serviceLogoWidth)
logoPosition = coalesce(overrideLogoPosition, serviceLogoPosition)
}
if (namedLogo) {
logoSvgBase64 = prepareNamedLogo({
name: namedLogo,
color: namedLogoColor,
style,
})
}
return {
text: [
// Use `coalesce()` to support empty labels and messages, as in the
// static badge.
coalesce(overrideLabel, serviceLabel, defaultLabel, category),
coalesce(serviceMessage, 'n/a'),
],
color: coalesce(
// In case of an error, disregard user's color override.
isError ? undefined : overrideColor,
serviceColor,
defaultColor,
'lightgrey'
),
labelColor: coalesce(
// In case of an error, disregard user's color override.
isError ? undefined : overrideLabelColor,
serviceLabelColor,
defaultLabelColor
),
template: style,
namedLogo,
logo: logoSvgBase64,
logoWidth,
logoPosition,
links: toArray(overrideLink || serviceLink),
cacheLengthSeconds: coalesce(serviceCacheSeconds, defaultCacheSeconds),
}
}

View File

@@ -0,0 +1,294 @@
'use strict'
const { expect } = require('chai')
const { getShieldsIcon, getSimpleIcon } = require('../../lib/logos')
const coalesceBadge = require('./coalesce-badge')
describe('coalesceBadge', function() {
describe('Label', function() {
it('uses the default label', function() {
expect(coalesceBadge({}, {}, { label: 'heyo' }).text).to.deep.equal([
'heyo',
'n/a',
])
})
// This behavior isn't great and we might want to remove it.
it('uses the category as a default label', function() {
expect(coalesceBadge({}, {}, {}, { category: 'cat' }).text).to.deep.equal(
['cat', 'n/a']
)
})
it('preserves an empty label', function() {
expect(
coalesceBadge({}, { label: '', message: '10k' }, {}).text
).to.deep.equal(['', '10k'])
})
it('overrides the label', function() {
expect(
coalesceBadge({ label: 'purr count' }, { label: 'purrs' }, {}).text
).to.deep.equal(['purr count', 'n/a'])
})
})
describe('Message', function() {
it('applies the service message', function() {
expect(coalesceBadge({}, { message: '10k' }, {}).text).to.deep.equal([
undefined,
'10k',
])
})
it('applies a numeric service message', function() {
// While a number of badges use this, in the long run we may want
// `render()` to always return a string.
expect(coalesceBadge({}, { message: 10 }, {}).text).to.deep.equal([
undefined,
10,
])
})
})
describe('Right color', function() {
it('uses the default color', function() {
expect(coalesceBadge({}, {}, {}).color).to.equal('lightgrey')
})
it('overrides the color', function() {
expect(
coalesceBadge({ color: '10ADED' }, { color: 'red' }, {}).color
).to.equal('10ADED')
// also expected for legacy name
expect(
coalesceBadge({ colorB: 'B0ADED' }, { color: 'red' }, {}).color
).to.equal('B0ADED')
})
context('In case of an error', function() {
it('does not override the color', function() {
expect(
coalesceBadge(
{ color: '10ADED' },
{ isError: true, color: 'lightgray' },
{}
).color
).to.equal('lightgray')
// also expected for legacy name
expect(
coalesceBadge(
{ colorB: 'B0ADED' },
{ isError: true, color: 'lightgray' },
{}
).color
).to.equal('lightgray')
})
})
it('applies the service color', function() {
expect(coalesceBadge({}, { color: 'red' }, {}).color).to.equal('red')
})
})
describe('Left color', function() {
it('provides no default label color', function() {
expect(coalesceBadge({}, {}, {}).labelColor).to.be.undefined
})
it('applies the service label color', function() {
expect(coalesceBadge({}, { labelColor: 'red' }, {}).labelColor).to.equal(
'red'
)
})
it('overrides the label color', function() {
expect(
coalesceBadge({ labelColor: '42f483' }, { color: 'green' }, {})
.labelColor
).to.equal('42f483')
// also expected for legacy name
expect(
coalesceBadge({ colorA: 'B2f483' }, { color: 'green' }, {}).labelColor
).to.equal('B2f483')
})
it('converts a query-string numeric color to a string', function() {
expect(
coalesceBadge(
// Scoutcamp converts numeric query params to numbers.
{ color: 123 },
{ color: 'green' },
{}
).color
).to.equal('123')
// also expected for legacy name
expect(
coalesceBadge(
// Scoutcamp converts numeric query params to numbers.
{ colorB: 123 },
{ color: 'green' },
{}
).color
).to.equal('123')
})
})
describe('Named logos', function() {
it('when not a social badge, ignores the default named logo', function() {
expect(coalesceBadge({}, {}, { namedLogo: 'appveyor' }).logo).to.be
.undefined
})
it('when a social badge, uses the default named logo', function() {
// .not.be.empty for confidence that nothing has changed with `getShieldsIcon()`.
expect(
coalesceBadge({ style: 'social' }, {}, { namedLogo: 'appveyor' }).logo
).to.equal(getSimpleIcon({ name: 'appveyor' })).and.not.be.empty
})
it('applies the named logo', function() {
expect(coalesceBadge({}, { namedLogo: 'npm' }, {}).namedLogo).to.equal(
'npm'
)
expect(coalesceBadge({}, { namedLogo: 'npm' }, {}).logo).to.equal(
getShieldsIcon({ name: 'npm' })
).and.not.to.be.empty
})
it('applies the named logo with color', function() {
expect(
coalesceBadge({}, { namedLogo: 'npm', logoColor: 'blue' }, {}).logo
).to.equal(getShieldsIcon({ name: 'npm', color: 'blue' })).and.not.to.be
.empty
})
it('overrides the logo', function() {
expect(
coalesceBadge({ logo: 'npm' }, { namedLogo: 'appveyor' }, {}).logo
).to.equal(getShieldsIcon({ name: 'npm' })).and.not.be.empty
})
it('overrides the logo with a color', function() {
expect(
coalesceBadge(
{ logo: 'npm', logoColor: 'blue' },
{ namedLogo: 'appveyor' },
{}
).logo
).to.equal(getShieldsIcon({ name: 'npm', color: 'blue' })).and.not.be
.empty
})
it("when the logo is overridden, it ignores the service's logo color, position, and width", function() {
expect(
coalesceBadge(
{ logo: 'npm' },
{
namedLogo: 'appveyor',
logoColor: 'red',
logoPosition: -3,
logoWidth: 100,
},
{}
).logo
).to.equal(getShieldsIcon({ name: 'npm' })).and.not.be.empty
})
it("overrides the service logo's color", function() {
expect(
coalesceBadge(
{ logoColor: 'blue' },
{ namedLogo: 'npm', logoColor: 'red' },
{}
).logo
).to.equal(getShieldsIcon({ name: 'npm', color: 'blue' })).and.not.be
.empty
})
// https://github.com/badges/shields/issues/2998
it('overrides logoSvg', function() {
const logoSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxu'
expect(coalesceBadge({ logo: 'npm' }, { logoSvg }, {}).logo).to.equal(
getShieldsIcon({ name: 'npm' })
).and.not.be.empty
})
})
describe('Custom logos', function() {
it('overrides the logo with custom svg', function() {
const logoSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxu'
expect(
coalesceBadge({ logo: logoSvg }, { namedLogo: 'appveyor' }, {}).logo
).to.equal(logoSvg)
})
it('ignores the color when custom svg is provided', function() {
const logoSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxu'
expect(
coalesceBadge(
{ logo: logoSvg, logoColor: 'brightgreen' },
{ namedLogo: 'appveyor' },
{}
).logo
).to.equal(logoSvg)
})
})
describe('Logo width', function() {
it('overrides the logoWidth', function() {
expect(coalesceBadge({ logoWidth: 20 }, {}, {}).logoWidth).to.equal(20)
})
it('applies the logo width', function() {
expect(
coalesceBadge({}, { namedLogo: 'npm', logoWidth: 275 }, {}).logoWidth
).to.equal(275)
})
})
describe('Logo position', function() {
it('overrides the logoPosition', function() {
expect(
coalesceBadge({ logoPosition: -10 }, {}, {}).logoPosition
).to.equal(-10)
})
it('applies the logo position', function() {
expect(
coalesceBadge({}, { namedLogo: 'npm', logoPosition: -10 }, {})
.logoPosition
).to.equal(-10)
})
})
describe('Links', function() {
it('overrides the links', function() {
expect(
coalesceBadge(
{ link: 'https://circleci.com/gh/badges/daily-tests' },
{
link:
'https://circleci.com/workflow-run/184ef3de-4836-4805-a2e4-0ceba099f92d',
},
{}
).links
).to.deep.equal(['https://circleci.com/gh/badges/daily-tests'])
})
})
describe('Style', function() {
it('overrides the template', function() {
expect(coalesceBadge({ style: 'pill' }, {}, {}).template).to.equal('pill')
})
})
describe('Cache length', function() {
it('overrides the cache length', function() {
expect(
coalesceBadge({ style: 'pill' }, { cacheSeconds: 123 }, {})
.cacheLengthSeconds
).to.equal(123)
})
})
})

View File

@@ -0,0 +1,5 @@
'use strict'
module.exports = function coalesce(...candidates) {
return candidates.find(c => c !== undefined && c !== null)
}

View File

@@ -0,0 +1,23 @@
'use strict'
const { test, given } = require('sazerac')
const coalesce = require('./coalesce')
// Sticking with our one-line spread implementation, and defaulting to
// `undefined` instead of `null`, though h/t to
// https://github.com/royriojas/coalescy for these tests!
describe('coalesce', function() {
test(coalesce, function() {
given().expect(undefined)
given(null, []).expect([])
given(null, [], {}).expect([])
given(null, undefined, 0, {}).expect(0)
const a = null,
c = 0,
d = 1
let b
given(a, b, c, d).expect(0)
})
})

View File

@@ -0,0 +1,63 @@
'use strict'
const Joi = require('joi')
const camelcase = require('camelcase')
const BaseService = require('./base')
const { isValidCategory } = require('./categories')
const { Deprecated } = require('./errors')
const { isValidRoute } = require('./route')
const attrSchema = Joi.object({
route: isValidRoute,
name: Joi.string(),
label: Joi.string(),
category: isValidCategory,
// The content of examples is validated later, via `transformExamples()`.
examples: Joi.array().default([]),
message: Joi.string(),
dateAdded: Joi.date().required(),
}).required()
function deprecatedService(attrs) {
const { route, name, label, category, examples, message } = Joi.attempt(
attrs,
attrSchema,
`Deprecated service for ${attrs.route.base}`
)
return class DeprecatedService extends BaseService {
static get name() {
return name
? `Deprecated${name}`
: `Deprecated${camelcase(route.base.replace(/\//g, '_'), {
pascalCase: true,
})}`
}
static get category() {
return category
}
static get isDeprecated() {
return true
}
static get route() {
return route
}
static get examples() {
return examples
}
static get defaultBadgeData() {
return { label }
}
async handle() {
throw new Deprecated({ prettyMessage: message })
}
}
}
module.exports = deprecatedService

View File

@@ -0,0 +1,69 @@
'use strict'
const { expect } = require('chai')
const deprecatedService = require('./deprecated-service')
describe('DeprecatedService', function() {
const route = {
base: 'service/that/no/longer/exists',
format: '(?:.+)',
}
const category = 'analysis'
const dateAdded = new Date()
const commonAttrs = { route, category, dateAdded }
it('returns true on isDeprecated', function() {
const service = deprecatedService({ ...commonAttrs })
expect(service.isDeprecated).to.be.true
})
it('has the expected name', function() {
const service = deprecatedService({ ...commonAttrs })
expect(service.name).to.equal('DeprecatedServiceThatNoLongerExists')
})
it('sets specified route', function() {
const service = deprecatedService({ ...commonAttrs })
expect(service.route).to.deep.equal(route)
})
it('sets specified label', function() {
const label = 'coverity'
const service = deprecatedService({ ...commonAttrs, label })
expect(service.defaultBadgeData.label).to.equal(label)
})
it('sets specified category', function() {
const service = deprecatedService({ ...commonAttrs })
expect(service.category).to.equal(category)
})
it('sets specified examples', function() {
const examples = [
{
title: 'Not sure we would have examples',
},
]
const service = deprecatedService({ ...commonAttrs, examples })
expect(service.examples).to.deep.equal(examples)
})
it('uses default deprecation message when no message specified', async function() {
const service = deprecatedService({ ...commonAttrs })
expect(await service.invoke()).to.deep.equal({
isError: true,
color: 'lightgray',
message: 'no longer available',
})
})
it('uses custom deprecation message when specified', async function() {
const message = 'extended outage'
const service = deprecatedService({ ...commonAttrs, message })
expect(await service.invoke()).to.deep.equal({
isError: true,
color: 'lightgray',
message,
})
})
})

113
core/base-service/errors.js Normal file
View File

@@ -0,0 +1,113 @@
'use strict'
class ShieldsRuntimeError extends Error {
get name() {
return 'ShieldsRuntimeError'
}
get defaultPrettyMessage() {
throw new Error('Must implement abstract method')
}
constructor(props = {}, message) {
super(message)
this.prettyMessage = props.prettyMessage || this.defaultPrettyMessage
if (props.underlyingError) {
this.stack = props.underlyingError.stack
}
}
}
const defaultNotFoundError = 'not found'
class NotFound extends ShieldsRuntimeError {
get name() {
return 'NotFound'
}
get defaultPrettyMessage() {
return defaultNotFoundError
}
constructor(props = {}) {
const prettyMessage = props.prettyMessage || defaultNotFoundError
const message =
prettyMessage === defaultNotFoundError
? 'Not Found'
: `Not Found: ${prettyMessage}`
super(props, message)
this.response = props.response
}
}
class InvalidResponse extends ShieldsRuntimeError {
get name() {
return 'InvalidResponse'
}
get defaultPrettyMessage() {
return 'invalid'
}
constructor(props = {}) {
const message = props.underlyingError
? `Invalid Response: ${props.underlyingError.message}`
: 'Invalid Response'
super(props, message)
this.response = props.response
}
}
class Inaccessible extends ShieldsRuntimeError {
get name() {
return 'Inaccessible'
}
get defaultPrettyMessage() {
return 'inaccessible'
}
constructor(props = {}) {
const message = props.underlyingError
? `Inaccessible: ${props.underlyingError.message}`
: 'Inaccessible'
super(props, message)
this.response = props.response
}
}
class InvalidParameter extends ShieldsRuntimeError {
get name() {
return 'InvalidParameter'
}
get defaultPrettyMessage() {
return 'invalid parameter'
}
constructor(props = {}) {
const message = props.underlyingError
? `Invalid Parameter: ${props.underlyingError.message}`
: 'Invalid Parameter'
super(props, message)
this.response = props.response
}
}
class Deprecated extends ShieldsRuntimeError {
get name() {
return 'Deprecated'
}
get defaultPrettyMessage() {
return 'no longer available'
}
constructor(props) {
const message = 'Deprecated'
super(props, message)
}
}
module.exports = {
ShieldsRuntimeError,
NotFound,
InvalidResponse,
Inaccessible,
InvalidParameter,
Deprecated,
}

View File

@@ -0,0 +1,169 @@
'use strict'
const Joi = require('joi')
const pathToRegexp = require('path-to-regexp')
const coalesceBadge = require('./coalesce-badge')
const { makeFullUrl } = require('./route')
const optionalObjectOfKeyValues = Joi.object().pattern(
/./,
Joi.string().allow(null)
)
const schema = Joi.object({
// This should be:
// title: Joi.string().required(),
title: Joi.string(),
namedParams: optionalObjectOfKeyValues.required(),
queryParams: optionalObjectOfKeyValues.default({}),
pattern: Joi.string(),
staticPreview: Joi.object({
label: Joi.string(),
message: Joi.alternatives()
.try(
Joi.string()
.allow('')
.required(),
Joi.number()
)
.required(),
color: Joi.string(),
style: Joi.string(),
}).required(),
keywords: Joi.array()
.items(Joi.string())
.default([]),
documentation: Joi.string(), // Valid HTML.
}).required()
function validateExample(example, index, ServiceClass) {
const result = Joi.attempt(
example,
schema,
`Example for ${ServiceClass.name} at index ${index}`
)
const { pattern, namedParams } = result
if (!pattern && !ServiceClass.route.pattern) {
throw new Error(
`Example for ${
ServiceClass.name
} at index ${index} does not declare a pattern`
)
}
if (pattern === ServiceClass.route.pattern) {
throw new Error(
`Example for ${
ServiceClass.name
} at index ${index} declares a redundant pattern which should be removed`
)
}
// Make sure we can build the full URL using these patterns.
try {
pathToRegexp.compile(pattern || ServiceClass.route.pattern)(namedParams)
} catch (e) {
throw Error(
`In example for ${
ServiceClass.name
} at index ${index}, ${e.message.toLowerCase()}`
)
}
// Make sure there are no extra keys.
let keys = []
pathToRegexp(pattern || ServiceClass.route.pattern, keys)
keys = keys.map(({ name }) => name)
const extraKeys = Object.keys(namedParams).filter(k => !keys.includes(k))
if (extraKeys.length) {
throw Error(
`In example for ${
ServiceClass.name
} at index ${index}, namedParams contains unknown keys: ${extraKeys.join(
', '
)}`
)
}
if (example.keywords) {
// Make sure the keywords are at least two characters long.
const tinyKeywords = example.keywords.filter(k => k.length < 2)
if (tinyKeywords.length) {
throw Error(
`In example for ${
ServiceClass.name
} at index ${index}, keywords contains words that are less than two characters long: ${tinyKeywords.join(
', '
)}`
)
}
// Make sure none of the keywords are already included in the title.
const title = (example.title || ServiceClass.name).toLowerCase()
const redundantKeywords = example.keywords.filter(k =>
title.includes(k.toLowerCase())
)
if (redundantKeywords.length) {
throw Error(
`In example for ${
ServiceClass.name
} at index ${index}, keywords contains words that are already in the title: ${redundantKeywords.join(
', '
)}`
)
}
}
return result
}
function transformExample(inExample, index, ServiceClass) {
const {
// We should get rid of this transform, since the class name is never what
// we want to see.
title = ServiceClass.name,
namedParams,
queryParams,
pattern,
staticPreview,
keywords,
documentation,
} = validateExample(inExample, index, ServiceClass)
const {
text: [label, message],
color,
template: style,
namedLogo,
} = coalesceBadge(
{},
staticPreview,
ServiceClass.defaultBadgeData,
ServiceClass
)
return {
title,
example: {
pattern: makeFullUrl(
ServiceClass.route.base,
pattern || ServiceClass.route.pattern
),
namedParams,
queryParams,
},
preview: {
label,
message: `${message}`,
color,
style: style === 'flat' ? undefined : style,
namedLogo,
},
keywords,
documentation: documentation ? { __html: documentation } : undefined,
}
}
module.exports = {
validateExample,
transformExample,
}

View File

@@ -0,0 +1,168 @@
'use strict'
const { expect } = require('chai')
const { test, given } = require('sazerac')
const { validateExample, transformExample } = require('./examples')
describe('validateExample function', function() {
it('passes valid examples', function() {
const validExamples = [
{
title: 'Package manager versioning badge',
staticPreview: { message: '123' },
pattern: 'dt/:package',
namedParams: { package: 'mypackage' },
keywords: ['semver', 'management'],
},
]
validExamples.forEach(example => {
expect(() =>
validateExample(example, 0, { route: {}, name: 'mockService' })
).not.to.throw(Error)
})
})
it('rejects invalid examples', function() {
const invalidExamples = [
{},
{ staticPreview: { message: '123' } },
{
staticPreview: { message: '123' },
pattern: 'dt/:package',
namedParams: { package: 'mypackage' },
exampleUrl: 'dt/mypackage',
},
{ staticPreview: { message: '123' }, pattern: 'dt/:package' },
{
staticPreview: { message: '123' },
pattern: 'dt/:package',
previewUrl: 'dt/mypackage',
},
{
staticPreview: { message: '123' },
pattern: 'dt/:package',
exampleUrl: 'dt/mypackage',
},
{ previewUrl: 'dt/mypackage' },
{
staticPreview: { message: '123' },
pattern: 'dt/:package',
namedParams: { package: 'mypackage' },
keywords: ['a'], // Keyword too short.
},
{
staticPreview: { message: '123' },
pattern: 'dt/:package',
namedParams: { package: 'mypackage' },
keywords: ['mockService'], // No title and keyword matching the class name.
},
{
title: 'Package manager versioning badge',
staticPreview: { message: '123' },
pattern: 'dt/:package',
namedParams: { package: 'mypackage' },
keywords: ['version'], // Keyword included in title.
},
]
invalidExamples.forEach(example => {
expect(() =>
validateExample(example, 0, { route: {}, name: 'mockService' })
).to.throw(Error)
})
})
})
test(transformExample, function() {
const ExampleService = {
name: 'ExampleService',
route: {
base: 'some-service',
pattern: ':interval/:packageName',
},
defaultBadgeData: {
label: 'downloads',
},
}
given(
{
pattern: 'dt/:packageName',
namedParams: { packageName: 'express' },
staticPreview: { message: '50k' },
keywords: ['hello'],
},
0,
ExampleService
).expect({
title: 'ExampleService',
example: {
pattern: '/some-service/dt/:packageName',
namedParams: { packageName: 'express' },
queryParams: {},
},
preview: {
label: 'downloads',
message: '50k',
color: 'lightgrey',
namedLogo: undefined,
style: undefined,
},
keywords: ['hello'],
documentation: undefined,
})
given(
{
namedParams: { interval: 'dt', packageName: 'express' },
staticPreview: { message: '50k' },
keywords: ['hello'],
},
0,
ExampleService
).expect({
title: 'ExampleService',
example: {
pattern: '/some-service/:interval/:packageName',
namedParams: { interval: 'dt', packageName: 'express' },
queryParams: {},
},
preview: {
label: 'downloads',
message: '50k',
color: 'lightgrey',
namedLogo: undefined,
style: undefined,
},
keywords: ['hello'],
documentation: undefined,
})
given(
{
namedParams: { interval: 'dt', packageName: 'express' },
queryParams: { registry_url: 'http://example.com/' },
staticPreview: { message: '50k' },
keywords: ['hello'],
},
0,
ExampleService
).expect({
title: 'ExampleService',
example: {
pattern: '/some-service/:interval/:packageName',
namedParams: { interval: 'dt', packageName: 'express' },
queryParams: { registry_url: 'http://example.com/' },
},
preview: {
label: 'downloads',
message: '50k',
color: 'lightgrey',
namedLogo: undefined,
style: undefined,
},
keywords: ['hello'],
documentation: undefined,
})
})

View File

@@ -0,0 +1,35 @@
'use strict'
const BaseService = require('./base')
const BaseJsonService = require('./base-json')
const NonMemoryCachingBaseService = require('./base-non-memory-caching')
const BaseStaticService = require('./base-static')
const BaseSvgScrapingService = require('./base-svg-scraping')
const BaseXmlService = require('./base-xml')
const BaseYamlService = require('./base-yaml')
const deprecatedService = require('./deprecated-service')
const redirector = require('./redirector')
const {
NotFound,
InvalidResponse,
Inaccessible,
InvalidParameter,
Deprecated,
} = require('./errors')
module.exports = {
BaseService,
BaseJsonService,
NonMemoryCachingBaseService,
BaseStaticService,
BaseSvgScrapingService,
BaseXmlService,
BaseYamlService,
deprecatedService,
redirector,
NotFound,
InvalidResponse,
Inaccessible,
InvalidParameter,
Deprecated,
}

View File

@@ -0,0 +1,310 @@
'use strict'
// eslint-disable-next-line node/no-deprecated-api
const domain = require('domain')
const request = require('request')
const queryString = require('query-string')
const LruCache = require('../../gh-badges/lib/lru-cache')
const makeBadge = require('../../gh-badges/lib/make-badge')
const log = require('../server/log')
const { setCacheHeaders } = require('./cache-headers')
const {
Inaccessible,
InvalidResponse,
ShieldsRuntimeError,
} = require('./errors')
const { makeSend } = require('./legacy-result-sender')
const coalesceBadge = require('./coalesce-badge')
// We avoid calling the vendor's server for computation of the information in a
// number of badges.
const minAccuracy = 0.75
// The quotient of (vendor) data change frequency by badge request frequency
// must be lower than this to trigger sending the cached data *before*
// updating our data from the vendor's server.
// Indeed, the accuracy of our badges are:
// A(Δt) = 1 - min(# data change over Δt, # requests over Δt)
// / (# requests over Δt)
// = 1 - max(1, df) / rf
const freqRatioMax = 1 - minAccuracy
// Request cache size of 5MB (~5000 bytes/image).
const requestCache = new LruCache(1000)
// Deep error handling for vendor hooks.
const vendorDomain = domain.create()
vendorDomain.on('error', err => {
log.error('Vendor hook error:', err.stack)
})
// These query parameters are available to any badge. They are handled by
// `coalesceBadge`.
const globalQueryParams = new Set([
'label',
'style',
'link',
'logo',
'logoColor',
'logoPosition',
'logoWidth',
'link',
'colorA',
'colorB',
'color',
'labelColor',
])
function flattenQueryParams(queryParams) {
const union = new Set(globalQueryParams)
;(queryParams || []).forEach(name => {
union.add(name)
})
return Array.from(union).sort()
}
// handlerOptions can contain:
// - handler: The service's request handler function
// - queryParams: An array of the field names of any custom query parameters
// the service uses
// - cacheLength: An optional badge or category-specific cache length
// (in number of seconds) to be used in preference to the default
// - fetchLimitBytes: A limit on the response size we're willing to parse
//
// For safety, the service must declare the query parameters it wants to use.
// Only the declared parameters (and the global parameters) are provided to
// the service. Consequently, failure to declare a parameter results in the
// parameter not working at all (which is undesirable, but easy to debug)
// rather than indeterminate behavior that depends on the cache state
// (undesirable and hard to debug).
//
// Pass just the handler function as shorthand.
function handleRequest(cacheHeaderConfig, handlerOptions) {
if (!cacheHeaderConfig) {
throw Error('cacheHeaderConfig is required')
}
if (typeof handlerOptions === 'function') {
handlerOptions = { handler: handlerOptions }
}
const allowedKeys = flattenQueryParams(handlerOptions.queryParams)
const {
cacheLength: serviceDefaultCacheLengthSeconds,
fetchLimitBytes,
} = handlerOptions
return (queryParams, match, end, ask) => {
const reqTime = new Date()
// `defaultCacheLengthSeconds` can be overridden by
// `serviceDefaultCacheLengthSeconds` (either by category or on a badge-
// by-badge basis). Then in turn that can be overridden by
// `serviceOverrideCacheLengthSeconds` (which we expect to be used only in
// the dynamic badge) but only if `serviceOverrideCacheLengthSeconds` is
// longer than `serviceDefaultCacheLengthSeconds` and then the `cacheSeconds`
// query param can also override both of those but again only if `cacheSeconds`
// is longer.
//
// When the legacy services have been rewritten, all the code in here
// will go away, which should achieve this goal in a simpler way.
//
// Ref: https://github.com/badges/shields/pull/2755
function setCacheHeadersOnResponse(res, serviceOverrideCacheLengthSeconds) {
setCacheHeaders({
cacheHeaderConfig,
serviceDefaultCacheLengthSeconds,
serviceOverrideCacheLengthSeconds,
queryParams,
res,
})
}
const filteredQueryParams = {}
allowedKeys.forEach(key => {
filteredQueryParams[key] = queryParams[key]
})
// Use sindresorhus query-string because it sorts the keys, whereas the
// builtin querystring module relies on the iteration order.
const stringified = queryString.stringify(filteredQueryParams)
const cacheIndex = `${match[0]}?${stringified}`
// Should we return the data right away?
const cached = requestCache.get(cacheIndex)
let cachedVersionSent = false
if (cached !== undefined) {
// A request was made not long ago.
const tooSoon = +reqTime - cached.time < cached.interval
if (tooSoon || cached.dataChange / cached.reqs <= freqRatioMax) {
const svg = makeBadge(cached.data.badgeData)
setCacheHeadersOnResponse(
ask.res,
cached.data.badgeData.cacheLengthSeconds
)
makeSend(cached.data.format, ask.res, end)(svg)
cachedVersionSent = true
// We do not wish to call the vendor servers.
if (tooSoon) {
return
}
}
}
// In case our vendor servers are unresponsive.
let serverUnresponsive = false
const serverResponsive = setTimeout(() => {
serverUnresponsive = true
if (cachedVersionSent) {
return
}
if (requestCache.has(cacheIndex)) {
const cached = requestCache.get(cacheIndex)
const svg = makeBadge(cached.data.badgeData)
setCacheHeadersOnResponse(
ask.res,
cached.data.badgeData.cacheLengthSeconds
)
makeSend(cached.data.format, ask.res, end)(svg)
return
}
ask.res.setHeader('Cache-Control', 'no-cache, no-store, must-revalidate')
const badgeData = coalesceBadge(
filteredQueryParams,
{ label: 'vendor', message: 'unresponsive' },
{}
)
const svg = makeBadge(badgeData)
let extension
try {
extension = match[0].split('.').pop()
} catch (e) {
extension = 'svg'
}
setCacheHeadersOnResponse(ask.res)
makeSend(extension, ask.res, end)(svg)
}, 25000)
// Only call vendor servers when last request is older than…
let cacheInterval = 5000 // milliseconds
function cachingRequest(uri, options, callback) {
if (typeof options === 'function' && !callback) {
callback = options
}
if (options && typeof options === 'object') {
options.uri = uri
} else if (typeof uri === 'string') {
options = { uri }
} else {
options = uri
}
options.headers = options.headers || {}
options.headers['User-Agent'] =
options.headers['User-Agent'] || 'Shields.io'
let bufferLength = 0
const r = request(options, (err, res, body) => {
if (res != null && res.headers != null) {
const cacheControl = res.headers['cache-control']
if (cacheControl != null) {
const age = cacheControl.match(/max-age=([0-9]+)/)
// Would like to get some more test coverage on this before changing it.
// eslint-disable-next-line no-self-compare
if (age != null && +age[1] === +age[1]) {
cacheInterval = +age[1] * 1000
}
}
}
callback(err, res, body)
})
r.on('data', chunk => {
bufferLength += chunk.length
if (bufferLength > fetchLimitBytes) {
r.abort()
r.emit(
'error',
new InvalidResponse({
prettyMessage: 'Maximum response size exceeded',
})
)
}
})
}
// Wrapper around `cachingRequest` that returns a promise rather than
// needing to pass a callback.
cachingRequest.asPromise = (uri, options) =>
new Promise((resolve, reject) => {
cachingRequest(uri, options, (err, res, buffer) => {
if (err) {
if (err instanceof ShieldsRuntimeError) {
reject(err)
} else {
// Wrap the error in an Inaccessible so it can be identified
// by the BaseService handler.
reject(new Inaccessible({ underlyingError: err }))
}
} else {
resolve({ res, buffer })
}
})
})
vendorDomain.run(() => {
const result = handlerOptions.handler(
filteredQueryParams,
match,
// eslint-disable-next-line mocha/prefer-arrow-callback
function sendBadge(format, badgeData) {
if (serverUnresponsive) {
return
}
clearTimeout(serverResponsive)
// Check for a change in the data.
let dataHasChanged = false
if (
cached !== undefined &&
cached.data.badgeData.text[1] !== badgeData.text[1]
) {
dataHasChanged = true
}
// Add format to badge data.
badgeData.format = format
// Update information in the cache.
const updatedCache = {
reqs: cached ? cached.reqs + 1 : 1,
dataChange: cached
? cached.dataChange + (dataHasChanged ? 1 : 0)
: 1,
time: +reqTime,
interval: cacheInterval,
data: { format, badgeData },
}
requestCache.set(cacheIndex, updatedCache)
if (!cachedVersionSent) {
const svg = makeBadge(badgeData)
setCacheHeadersOnResponse(ask.res, badgeData.cacheLengthSeconds)
makeSend(format, ask.res, end)(svg)
}
},
cachingRequest
)
if (result && result.catch) {
result.catch(err => {
throw err
})
}
})
}
}
function clearRequestCache() {
requestCache.clear()
}
module.exports = {
handleRequest,
clearRequestCache,
// Expose for testing.
_requestCache: requestCache,
}

View File

@@ -0,0 +1,392 @@
'use strict'
const { expect } = require('chai')
// https://github.com/nock/nock/issues/1523
const got = require('got').extend({ retry: 0 })
const nock = require('nock')
const portfinder = require('portfinder')
const Camp = require('camp')
const coalesceBadge = require('./coalesce-badge')
const {
handleRequest,
clearRequestCache,
_requestCache,
} = require('./legacy-request-handler')
async function performTwoRequests(baseUrl, first, second) {
expect((await got(`${baseUrl}${first}`)).statusCode).to.equal(200)
expect((await got(`${baseUrl}${second}`)).statusCode).to.equal(200)
}
function fakeHandler(queryParams, match, sendBadge, request) {
const [, someValue, format] = match
const badgeData = coalesceBadge(
queryParams,
{
label: 'testing',
message: someValue,
},
{}
)
sendBadge(format, badgeData)
}
function createFakeHandlerWithCacheLength(cacheLengthSeconds) {
return function fakeHandler(queryParams, match, sendBadge, request) {
const [, someValue, format] = match
const badgeData = coalesceBadge(
queryParams,
{
label: 'testing',
message: someValue,
},
{},
{
_cacheLength: cacheLengthSeconds,
}
)
sendBadge(format, badgeData)
}
}
function fakeHandlerWithNetworkIo(queryParams, match, sendBadge, request) {
const [, someValue, format] = match
request('https://www.google.com/foo/bar', (err, res, buffer) => {
let message
if (err) {
message = err.prettyMessage
} else {
message = someValue
}
const badgeData = coalesceBadge(
queryParams,
{
label: 'testing',
message,
format,
},
{}
)
sendBadge(format, badgeData)
})
}
describe('The request handler', function() {
let port, baseUrl
beforeEach(async function() {
port = await portfinder.getPortPromise()
baseUrl = `http://127.0.0.1:${port}`
})
let camp
beforeEach(function(done) {
camp = Camp.start({ port, hostname: '::' })
camp.on('listening', () => done())
})
afterEach(function(done) {
clearRequestCache()
if (camp) {
camp.close(() => done())
camp = null
}
})
const standardCacheHeaders = { defaultCacheLengthSeconds: 120 }
describe('the options object calling style', function() {
beforeEach(function() {
camp.route(
/^\/testing\/([^/]+)\.(svg|png|gif|jpg|json)$/,
handleRequest(standardCacheHeaders, { handler: fakeHandler })
)
})
it('should return the expected response', async function() {
const { statusCode, body } = await got(`${baseUrl}/testing/123.json`, {
json: true,
})
expect(statusCode).to.equal(200)
expect(body).to.deep.equal({
name: 'testing',
value: '123',
label: 'testing',
message: '123',
color: 'lightgrey',
link: [],
})
})
})
describe('the function shorthand calling style', function() {
beforeEach(function() {
camp.route(
/^\/testing\/([^/]+)\.(svg|png|gif|jpg|json)$/,
handleRequest(standardCacheHeaders, fakeHandler)
)
})
it('should return the expected response', async function() {
const { statusCode, body } = await got(`${baseUrl}/testing/123.json`, {
json: true,
})
expect(statusCode).to.equal(200)
expect(body).to.deep.equal({
name: 'testing',
value: '123',
label: 'testing',
message: '123',
color: 'lightgrey',
link: [],
})
})
})
describe('the response size limit', function() {
beforeEach(function() {
camp.route(
/^\/testing\/([^/]+)\.(svg|png|gif|jpg|json)$/,
handleRequest(standardCacheHeaders, {
handler: fakeHandlerWithNetworkIo,
fetchLimitBytes: 100,
})
)
})
it('should not throw an error if the response <= fetchLimitBytes', async function() {
nock('https://www.google.com')
.get('/foo/bar')
.once()
.reply(200, 'x'.repeat(100))
const { statusCode, body } = await got(`${baseUrl}/testing/123.json`, {
json: true,
})
expect(statusCode).to.equal(200)
expect(body).to.deep.equal({
name: 'testing',
value: '123',
label: 'testing',
message: '123',
color: 'lightgrey',
link: [],
})
})
it('should throw an error if the response is > fetchLimitBytes', async function() {
nock('https://www.google.com')
.get('/foo/bar')
.once()
.reply(200, 'x'.repeat(101))
const { statusCode, body } = await got(`${baseUrl}/testing/123.json`, {
json: true,
})
expect(statusCode).to.equal(200)
expect(body).to.deep.equal({
name: 'testing',
value: 'Maximum response size exceeded',
label: 'testing',
message: 'Maximum response size exceeded',
color: 'lightgrey',
link: [],
})
})
afterEach(function() {
nock.cleanAll()
})
})
describe('caching', function() {
describe('standard query parameters', function() {
let handlerCallCount
beforeEach(function() {
handlerCallCount = 0
})
function register({ cacheHeaderConfig }) {
camp.route(
/^\/testing\/([^/]+)\.(svg|png|gif|jpg|json)$/,
handleRequest(
cacheHeaderConfig,
(queryParams, match, sendBadge, request) => {
++handlerCallCount
fakeHandler(queryParams, match, sendBadge, request)
}
)
)
}
context('With standard cache settings', function() {
beforeEach(function() {
register({ cacheHeaderConfig: standardCacheHeaders })
})
it('should cache identical requests', async function() {
await performTwoRequests(
baseUrl,
'/testing/123.svg',
'/testing/123.svg'
)
expect(handlerCallCount).to.equal(1)
})
it('should differentiate known query parameters', async function() {
await performTwoRequests(
baseUrl,
'/testing/123.svg?label=foo',
'/testing/123.svg?label=bar'
)
expect(handlerCallCount).to.equal(2)
})
it('should ignore unknown query parameters', async function() {
await performTwoRequests(
baseUrl,
'/testing/123.svg?foo=1',
'/testing/123.svg?foo=2'
)
expect(handlerCallCount).to.equal(1)
})
})
it('should set the expires header to current time + defaultCacheLengthSeconds', async function() {
register({ cacheHeaderConfig: { defaultCacheLengthSeconds: 900 } })
const { headers } = await got(`${baseUrl}/testing/123.json`)
const expectedExpiry = new Date(
+new Date(headers.date) + 900000
).toGMTString()
expect(headers.expires).to.equal(expectedExpiry)
expect(headers['cache-control']).to.equal('max-age=900')
})
it('should set the expected cache headers on cached responses', async function() {
register({ cacheHeaderConfig: { defaultCacheLengthSeconds: 900 } })
// Make first request.
await got(`${baseUrl}/testing/123.json`)
const { headers } = await got(`${baseUrl}/testing/123.json`)
const expectedExpiry = new Date(
+new Date(headers.date) + 900000
).toGMTString()
expect(headers.expires).to.equal(expectedExpiry)
expect(headers['cache-control']).to.equal('max-age=900')
})
it('should let live service data override the default cache headers with longer value', async function() {
camp.route(
/^\/testing\/([^/]+)\.(svg|png|gif|jpg|json)$/,
handleRequest(
{ defaultCacheLengthSeconds: 300 },
(queryParams, match, sendBadge, request) => {
++handlerCallCount
createFakeHandlerWithCacheLength(400)(
queryParams,
match,
sendBadge,
request
)
}
)
)
const { headers } = await got(`${baseUrl}/testing/123.json`)
expect(headers['cache-control']).to.equal('max-age=400')
})
it('should not let live service data override the default cache headers with shorter value', async function() {
camp.route(
/^\/testing\/([^/]+)\.(svg|png|gif|jpg|json)$/,
handleRequest(
{ defaultCacheLengthSeconds: 300 },
(queryParams, match, sendBadge, request) => {
++handlerCallCount
createFakeHandlerWithCacheLength(200)(
queryParams,
match,
sendBadge,
request
)
}
)
)
const { headers } = await got(`${baseUrl}/testing/123.json`)
expect(headers['cache-control']).to.equal('max-age=300')
})
it('should set the expires header to current time + cacheSeconds', async function() {
register({ cacheHeaderConfig: { defaultCacheLengthSeconds: 0 } })
const { headers } = await got(
`${baseUrl}/testing/123.json?cacheSeconds=3600`
)
const expectedExpiry = new Date(
+new Date(headers.date) + 3600000
).toGMTString()
expect(headers.expires).to.equal(expectedExpiry)
expect(headers['cache-control']).to.equal('max-age=3600')
})
it('should ignore cacheSeconds when shorter than defaultCacheLengthSeconds', async function() {
register({ cacheHeaderConfig: { defaultCacheLengthSeconds: 600 } })
const { headers } = await got(
`${baseUrl}/testing/123.json?cacheSeconds=300`
)
const expectedExpiry = new Date(
+new Date(headers.date) + 600000
).toGMTString()
expect(headers.expires).to.equal(expectedExpiry)
expect(headers['cache-control']).to.equal('max-age=600')
})
it('should set Cache-Control: no-cache, no-store, must-revalidate if cache seconds is 0', async function() {
register({ cacheHeaderConfig: { defaultCacheLengthSeconds: 0 } })
const { headers } = await got(`${baseUrl}/testing/123.json`)
expect(headers.expires).to.equal(headers.date)
expect(headers['cache-control']).to.equal(
'no-cache, no-store, must-revalidate'
)
})
describe('the cache key', function() {
beforeEach(function() {
register({ cacheHeaderConfig: standardCacheHeaders })
})
const expectedCacheKey = '/testing/123.json?color=123&label=foo'
it('should match expected and use canonical order - 1', async function() {
await got(`${baseUrl}/testing/123.json?color=123&label=foo`)
expect(_requestCache.cache).to.have.keys(expectedCacheKey)
})
it('should match expected and use canonical order - 2', async function() {
await got(`${baseUrl}/testing/123.json?label=foo&color=123`)
expect(_requestCache.cache).to.have.keys(expectedCacheKey)
})
})
})
describe('custom query parameters', function() {
let handlerCallCount
beforeEach(function() {
handlerCallCount = 0
camp.route(
/^\/testing\/([^/]+)\.(svg|png|gif|jpg|json)$/,
handleRequest(standardCacheHeaders, {
queryParams: ['foo'],
handler: (queryParams, match, sendBadge, request) => {
++handlerCallCount
fakeHandler(queryParams, match, sendBadge, request)
},
})
)
})
it('should differentiate them', async function() {
await performTwoRequests(
baseUrl,
'/testing/123.svg?foo=1',
'/testing/123.svg?foo=2'
)
expect(handlerCallCount).to.equal(2)
})
})
})
})

View File

@@ -0,0 +1,61 @@
'use strict'
const fs = require('fs')
const path = require('path')
const stream = require('stream')
const svg2img = require('../../gh-badges/lib/svg-to-img')
const log = require('../server/log')
const internalError = fs.readFileSync(
path.resolve(__dirname, '..', 'server', 'error-pages', '500.html'),
'utf-8'
)
function streamFromString(str) {
const newStream = new stream.Readable()
newStream._read = () => {
newStream.push(str)
newStream.push(null)
}
return newStream
}
function sendSVG(res, askres, end) {
askres.setHeader('Content-Type', 'image/svg+xml;charset=utf-8')
end(null, { template: streamFromString(res) })
}
function sendOther(format, res, askres, end) {
askres.setHeader('Content-Type', `image/${format}`)
svg2img(res, format)
// This interacts with callback code and can't use async/await.
// eslint-disable-next-line promise/prefer-await-to-then
.then(data => {
end(null, { template: streamFromString(data) })
})
.catch(err => {
// This emits status code 200, though 500 would be preferable.
log.error('svg2img error', err)
end(internalError)
})
}
function sendJSON(res, askres, end) {
askres.setHeader('Content-Type', 'application/json')
askres.setHeader('Access-Control-Allow-Origin', '*')
end(null, { template: streamFromString(res) })
}
function makeSend(format, askres, end) {
if (format === 'svg') {
return res => sendSVG(res, askres, end)
} else if (format === 'json') {
return res => sendJSON(res, askres, end)
} else {
return res => sendOther(format, res, askres, end)
}
}
module.exports = {
makeSend,
}

View File

@@ -0,0 +1,3 @@
'use strict'
module.exports = []

View File

@@ -0,0 +1,4 @@
/* eslint-disable */
'use strict'
class BadService {}

View File

@@ -0,0 +1,3 @@
'use strict'
module.exports = {}

View File

@@ -0,0 +1,3 @@
'use strict'
module.exports = undefined

View File

@@ -0,0 +1,9 @@
'use strict'
const BaseJsonService = require('../base-json')
class BadBaseService {}
class GoodService extends BaseJsonService {}
class BadService extends BadBaseService {}
module.exports = [GoodService, BadService]

View File

@@ -0,0 +1,5 @@
'use strict'
class BadService {}
module.exports = BadService

View File

@@ -0,0 +1,6 @@
'use strict'
class BadBaseService {}
class BadService extends BadBaseService {}
module.exports = BadService

View File

@@ -0,0 +1,30 @@
'use strict'
const BaseJsonService = require('../base-json')
class GoodServiceOne extends BaseJsonService {
static get category() {
return 'build'
}
static get route() {
return {
base: 'good',
pattern: 'one',
}
}
}
class GoodServiceTwo extends BaseJsonService {
static get category() {
return 'build'
}
static get route() {
return {
base: 'good',
pattern: 'two',
}
}
}
module.exports = [GoodServiceOne, GoodServiceTwo]

View File

@@ -0,0 +1,18 @@
'use strict'
const BaseJsonService = require('../base-json')
class GoodService extends BaseJsonService {
static get category() {
return 'build'
}
static get route() {
return {
base: 'it/is',
pattern: 'good',
}
}
}
module.exports = GoodService

View File

@@ -0,0 +1,30 @@
'use strict'
const BaseJsonService = require('../base-json')
class GoodServiceOne extends BaseJsonService {
static get category() {
return 'build'
}
static get route() {
return {
base: 'good',
pattern: 'one',
}
}
}
class GoodServiceTwo extends BaseJsonService {
static get category() {
return 'build'
}
static get route() {
return {
base: 'good',
pattern: 'two',
}
}
}
module.exports = { GoodServiceOne, GoodServiceTwo }

115
core/base-service/loader.js Normal file
View File

@@ -0,0 +1,115 @@
'use strict'
const path = require('path')
const glob = require('glob')
const countBy = require('lodash.countby')
const categories = require('../../services/categories')
const BaseService = require('./base')
const { assertValidServiceDefinitionExport } = require('./service-definitions')
const serviceDir = path.join(__dirname, '..', '..', 'services')
class InvalidService extends Error {
constructor(message) {
super(message)
this.name = 'InvalidService'
}
}
function loadServiceClasses(servicePaths) {
if (!servicePaths) {
servicePaths = glob.sync(path.join(serviceDir, '**', '*.service.js'))
}
let serviceClasses = []
servicePaths.forEach(servicePath => {
const module = require(servicePath)
const theseServiceClasses = []
if (
!module ||
(module.constructor === Array && module.length === 0) ||
(module.constructor === Object && Object.keys(module).length === 0)
) {
throw new InvalidService(
`Expected ${servicePath} to export a service or a collection of services`
)
} else if (module.prototype instanceof BaseService) {
theseServiceClasses.push(module)
} else if (module.constructor === Array || module.constructor === Object) {
for (const key in module) {
const serviceClass = module[key]
if (serviceClass.prototype instanceof BaseService) {
theseServiceClasses.push(serviceClass)
} else {
throw new InvalidService(
`Expected ${servicePath} to export a service or a collection of services; one of them was ${serviceClass}`
)
}
}
} else {
throw new InvalidService(
`Expected ${servicePath} to export a service or a collection of services; got ${module}`
)
}
// Decorate each service class with the directory that contains it.
theseServiceClasses.forEach(serviceClass => {
serviceClass.serviceFamily = servicePath
.replace(serviceDir, '')
.split(path.sep)[1]
})
serviceClasses = serviceClasses.concat(theseServiceClasses)
})
serviceClasses.forEach(ServiceClass => ServiceClass.validateDefinition())
return serviceClasses
}
function assertNamesUnique(names, { message }) {
const duplicates = {}
Object.entries(countBy(names))
.filter(([name, count]) => count > 1)
.forEach(([name, count]) => {
duplicates[name] = count
})
if (Object.keys(duplicates).length) {
throw new Error(`${message}: ${JSON.stringify(duplicates, undefined, 2)}`)
}
}
function checkNames() {
const services = loadServiceClasses()
assertNamesUnique(services.map(({ name }) => name), {
message: 'Duplicate service names found',
})
}
function collectDefinitions() {
const services = loadServiceClasses()
// flatMap.
.map(ServiceClass => ServiceClass.getDefinition())
.reduce((accum, these) => accum.concat(these), [])
const result = { schemaVersion: '0', categories, services }
assertValidServiceDefinitionExport(result)
return result
}
function loadTesters() {
return glob
.sync(path.join(serviceDir, '**', '*.tester.js'))
.map(path => require(path))
}
module.exports = {
InvalidService,
loadServiceClasses,
checkNames,
collectDefinitions,
loadTesters,
}

View File

@@ -0,0 +1,59 @@
'use strict'
const { expect } = require('chai')
const { loadServiceClasses, InvalidService } = require('./loader')
describe('loadServiceClasses function', function() {
it('throws if module exports empty', function() {
expect(() =>
loadServiceClasses(['./loader-test-fixtures/empty-undefined.fixture.js'])
).to.throw(InvalidService)
expect(() =>
loadServiceClasses(['./loader-test-fixtures/empty-array.fixture.js'])
).to.throw()
expect(() =>
loadServiceClasses(['./loader-test-fixtures/empty-object.fixture.js'])
).to.throw(InvalidService)
expect(() =>
loadServiceClasses(['./loader-test-fixtures/empty-no-export.fixture.js'])
).to.throw(InvalidService)
expect(() =>
loadServiceClasses([
'./loader-test-fixtures/valid-array.fixture.js',
'./loader-test-fixtures/valid-class.fixture.js',
'./loader-test-fixtures/empty-array.fixture.js',
])
).to.throw(InvalidService)
})
it('throws if module exports invalid', function() {
expect(() =>
loadServiceClasses(['./loader-test-fixtures/invalid-no-base.fixture.js'])
).to.throw(InvalidService)
expect(() =>
loadServiceClasses([
'./loader-test-fixtures/invalid-wrong-base.fixture.js',
])
).to.throw(InvalidService)
expect(() =>
loadServiceClasses(['./loader-test-fixtures/invalid-mixed.fixture.js'])
).to.throw(InvalidService)
expect(() =>
loadServiceClasses([
'./loader-test-fixtures/valid-array.fixture.js',
'./loader-test-fixtures/valid-class.fixture.js',
'./loader-test-fixtures/invalid-no-base.fixture.js',
])
).to.throw(InvalidService)
})
it('registers services if module exports valid service classes', function() {
expect(
loadServiceClasses([
'./loader-test-fixtures/valid-array.fixture.js',
'./loader-test-fixtures/valid-object.fixture.js',
'./loader-test-fixtures/valid-class.fixture.js',
])
).to.have.length(5)
})
})

View File

@@ -0,0 +1,123 @@
'use strict'
const camelcase = require('camelcase')
const emojic = require('emojic')
const Joi = require('joi')
const queryString = require('query-string')
const BaseService = require('./base')
const {
serverHasBeenUpSinceResourceCached,
setCacheHeadersForStaticResource,
} = require('./cache-headers')
const { isValidCategory } = require('./categories')
const { isValidRoute, prepareRoute, namedParamsForMatch } = require('./route')
const trace = require('./trace')
const attrSchema = Joi.object({
name: Joi.string().min(3),
category: isValidCategory,
route: isValidRoute,
transformPath: Joi.func()
.maxArity(1)
.required()
.error(
() =>
'"transformPath" must be a function that transforms named params to a new path'
),
transformQueryParams: Joi.func().arity(1),
dateAdded: Joi.date().required(),
overrideTransformedQueryParams: Joi.bool().optional(),
}).required()
module.exports = function redirector(attrs) {
const {
name,
category,
route,
transformPath,
transformQueryParams,
overrideTransformedQueryParams,
} = Joi.attempt(attrs, attrSchema, `Redirector for ${attrs.route.base}`)
return class Redirector extends BaseService {
static get name() {
if (name) {
return name
} else {
return `${camelcase(route.base.replace(/\//g, '_'), {
pascalCase: true,
})}Redirect`
}
}
static get category() {
return category
}
static get isDeprecated() {
return true
}
static get route() {
return route
}
static register({ camp, requestCounter }) {
const { regex, captureNames } = prepareRoute(this.route)
const serviceRequestCounter = this._createServiceRequestCounter({
requestCounter,
})
camp.route(regex, async (queryParams, match, end, ask) => {
if (serverHasBeenUpSinceResourceCached(ask.req)) {
// Send Not Modified.
ask.res.statusCode = 304
ask.res.end()
return
}
const namedParams = namedParamsForMatch(captureNames, match, this)
trace.logTrace(
'inbound',
emojic.arrowHeadingUp,
'Redirector',
route.base
)
trace.logTrace('inbound', emojic.ticket, 'Named params', namedParams)
trace.logTrace('inbound', emojic.crayon, 'Query params', queryParams)
const targetPath = transformPath(namedParams)
trace.logTrace('validate', emojic.dart, 'Target', targetPath)
let urlSuffix = ask.uri.search || ''
if (transformQueryParams) {
const specifiedParams = queryString.parse(urlSuffix)
const transformedParams = transformQueryParams(namedParams)
const redirectParams = overrideTransformedQueryParams
? Object.assign(transformedParams, specifiedParams)
: Object.assign(specifiedParams, transformedParams)
const outQueryString = queryString.stringify(redirectParams)
urlSuffix = `?${outQueryString}`
}
// The final capture group is the extension.
const format = match.slice(-1)[0]
const redirectUrl = `${targetPath}.${format}${urlSuffix}`
trace.logTrace('outbound', emojic.shield, 'Redirect URL', redirectUrl)
ask.res.statusCode = 301
ask.res.setHeader('Location', redirectUrl)
// To avoid caching mistakes for a long time, and to make this simpler
// to reason about, use the same cache semantics as the static badge.
setCacheHeadersForStaticResource(ask.res)
ask.res.end()
serviceRequestCounter.inc()
})
}
}
}

View File

@@ -0,0 +1,207 @@
'use strict'
const Camp = require('camp')
const got = require('got')
const portfinder = require('portfinder')
const { expect } = require('chai')
const redirector = require('./redirector')
describe('Redirector', function() {
const route = {
base: 'very/old/service',
pattern: ':namedParamA',
}
const category = 'analysis'
const transformPath = () => {}
const dateAdded = new Date()
const attrs = { category, route, transformPath, dateAdded }
it('returns true on isDeprecated', function() {
expect(redirector(attrs).isDeprecated).to.be.true
})
it('has the expected name', function() {
expect(redirector(attrs).name).to.equal('VeryOldServiceRedirect')
})
it('overrides the name', function() {
expect(
redirector({
...attrs,
name: 'ShinyRedirect',
}).name
).to.equal('ShinyRedirect')
})
it('sets specified route', function() {
expect(redirector(attrs).route).to.deep.equal(route)
})
it('sets specified category', function() {
expect(redirector(attrs).category).to.equal(category)
})
it('throws the expected error when dateAdded is missing', function() {
expect(() =>
redirector({ route, category, transformPath }).validateDefinition()
).to.throw('"dateAdded" is required')
})
describe('ScoutCamp integration', function() {
let port, baseUrl
beforeEach(async function() {
port = await portfinder.getPortPromise()
baseUrl = `http://127.0.0.1:${port}`
})
let camp
beforeEach(async function() {
camp = Camp.start({ port, hostname: '::' })
await new Promise(resolve => camp.on('listening', () => resolve()))
})
afterEach(async function() {
if (camp) {
await new Promise(resolve => camp.close(resolve))
camp = undefined
}
})
const transformPath = ({ namedParamA }) => `/new/service/${namedParamA}`
beforeEach(function() {
const ServiceClass = redirector({
category,
route,
transformPath,
dateAdded,
})
ServiceClass.register({ camp }, {})
})
it('should redirect as configured', async function() {
const { statusCode, headers } = await got(
`${baseUrl}/very/old/service/hello-world.svg`,
{
followRedirect: false,
}
)
expect(statusCode).to.equal(301)
expect(headers.location).to.equal('/new/service/hello-world.svg')
})
it('should preserve the extension', async function() {
const { statusCode, headers } = await got(
`${baseUrl}/very/old/service/hello-world.png`,
{
followRedirect: false,
}
)
expect(statusCode).to.equal(301)
expect(headers.location).to.equal('/new/service/hello-world.png')
})
it('should forward the query params', async function() {
const { statusCode, headers } = await got(
`${baseUrl}/very/old/service/hello-world.svg?color=123&style=flat-square`,
{
followRedirect: false,
}
)
expect(statusCode).to.equal(301)
expect(headers.location).to.equal(
'/new/service/hello-world.svg?color=123&style=flat-square'
)
})
describe('transformQueryParams', function() {
const route = {
base: 'another/old/service',
pattern: 'token/:token/:namedParamA',
}
const transformQueryParams = ({ token }) => ({ token })
beforeEach(function() {
const ServiceClass = redirector({
category,
route,
transformPath,
transformQueryParams,
dateAdded,
})
ServiceClass.register({ camp }, {})
})
it('should forward the transformed query params', async function() {
const { statusCode, headers } = await got(
`${baseUrl}/another/old/service/token/abc123/hello-world.svg`,
{
followRedirect: false,
}
)
expect(statusCode).to.equal(301)
expect(headers.location).to.equal(
'/new/service/hello-world.svg?token=abc123'
)
})
it('should forward the specified and transformed query params', async function() {
const { statusCode, headers } = await got(
`${baseUrl}/another/old/service/token/abc123/hello-world.svg?color=123&style=flat-square`,
{
followRedirect: false,
}
)
expect(statusCode).to.equal(301)
expect(headers.location).to.equal(
'/new/service/hello-world.svg?color=123&style=flat-square&token=abc123'
)
})
it('should use transformed query params on param conflicts by default', async function() {
const { statusCode, headers } = await got(
`${baseUrl}/another/old/service/token/abc123/hello-world.svg?color=123&style=flat-square&token=def456`,
{
followRedirect: false,
}
)
expect(statusCode).to.equal(301)
expect(headers.location).to.equal(
'/new/service/hello-world.svg?color=123&style=flat-square&token=abc123'
)
})
it('should use specified query params on param conflicts when configured', async function() {
const route = {
base: 'override/service',
pattern: 'token/:token/:namedParamA',
}
const ServiceClass = redirector({
category,
route,
transformPath,
transformQueryParams,
overrideTransformedQueryParams: true,
dateAdded,
})
ServiceClass.register({ camp }, {})
const { statusCode, headers } = await got(
`${baseUrl}/override/service/token/abc123/hello-world.svg?style=flat-square&token=def456`,
{
followRedirect: false,
}
)
expect(statusCode).to.equal(301)
expect(headers.location).to.equal(
'/new/service/hello-world.svg?style=flat-square&token=def456'
)
})
})
})
})

View File

@@ -0,0 +1,88 @@
'use strict'
const Joi = require('joi')
const pathToRegexp = require('path-to-regexp')
function makeFullUrl(base, partialUrl) {
return `/${[base, partialUrl].filter(Boolean).join('/')}`
}
const isValidRoute = Joi.object({
base: Joi.string()
.allow('')
.required(),
pattern: Joi.string().allow(''),
format: Joi.string(),
capture: Joi.alternatives().when('format', {
is: Joi.string().required(),
then: Joi.array().items(Joi.string().required()),
}),
queryParamSchema: Joi.object().schema(),
})
.xor('pattern', 'format')
.required()
function assertValidRoute(route, message = undefined) {
Joi.assert(route, isValidRoute, message)
}
function prepareRoute({ base, pattern, format, capture }) {
let regex, captureNames
if (pattern === undefined) {
regex = new RegExp(
`^${makeFullUrl(base, format)}\\.(svg|png|gif|jpg|json)$`
)
captureNames = capture || []
} else {
const fullPattern = `${makeFullUrl(
base,
pattern
)}.:ext(svg|png|gif|jpg|json)`
const keys = []
regex = pathToRegexp(fullPattern, keys, {
strict: true,
sensitive: true,
})
captureNames = keys.map(item => item.name).slice(0, -1)
}
return { regex, captureNames }
}
function namedParamsForMatch(captureNames = [], match, ServiceClass) {
// Assume the last match is the format, and drop match[0], which is the
// entire match.
const captures = match.slice(1, -1)
if (captureNames.length !== captures.length) {
throw new Error(
`Service ${
ServiceClass.name
} declares incorrect number of named params ` +
`(expected ${captures.length}, got ${captureNames.length})`
)
}
const result = {}
captureNames.forEach((name, index) => {
result[name] = captures[index]
})
return result
}
function getQueryParamNames({ queryParamSchema }) {
if (queryParamSchema) {
const { children, renames = [] } = Joi.describe(queryParamSchema)
return Object.keys(children).concat(renames.map(({ from }) => from))
} else {
return []
}
}
module.exports = {
makeFullUrl,
isValidRoute,
assertValidRoute,
prepareRoute,
namedParamsForMatch,
getQueryParamNames,
}

View File

@@ -0,0 +1,124 @@
'use strict'
const { expect } = require('chai')
const Joi = require('joi')
const { test, given, forCases } = require('sazerac')
const {
prepareRoute,
namedParamsForMatch,
getQueryParamNames,
} = require('./route')
describe('Route helpers', function() {
context('A `pattern` with a named param is declared', function() {
const { regex, captureNames } = prepareRoute({
base: 'foo',
pattern: ':namedParamA',
queryParamSchema: Joi.object({ queryParamA: Joi.string() }).required(),
})
const regexExec = str => regex.exec(str)
test(regexExec, () => {
forCases([
given('/foo/bar.bar.bar.zip'),
given('/foo/bar/bar.svg'),
// This is a valid example with the wrong extension separator, to
// test that we only accept a `.`.
given('/foo/bar.bar.bar_svg'),
]).expect(null)
})
const namedParams = str =>
namedParamsForMatch(captureNames, regex.exec(str))
test(namedParams, () => {
forCases([
given('/foo/bar.bar.bar.svg'),
given('/foo/bar.bar.bar.png'),
given('/foo/bar.bar.bar.gif'),
given('/foo/bar.bar.bar.jpg'),
given('/foo/bar.bar.bar.json'),
]).expect({ namedParamA: 'bar.bar.bar' })
})
})
context('A `format` with a named param is declared', function() {
const { regex, captureNames } = prepareRoute({
base: 'foo',
format: '([^/]+)',
capture: ['namedParamA'],
})
const regexExec = str => regex.exec(str)
test(regexExec, () => {
forCases([
given('/foo/bar.bar.bar.zip'),
given('/foo/bar/bar.svg'),
// This is a valid example with the wrong extension separator, to
// test that we only accept a `.`.
given('/foo/bar.bar.bar_svg'),
]).expect(null)
})
const namedParams = str =>
namedParamsForMatch(captureNames, regex.exec(str))
test(namedParams, () => {
forCases([
given('/foo/bar.bar.bar.svg'),
given('/foo/bar.bar.bar.png'),
given('/foo/bar.bar.bar.gif'),
given('/foo/bar.bar.bar.jpg'),
given('/foo/bar.bar.bar.json'),
]).expect({ namedParamA: 'bar.bar.bar' })
})
})
context('No named params are declared', function() {
const { regex, captureNames } = prepareRoute({
base: 'foo',
format: '(?:[^/]+)',
})
const namedParams = str =>
namedParamsForMatch(captureNames, regex.exec(str))
test(namedParams, () => {
forCases([
given('/foo/bar.bar.bar.svg'),
given('/foo/bar.bar.bar.png'),
given('/foo/bar.bar.bar.gif'),
given('/foo/bar.bar.bar.jpg'),
given('/foo/bar.bar.bar.json'),
]).expect({})
})
})
context('The wrong number of params are declared', function() {
const { regex, captureNames } = prepareRoute({
base: 'foo',
format: '([^/]+)/([^/]+)',
capture: ['namedParamA'],
})
expect(() =>
namedParamsForMatch(captureNames, regex.exec('/foo/bar/baz.svg'), {
name: 'MyService',
})
).to.throw(
'Service MyService declares incorrect number of named params (expected 2, got 1)'
)
})
it('getQueryParamNames', function() {
expect(
getQueryParamNames({
queryParamSchema: Joi.object({ foo: Joi.string() }).required(),
})
).to.deep.equal(['foo'])
expect(
getQueryParamNames({
queryParamSchema: Joi.object({ foo: Joi.string() })
.rename('bar', 'foo', { ignoreUndefined: true, override: true })
.required(),
})
).to.deep.equal(['foo', 'bar'])
})
})

View File

@@ -0,0 +1,86 @@
'use strict'
const Joi = require('joi')
// This should be kept in sync with the schema in
// `frontend/lib/service-definitions/service-definition-prop-types.js`.
const arrayOfStrings = Joi.array()
.items(Joi.string())
.allow([])
.required()
const objectOfKeyValues = Joi.object()
.pattern(/./, Joi.string().allow(null))
.required()
const serviceDefinition = Joi.object({
category: Joi.string().required(),
name: Joi.string().required(),
isDeprecated: Joi.boolean().required(),
route: Joi.alternatives().try(
Joi.object({
pattern: Joi.string().required(),
queryParams: arrayOfStrings,
}),
Joi.object({
format: Joi.string().required(),
queryParams: arrayOfStrings,
})
),
examples: Joi.array()
.items(
Joi.object({
title: Joi.string().required(),
example: Joi.object({
pattern: Joi.string(),
namedParams: objectOfKeyValues,
queryParams: objectOfKeyValues,
}).required(),
preview: Joi.object({
label: Joi.string(),
message: Joi.string()
.allow('')
.required(),
color: Joi.string().required(),
style: Joi.string(),
namedLogo: Joi.string(),
}).required(),
keywords: arrayOfStrings,
documentation: Joi.object({
__html: Joi.string().required(), // Valid HTML.
}),
})
)
.default([]),
}).required()
function assertValidServiceDefinition(example, message = undefined) {
Joi.assert(example, serviceDefinition, message)
}
const serviceDefinitionExport = Joi.object({
schemaVersion: Joi.equal('0').required(),
categories: Joi.array()
.items(
Joi.object({
id: Joi.string().required(),
name: Joi.string().required(),
})
)
.required(),
services: Joi.array()
.items(serviceDefinition)
.required(),
}).required()
function assertValidServiceDefinitionExport(examples, message = undefined) {
Joi.assert(examples, serviceDefinitionExport, message)
}
module.exports = {
serviceDefinition,
assertValidServiceDefinition,
serviceDefinitionExport,
assertValidServiceDefinitionExport,
}

View File

@@ -0,0 +1,11 @@
'use strict'
module.exports = function toArray(val) {
if (val === undefined) {
return []
} else if (Object(val) instanceof Array) {
return val
} else {
return [val]
}
}

View File

@@ -0,0 +1,42 @@
'use strict'
const chalk = require('chalk')
const config = require('config').util.toObject()
// Config is loaded globally but it would be better to inject it. To do that,
// there needs to be one instance of the service created at registration time,
// which gets the config injected into it, instead of one instance per request.
// That way most of the current static methods could become instance methods,
// thereby gaining access to the injected config.
const {
services: { trace: enableTraceLogging },
} = config.public
function _formatLabelForStage(stage, label) {
const colorFn = {
inbound: chalk.black.bgBlue,
fetch: chalk.black.bgYellow,
validate: chalk.black.bgGreen,
unhandledError: chalk.white.bgRed,
outbound: chalk.black.bgBlue,
}[stage]
return colorFn(` ${label} `)
}
function logTrace(stage, symbol, label, content, { deep = false } = {}) {
if (enableTraceLogging) {
if (deep) {
console.log(_formatLabelForStage(stage, label), symbol)
console.dir(content, { depth: null })
} else {
console.log(_formatLabelForStage(stage, label), symbol, '\n', content)
}
return true
} else {
return false
}
}
module.exports = {
logTrace,
}

View File

@@ -0,0 +1,54 @@
'use strict'
const emojic = require('emojic')
const Joi = require('joi')
const trace = require('./trace')
function validate(
{
ErrorClass,
prettyErrorMessage = 'data does not match schema',
includeKeys = false,
traceErrorMessage = 'Data did not match schema',
traceSuccessMessage = 'Data after validation',
allowAndStripUnknownKeys = true,
},
data,
schema
) {
if (!schema || !schema.isJoi) {
throw Error('A Joi schema is required')
}
const options = allowAndStripUnknownKeys
? {
allowUnknown: true,
stripUnknown: true,
}
: undefined
const { error, value } = Joi.validate(data, schema, options)
if (error) {
trace.logTrace(
'validate',
emojic.womanShrugging,
traceErrorMessage,
error.message
)
let prettyMessage = prettyErrorMessage
if (includeKeys) {
const keys = error.details.map(({ path }) => path)
if (keys) {
prettyMessage = `${prettyErrorMessage}: ${keys.join(', ')}`
}
}
throw new ErrorClass({ prettyMessage, underlyingError: error })
} else {
trace.logTrace('validate', emojic.bathtub, traceSuccessMessage, value, {
deep: true,
})
return value
}
}
module.exports = validate

Some files were not shown because too many files have changed in this diff Show More