Commit Graph

389 Commits

Author SHA1 Message Date
Paul Melnikow
fc12b591db Reorganize BaseService-related modules (#2831)
Ref #2698
2019-01-22 23:52:13 -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
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
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
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
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
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
chris48s
653242d004 refactor [itunes] service (#2802) 2019-01-18 06:44:49 -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
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
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
a58de54281 Set static previews for [jenkins jenkinsplugin] and tweak tests (#2765) 2019-01-14 22:39:51 -05:00
Pierre-Yves B
3cebe3bbd4 Made tests use isBuildStatus validator from build-status.js (#2762) 2019-01-14 19:39:06 +00: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
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
Caleb Cartwright
afcc0e3920 refactor: rename VS Marketplace to Visual Studio Marketplace (#2738) 2019-01-11 15:02:58 -06: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