Commit Graph

309 Commits

Author SHA1 Message Date
Paul Melnikow
c4143b9c23 Convert a bunch of exampleUrls and formats (#2633) 2019-01-05 14:54:34 -05:00
Paul Melnikow
d97a5e4697 Server start time badge [debug] (#2631) 2019-01-04 17:23:30 -05:00
Paul Melnikow
5233a25ddc Remove spurious truthiness checks on serverSecrets (#2634)
`serverSecrets` is always truthy.

Close #2606
2019-01-04 12:49:48 -05:00
Ang YC
f6357da8ee [Date] Relative date badge (#2244)
Close #749
2019-01-04 11:32:38 -05:00
chris48s
d96d8ae193 Document private/secret.json; affects [bower jira] (#2599)
* don't use a libraries.io token for bower integration

The libraries.io docs claim you need to be authenticated
to make any API request: https://libraries.io/api#authentication

In practice we can call https://libraries.io/api/bower/jquery
just fine with no token and based on chucking a load of
requests at it and examining the `x-ratelimit-remaining`
headers you actually seem to get a better limit with no
authentication.

All of our libraries.io badges in `services/librariesio`
seem to have been running fine with no token for some time.


* change jira auth settings to jira_user, jira_pass

All the other services use servicename_user, servicename_pass

This switches JIRA to use that convention by preference
but supports _username and _password for legacy users.


* add docs for server secrets


* add danger rule for server-secrets.md

this rule prompts users to update server-secrets.md
if 'serverSecrets' is in the diff
2019-01-02 20:49:42 +00:00
Paul Melnikow
a9ff282b74 Extend timeout on GitHub integration test (#2618) 2019-01-02 11:24:03 -05:00
Caleb Cartwright
3bbe2482bc Refactor [TeamCity] and add tests (#2601) 2019-01-02 00:19:33 -05:00
Caleb Cartwright
6d1c748453 Fix serverHasBeenUpSinceResourceCached test (#2593)
Fixes #2571 (Really fixed this time 😄) 

I attempted a fix in https://github.com/badges/shields/pull/2590 using fake timers but didn't realize how the timestamps being used in `cache-headers` were being created. This approach uses a dynamically generated `if-modified-since` value that will now be 30 minutes ahead of the server time stamp used in the comparison.
2018-12-25 21:07:31 -05:00
Caleb Cartwright
09ff426cba tests: add fake timers to cache-headers tests (#2590) 2018-12-24 19:10:11 +00:00
chris48s
ec3531bbde refactor [shippable] service (#2576) 2018-12-23 16:28:40 +00: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
chris48s
7dac325196 refactor [CPAN] service (#2575) 2018-12-23 15:20:50 +00:00
Paul Melnikow
4a976b52ea Fix import issue with [dynamic] badge (#2578)
Ref https://github.com/badges/shields/pull/2519#issuecomment-449511750
2018-12-23 10:13:04 -05:00
Brendan Abolivier
da5ca7454a Improve [Matrix] badge generation (#2527)
Fixes #2524 

This PR addresses the issues expressed in #2524, in that it:

* checks if a server has advertised a FQDN it can be reached at and if that FQDN hosts Matrix's client APIs
* uses room aliases instead of room IDs, in order to avoid a badge being impossible to generate if the server that created the room leaves it

This includes a breaking change to the badge endpoint.
2018-12-20 17:00:49 -05:00
Caleb Cartwright
2fe61d2c5c Add [Snyk] badges (#2566)
Adds vulnerability badges from Snyk.io, closes #1642 

- [X] Vulnerability badge for GitHub repos
- [x] Vulnerability badge for npm package
2018-12-20 16:28:54 -05:00
Caleb Cartwright
fc41b576f3 Update [Jira] tests to include color validation (#2565)
Augmenting the tests for Jira that were added in #2541 to also validate color scheme
2018-12-20 15:55:15 -05:00
Paul Melnikow
4e5e3c8aee Split up [github] testers (#2560)
- Update github contributors badge for `create-service-tester`.
2018-12-19 17:20:15 -05:00
Paul Melnikow
382af10506 Rewrite [GithubManifest] and [GithubPackageJson] badges (#2470)
Pave the way for #2259 and rewrite #1721 along the way.

Ref: #2320
2018-12-19 16:33:20 -05:00
Caleb Cartwright
6d3798f26f Migrates [Nexus] service to new service model (#2520)
Ports the Nexus service to the new service model. Some related/relevant conversation in #2347 (and closes #2347). Also adds support for authentication which resolves #1699.
2018-12-19 15:45:22 -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
Paul Melnikow
b36a9040f3 Add warning banners to legacy services (#2546) 2018-12-18 20:52:17 +00:00
Caleb Cartwright
7d30d86f2b Migrate [Jira] services to new service model (#2541)
Migrates the Jira badge services to the new service model, and also adds tests for those badges. 

I did make one minor changes to the badge labels/messages when the issue or sprint cannot be found. For example: 

With the LegacyService implementation, when an issue was not found the badge would display as 'issue key | inaccessible' such as `KAFKA-2869 | inaccessible` but this changes that behavior to `jira | issue not found`. I personally find this to be a bit more informative of a message, but want to call it out as I know how important backwards compatibility is. However, at first glance I'm also not sure how we'd replicate the old behavior of using the issue key (provided by user as a param) as the badge label when an issue is not found because the API response has a status code of 404 and a different schema than what Joi is expecting/validating. 

Similarly for the sprints, the old format for a sprint not found was `completion | inaccessible` it's now `jira | sprint not found`
2018-12-17 23:30:33 -05:00
Dean Davidson
b0fbe5f76f Refactor [AzureDevOpsCoverage AzureDevOpsTests] to only report on completed builds; test all [azuredevops] (#2549)
This is in response to [this conversation](https://github.com/badges/shields/issues/2237#issuecomment-446812796). The change turned out being even easier than I had anticipated because the [API supports a buildStatus filter](https://docs.microsoft.com/en-us/rest/api/azure/devops/build/builds/list?view=azure-devops-rest-5.0#buildstatus). I did quite a bit of local testing to make sure this is solid. I also ran tests and checked coverage.
2018-12-17 23:12:52 -05:00
Caleb Cartwright
6c9fc0de79 Migrate [Codetally] to new service model (#2548) 2018-12-17 23:07:21 -05:00
Caleb Cartwright
09e8c587d9 feat: migrate sourcegraph to new service model and fix tests (#2535) 2018-12-16 22:05:02 +00:00
chris48s
b5ac5d6044 [dynamicyaml f-droid] add yaml base service class (#2540) 2018-12-16 20:29:20 +00:00
chris48s
e5cacbc73f refactor [CRAN] service (#2538) 2018-12-16 19:25: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
Paul Melnikow
5e50b7bcc4 Fix [npm] badges when a dependency points to a URL (#2525)
Fix #2523
2018-12-13 14:07:33 -05:00
Paul Melnikow
b8461aa921 Rewrite [DynamicXml] and [DynamicYaml] badges (#2487)
- A little related cleanup in `server.js`: remove a couple import renames.
2018-12-12 16:52:47 -05:00
Paul Melnikow
a3a52524fc Add [npm] badges for collaborator count and dependency version (#2461)
This adds a badge for collaborator count. When evaluating a library, it can be useful to know that there's not a single-contributor bottleneck for publishing. Having more than one collaborator is a sign of library maturity.

It adds another badge for dependency version of published dependencies, which solves a similar problem as the node-version badge. I will find this useful for making sure dependencies are up to date in a library.
2018-12-12 15:02:37 -05:00
Paul Melnikow
38ca6fc396 Add quality category and sort a couple other badges [scrutinizer] (#2483)
Ref #1905
2018-12-12 14:59:46 -05:00
Pierre-Yves B
029a14681d Improved [MicroBadger] tests speed (#2512) 2018-12-12 19:19:45 +00:00
Paul Melnikow
88c8b0ee3e More example urls and static examples [apm waffle] (#2478) 2018-12-11 16:31:01 -05:00
Caleb Cartwright
d74568b9c9 Minor test updates for jenkins coverage and token-pool (#2509) 2018-12-11 21:10:21 +00:00
Caleb Cartwright
43faea4561 Add new service for CII Best Practices badges [CIIBestPractices] (#2477) 2018-12-11 19:20:51 +00:00
chris48s
0a98bd3121 refactor [dependabot] semver stability service (#2494) 2018-12-10 21:24:18 +00:00
chris48s
9189438a91 refactor [bountysource] service (#2492) 2018-12-10 21:21:39 +00:00
chris48s
b74fe4ed6f refactor [redmine] plugin rating services (#2491) 2018-12-10 20:02:38 +00:00
Pierre-Yves B
c89396088d [Wheelmap] service rewrite and tests (#2486) 2018-12-10 18:44:47 +00:00
Paul Melnikow
1649a42a4a Fix whitespace in Codetally test (#2488)
This was caused by #2475 and fixes the mocked test. It's not related to #2480 which is causing the other one to fail.
2018-12-09 16:41:21 -05:00
Paul Melnikow
58b276539a Refactor frontend main page and badge-example code (#2441)
- The goal of this PR is:
    - Consume the new service-definition format. (#2397)
    - Make the frontend more readable.
- Behavior changes:
    - I changed the **Image** field in the markup modal to show only the path.
    - I added another click-to-select field below that shows the complete URL.
    - This made it easier to suppress the live badge preview while it contains placeholders like `:user` or `:gem`, a minor tweak discussed at https://github.com/badges/shields/issues/2427#issuecomment-442972100.
    - The search box now searches all categories, regardless of the current page. (This is an improvement, I would say.)
- I did not deliberately address performance, though I ripped out a bunch of anonymous functions and avoided re-filtering all the examples by category on every render, which I expect will not hurt. I haven't really tested this on a mobile connection and it'd be worth doing that.
- It would be great to have some tests of the components, though getting started with that seemed like a big project and I did not want to make this any larger than it already is.

It's a medium-sized refactor:

1. Replace `BadgeExamples`, `Category` and `Badge` component with a completely rewritten `BadgeExamples` component which renders a table of badges, and `CategoryHeading` and `CategoryHeadings` components.
2. Refactor `ExamplesPage` and `SearchResults` components into a new `Main` component.
3. Rewrite the data flow for `MarkupModal`. Rather than rely on unmounting and remounting the component to copy the badge URL into state, employ the `getDerivedStateFromProps` lifecycle method.
4. Remove `prepareExamples` and `all-badge-examples`.
5. Rewrite the `$suggest` schema to harmonize with the service definition format. It's not backward-compatible which means at deploy time there probably will be 10–20 minutes of downtime on that feature, between the first server deploy and the final gh-pages deploy.  🤷‍♂️ (We could leave the old version in place if it seems worth it.)
6. Added two new functions in `make-badge-url` with tests. I removed _most_ of the uses of the old functions, but there are some in parts of the frontend I didn't touch like the static and dynamic badge generators, and again I didn't want to make this any larger than it already is.
7. Fix a couple bugs in the service-definition export.
2018-12-08 15:26:13 -05:00
Paul Melnikow
8a8311d931 Unify and minimize tester boilerplate (#2472)
I started using this one-line boilerplate a while back and it seems to tidy things up a bit.
2018-12-08 13:15:24 -05:00
chris48s
2a545b9853 fix swagger example (#2476) 2018-12-07 20:55:17 +00:00
Paul Melnikow
b26ebeb6b2 Modernize chrome web store examples; PR check state -> build (#2474)
`/users` and `/d` are the same so I dropped `/d` and updated `/users`.
2018-12-07 15:39:06 -05:00
Caleb Cartwright
88ca8ca3b5 tests: added some base class override tests (#2471) 2018-12-07 20:03:10 +00:00
Camilo QS
5b5ec38337 Improve [F-droid] support to .yml metadata format (#2377)
closes: #2083
2018-12-07 00:45:19 -05:00
Caleb Cartwright
a5bbe9a8fa Fix Jenkins Cobertura badge and tests (#2468) 2018-12-06 22:07:27 +00:00
Paul Melnikow
6a737b7b38 Rewrite the DynamicJson badge (#2399)
This starts the rewrite of the dynamic badges. I've pulled into BaseService an initial version of the query param validation from #2325.

I've extended from BaseJsonService to avoid duplicating the deserialization logic, though it means there is a bit of duplicated code among the three dynamic services. The way to unravel this would be to move the logic from `_requestJson` and friends from the base classes into functions so DynamicJson can inherit from BaseDynamic. Would that be worth it?

This introduces a regression of #1446 for this badge.

Close #2345
2018-12-06 16:45:40 -05:00
Caleb Cartwright
b2d5d3ecca Add Leanpub Book Summary Badges [LeanpubBookSummary] (#2458)
* feat: adds LeanPub book summary badges
2018-12-06 21:19:41 +00:00