Commit Graph

1355 Commits

Author SHA1 Message Date
Paul Melnikow
653f79fbde Tests: Convert to ES6, use node-fetch, refactor, and clean up style (#971) 2017-04-30 10:51:18 -04:00
Fabrizio Cucci
138c1ea4d5 [maven-central] Maven Central badge based on repo1.maven.org rather than search.maven.org (#957)
According to http://central.sonatype.org/pages/ossrh-guide.html#releasing-to-central:

> Upon release, your component will be published to Central: this typically occurs within 10 minutes, though updates to search can take up to two hours.

So, besides the delay, if the indexing jobs for search.maven.org are paused (see https://issues.sonatype.org/browse/OSSRH-27247), it may take quite some time to see the last artifact version even though it has been actually released on Maven Central.

This uses 'latest' version instead of 'release' version. According to the Maven documentation of the maven-metadata.xml (http://maven.apache.org/ref/3.2.5/maven-repository-metadata/repository-metadata.html):
- 'latest': what the latest version in the directory is, including snapshots;
- 'release': what the latest version in the directory is, of the releases only.

Using the 'release' version would imply altering the behavior of the badge, i.e. getting the release version instead of the latest version, which could also be a snapshot version.

Fixes #846.
2017-04-30 10:11:56 -04:00
Fabrizio Cucci
0c477524a5 Fix regexp used for matching services in pull requests (#978)
According to the [Mozilla documentation about regular expressions](https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions), the special character '\w' is equivalent to '[A-Za-z0-9_]', which does not include the hyphen character (i.e. '-'). This cause the matching of services containing a hyphen to fail (e.g. 'maven-central').
2017-04-30 10:01:37 -04:00
Paul Melnikow
8233a0ba38 Fix service coverage script and linting (#975)
* Fix "callback is not a function" in coverage:test:services

* Don't lint /coverage
2017-04-29 17:31:07 -07:00
drdamour
02fc1a1a21 [sonar] Invert colors for public_documented_api_density (#974)
Fix the logic from #724.
2017-04-29 13:54:39 -04:00
Thaddee Tyl
e17c15c00b Set the coverage npm script to use current specs
The coverage script was introduced in 5c147b8d91,
and the spec files were moved in c3ef232bf7.

Also, correct a small typo.
2017-04-28 16:39:17 -04:00
drdamour
a086dca4de [sonar] Support public_documented_api_density metric as a percentage (#724)
See http://docs.sonarqube.org/display/SONAR/Metric+Definitions
2017-04-28 16:19:39 -04:00
Paul Melnikow
bd8a04141e Record minimum Node version 2017-04-28 21:16:08 +02:00
anatoly techtonik
6c34191fcf Add logo to AppVeyor badge and change logo color (#812)
Fixes #507
2017-04-28 01:35:19 -04:00
Paul Melnikow
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
Paul Melnikow
c3ef232bf7 Place tests alongside their code (#969)
Reorg of the tests: move them just alongside their code. The principle relates to grouping by coupling, not by function and is established in best-practice documents (e.g. https://github.com/focusaurus/express_code_structure#underlying-principles-and-motivations), despite its break from the tradition of a separate `test/` tree. All of today's tools can handle tests spread through the repository.

There are some good, if subtle consequences of this change:

- Since files are close at hand, friction is reduced at development time, which encourages that new tests are written to cover new behaviors.
- It's easier to find the tests that cover a particular piece of functionality.
- It's easier to see which code has tests and which doesn't.
2017-04-28 00:55:15 -04:00
Saugat Acharya
df9bbbf11b Add npm weekly and npm yearly downloads badge (#958)
Add new badges npm weekly and npm yearly
2017-04-27 21:51:05 -07:00
Paul Melnikow
5c147b8d91 Service tests (#937)
- Eliminate manual testing which is error-prone and time consuming, and must be repeated many times through the PR review process
- Make contributing more fun. For many, fixing bugs and making new badges is faster and more satisfying with automated tests than with manual testing.
- Push out the work of testing new badges to a much broader net. The PR originator could write tests, but so could any other contributor who wants to push review along.
- Detect badge failures resulting from changes in vendor contracts without waiting for user reports.
- Detect and prevent regressions in the code.
- Be runnable, readable, writable, and editable by as many developers as possible, including those who may not be familiar with JavaScript test tools.

-- @paulmelnikow, @niccokunzmann, @Daniel15
2017-04-27 23:13:14 -04:00
Thaddee Tyl
a0663d8da5 Reduce page jumping while all the badges are loading
Commit c486c0dcd1 missed a large number of badges
on the webpage. This includes all relevant badges.
2017-04-27 13:14:01 -04:00
Paul Melnikow
112669e074 Remove unused / unnecessary test fixtures (#951)
`server-test.js` is not used anymore, and `gh-badge.js` can be used directly.
2017-04-26 14:26:30 -04:00
Georges Dupéron
db2aafaf2a Removed ability to specify the badge's label for the “website” service, as this is already possible with ?label=some-text 2017-04-26 14:25:15 -04:00
anatoly techtonik
65fc2a7f56 Update request to 2.81.0 (#961)
Fix deprecated uuid warning
2017-04-25 23:47:48 -04:00
Thaddee Tyl
182018be76 Redirect root to https://shields.io
The website relies on GitHub Pages. When created, that did not support
TLS. However, last year, support for TLS was added, as detailed
in the following blog post:
https://github.com/blog/2186-https-for-github-pages
2017-04-25 23:43:09 -04:00
Paul Melnikow
cca46b7e94 Generate index.html only on gh-pages when deploying
- Build index.html at deploy time
- Update corresponding documentation references
- Since index.html is untracked, git add needs -f
- Clarify gh-pages generated commit message
- Improve Makefile dependencies related to website generation

As discussed in #936, tracking the index.html causes makes PRs longer / noisier
and causes extra merge conflicts. More importantly, it causes contributors to
inadvertently edit the wrong file, which causes extra work (#949) or
contributions to be lost (#898).

Since there's no need for index.html in development (everything uses try.html) a
logical solution is to generate and commit the index.html at deploy time.

Recording compiled or generated files in a deploy commit is a reasonable
practice for git-based deploys (Heroku, gh-pages, and others).

The old version of this was slightly "unsafe" for my taste, in that it depended
on the local copy of gh-pages (if it existed) and master. The new version just
replaces gh-pages with master + the new commit.

Closes #936.

Fixes #954 (the PR).
2017-04-25 23:40:08 +02:00
G. Roggemans
9b8c1c806d GitHub (pre-)releases (#959)
Added the `/github/release/user/repo/all.svg` endpoint that shows the latest release, including pre-releases.
2017-04-25 12:16:28 -04:00
Daniel Lo Nigro
ccbdad69ba Split various utilities into standalone files (#952) 2017-04-24 18:37:22 -04:00
Thibaud Lepretre
108533e08e [SonarQube] Support user token authentication (#854)
- new secret: `sonarqube_token`
2017-04-24 11:21:09 -04:00
Georges Dupéron
832aaaf11d Added installation steps for Node.js 6 2017-04-20 14:38:05 -04:00
Georges Dupéron
571f46f16a Website badge: Fix color and subdirs, allow specifying label (#949) 2017-04-20 14:21:27 -04:00
Cr@zy
a079b682e3 Add badges for Uptime Robot (#947)
* numberOfDays optional (default 30) for Uptime Robot ratio
* Require a monitor key, not a user key
* Update gitignore for Jetbrains
2017-04-20 09:31:03 -04:00
Daniel Lo Nigro
c5bd4a4f5a Add badge for NuGet download count, again (#945)
Switched from SearchAutocompleteService to SearchQueryService as this service also provides download counts.

Closes #678.
2017-04-20 09:26:56 -04:00
Georges Dupéron
c6f4f57cd1 Closes #946 “maintenance badge doesn't need a question mark” (#950) 2017-04-19 19:14:56 +02:00
Paul Melnikow
07cedee321 Update index.html for recent changes 2017-04-19 00:04:56 -04:00
Georges Dupéron
26847dca80 Fix website badge for deep links (#720)
Works: https://img.shields.io/website/http/github.com.svg
Does not work: https://img.shields.io/website/http/github.com/badges.svg

Regexp was too greedy and included the beginning of the path in the protocol
2017-04-18 23:55:19 -04:00
Maël Nison
5a8b565ebb Fix NPM license badge for scoped packages (#796)
Closes #757
2017-04-18 22:42:14 -04:00
Paul Melnikow
1ffd5d949c Build branches
When merging someone else's PR with edits, it's helpful to to push a branch
and make sure the tests are also passing in CI.
2017-04-17 14:51:49 +02:00
Paul Melnikow
a3429a316a Add cauditor.org badge (#704) 2017-04-16 23:44:30 -04:00
Paul Melnikow
1ff0d9217f Fix express repository owner name (#721)
Closes #721
2017-04-13 15:48:58 -04:00
Paul Melnikow
64f8f11026 Allow specifying the key and cert for SSL (#844) 2017-04-13 15:30:30 -04:00
Paul Melnikow
59ec4a420c Check explicitly that license is an array 2017-04-13 08:17:47 +02:00
Paul Melnikow
1ae490a218 Improve CTAN error handling and fix non-svg 404 badges
Fix #921
2017-04-13 08:17:47 +02:00
Paul Melnikow
ee9ba82969 Run tests even if lint fails 2017-04-13 00:03:38 +02:00
Paul Melnikow
c7c92f12fd Clarify that secrets are optional
- Quit witih an error when secrets can’t be loaded
- Refactor duplicated code

Resolves #894
2017-04-13 00:02:18 +02:00
Paul Melnikow
9e4476d1b6 Use standard version color for clojars 2017-04-12 23:58:37 +02:00
Paul Melnikow
64e9d13e76 Disallow unused variables and turn on a few recommended rules 2017-04-12 23:55:13 +02:00
Paul Melnikow
de18dce94a Add more test helpers
While working on some tests, I was having a tricky problem in a test suite. Eventually I tracked it down to an interaction between tests. I suspected the test library, but once I tried to make an isolated test case, I realized the test library was working fine. It turns out it was the server’s request cache. The fix is to clear the cache between tests.

Not needed for this PR, though I’m adding it to this branch because it conflicts with this change.
2017-04-12 23:13:16 +02:00
Paul Melnikow
5a45003bc3 Test server logic for img2svg error, and run the server in-process
Running the server in process is necessary for the mock to work. This is an approach I’ve taken in the past. I experimented with this setup quite a bit when I was playing around with a test suite, and it seemed to work well enough. Setting `process.argv` is a admitedly a bit gross, though a cleaner approach would require more involved changes to `server.js`.
2017-04-12 23:13:16 +02:00
Paul Melnikow
8b77d16a72 Always call the callback + reliable erroring
Fixes #914
2017-04-12 23:13:16 +02:00
Paul Melnikow
0760d17d82 Return data from svg2img via callback
Given the chunks coming from imagemagick are getting stored memory and
then tucked into a cache, this function could as easily return a buffer
via callback. Streaming is just making it more complex. (And trickier to
test!)
2017-04-12 23:13:16 +02:00
Paul Melnikow
ad1e419d42 Add tests for svgToImg 2017-04-12 23:13:16 +02:00
Paul Melnikow
3905424d1c Add a test for badge.js and refactor 2017-04-12 23:13:16 +02:00
Thaddee Tyl
2d71e844a2 Store raster badges in the LRU cache
In ef1a5159, the switch to using imagemagick made a faulty use of the library by
listening for an 'end' event that is never raised. As a result, the cache was
never populated.

In d985f81f, a fix that takes care of the fact that the previously mentioned
dead code relies on a non-existent variable caused it to kill the server when a
raster badge is requested twice, as what it stored in the cache was the pipe
transmitting chunks, not the chunks themselves, and the pipe (a Socket object)
cannot be subsequently sent through a pipe. The following error occured instead:

    events.js:163
          throw er; // Unhandled 'error' event
          ^

    TypeError: Invalid non-string/buffer chunk
        at chunkInvalid (_stream_readable.js:395:10)
        at readableAddChunk (_stream_readable.js:150:12)
        at DataStream.Readable.push (_stream_readable.js:136:10)
        at DataStream._read (/home/m/shields/lib/svg-to-img.js:45:21)
        at DataStream.Readable.read (_stream_readable.js:350:10)
        at resume_ (_stream_readable.js:739:12)
        at _combinedTickCallback (internal/process/next_tick.js:80:11)
        at process._tickDomainCallback (internal/process/next_tick.js:128:9)
2017-04-12 23:13:16 +02:00
Paul Melnikow
6e07fd0098 Update index.html with recent changes 2017-04-10 14:42:09 -04:00
Javier González
aa981cba84 iTunes app store version (#840) 2017-04-10 14:40:16 -04:00
Olivier Lacan
6f4c1fc3e3 Add more Shields users [ci skip] 2017-04-08 02:33:51 +02:00