* fix github service tests
* migrate some services from examples to openApi
* document latest variant with separate examples
making seperate routes for the /{version} and /latest variants
allows us to only show the docs for
- include_prereleases
- sort and
- filter
in the situation where they are relevant
* feat: Add author filter option for CommitActivity
Add a new filter option to [GithubCommitActivity], allowing users to filter the commit activity by a specific author.
To make the filter more explicit, The label display "commits by [author]" for the total amount of commits and "commit activity by [author]" for other intervals when an author filter is selected.
To maintain a clear and organized code structure, The filtered author is added as an argument and not to the shield path.
The request to find the number of commits by the author is made using the REST api rather then the GraphQL api to make it in 1 request rather then 2.
Resolves#9215
* fix: solve eslint errors
* Add tests for [GithubCommitActivity] filter by author
Add tests for the new filter by author feature.
* update [GithubCommitActivity] spec file for new author feat
Add test for new transformAuthorFilter function of GithubCommitActivity added for the author filter feature.
* Fix null string for label of GithubCommitActivity
* Update GithubCommitActivity example
* improve error handeling for GithubCommitActivity
The author filter error handling removed was redundent as it would never execute, there is no way to seperate branch not found from repo not found.
* update depricated functions
PR #9233 replaced errorsMessages with httpErrors.
This commit updates the new changes to stay up to date with that PR
* remove test for nonexisting error
this exception was removed in commit 9e358c8 and is not needed anymore
* Fixed test for commit activity unexisting repo
* Update example for GithubCommitActivity
Picked a user with commits in the repo as an example that would work
* Add test for invalid commit activity branch
Add test for REST API calls in commit activity branch
---------
Co-authored-by: jNullj <jNullj@users.noreply.github.com>
* 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>
* 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>
* add base class for Graphql APIs
* add GithubAuthV4Service + updates to GH token pool
* update github forks to use GithubAuthV4Service
* rename GithubAuthService to GithubAuthV3Service
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.
The route helper functions are fairly well isolated from the rest of BaseService, with a few convenient entry points. They are easier to test in isolation.
The way the code was written before, `pathToRegexp` was invoked once for every request, which seems inefficient.
`route` was validated when it was used, though it seems more helpful to validate it up front.
This breaks out `_makeFullUrl`, `_regex`, `_regexFromPath` into new helper functions `makeFullUrl`, `assertValidRoute`, `prepareRoute`, and `namedParamsForMatch`.
It adds validation to route, and updates the services without patterns to include one, in order to pass the new validation rules.