Commit Graph

1348 Commits

Author SHA1 Message Date
chris48s
57c2ba0d68 Convert examples arrays to openApi objects (part 1) (#9320)
* 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
2023-07-31 12:22:33 +01:00
chris48s
631ca1ccb6 add some tests for [docsrs] (#9423) 2023-07-31 03:06:20 +00:00
Nemo157
2e2959a12c Migrate from docs.rs' builds API to status API (#9422) 2023-07-30 16:01:50 +00:00
empathicqubit
436f3a1a3f [OpenVSX] Fix OpenVSX API call for unversioned package URLs (#9408) 2023-07-23 09:39:43 +00:00
Kavin
528165f65c Add support for [Lemmy] (#9368)
* Add support for Lemmy.

* Add tests for lemmy.

* Remove specifying a server fqdn to fetch from.

* Fix for requested changes.
2023-07-17 15:53:58 +00:00
Pierre-Yves Bigourdan
e7fc6d56d3 Go back to default YouTube cache (#9372) 2023-07-14 15:42:50 +01:00
chris48s
83c22ccd55 cache docker badges for longer (take 3) (#9369) 2023-07-12 20:28:05 +01:00
dependabot[bot]
b9d96755ec chore(deps-dev): bump prettier from 2.8.8 to 3.0.0 (#9357)
* chore(deps-dev): bump prettier from 2.8.8 to 3.0.0

Bumps [prettier](https://github.com/prettier/prettier) from 2.8.8 to 3.0.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.8.8...3.0.0)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* reformat all the things (prettier 3)

* update tests to await calls to prettier.format()

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: chris48s <git@chris-shaw.dev>
2023-07-10 09:27:51 +00:00
chris48s
fb794ec479 Revert "[OpenCollective] update opencollective to api v2 (#9346)" (#9362)
This reverts commit e02c8aa884.
2023-07-08 13:13:06 +01:00
chris48s
71cd657e3c improve docs for github issues search badge (#9360)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-07-08 10:52:03 +00:00
xxchan
e02c8aa884 [OpenCollective] update opencollective to api v2 (#9346)
* update opencollective to api v2

* fix tests

* fix: do not filter by accountType for opencollective/all

* remove 404

* remove required in schema

* cnt -> count

* keep by-tier code as-is

---------

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-07-08 10:18:02 +00:00
jNullj
1251adaec2 Add [GitHubDiscussionsSearch] and GitHubRepoDiscussionsSearch service (#9340)
* 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>
2023-07-07 20:30:16 +00:00
chris48s
1543d0f363 Allow user to filter github tags and releases (#9193)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-07-03 20:27:31 +00:00
chris48s
e7197f6db4 don't URL encode slash in [githubactionsworkflow] badge (#9322)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-07-03 20:01:13 +00:00
chris48s
7bad3f5902 deprecate [snyk] badges (#9349)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-07-03 16:59:04 +00:00
chris48s
1afa3b7871 increase max-age on [docker] badges, again (#9350) 2023-07-03 11:48:50 -05:00
chris48s
bf0395dc00 cache [dockerpulls] badges for an hour (#9343) 2023-07-02 10:25:57 +01:00
Pierre-Yves Bigourdan
04a6344efe Mention YouTube API services and link to Google Privacy Policy (#9339) 2023-07-01 11:20:25 +00:00
chris48s
53cce8f1f1 allow negative timestamps in relative [date] badge (#9321)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-06-26 22:34:20 +00:00
chris48s
08e6933f0e Upgrade to ESLint 8; affects [docker factorio] (#9289)
* upgrade to ESLint 8

* update services to fix camelcase rule errors

---------

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-06-18 19:47:18 +00:00
chris48s
e7737ce050 remove obsolete travis .org examples (#9284)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-06-18 12:00:36 +00:00
chris48s
f24b00fecd increase max age on reddit badges (#9282)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-06-18 11:50:19 +00:00
chris48s
a5f91a40e5 fix a load of spacing issues in frontend content (#9281) 2023-06-18 09:05:42 +01:00
chris48s
50ea7068a8 migrate frontend to docusaurus (#9014)
* 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
2023-06-17 10:59:07 +01:00
jNullj
67d935492d feat: Add author filter option for [GithubCommitActivity] (#9251)
* 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>
2023-06-15 19:20:16 +01:00
jNullj
35dfd75ef5 Fix: [GithubCommitActivity] invalid branch error handling (#9258)
* 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>
2023-06-14 20:53:48 +01:00
chris48s
14892e3943 Implement a pattern for dealing with upstream APIs which are slow on the first hit; affects [endpoint] (#9233)
* 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
2023-06-13 21:08:43 +01:00
Pierre-Yves Bigourdan
2651e5fe87 Delete old deprecated services (#9254)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-06-12 07:49:20 +00:00
Pierre-Yves Bigourdan
554c01097d Fix [CodeClimate] tests and examples (#9253)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-06-11 23:41:39 +00:00
chris48s
6593927f23 embiggen youtube cache, again (#9250) 2023-06-09 23:17:27 +01:00
uncenter
00aef7e63a feat: add 'canceled' status to netlify deploy badge (#9240)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-06-07 09:41:12 +00:00
Christian Clauss
3b7495a985 php-version.js: Fix typos (#9239) 2023-06-07 09:35:04 +00:00
chris48s
bf1bea8b4a increase default cache on youtube badges (#9238) 2023-06-04 19:04:40 +01:00
chris48s
64d3380e1f fix typo in test name (#9216) 2023-05-30 15:03:19 +01:00
Prashant Rawat
a65a86c6bf Add docstrings for validators service (#9197)
* add docstrings for validators service

* Update services/validators.js

---------

Co-authored-by: chris48s <chris48s@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-05-29 20:00:03 +00:00
jNullj
8a11db8265 feat: Add total commits to [GitHubCommitActivity] (#9196)
* 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>
2023-05-29 19:46:41 +00:00
Prashant Rawat
da615eeef7 add docstrings for text-formatters service (#9188)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-05-20 19:18:06 +00:00
chris48s
e3154f67be set a custom error on 429 (#9159)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-05-18 23:44:05 +00:00
chris48s
165159eec3 deprecate [travis].org badges (#9171)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-05-14 19:24:07 +00:00
chris48s
0c44117b5b count private sponsors on [GithubSponsors] badge (#9170) 2023-05-13 17:10:40 -05:00
chris48s
4f4d49d424 switch from xmldom to @xmldom/xmldom (#9100) 2023-05-01 19:17:40 +01:00
chris48s
388459a8ca fail to start server if there are duplicate service names (#9099)
* 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>
2023-05-01 18:07:13 +00:00
Prashant Rawat
96a06d48b4 Add docstrings for route builder service (#9118)
* add docstrings for route builder service
2023-05-01 18:54:50 +01:00
chris48s
82a2b9c605 fix [sourceforge] downloads (#9102) 2023-04-20 18:20:52 +01:00
Av32000
c2998a2dc9 [SourceForge] Added badges for SourceForge (#9078)
* Added sourceforge last-commit badge

* Added sourceforge commit-count badge

* Added sourceforge languages badge

* Added sourceforge contributors badge

* Added sourceforge translations badge

* Added sourceforge platform badge

* Fix SourceForge services ClassName

* Fixed JoiSchema + Added BaseSourceForgeService + Fixed last-commit and commit-count
2023-04-17 19:23:42 +00:00
chris48s
b96192eec6 remove redis token persistence backend (#9065)
* remove redis token persistence backend

* error and exit if redis_url is set
2023-04-15 20:17:35 +01:00
Tobias Bieniek
c038933db7 crates: Use ?include= to reduce crates.io backend load (#9081)
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.
2023-04-15 14:41:08 +00:00
chris48s
148b51d554 Export OpenAPI definitions from service examples; affects [dynamic endpoint static] (#8966)
* 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
2023-04-11 18:37:16 +01:00
Yukai Chou
6deeadcfe1 [CTAN] fallback to date if version is empty (#9036)
* [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
2023-03-29 19:46:40 +00:00
Matthew Mirvish
0e0ac8fe60 [JenkinsCoverage] Update Jenkins Code Coverage API for new plugin version (#9010)
* 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>
2023-03-25 18:24:53 +00:00