* add and consistently use parseDate and renderDateBadge helpers
also move
- age
- formatDate
- formatRelativeDate
to date.js
* fix bug in wordpress last update badge
* validate in formatDate() and age()
it is going to be unlikely we'll invoke either of these
directly now, but lets calidate here too
* remove unusued imports
* reverse colours for galaxy toolshed
* WIP enums
* WIP moar enums
* add a helper function for extracting enum from route pattern
* add enum schemas to services
* review and improve service names
* convert some more services with enums
* review and improve service names
* fix issue/pull request detail
* 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
* 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>
* add base class for Graphql APIs
* add GithubAuthV4Service + updates to GH token pool
* update github forks to use GithubAuthV4Service
* rename GithubAuthService to GithubAuthV3Service
* which --> variant
* which --> alias
* which --> format
* improve param names in codeclimate
* improve param names in github-issue-detail
* update github-issue-detail unit tests
* refactor(GithubIssueDetail): ported to new service model
* refactor(GithubIssueDetail): updates based on PR discussions
* refactor(GithubIssueDetail): minor updates and additional tests
* refactor(GithubIssueDetail): minor updates to render functions per PR disc.
This moves a few helpers from `lib/` to `services/`:
build-status.js
build-status.spec.js
color-formatters.js
color-formatters.spec.js
contributor-count.js
licenses.js
licenses.spec.js
php-version.js
php-version.spec.js
text-formatters.js
text-formatters.spec.js
version.js
version.spec.js
And one from `lib/` to `core/`:
unhandled-rejection.spec.js
The diff is long, but the changes are straightforward.
Ref #2832
This pull request closes#2551: making sure that the keywords don't already appear in the example's title.
I also added validation that checks that they are at least two characters long, as this is enforced by the homepage when type your search.
- Replace the idea of color schemes with the idea of named colors (since none of our colorschemes have used `colorA`)
- Pass through the normalized color to `_shields_test` to harmonize with BaseService and simplify testing
- Update service tests
- Move responsibility for color generation into the npm package
- Remove several color helper functions and their tests
- Update gh-badge public API to accept `color` and `labelColor`
This is a precursor to refactoring some of the logo code for #2473.