* Fix error handling of bad branch in [GithubCommitActivity]
When GraphQL response with a bad repo it returns an error indicating the bad repo.
When GraphQL has the currect repo with a bad branch it will null inside the repo object without an error object.
The privouse commits seems to try and use that but due not allowing null in schema it did not work and an error due to bad schema would show insted.
This commit fixes this issue
* Add test for invalid branch in [GithubCommitActivity]
---------
Co-authored-by: jNullj <jNullj@users.noreply.github.com>
* allow serviceData to override cacheSeconds with a longer value
* prevent [endpoint] json cacheSeconds property exceeding service default
* allow ShieldsRuntimeError to specify a cacheSeconds property
By default error responses use the cacheLength of
the service class throwing the error.
This allows error to tell the handling layer the maxAge
that should be set on the error badge response.
* add customExceptions param
This
1. allows us to specify custom properties to pass to the exception
constructor if we throw any of the standard got errors
e.g: `ETIMEDOUT`, `ECONNRESET`, etc
2. uses a custom `cacheSeconds` property (if set on the exception)
to set the response maxAge
* customExceptions --> systemErrors
* errorMessages --> httpErrors
* feat: Add total commits to GithubCommitActivity
As part of a new feature proposed at issue #6070 added the requested feature.
I also used the conversation at pull request #6081 as a basis for those changes.
This change adds a new interval to the github/commit-activity shield 'total' (t for short).
The interval shows the total commits of the repo since its creation.
* Fix format with prettier
* Label for 'total' interval is now commits
Label change for the 'total' interval from 'commit activity' to 'commits'
---------
Co-authored-by: jNullj <jNullj@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
* fix some params incorrectly marked as optional
all of these are really required
* make '@' part of the param (not route) for scoped packages
* minor HTML tweaks to sonar help
---------
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
* send X-GitHub-Api-Version when calling GitHub v3 API
* TODO: invesitgate
* read baseUrl from config.service.baseUri
* add workflow to check for new GH api releases on schedule
* format config/default.yml to match yaml.dump() format
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
* switch from github workflows to github actions workflows
* update github actions workflow badge to use api
* add test case for missing branch param
* custom deprecation message
* add schema and fetch method to service class
* add transform, render and handle method to service class
* add documentation and examples
* add tester
* add suggeseted changes
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
* Add github-gist-last-commit.service.js
* Still having difficulty with the reponse in the test file for github-gist-last-commit being in svg format, rather than json
* Yay, tests are greeeeen, the best sight for sore eyes xD
* Apply suggestions from code review - destructuring+rename and path change
Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
* Removed the unnecessary test from github-gist-last-commit
Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
* Modify github-size.service.js
* Add tests for Github Size Service to test the new ref parameter
* Modified request for a file size: ref is now sent only if if was specified
* fix: Use graphQL for github file count badges
* Add test for repo not found and update transform tests
* Fix extensions in transform test
* Mark type and extension as required
* Simpler type transform since only file, dir supported
* Added milestone property to GitHub issue details service
* Fixed case when no milestone is available
* fixing unit test
* fixed service test for milestone property
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
* expose fetchLimitBytes/userAgent in got-config module
* export a function not a factory
* send better user-agent values
- add userAgentBase setting
- send short SHA in user agent on heroku
- set a version (tag or short SHA) in Dockefile and use
it to report server version in UA for docker users
* add a comment explaining fileSize
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
* migrate github badges to use got instead of request
* simplify creation of requestFetcher in libraries.io base
* improve libraries.io connection error test
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
* refactor: add render helper for downloads badges
* refactor: use new helper in some download badge classes
* doc renderer function
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>