Commit Graph
90 Commits
Author SHA1 Message Date
Paul MelnikowandGitHub 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 MelnikowandPaul Melnikow 7eb9bb5209 Promisify svg2img 2017-10-31 23:13:23 -04:00
Paul MelnikowandPaul Melnikow 550012a09c Fix a couple badge examples 2017-10-31 23:12:50 -04:00
freezyandPaul Melnikow ad4a8b4406 [bitrise] Added new build service Bitrise.io (#1227)
Close #574.
2017-10-31 13:23:33 -04:00
Paul MelnikowandGitHub 37fbef5504 Clean up the outer scope of server.js (#1235) 2017-10-31 13:21:43 -04:00
Paul MelnikowandPaul Melnikow b458faee1a Change makeBadge() to a synchronous function 2017-10-31 00:10:45 -04:00
Paul MelnikowandGitHub a54338afa8 Rename badge() -> makeBadge() (#1232) 2017-10-30 22:08:33 -04:00
Paul MelnikowandPaul Melnikow 91eaa2958c Move gh-badges CLI into lib/ 2017-10-30 21:46:50 -04:00
Paul MelnikowandGitHub 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 MelnikowandGitHub 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 MelnikowandPaul Melnikow 9d84d2fec1 Fix Sourcegraph preview URI 2017-10-29 21:29:22 -04:00
Paul MelnikowandGitHub 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
freezyandPaul Melnikow cf14ab1464 Added Funding category 2017-10-28 11:07:35 -04:00
Kieran HuntandDanial 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 MielnickiandPaul Melnikow f89b317542 Latest tag with any prefix + tests (#1188) 2017-10-26 16:31:13 -04:00
PyvesandPaul Melnikow 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 MelnikowandGitHub 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
Tesla Ice ZhangandPaul Melnikow f7cecf7eda Add JetBrains plugin version to the front page (#1197) 2017-10-21 12:06:41 -04:00
Paul MelnikowandPaul Melnikow 6aae294b28 Avoid errors when offline 2017-10-21 11:29:30 -04:00
PyvesandPaul Melnikow 5a1e994296 Better test coverage of text formatters + fix thousand case (#1185) 2017-10-20 21:25:04 -04:00
Paul MelnikowandGitHub 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
Paul MelnikowandGitHub 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
PyvesandPaul Melnikow 7fa38c3335 More precise star display with test (#1179) 2017-10-16 16:30:40 -04:00
DanialandPaul Melnikow 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
Paul MelnikowandGitHub 8e47ae93d4 Refactor and test the SVG badge parser (#1147)
- Add one todo
2017-10-14 15:41:56 -04:00
Paul MelnikowandGitHub 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
Marcin MielnickiandPaul Melnikow a7ed4b244f [suggest] Badge suggestions show incorrect license (#1159)
Fix #821
2017-10-12 15:54:34 -04:00
Paul MelnikowandGitHub 2809ff6888 Configure prettier and eslint-config-standard (#1123) 2017-10-09 14:46:30 -04:00
Ritwick DeyandPaul Melnikow 2d157b3928 [GitHub] badge for (pre-)release date (#1133) 2017-10-06 15:18:25 -04:00
Paul MelnikowandGitHub 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 DeyandPaul Melnikow e7f1f57b6b [GitHub] Latest release badge (#1122)
Reopen of #905.
2017-10-04 10:21:52 -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 DeyandPaul Melnikow 7ae29932a5 [Github] Commits since latest release (#1115)
Close #993.
2017-10-02 14:17:41 -04:00
Paul MelnikowandGitHub 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 MelnikowandGitHub 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 MelnikowandGitHub 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 MelnikowandGitHub 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 MelnikowandGitHub 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
Ritwick DeyandPaul Melnikow 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
un.defandPaul Melnikow 4104f822fd [LuaRocks] package version badge (#1087) 2017-09-25 20:28:14 -04:00
Paul MelnikowandThaddée Tyl 8e6fe01d20 Add test for measure-text 2017-09-24 22:36:14 +02:00
Christophe BliardandPaul Melnikow 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
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
Adriaan GroenenboomandDaniel Lo Nigro 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
Paul MelnikowandGitHub 653f79fbde Tests: Convert to ES6, use node-fetch, refactor, and clean up style (#971) 2017-04-30 10:51:18 -04:00
anatoly techtonikandPaul Melnikow 6c34191fcf Add logo to AppVeyor badge and change logo color (#812)
Fixes #507
2017-04-28 01:35:19 -04:00
Paul MelnikowandGitHub 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