Commit Graph

112 Commits

Author SHA1 Message Date
Paul Melnikow
1d313bdd19 Github admin endpoint: use basic auth password instead of username (#1317) 2017-12-03 15:07:58 -05:00
Thaddee Tyl
9cb9113a34 Add endpoint to obtain logs
It goes through a WebSocket; the secret is sent, and if valid, the logs
are sent back.
2017-12-03 18:48:31 +01:00
Thaddee Tyl
e61373e739 Add system endpoint to fetch network information
This is part of an effort to set up an admin monitoring platform.
2017-12-03 18:48:31 +01:00
chris48s
56b82e1665 [pypi] Add badge for django version support (#1286)
Closes #1018
2017-12-01 16:10:34 -05:00
Paul Melnikow
6f632224c1 Fix some example and preview URLs 2017-12-01 09:42:19 -05:00
Pyves
bf13792633 Optimisation of makeBadge key width computation (#1298)
* Added cache to text width for badge keys.
2017-11-30 22:25:08 -05:00
Paul Melnikow
af0799a312 Use template strings in make-badge (#1296)
c.f. https://github.com/badges/shields/pull/1167#discussion_r145313407
2017-11-30 17:16:08 -05:00
Paul Melnikow
127b46aef8 Github auth admin endpoint and logging (#1267)
- Periodically log github auth information
    - Tokens are hashed which reduces the security risk inherent in the logs
        - A consistent hash is used so tokens can be correlated across the three data structures and across the three servers
- Add an admin endpoint for github auth information
    - Tokens are returned as-is to enable troubleshooting (e.g. comparing our reqRemaining to github’s)
2017-11-30 13:21:27 -05:00
Paul Melnikow
4b5bf03fea Rewrite frontend in React (#1273)
I rewrote the frontend in React using a module bundler. It's matched feature-for-feature with the current frontend, with only slight changes in the styling. I did not fuss about making the styling identical; the badge popup looks particularly different.

This makes the front end much easier to develop. I'm really looking forward to implementing #701, to which this paves the way.

This makes light use of Next.js, which provides webpack config and dev/build tooling. We’ll probably replace it with create-react-app or our own webpack setup because unfortunately it comes with a lot of runtime overhead (the build is 400k).

Let’s open new issues for bugs and features, and track other follow-ups here: https://github.com/badges/shields/projects/1
2017-11-28 11:34:17 -05:00
Paul Melnikow
1af1f497bb Allow configuring allowed CORS origins for suggest (#1282)
- Support single-server testing and a local dev server (like Next) that is on a different port from the shields server
- Refactor config schema

With this change, the suggestions work locally in #1273.
2017-11-25 18:27:02 -05:00
Danial
a4bce73da6 For-the-badge | Convert labels to string then uppercase (#1281) 2017-11-22 23:35:33 -05:00
Vladimir Starkov
e588bef199 Support custom npm registry URLs (#1277) 2017-11-20 19:22:42 -05:00
Paul Melnikow
d91b904b82 Redirect the root only when configured (#1270)
- Fix `’INFOSITE' is not recognized` in `npm start` on Windows

Close #1259
2017-11-17 13:42:38 -06:00
Pyves
7039e68018 Consistent version formatting (#1246)
Provide greater consistency for badges related to versions. Fix #1181.

- the `version` function in `color-formatters` was previously returning the colour of the badge, but also its text with a leading _v_. It was broken down into two separate functions and the text formatting part was moved to `text-formatters`, where it really belongs.

- unit tests were added for these two functions in `color-formatters.spec` and `text-formatters.spec`, using Sazerac.

- as discussed in #1181, the leading _v_ was omitted  for _xxxx-yy-zz_ date patterns. Any future exceptions can easily be added to the `ignoredVersionPatterns` pattern.

- the badge colour was previously switched to orange if a hyphen was found in the version string. This didn't seem ideal, instead pattern matching is done to find keywords such as `beta`, `alpha` or `snapshot`. Of course, this list can easily be extended.

- all badges related to versions now use the `versionText` and `versionColor` functions. There are a few rare exceptions, for instance in cases where the data returned by the service's API allows to figure things out without relying on any parsing/pattern matching (eg. `badgeData.colorscheme = prerelease ? 'orange' : 'blue';`, where `prerelease` is determined from an API's response).
2017-11-11 17:54:38 -05:00
Danial
8c2de04d99 [sonar] support new SonarQube api (#1239)
* update sonarqube

* parse value as int

* Add tests

* Update example & Add depreciated API example

* eslint

* tidyup & depreciated -> legacy
2017-11-12 09:26:15 +13:00
rnons
178376ddf0 add [elm-package] badge 2017-11-11 14:17:30 -05:00
Thaddee Tyl
59c0662874 Fix bug saving GitHub tokens from other servers
This fixes a bug introduced in 076cb14, wherein we discarded tokens received
from other servers, and wherein we could save tokens with invalid
identification.

The bug was raised by Paul Melnikow.
2017-11-11 10:27:24 +01:00
Paul Melnikow
8733a8b8f2 Use GitHub token rotation in production :P (#1266) 2017-11-10 13:51:39 -05:00
Peter Gribanov
0d3d33bf1b Get PHP version from [Packagist] (#1256) 2017-11-10 12:46:52 -05:00
Tyler Nickerson
632c70b6b5 Added support for new Code Climate scores (#1236) 2017-11-06 18:53:40 -05:00
Tatsuya Saito
6788a31ed5 Adds new badge for [Redmine] plugin rating (#1247) 2017-11-06 10:59:26 -05:00
Paul Melnikow
4d22799962 Fix Github base url again
Fix #1243.
2017-11-02 10:35:22 -04:00
Paul Melnikow
7ca2e97155 Use sazerac for our data-driven tests (#1228)
Sazerac is a library for data-driven tests, where a series of tests asserts that the return value of a function matches the expected value. It provides nice syntax for tightening this up.

https://hackernoon.com/sazerac-data-driven-testing-for-javascript-e3408ac29d8c

This converts our tests to use it, and replaces some similar home-grown code.

I fixed one bug I encountered along the way: mikec/sazerac#12.
2017-11-01 20:15:19 -04:00
Paul Melnikow
7eb9bb5209 Promisify svg2img 2017-10-31 23:13:23 -04:00
Paul Melnikow
550012a09c Fix a couple badge examples 2017-10-31 23:12:50 -04:00
freezy
ad4a8b4406 [bitrise] Added new build service Bitrise.io (#1227)
Close #574.
2017-10-31 13:23:33 -04:00
Paul Melnikow
37fbef5504 Clean up the outer scope of server.js (#1235) 2017-10-31 13:21:43 -04:00
Paul Melnikow
b458faee1a Change makeBadge() to a synchronous function 2017-10-31 00:10:45 -04:00
Paul Melnikow
a54338afa8 Rename badge() -> makeBadge() (#1232) 2017-10-30 22:08:33 -04:00
Paul Melnikow
91eaa2958c Move gh-badges CLI into lib/ 2017-10-30 21:46:50 -04:00
Paul Melnikow
b16122d9a4 When a global gh_token is configured, always use it (#1118)
If I configure a global gh_token, I expect it to be used all the time. I expect to see predictable failures when that token is exhausted.
2017-10-29 22:36:39 -04:00
Paul Melnikow
090454a828 Cache keys should not be the same (#1223)
Fix the cache bug introduced in #1186 that blocked today's deploy.
2017-10-29 22:11:10 -04:00
Paul Melnikow
9d84d2fec1 Fix Sourcegraph preview URI 2017-10-29 21:29:22 -04:00
Paul Melnikow
3c37dbd3dc [maven-metadata] Add support for maven-metadata.xml (#1214)
Based on ArsenArsen's work in #953.
2017-10-28 15:12:44 -04:00
freezy
cf14ab1464 Added Funding category 2017-10-28 11:07:35 -04:00
Kieran Hunt
d9860991ed Fix style issue with iTunes App Store on homepage (#1211)
References:
- https://en.wikipedia.org/wiki/ITunes
- https://www.apple.com/itunes/
2017-10-28 08:03:55 +13:00
Marcin Mielnicki
f89b317542 Latest tag with any prefix + tests (#1188) 2017-10-26 16:31:13 -04:00
Pyves
ffb6fdb884 [eclipse-marketplace] New last updated Eclipse badge (#1204)
Implement a fifth Eclipse Marketplace badge, which displays the "date" when the plugin was last updated on the marketplace.
2017-10-25 22:23:22 -04:00
Paul Melnikow
446d4ce21e Correct cache behavior for custom query parameters (#1186)
I developed this for #820 to provide the correct cache behavior when a service wants to use custom parameters from the query string.

For safety, only the declared parameters (and the global parameters) are provided to the service. Consequently, failure to declare a parameter results in the parameter not working at all (undesirable, but easy to debug) rather than indeterminate behavior that depends on the cache state (undesirable, but hard to debug).
2017-10-24 23:00:23 -04:00
Tesla Ice Zhang
f7cecf7eda Add JetBrains plugin version to the front page (#1197) 2017-10-21 12:06:41 -04:00
Paul Melnikow
6aae294b28 Avoid errors when offline 2017-10-21 11:29:30 -04:00
Pyves
5a1e994296 Better test coverage of text formatters + fix thousand case (#1185) 2017-10-20 21:25:04 -04:00
Paul Melnikow
b411f08ad1 Generate badge examples from data + code (#1163)
This pull request sets us up to generate the badge examples dynamically from data and code.

Right now, try.html is still checked in, mostly for the benefit of reading this diff, though it should be removed on the next pass to avoid unnecessary complexity at merge time.
2017-10-20 17:33:12 -04:00
Paul Melnikow
dc44ba7725 Clean up request-handler, github-auth, and analytics; upgrade to Mocha 4 (#1142)
- Add tests to request-handler to prepare for some tweaks to caching for #820
- Clean up code in request-handler: renames, DRY, arrows, imports
- Allow for clean shutdown of `setInterval` code. This requires the ability to cancel autosaving.
- Upgrade to Mocha 4, and clean up so the process exits on its own (see mochajs/mocha#3044)
- Better encapsulate analytics
2017-10-17 22:01:46 -04:00
Pyves
7fa38c3335 More precise star display with test (#1179) 2017-10-16 16:30:40 -04:00
Danial
c026ebf235 for the badge style badges (#1166)
https://forthebadge.com/ style of badges, with link support

Close #818
2017-10-15 16:52:28 -04:00
Paul Melnikow
8e47ae93d4 Refactor and test the SVG badge parser (#1147)
- Add one todo
2017-10-14 15:41:56 -04:00
Paul Melnikow
7f385fb361 Upgrade dev dependencies, clean lint (#1151)
Looks like eslint 4 adds `no-useless-escape` and `no-self-compare` to `eslint:recommended`.
2017-10-12 15:57:29 -04:00
Marcin Mielnicki
a7ed4b244f [suggest] Badge suggestions show incorrect license (#1159)
Fix #821
2017-10-12 15:54:34 -04:00
Paul Melnikow
2809ff6888 Configure prettier and eslint-config-standard (#1123) 2017-10-09 14:46:30 -04:00