Commit Graph

369 Commits

Author SHA1 Message Date
Paul Melnikow
e3d115cf99 Rename maxAge to cacheSeconds (#3090)
Close #3069
2019-02-23 20:33:38 -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
Paul Melnikow
6684f4b566 Remove unused version helper (#3086) 2019-02-23 15:20:34 -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
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
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
Paul Melnikow
0f22c0af25 Store the deprecation date inline (#3029) 2019-02-18 16:59:08 -05: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
Philip Harrison
cf7b76d5a6 Update Dependabot logo (#2931)
* Update dependabot logo
* update tests
2019-02-06 21:33:40 +00: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
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
chris48s
1822a3adfb more icon changes (#2872)
* delete scrutinizer logo
* optimise superuser logo
2019-01-27 18:27:27 +00: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
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
Paul Melnikow
fc12b591db Reorganize BaseService-related modules (#2831)
Ref #2698
2019-01-22 23:52:13 -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
62810143ac Move coalesce and validate (#2828)
Ref #2698
2019-01-21 16:11:23 -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
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
5ff7beb3bf Reorganize token pooling code (#2792)
Ref #2698
2019-01-18 06:18:31 -05:00
Paul Melnikow
4415a3e94e Reorganize badge URL helper functions (#2790)
Ref #2698
2019-01-17 13:44:46 -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
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
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
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
Paul Melnikow
b3606724fd Wildcard to run all service tests [*] (#2739)
Close #2685.
2019-01-11 16:11:46 -05: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
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
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
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
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
Ang YC
f6357da8ee [Date] Relative date badge (#2244)
Close #749
2019-01-04 11:32:38 -05:00
Paul Melnikow
5dc25af93c redirectUrl: Update terminology and add a test (#2617) 2019-01-02 13:48:27 -05:00
Caleb Cartwright
97cdc5762f Add timeout for server test setup/teardown (#2612) 2019-01-01 21:16:35 -05:00
Caleb Cartwright
dcfd84923c fix: fix bug in server-config on allowedOrigin (#2607) 2018-12-30 21:26:41 +00: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
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
Paul Melnikow
ebe4a12acc Convert lodash.uniq to native and remove an unused dev dep (#2564) 2018-12-20 15:15:56 -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
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
Caleb Cartwright
dea35025b1 Deprecate [nsp] service (#2529)
deprecated nsp service and added doc for deprecation
2018-12-16 19:21:22 +00:00
Caleb Cartwright
d74568b9c9 Minor test updates for jenkins coverage and token-pool (#2509) 2018-12-11 21:10:21 +00:00