Commit Graph
1645 Commits
Author SHA1 Message Date
Paul MelnikowandGitHub 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
DanialandGitHub 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
chris48sandPaul Melnikow 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 StarkovandPaul Melnikow 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 MelnikowandGitHub 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 MelnikowandGitHub e358ebe6b3 Refactor LRU cache test asserts (#1418) 2018-01-15 14:15:27 -05:00
greenkeeper[bot]andPaul Melnikow b422e880c1 Update prettier to the latest version 🚀 (#1434) 2018-01-15 14:14:08 -05:00
Paul MelnikowandGitHub 606946f24a Log + fail tests on unhandled promise rejections (#1424) 2018-01-14 16:57:40 -05:00
chris48sandPaul Melnikow 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 StarkovandPaul Melnikow db39093fa7 fix: add missing git to apk installation script. close #1435 (#1436) 2018-01-11 16:55:33 -05:00
Paul MelnikowandGitHub 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 MelnikowandGitHub 7c1a3fef69 Adopt Chai for assertions (#1419) 2018-01-08 14:18:07 -07:00
chris48sandPaul Melnikow 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
MichaelandPaul Melnikow a55ab15de2 fix inline image path (#1427) 2018-01-06 08:44:11 -07:00
greenkeeper[bot]andPaul Melnikow 2013968990 Update danger to the latest version 🚀 (#1414) 2018-01-05 22:09:25 -07:00
chris48sandPaul Melnikow 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 NigroandPaul Melnikow 02683afd04 Don't crash when logo passed as integer (#1319) 2018-01-04 17:11:59 -07:00
chris48sandDanial e91c9fc7ab Add tests for Circle-CI (#1421) 2018-01-05 12:16:25 +13:00
Paul MelnikowandGitHub ccb3eb8fdf Fix January unit test (#1417) 2018-01-03 20:37:35 -07:00
chris48sandPaul Melnikow 9cb9d5984d [requires] add tests for requires.io service, review error handling (#1361) 2018-01-02 20:13:10 -07:00
DanialandGitHub 503618443e Add Discord logo (#1413) 2018-01-03 10:09:01 +13:00
Sebastian StaudtandPaul Melnikow 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
chris48sandPaul Melnikow e2ee997f07 service tests for [clojars] (#1410) 2018-01-01 17:15:55 -05:00
chris48sandPaul Melnikow 21b1ad73e7 Service tests for [cdnjs] (#1409) 2018-01-01 17:14:16 -05:00
chris48sandPaul Melnikow 438e47adfb Add tests for codeship service (#1411) 2018-01-01 17:10:02 -05:00
Paul MelnikowandGitHub 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 MelnikowandGitHub 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
DanialandGitHub 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 MelnikowandGitHub 09cf211786 Fix tests for [suggest] endpoint (#1398) 2017-12-28 14:21:16 -05:00
Peter GribanovandPaul Melnikow f719705518 Get tested PHP version from PHP-Eye (#1372) 2017-12-28 13:44:50 -05:00
Paul MelnikowandGitHub 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 MelnikowandGitHub 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 MelnikowandGitHub 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 MelnikowandGitHub 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
PravdomilandPaul Melnikow e4fed8d178 Copyedit and add link in footer (#1366) 2017-12-21 18:34:48 -05:00
DanialandGitHub b48091a198 [FIX] Bower service tests (#1383) 2017-12-22 12:02:04 +13:00
Paul MelnikowandGitHub 78bb20dc6a Danger: badge examples are not lib/ + wordsmith (#1381) 2017-12-20 21:11:59 -05:00
Zhmayev YaroslavandDanial 2f9307ae2c Add Scrutinizer CI logo (#1380) 2017-12-21 11:24:11 +13:00
Marcin MielnickiandPaul Melnikow cc84240b61 Prettier updated to 1.9.2 in package-lock (#1375) 2017-12-19 13:26:44 -05:00
PyvesandDanial 9c2645b41e Fixed Code Climate coverage and maintainability score badges (#1368) 2017-12-18 18:20:29 +13:00
PyvesandDanial 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 CazzulinoandThaddée Tyl 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]andPaul Melnikow 31fb96e4ac chore(package): update prettier to version 1.9.2 (#1367) 2017-12-11 22:47:38 -05:00
Thaddée TylandPaul Melnikow 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 MelnikowandGitHub 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 MelnikowandGitHub ec3971b984 Update contributing guidelines (#1357) 2017-12-09 12:02:45 -05:00