* add helper functions for generating Open API path/query params with defaults
* tweak Open API schema
- make description optional
- allow null example + allowEmptyValue (for boolean query params)
* convert examples --> openApi in amo
* convert examples --> openApi in ansible
* convert examples --> openApi in appveyor build/job
* add re-usable Open API query param for test-results badges
we can use these for all the 'test results' badges
* convert examples --> openApi in appveyor tests
* DRY up existing dynamic/endpoint param definitions
* DRY up queryParam
* allow enum param in serviceDefinition schema
* improve misleading param name
* check route and openApi are consistent on service load
* fix mistake in ansible role route
* documentation --> description
* add pathParams and queryParams helpers +docstrings
* give everything a search-friendly summary, check for duplicate summary
* prettier fixup
* Add GitHub Discussions custom search service
This commit adds a GitHub Discussions custom search service in the github-discussions-custom-search.service.js file. It includes classes for global discussions search (GithubDiscussionsSearch) and repository-specific discussions search (GithubRepoDiscussionsSearch). Users can now search discussions with custom queries and retrieve the discussion count.
Fixes#9213
* Add tester to GithubDiscussionsSearch
* Add documentation for GithubDiscussionsSearch
Inform users of filters and query values for the free search.
* Update GithubDiscussionsSearch examples
Change examples from filter by author to `filter` by `answered-by` as this has higher change of being a more common use case.
* fix typo
---------
Co-authored-by: jNullj <jNullj@users.noreply.github.com>
Co-authored-by: chris48s <chris48s@users.noreply.github.com>
* delete loads of really important stuff that we definitely need
* v basic MVP smoosh docusaurus PoC into repo
* TODO
* delete more really important stuff
* TODO
* tidyup: use run-s
* don't redirect images used in frontend to raster proxy
* fix routing
* preserve the /endpoint link
* delete the blog (for now)
I would quite like to re-add this at some point
but its not really the top priority thing right now
* content edits
* appease the lint gods
* update danger rules
* remove placeholder
* cypress tests
* dockerhub --> ghcr
* Revert "dockerhub --> ghcr"
This reverts commit ef74cbb26b.
* downgrade lockfile format
* implement defs/BASE_URL
* fix e2e build
* actually fix cypress tests
* always run cypress tests on build
* this never worked
* add command for docusaurus:clear
* delete more code we don't need any more
* update ESLint/prettier config
* delete unsused exports
* documentation updates
* delete a fairly large chunk of our dependency tree
* allow base_url as build arg to Dockerfile
* fixup dockerfile
* work out base url at runtime if not set
doing this at image build time is not the right approach
* remove gatsby monorepo from closebot
* rename HomepageFeatures to homepage-features
* 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>
* 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>
* fail to start server if there are duplicate service names
* update class names in loader test fixtures
---------
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
By default the `/crates/:crate_name` API endpoint returns the categories and keywords related to the crates. Unfortunately this causes two additional database queries on the crates.io backend.
This commit change the request URL to use `?include=` to only include the additional metadata that is needed for the requested badges.
* WIP export OpenAPI definitions from service examples
* allow services to optionally define an OpenApi Paths Object instead of examples
* make use of param descriptions and required query params
* convert other 'core' services to declare openApi..
..instead of examples
* tweak descriptions for standard query params
* move stuff around, add a high-level integration test for category2openapi
* update simple-icons text refs #9054
* remove legacy param names
* [CTAN] version: Fallback to date if version is empty
* Fix importing of `InvalidResponse`
* Satisfy prettier manually
* Format code using a global prettier
* more readability
* use `joi` schema directly
* make `version.date` also `required()`
* import `Joi`
* add required `date` entry for tests
* examples don't need `date` entry
* Update Jenkins Code Coverage API for new plugin version
Recently, the Jenkins Code Coverage API plugin re-added its external
API, but changed the format. This updates the jenkins service to
accomodate the new API.
* Update coverage API test url
* Re-introduce old badge format as apiv1 and add redirectors
* Mock coverage apiv1 with historical result
* format mock response as object
---------
Co-authored-by: chris48s <git@chris-shaw.dev>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>