* added badge for total stars of an user / org
* Added a transformJson method in graphql-base to handle partial data
Co-authored-by: Pratapi Hemant Patel <pratpatel@expedia.com>
Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
Since we've upgraded production to Node 12 (#5436) we can finally adopt static fields!
This starts the process by updating core and one of the service families.
* Migrate [Discord] implementation to use bot token
* Rework authorization field creation
* Revert "Rework authorization field creation"
This reverts commit caf65bde5d.
* Add LGTM exclusion for hardcoded credentials
For some reason the `--delay` version is not working in Mocha 7. I'm not sure why that is. Although, invoking Mocha the normal synchronous way seems to be working fine, so maybe `--delay` just isn't necessary anymore for what we're doing in Shields.
I don't see anything in the changelog about this 🤷♂️Closes#4842
* Validate input to BadgeFactory.create() (#3875)
* validate input to create()
* remove deprecated properties (#3881)
* remove BadgeFactory class (#3884)
* Template literal templates (#4459)
- Remove use of the doT template library and move to generating SVG output using javascript template literals.
- Drop SVGO and mostly manually implement the optimisations.
- Add a bunch more tests
Co-authored-by: Paul Melnikow <github@paulmelnikow.com>
* drop raster support in package CLI (#4523)
* drop raster support in package CLI
* update docs
* rename gh-badges package to badge-maker
* rename gh-badges dir to badge-maker
* update relative imports and other refs to in parent dir
'gh-badges' --> 'badge-maker'
* update snyk service tests
This change is only tangentially related
We've used the shields repo as an example for these tests so
moving files around in our repo has a knock-on effect on them
* add missing type hints to dev style page
* write the changelog/migration guide for v3
* use extension in README CLI example
* update CLI help
whoops - missed this in #4523
* bump version
* update for self-hosting users
* README updates
* drop .format param from CLI, always output SVG
* Change text[] to label and message, Remove JSON output
- Change text[] to label and message
- Fix message only badge
- Remove JSON output format
- Update the docs
* update package-lock
* rename 'template' to 'style'
* handle invalid styles in coalesceBadge
* ensure makeBadge is passed a string for template in coalesceBadge()
issue #4925
* fix (logo/no label text/label color specified) case
issue #4926
* add example of (logo/no label text/label color specified) to style debug page
* update type defs
* padding fix for FTB style
Co-authored-by: Paul Melnikow <github@paulmelnikow.com>
* prom-client JSON to InfluxDB line protocol converter
* Converts a metric with separate names
* prom-client JSON to InfluxDB line protocol (version 2) converter
* Server has instance id
* Read the instance id from an environment variable
* More unit tests for instance-metadata
* Log instance id
* Push influx metrics
* INSTANCE_ID with dyno metadata
* Prepare influx metrics in one place
* Influx metrics endpoint should return metrics
* More readable tests
* Env added to instance metadata
* hostname as an instance label value
* HEROKU_DYNO_ID as an instance id for heroku
* Instance env can be set by env variable
* HEROKU_APP_NAME as an instance env
* Log instance metadata as a JSON
* Typo fix
* Code refactoring in tests
* wait-for-expect dev dependency added
* Test for pushing metrics
* Test for pushing metrics
* Use basic authentication for pushing metrics
* intervalSeconds=2 for development env
* Using existing methods
* TODOs removed
* Schema for influx credentials
* Influx config removed from config files
* Require username and password when influx metrics are enabled
* Unused args removed
* pushing component should log errors
* Speed up tests
* should log error responses
* InstanceMetadata class replaces by simple object
* Influx metrics can be configuredd by env variables
* Use application label name instead of service
* Unused code removed
* Integration test for prom-client and converter
* metrics.influx.enabled configuration option added
* Improved influx configuration schema
* instanceMetadata validation
* Typo fix
* Default value for env
* metrics.infux.hostnameAsAInstanceId added
* should add hostname as an instance label when hostnameAsAInstanceId is enabled
* Default values for influx configuration
* flatMap is not available in Node.js 9.4
* Env vars removed from Procfile
* Better instance metadata values in tests
* Typo fix
* lodash.groupby added to prod dependencies
* Allow other keys in private config
* Missing test - should allow other private keys when influx metrics are enabled
* Missing test - should require private metrics config when influx configuration is enabled
* log.error instead of console.log
* metrics.influx.uri -> metrics.influx.url
* Unused arguments removed
* async removed
* promisify sendMetrics
* Allow to disable prometheus metrics
* Create test server with custom config
* 'metrics-influx' resource removed
* 'metrics-influx' resource removed
* Private config schema flattened out
* Extra code removed in Prometheus tests
* promisify moved outside of the class
* Do not throw errors from got in a specific test
* hostnameAliases added
* instanceIdFrom added
* instanceIdEnvVarName added
* envLabel added to schema
* instanceMetadata is not used by InfluxMetrics
* Instance metadata removed
* hostnameAsAnInstanceId removed
* A comment added
* waitForExpect removed
* Unused code removed
* Make it easier to benchmark and profile the code
* Remove unnecessary escape
* Clarify that the backend server is started without the frontend
* Add missing NODE_CONFIG_ENV environment variable
* Add error message when user has not included console.time statements
* Fix lint issue
* Handle multiple console.time statements
* Switch NODE_CONFIG_ENV to test
* Switch to const as variable never re-assigned
* set followRedirect: false by default in tests
* update tests implicitly relying on redirects
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
* Response size metric for all services
* Unused code removed
* Test for service response size metric
* All buckes of the service_response_bytes in a comment
* Register parameter in PrometheusMetrics is optional
* service response size metric enabled for dynamic badges
* Better test name
* JSDoc removed
* One import from one file
* Gather metrics in the background
* Revert saving response time metrics in the background
* Changed configuration validation to allow using a named pipe for port.
* Update core/server/server.js
Co-Authored-By: Caleb Cartwright <calebcartwright@users.noreply.github.com>
* Applied prettier.
* Update core/server/server.spec.js
Co-Authored-By: Caleb Cartwright <calebcartwright@users.noreply.github.com>
* Updated spec for port setting to allow only numbers or formatted named pipes.
* Subclass factory for JSON path services
* Common methods moved to JSON path class
* should throw error if _getData is not overridden
* Test JSON path factory using chai-as-promised
* Using chai-as-promised in more tests
* JSDoc for json-path
* Error message adopted to JSON and YAML
* Dynamic YAML badge handles YAML with a string
* 'fetch' naming covention
* Strict string validation in error message
* Try enable universal cors
* Move handle from registerErrorHandlers because it isn't and error handler
* Add test for cors headers
Also add link to issue
* add /twitch/status/:user badge
* update comments
* use a proper schema for the Twitch API calls
* use a token to make Twitch api calls
* fix handling of rate-limit error and bad token error
* [twitch] get a token as soon as creating a Twitch service
* [twitch] start both requests to users and stream before awaiting
* [twitch] set a timeout to replace the token before it expires
* [twitch] use authHelper
* [twitch] skip tests when no credentials
* [twitch] add one more status test
* twitch: do not check whether a user exists
* Refactor existing metrics support into MetricHelper
This completes the refactor done at https://github.com/badges/shields/pull/3662#issuecomment-509011229 in anticipation of adding more metrics support, such as response size of an upstream service, or response time.
* Clean up
* Renames
* Add response time metrics
This adds around 30 new metrics to cover response times at a fairly granular level. We may be able to shrink the number of buckets with time, though I think using 30 metrics is probably okay given that I think may become our most important metric.
* Fix
* add base class for Graphql APIs
* add GithubAuthV4Service + updates to GH token pool
* update github forks to use GithubAuthV4Service
* rename GithubAuthService to GithubAuthV3Service