Commit Graph

434 Commits

Author SHA1 Message Date
chris48s
0b73b1d734 refactor [discourse] service (#3010) 2019-02-17 21:57:44 +00:00
Ville Skyttä
0d4a74bd6b Spelling fixes (#3013) 2019-02-17 14:10:06 -05:00
chris48s
21612dd003 refactor [homebrew] service (#3009) 2019-02-17 17:25:31 +00:00
James Cahill
08bf7f02e4 refactor maintenance service (#3005) 2019-02-17 12:03:31 +00:00
Skyper
6bfa9b1b41 Add badges for [Keybase] (#2969)
* Add Keybase PGP badge

* Return 'not found' if the key is not present

* Change the default colour

* Add more constraints to the schema

* Render 64-bit fingerprints

* Add example

* Add a 'hex()' constraint to the fingerprint

* Improve error handling

* Add class 'KeybaseProfile'

* Add unit tests for Keybase PGP

* Add Keybase BTC

* Add unit tests for Keybase BTC

* Add Keybase ZEC

* Add unit tests for Keybase ZEC

* Add Keybase XLM

* Add unit tests for Keybase XLM

* Validate the BTC address using a regex

Regex taken from
https://mokagio.github.io/tech-journal/2014/11/21/regex-bitcoin.html.

* Exclude 'not found' from addresses' value in unit tests

* Remove useless keywords

* Add the link to the Keybase API documentation

* Move the colour into 'defaultBadgeData'

* Remove the HTTP method

'GET' is already the default one.

* Improve the error handling for Keybase BTC

* Add more constraints to the Keybase BTC schema

* Update one unit test for Keybase BTC

* Fix the error handling for Keybase BTC

* Add more unit tests for Keybase BTC

* Improve the error handling for Keybase ZEC

* Improve the error handling for Keybase PGP

* Improve the error handling for Keybase XLM

* Display a real username value in the examples

* Include the status code in the schemas

* Move the category to the base class

The same category is used by all badges.

* Add function 'transform' to the base class

The function 'transform' is used to encapsulate the error handling logic
as it is the same in each service.
2019-02-15 11:33:06 -06:00
Paul Melnikow
951aa0f9ea Tweak [spiget] badges (#2989)
1. Move tested server version to platform support, tweak description
2. Make version label consistent with others
3. Avoid setting category or defaultBadgeData in abstract base class
2019-02-13 21:06:31 +00:00
Pierre-Yves B
bc96f0e25f Example keywords validation (#2956)
This pull request closes #2551: making sure that the keywords don't already appear in the example's title.

I also added validation that checks that they are at least two characters long, as this is enforced by the homepage when type your search.
2019-02-13 13:14:12 -04:00
Paul Melnikow
28948925c2 Remove unused parameter in [jsdelivr] (#2988)
`headers` is not destructured; it needs to go in `options`.

`Shields.io` is set as the `User-Agent` by code in `legacy-request-handler.js`.
2019-02-13 10:53:48 -06:00
Hugo van Rijswijk
56d374a467 Allow plus in semver [Nexus aur bintray chocolatey dubversion myget nuget powershellgallery resharper] (#2987)
* Also allow + in semver

* Add test for + in semver version

* Add more dashes to test version

* Fix tests
2019-02-13 10:50:21 -06:00
chris48s
b87d67bb18 refactor [cocoapods] service (#2977)
* refactor [cocoapods] service

* remove pointless default

* move join to render()
2019-02-12 20:14:36 -06:00
James Cahill
e1a50a7246 [jsDelivr] badges (#2970) 2019-02-12 19:45:18 +00:00
chris48s
93a209f8a4 refactor [amo] service (#2972)
* refactor [amo] service

* change colour
2019-02-10 15:42:35 -06:00
Caleb Cartwright
9b4fec0d2e Restored coverity service (#2967) 2019-02-10 11:39:12 +00:00
Paul Melnikow
dbe5eb8346 Some cleanup in [bower] (#2959)
* Some cleanup in [bower]

* More fixes
2019-02-08 17:38:13 -06:00
Owen Voke
5702ac470e Add badge for the [HSTS] preload list (#2926)
As per #2913, this PR adds a new badge for the [HSTS preload][hsts] list.

Badges will use the format `/hsts/preload/:domain.svg` (e.g. `/hsts/preload/github.com.svg`)

Closes #2913 

[hsts]: https://hstspreload.org
2019-02-08 07:59:42 -05:00
Paul Melnikow
1486fd2fca Redirect from alias to canonical URL [azuredevops vso] (#2939)
As described in #2340, this provides a way to replace an old alias with a redirect. This makes it easier to migrate our URLs over time without making our matching patterns more complicated.

The 301 redirect is sent back to the requester. If a user pastes the aliased URL into the address bar, it'll be replaced in the browser with the new URL, which gently encourages them to migrate.

Close #2340
2019-02-08 01:07:50 -05:00
Paul Melnikow
4d45fe3ea0 Make [wercker] no builds terminology consistent with other badges (#2957)
This makes the "no builds" state pass `isBuildStatus`, which is what fixes the failing tests:

https://circleci.com/gh/badges/daily-tests/138
2019-02-08 00:52:20 -05:00
Paul Melnikow
8c478d0e0a Use normalized colors to fix [dynamic matrix nexus] service tests (#2958) 2019-02-08 00:49:27 -05:00
Andrew Marcuse
c46d2f9dae [NodePing] support for NodePing uptime monitoring service (#2910)
* [NodePing] support for NodePing uptime monitoring service

* NodePing test tweaks
2019-02-07 20:24:40 -06:00
Paul Melnikow
2ee1327eed Refactor the NuGet v2 badges; switch Resharper to XML (#2934)
This closes #2921 by switching ReSharper to the XML API used by Powershell, and refactors the powershell code back into the common nuget v2 service class. It also removes mocked tests of the color logic, replacing them with smaller-bracket tests that accomplish the same thing more concisely.
2019-02-07 21:14:04 -05:00
Paul Melnikow
d8ce045ead Adopt Gatsby (#2906)
While Next.js can handle static sites, we've had a few issues with it, notably a performance hit at runtime and some bugginess around routing and SSR. Gatsby being fully intended for high-performance static sites makes it a great technical fit for the Shields frontend. The `createPages()` API should be a really nice way to add a page for each service family, for example.

This migrates the frontend from Next.js to Gatsby. Gatsby is a powerful tool, which has a bit of downside as there's a lot to dig through. Overall I found configuration easier than Next.js. There are a lot of plugins and for the most part they worked out of the box. The documentation is good.

Links are cleaner now: there is no #. This will break old links though perhaps we could add some redirection to help with that. The only one I’m really concerned about `/#/endpoint`. I’m not sure if folks are deep-linking to the category pages.

There are a lot of enhancements we could add, in order to speed up the site even more. In particular we could think about inlining the SVGs rather than making separate requests for each one.

While Gatsby recommends GraphQL, it's not required. To keep things simple and reduce the learning curve, I did not use it here.

Close #1943 
Fix #2837 Fix #2616
2019-02-06 16:37:55 -05:00
chris48s
7953a97e1d refactor [jitpack] service (#2943) 2019-02-06 16:11:46 -05:00
chris48s
4a8a1f20ef refactor [pub] service (#2942) 2019-02-06 16:07:06 -05:00
Caleb Cartwright
aa105e4a6c tests: update teamcity test targets (#2940) 2019-02-05 21:39:54 -06:00
Caleb Cartwright
855c9cd261 Remove dev dep imports in production code (#2937)
Fixes #2876 with @paulmelnikow's suggestion 

Moved imports of `ServiceTester` and `createServiceTester` to a separate file so that dev dependencies are not imported by service classes.
2019-02-05 21:51:55 -05:00
Paul Melnikow
cdeba2fdf9 Fix some service tests [circle dependabot githubissues] (#2936) 2019-02-05 21:49:40 -05:00
Paul Melnikow
e083dd3ce5 deprecatedService: rename url to route for consistency; test on [versioneye] (#2938) 2019-02-05 21:37:00 -05:00
Pierre-Yves B
b6c2f166f5 Fixed Jacoco example (#2933)
This small pull request closes #2648. The previous project targeted by the example no longer seems to be using the Jacoco plugin, so I've hunted down another one:
https://img.shields.io/jenkins/j/https/builds.apache.org/job/Derby-JaCoCo.svg 
![](https://img.shields.io/jenkins/j/https/builds.apache.org/job/Derby-JaCoCo.svg)
2019-02-05 17:38:00 -05:00
Paul Melnikow
ef5c36dcb4 Remove some obsolete .networkOff() tests (#2932) 2019-02-05 21:23:24 +00:00
Pierre-Yves B
ea833a83c4 [GitHubCommitActivity] improvements and examples (#2920) 2019-02-04 20:27:52 -05:00
Paul Melnikow
7c3bca1ab7 Refactor endpoint functions (#2909) 2019-02-03 17:29:52 -05: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
Paul Melnikow
4fc31cfff9 Add timeouts to some flaky tests (#2896)
* Add timeouts to some flaky tests

* tests: increased timeouts on snyk tests
2019-01-30 17:35:40 -06:00
Paul Melnikow
eef3d36f52 Convert remaining preview URLs (#2887)
Close #1961
2019-01-29 21:13:15 -06:00
Paul Melnikow
027cb4fe31 Fix [conda] service tests and rm some obsolete tests (#2894)
Ref https://circleci.com/gh/badges/daily-tests/119
2019-01-29 19:31:45 -06:00
James Cahill
57badc337a Refactor [lgtm] to new service model and static previews (#2753) 2019-01-29 16:10:47 -06:00
Paul Melnikow
5b122ddd73 Social badge support for static previews (#2871)
The static previews don't support the social badges. Adding that lets us remove support for `exampleUrl`. Close #2479.

This includes `style` and `namedLogo` in the service-definition export and updates the frontend to use it. To accomplish this, it passes `namedLogo` through `coalesceBadge`. After logo resolution is moved to `makeBadge` this duplication can be removed, as `logo` will no longer be needed in the result of `coalesceBadge`.
2019-01-28 22:44:25 -06:00
chris48s
a9d6809e3f refactor [liberapay] service (#2879) 2019-01-28 20:57:11 +00:00
Paul Melnikow
97e2ec1e60 Refactor [GemDownloads] for readability; improve error messages (#2870)
Close #1960
2019-01-28 11:53:53 -06:00
chris48s
212ac47ec0 refactor [hackage] service (#2878) 2019-01-27 20:32:58 -06:00
Paul Melnikow
47e8cc3de3 Refactor route functions in BaseService (#2860)
The route helper functions are fairly well isolated from the rest of BaseService, with a few convenient entry points. They are easier to test in isolation.

The way the code was written before, `pathToRegexp` was invoked once for every request, which seems inefficient.

`route` was validated when it was used, though it seems more helpful to validate it up front.

This breaks out `_makeFullUrl`, `_regex`, `_regexFromPath` into new helper functions `makeFullUrl`, `assertValidRoute`, `prepareRoute`, and `namedParamsForMatch`.

It adds validation to route, and updates the services without patterns to include one, in order to pass the new validation rules.
2019-01-26 02:38:12 -05: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
Paul Melnikow
be7cb93773 Refactor service loader (#2861)
This moves the loader code into `core/base-service`, leaving behind in `services/index.js` only the convenience imports.

Ref #2832
2019-01-24 22:55:10 -05:00
Caleb Cartwright
8e41e95a4e Update [VisualStudioMarketplace] download calculation for Azure DevOps Extensions (#2748)
* feat: udpate vs marketplace download counts to handle azure devops scenario

* chore: added documentation info to download badge for AzureDevOps on VS Marketplace

* refactor: updated VS Marketplace Downloads badge to better cover Azure DevOps extensions

* feat: added separate service for ADO extension install badges

* refactor: simplifying vs marketplace statistics transform

* refactor: finished refactoring VS Marketplace services

* docs: added inline comment on VS Marketplace service base

* Tweak docs

* refactor: tweaked validation for VS Marketplace response

* chore: added todo in VS Marketplace base

* Tweak comment

* refactor: VS Marketplace base validation cleanup

* refactor: moved rating precision in VS Marketplace
2019-01-23 18:14:26 -06:00
Paul Melnikow
4e9763b4c3 Provide friendlier error messages for [endpoint] (#2858)
Ref https://github.com/badges/shields/issues/2838#issuecomment-456594803
2019-01-23 18:43:38 -05:00
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