Commit Graph

835 Commits

Author SHA1 Message Date
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
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
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
e3ac9c3db5 service tests for [itunes] (#1464) 2018-01-21 17:50:04 -05:00
chris48s
7c6723a79d service tests for [docker] (#1428) 2018-01-15 22:03:52 -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
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
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
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
chris48s
9cb9d5984d [requires] add tests for requires.io service, review error handling (#1361) 2018-01-02 20:13:10 -07: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
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
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
Pyves
9c2645b41e Fixed Code Climate coverage and maintainability score badges (#1368) 2017-12-18 18:20:29 +13: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
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
chris48s
350a9819cd check status code before parsing body (#1343) 2017-12-06 14:03:32 -05:00
Peter Gribanov
962cf61b82 PHP version from .travis.yml (#1258)
Reference: #819
2017-12-06 11:04:24 -05:00
mattbk
2028251ca0 Add [Liberapay] (#1251) 2017-12-05 23:01:02 -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
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
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
chris48s
56b82e1665 [pypi] Add badge for django version support (#1286)
Closes #1018
2017-12-01 16:10:34 -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
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
Vladimir Starkov
e588bef199 Support custom npm registry URLs (#1277) 2017-11-20 19:22:42 -05: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
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
Peter Gribanov
0d3d33bf1b Get PHP version from [Packagist] (#1256) 2017-11-10 12:46:52 -05: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
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
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