Commit Graph

232 Commits

Author SHA1 Message Date
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
1e85cf7926 upgrade to graphql 16 (#9290)
* upgrade to graphql 16

* update base graphql tests
2023-06-23 19:47:40 +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
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
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
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
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
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
chris48s
fab3fd7a93 sort service path matches (#8968) 2023-03-06 15:58:16 +00:00
dependabot[bot]
a5480d5a8c chore(deps): bump glob from 8.1.0 to 9.2.1 (#8952)
* chore(deps): bump glob from 8.1.0 to 9.2.1

Bumps [glob](https://github.com/isaacs/node-glob) from 8.1.0 to 9.2.1.
- [Release notes](https://github.com/isaacs/node-glob/releases)
- [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/node-glob/compare/v8.1.0...v9.2.1)

---
updated-dependencies:
- dependency-name: glob
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

* update glob usage

---------

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>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-03-06 12:09:48 +00:00
chris48s
565139660d only try to close pool if one exists (#8947)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-03-04 17:05:38 +00:00
chris48s
091ccfdbcd migrate token pooling to postgres (#8922)
* add ability to store token pool in Postgres DB

* update transitive ansi-regex dependencies
2023-02-23 17:18:39 +00:00
chris48s
e8c42e9ec1 migrate service tests to GH actions (#8421)
* run service tests with GHA

* rename GithubGist services to Gist

* completely delete circle ci config
2023-01-17 20:55:57 +00:00
chris48s
f67fe525c2 fix service test loader on windows, add tests (#8786)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-01-14 00:37:25 +00:00
Prashant Rawat
5e6583c530 Docstrings for php-version service (#8766)
* add docstrings for php-version service

* update docstring for resource-cache service

* update docstring param type
2023-01-06 21:01:59 +00:00
chris48s
c3d08f7f8b Send X-GitHub-Api-Version when calling [GitHub] v3 API (#8669)
* 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>
2022-12-31 15:56:04 +00:00
chris48s
f67251a9ca don't try to call .entries on null or undefined (#8757) 2022-12-29 16:54:11 +00:00
chris48s
00f35c67e8 fix debug logging of undefined query params (#8540) 2022-12-28 19:54:11 +00:00
chris48s
53c5cfa94d allow passing key to [stackexchange] (#8539)
* refactoring groundwork

* add stackapps_api_key setting

* add test for stackexchange auth

* clarify docs

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-12-04 10:53:59 +00:00
Sébastien Règne
bcc39200ae fix: support logoColor to shield icons. (#8263)
* fix: support logoColor to shield icons.

* FIXUP: Use 'travis-ci' to 'travis'

* FIXUP: Update docs.

* docs tweak

Co-authored-by: chris48s <chris.shaw480@gmail.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-11-26 13:48:34 +00:00
chris48s
b95e60bace don't call external services in core tests (#8643)
* don't call external services in core tests

* remove duplicate test
2022-11-24 17:57:53 +00:00
chris48s
5305e11f79 Remove 'suggest badges' feature (#8311)
* remove 'suggest badges' feature

* remove allowedOrigin/ALLOWED_ORIGIN setting

* keep allowedOrigin for now

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-11-09 18:15:59 +00:00
chris48s
d78a2f4155 allow/validate bitbucket_username / bitbucket_password in private config schema (#8472)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-10-08 10:37:05 +00:00
chris48s
b624179b8d get the tests passing on windows (#8350)
* run the core tests on windows

* fix glob with windows path seperator

* always use slash when slicing serviceClass matches

..and add comment explaining why we need to do this

* strip line endings (+ any other whitspace) before base64 encoding

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-08-29 19:58:10 +00:00
Caleb Cartwright
65d12efe32 ci: support new circle PR url variable (#8135) 2022-06-28 06:03:17 -05:00
Paul Melnikow
d6d5c02ed5 Remove obsolete monitor.html (#7878) 2022-04-22 18:09:55 -04:00
chris48s
8821ff85fc handle missing 'fly-client-ip' (#7814) 2022-04-05 20:29:28 +01:00
chris48s
ca1e77436b allow requireCloudflare setting to work when hosted on fly.io (#7781) 2022-03-26 20:08:22 +00:00
chris48s
ace5e03221 set a higher default cacheLength on rating/star category (#7587)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-02-10 21:02:22 +00:00
dependabot[bot]
f2d88e76fb chore(deps): bump fast-xml-parser from 3.21.1 to 4.0.1
* chore(deps): bump fast-xml-parser from 3.21.1 to 4.0.1
* update for fast-xml-parser v4
* fix maven and jetbrains badges

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: chris48s <chris.shaw480@gmail.com>
Co-authored-by: chris48s <chris48s@users.noreply.github.com>
2022-01-29 20:10:07 +00:00
dependabot[bot]
0f288a42fc chore(deps): bump got from 11.8.3 to 12.0.1 (#7370)
* chore(deps): bump got from 11.8.3 to 12.0.1
* update limit syntax
* update CancelError import
* update timeout syntax
* set missing user/pass to empty string for basic auth
* fix opm badge

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: chris48s <chris.shaw480@gmail.com>
Co-authored-by: chris48s <chris48s@users.noreply.github.com>
2022-01-29 20:04:11 +00:00
chris48s
015c39336b throw on unexpected keys in expectBadge() (#7354)
* throw on unexpected object keys

* fix docs.rs tests

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-12-10 21:26:41 +00:00
Caleb Cartwright
38c1e2df16 restore cors header injection from #4171, run [npm travis] (#4255)
* fix: restore cors header injection from #4171

* tests: move test into describe

* prettier
2021-12-05 15:40:48 -06:00
chris48s
feb1682814 Clean up cache module; affects [feedz jenkinsplugin myget node nuget packagist travis wordpress] (#7319)
* update terminology
    - "regular update" to "cached resource"
    - "interval" to "ttl"
    - move file and update imports

* set a default TTL, don't explicitly pass params if we want the default

* add tests

* update docs
2021-11-29 21:21:03 +00:00
chris48s
99bffd3a86 Send better user-agent values (and got config changes) (#7309)
* 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>
2021-11-25 17:11:49 +00:00
chris48s
6d22389e88 rename sendAndCacheRequest (#7277) 2021-11-17 20:00:29 +00:00
chris48s
c73072deed Remove requestOptions2GotOptions compatibility layer (#7270)
* gzip --> decompress

* strictSSL --> https.rejectUnauthorized

* auth --> username/password

* qs --> searchParams

* fix base service auth docs

* completely remove requestOptions2GotOptions layer

* update the docs

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-11-15 19:56:08 +00:00
chris48s
f1b643df0d remove request from legacy request handler (#7233)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-11-06 10:59:58 +00:00
chris48s
b79e00db14 migrate regularUpdate() from request-->got (#7215)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-11-03 19:53:18 +00:00
chris48s
eb07b60cf0 migrate github badges to use got instead of request; affects [github librariesio] (#7212)
* 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>
2021-10-31 16:19:09 +00:00
Caleb Cartwright
ae58e4a211 Add authentication for Libraries.io-based badges, run [Libraries Bower] (#7080)
* feat: support authentication on Libraries.io requests

* feat: wire up libraries.io config and api provider instantiation

* feat: create libraries.io and bower base classes

* refactor: tweak libraries/bower service classes and tests

* rename request fetcher function/arg

* throw exception when no tokens available

* cleanup old value

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-10-28 19:21:24 -05:00
chris48s
f62dbed843 set content-length header on badge responses (#7179)
closes #7171

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-10-21 17:09:45 +00:00
chris48s
14f64d17a8 Revert "got --> node-fetch" (#7175)
This reverts commit b209f5c63a.
2021-10-21 18:01:10 +01:00
chris48s
b209f5c63a got --> node-fetch (#6914) 2021-10-08 17:27:50 +01:00
chris48s
0ce98396d7 remove [github] admin routes (#7105) 2021-10-05 17:17:26 +01:00
Caleb Cartwright
5e96598fcb refactor: cleanup legacy sinon sandboxing (#7066)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-09-26 20:34:51 +00:00
Florian "sp1rit
8a9efb2fc9 [OBS] add Open Build Service service-badge (#6993)
* service: add obs service

* service: obs: replaced replaceAll with replace and global regex

* service: obs: added space between class members

* service: obs: support for multiple instances

* service: obs: removed user prefix from auth vars

obs_userName is now called obs_user and obs_userPass is called obs_pass

Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>

* service: obs: removed constructor hack in favour of serviceKey

* service: obs: apply suggestions from @calebcartwright

* service: obs: remove unneccesary http status mappings

Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-09-25 17:44:56 +00:00
Caleb Cartwright
961e13b229 Add API-based support for [GitLab] badges, add new GitLab Tag badge (#6988)
* Added GitLab Tag service

* Added prettyMessage for when repo has no tags

* Added pretty message for repo not found

* core: esm-ify gitlab tag service

* feat: support gitlab auth

* feat: support custom gitlab url on tag badges

* tests: add auth test for gitlab

* docs: fix gitlab config key references

* feat: support gitlab tag sorting options

* docs: add custom gitlab instance example for tags badge

* use v in gitlab route

* fix: gitlab tag examples

Co-authored-by: Ideotec <guille@ideotec.es>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-09-14 23:06:57 +00:00
Pierre-Yves B
8fd54b1b8d Switch all shields.io links to https (#6935) 2021-08-22 17:20:59 +01:00
dependabot[bot]
5cdb8102d8 chore(deps-dev): bump icedfrisby-nock from 2.0.0 to 2.1.0 (#6819)
* chore(deps-dev): bump icedfrisby-nock from 2.0.0 to 2.1.0

Bumps [icedfrisby-nock](https://github.com/paulmelnikow/icedfrisby-nock) from 2.0.0 to 2.1.0.
- [Release notes](https://github.com/paulmelnikow/icedfrisby-nock/releases)
- [Changelog](https://github.com/paulmelnikow/icedfrisby-nock/blob/main/CHANGELOG.md)
- [Commits](https://github.com/paulmelnikow/icedfrisby-nock/compare/2.0.0...2.1.0)

---
updated-dependencies:
- dependency-name: icedfrisby-nock
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

* fix: ensure network available during non-mocked service tests

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Caleb Cartwright <caleb.cartwright@outlook.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-07-29 21:13:40 +00:00