Commit Graph

387 Commits

Author SHA1 Message Date
Sergei Zharinov 0ae44810fc fix(http): detect x-access-token prefix before hostType-based auth branching (#42083)
* fix: Add `github-digest` to `GITHUB_API_USING_HOST_TYPES` list

* fix(http): detect x-access-token prefix before hostType-based auth branching

Moves GitHub App installation token detection (`x-access-token:` prefix)
before the hostType-based authorization chain in `applyAuthorization`.
This ensures correct `token` scheme auth for any GitHub-related hostType,
not only those listed in `GITHUB_API_USING_HOST_TYPES`.

* test(http/auth): add regression test for GitHub App token with non-listed hostType

* Fixes

* Fix tests
2026-03-24 17:11:56 +00:00
Michael Kriese a065a3dd41 fix(datasource/docker): use custom www-authenticate parser (#41813)
* fix(datasource/docker): use custom `www-authenticate` parser

* chore: drop license comments

* test: extend test

* fix: wrong regex

* test: fix tests

* Update lib/util/http/www-authenticate.ts

Co-authored-by: Jamie Tanna <jamie.tanna@mend.io>

* test: add more tests

---------

Co-authored-by: Jamie Tanna <jamie.tanna@mend.io>
2026-03-11 16:48:15 +00:00
renovate[bot] c2aa761c1e chore(deps): update linters (main) (#41417)
* chore(deps): update linters

| datasource | package              | from   | to     |
| ---------- | -------------------- | ------ | ------ |
| npm        | @eslint/js           | 9.39.2 | 9.39.3 |
| npm        | eslint               | 9.39.2 | 9.39.3 |
| npm        | eslint-plugin-oxlint | 1.46.0 | 1.49.0 |
| npm        | oxlint               | 1.47.0 | 1.49.0 |
| npm        | typescript-eslint    | 8.55.0 | 8.56.0 |

* chore(deps): update linters

| datasource | package              | from   | to     |
| ---------- | -------------------- | ------ | ------ |
| npm        | @eslint/js           | 9.39.2 | 9.39.3 |
| npm        | eslint               | 9.39.2 | 9.39.3 |
| npm        | eslint-plugin-oxlint | 1.46.0 | 1.49.0 |
| npm        | oxlint               | 1.47.0 | 1.49.0 |
| npm        | typescript-eslint    | 8.55.0 | 8.56.0 |

* Radix rule has been deprecated

* fixup! Radix rule has been deprecated

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: secustor <sebastian@poxhofer.at>
2026-02-28 11:23:25 +00:00
zT-1337 ddc46220b9 feat(platform): add support for the SCM-manager (#26866)
* - Added Renovate support for the [SCM-Manager](https://scm-manager.org/)
  - SCM-Manager is a repository management tool like GitHub
  - It is maintained as an open source project by the company [Cloudogu](https://cloudogu.com/en/)
- The SCM-Manager support is not feature complete yet, features like auto merging are still missing
- The SCM-Manager also got added to the documentation as another platform

author  Thomas Zerr <thomas.zerr@cloudogu.com> 1690877165 +0200
committer Eduard Heimbuch <eduard.heimbuch@cloudogu.com> 1706264263 +0100

* Reverted numbering change in markdown docs

* Changed from type to interface, if possible

* Removed axios dependency and using the http layer of renovate instead

* Fixed not using scmm specific mime types for accept header

* Use git from test/util instead

* Add dummy tests for no ops

* Fix some phrasing and spelling issues

* Change scmm to scm-manager and fix SCM-Manager specific content type

* Add supported major versions, review plugin requirement, write permissions is needed

* Change using actual host rules instead of mocking it

* Change use http mocks for testing

* Update docs/usage/getting-started/running.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update lib/modules/platform/scm-manager/index.ts

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update lib/modules/platform/scm-manager/mapper.spec.ts

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update lib/modules/platform/scm-manager/readme.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update lib/modules/platform/scm-manager/readme.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update lib/modules/platform/scm-manager/readme.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update lib/modules/platform/scm-manager/readme.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update lib/modules/platform/scm-manager/readme.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Fix scm-manager docs link

* Fix linting

* Fix linting

* Throw errors if username or token is not provided by the host rules

* Replace NO-OP with Not implemented

* Remove objects from log messages

* Fix linting

* Fix path to platform config options

* Fix link to self-host-configuration docs

* Fix link to self-host-configuration docs

* Remove the link to the platform config option, because the tests keep failing

* Fix link to self-host-configuration docs

* Remove not needed type cast

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>

* Fix type check of protocol links

* Move scm-manager into util http folder

* Apply linting

* Add maxBodyLength function and its test

* Add test case if protocol links are not an array of links

* Use zod schema for pagination

* Apply linting

* Refactor typing with zod schema

* Fix test description

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Fix test description

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Fix test description

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Fix test description

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update readme

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Add try catch around fetching the current user

* Switch log statement from info to debug

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>

* Switch log statement from info to trace

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>

* Switch log statement from debug to trace

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>

* Switch log statement from info to trace

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>

* Switch log statement from info to trace

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>

* Switch log statement from info to trace

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>

* Fix linting errors

* Remove credentials check in initRepo

* Fix imports

* Fix zod schema for repositories

* Fix zod schema for pull requests

* Fix 500 error after attempting to update an pr

* Fix wrong typing

* Refactor parameterized tests for better readability

* Refactor SCM HTTP API

* Add setToken functionality

* Remove not needed type definition

Co-authored-by: Michael Kriese <michael.kriese@gmx.de>

* Fix assertion

* Fix istanbul comment

* Change log statement

* Remove type rename

* Move inferred types close to corresponding schemas

* Add platform is experimental

* Remove type renaming

* Fix type imports

* Fix test suite description

* Remove debug log statement

Co-authored-by: Michael Kriese <michael.kriese@gmx.de>

* Fix warning

* Fix paremeterized unit tests with string templates

* Fix spelling

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Fix eslint error

* Convert trace logs to debug logs

* Convert info logs to debug

* Replace manual null and undefinded check with is util

* Rephrase instruction in readme

* Use ensureTrailingSlash instead

* Fix linting

* Keep type and schema together

* Simplify hasAssignees check

* Simplify reviewer mapping

* Remove istanbul comments

* Replace custom scmm header option with renovate native http headers option

* Let the token be passed in initPlatform

* Add description which permissions are needed

* Add support for ignorePrAuthor filter

* Add notes about automerge feature within platform readme

* Add support for fast_forward_only

* Change supported versions due to merge strategy change

* Remove commented code

* Fix import

* Use email schema

* Heed review advice

* Fix import and empty array assertions

* Fix linting issue

* Fix import errors

* Fix removed ignorePrAuthor parameter from initRepo function

* Fix failing unit tests by setting/reseting the global config

* Mark scm-manager as experimental

* Fix zod import path

* Change endpoint configuration, so that user only needs to define origin, but not also the path

* Fix warning of redundant backslash

---------

Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: René Pfeuffer <rene@pfeuffer-web.de>
Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2026-02-26 13:38:31 +00:00
Sergei Zharinov d1f4f804c7 fix: resolve cache TTL lazily in PackageHttpCacheProvider (#41386)
fix: resolve cache TTL lazily in PackageHttpCacheProvider
2026-02-23 08:17:59 +00:00
Michael Kriese 0121da55f0 fix(got): only flat copy options (#41349) 2026-02-20 09:15:08 +00:00
renovate[bot] e752a3db29 build(deps): update dependency got to v14 (main) (#41302)
* build(deps): update dependency got to v14

| datasource | package | from   | to     |
| ---------- | ------- | ------ | ------ |
| npm        | got     | 12.6.1 | 14.6.6 |

* test: fix tests

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-02-19 17:50:48 +00:00
Michael Kriese 3ac23ec833 fix(got): set rejectUnauthorized=false when NODE_TLS_REJECT_UNAUTHORIZED=0 is set (#41308)
* fix(got): set `rejectUnauthorized=false` when `NODE_TLS_REJECT_UNAUTHORIZED=0` is set

* test: silence codeql

* test: silence codeql

* Fix typo

---------

Co-authored-by: Jamie Tanna <jamie.tanna@mend.io>
2026-02-19 09:34:41 +00:00
renovate[bot] 00aeb9d8dc build(deps): update dependency got to v12 (main) (#41284)
* build(deps): update dependency got to v12

| datasource | package | from   | to     |
| ---------- | ------- | ------ | ------ |
| npm        | got     | 11.8.6 | 12.6.1 |

* fix: migration

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-02-18 16:08:12 +00:00
Michael Kriese 0babee8a19 fix: drop unused got remove authorization beforeRedirect hook (#41299) 2026-02-18 15:47:11 +00:00
Michael Kriese 99f4a76dc9 fix(got): normalize options (#41298) 2026-02-18 14:01:37 +00:00
renovate[bot] 4a2578d18d build(deps): update dependency zod to v4 (main) (#41225)
* build(deps): update dependency zod to v4

| datasource | package | from    | to    |
| ---------- | ------- | ------- | ----- |
| npm        | zod     | 3.25.76 | 4.3.6 |

* fix: zod migration

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-02-18 07:37:50 +00:00
Sergei Zharinov 628f9a2835 fix(mutex): support per-call-site acquire timeouts (#41259)
fix(mutex): Support per-call-site acquire timeouts

Closes #41210
2026-02-17 20:27:11 +00:00
Jamie Tanna acc1d3dfbd fix(types): don't use infer from Zod (#41054)
Due to an upstream issue with Rolldown, the import of `Infer` gets
rewritten by Rolldown to `infer` in the `.d.ts` files, which then
results in Typescript not compiling.
2026-02-10 10:40:24 +00:00
Sergei Zharinov 9d857c1f68 refactor(lint): Organize imports with biome (#40966) 2026-02-06 13:40:01 +00:00
Sergei Zharinov 2b0e80b884 feat!: Switch to ESM modules (#40756) 2026-01-29 14:21:41 +00:00
Sergei Zharinov c5b0a74f82 refactor: Remove constructor parameter properties (#40712) 2026-01-27 11:16:26 +00:00
Sergei Zharinov 930cf6633c refactor: Rewrite imports with .ts extensions (#40700)
fix: Additional vi.mock path corrections and prettier formatting
2026-01-26 22:48:17 +00:00
Michael Kriese 9fe353adb4 test: add coverage (part1) (#40636) 2026-01-23 15:09:01 +00:00
Sergei Zharinov 2e9edba619 feat(http): Prevent writes of already cached responses (#38986)
* feat(http): Prevent writes of already cached responses

* Update repository-http-cache-provider.ts

* Update repository-http-cache-provider.ts

* Fix queue timing measurement in HTTP request

* Fix import type for HttpCache schema

* Add mutex to HTTP request to prevent race conditions

* Refactor is import to use isPlainObject directly

* Only use locks for GET and HEAD

* Return method name to the mutex key

---------

Co-authored-by: Jamie Tanna <jamie.tanna@mend.io>
2026-01-07 15:25:46 +00:00
Sergei Zharinov 151d78f37f feat(typst): Update datasource to use official registry API (#38982)
* feat(typst): Update datasource to use official registry API

* Fix

* Update self-hosted-configuration.md

* Update rate-limits.ts
2025-12-30 10:25:03 +00:00
Cyrille a8ee6648c0 fix(forgejo): support fallback for all forgejo-* host types (#39968)
* fix: support fallback for forgejo-* host types

* Sort imports

* Reorganize code to lexicographical order
2025-12-16 20:28:24 +00:00
Jamie Tanna bd6b7c3d9a fix(github): warn on rate limit errors (#39585)
As noted in #39406, we're seeing a number of self-hosted users who have
missed the onboarding requirement for a `GITHUB_COM_TOKEN` for their
authentication to `github.com`.

On top of the docs improvements in #39406, we can make this clearer by
adding a warning log when we're going to report a `rate-limit-exceeded`
error, noting which hostname is failing (in case of GitHub Enterprise).

This requires a slightly duplicated `fail` function re-definition, so we
can override the baseUrl.

In the case that the request fails for `github.com`, we can also point
to our docs for the configuration needed.
2025-11-27 17:53:00 +00:00
Michael Kriese 050ac8d23b chore: better code coverage (#39518) 2025-11-25 15:01:54 +00:00
RahulGautamSingh 76f911041a refactor: use named exports (#39196)
* use named exports

* fix test

* add missing imnport

* fix prettier
2025-11-10 12:00:35 +00:00
renovate[bot] b34bbb5b2a chore(deps): update linters (main) (#38897)
* chore(deps): update linters

| datasource | package           | from   | to     |
| ---------- | ----------------- | ------ | ------ |
| npm        | @eslint/js        | 9.37.0 | 9.39.0 |
| npm        | eslint            | 9.37.0 | 9.39.0 |
| npm        | typescript-eslint | 8.45.0 | 8.46.2 |

* refactor: fix lint issues (#39183)

* chore(deps): update linters

| datasource | package           | from   | to     |
| ---------- | ----------------- | ------ | ------ |
| npm        | @eslint/js        | 9.37.0 | 9.38.0 |
| npm        | eslint            | 9.37.0 | 9.38.0 |
| npm        | typescript-eslint | 8.45.0 | 8.46.2 |

* chore(deps): update linters

| datasource | package           | from   | to     |
| ---------- | ----------------- | ------ | ------ |
| npm        | @eslint/js        | 9.37.0 | 9.39.0 |
| npm        | eslint            | 9.37.0 | 9.39.0 |
| npm        | typescript-eslint | 8.45.0 | 8.46.2 |

* refactor

* revert unwanted changes

* version sync

* version sync

* sync versions

* sync versions

* Apply suggestion from @RahulGautamSingh

* use named exports

* fix new lint issues

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: RahulGautamSingh <rahultesnik@gmail.com>
2025-11-10 10:33:01 +00:00
Rhys Arkins 4e4a0f99b0 fix!: remove the "Bot" from user-agent header (#37535) 2025-11-06 08:07:40 +00:00
renovate[bot] 31b4ceb704 build(deps): update dependency p-queue to v9 (main) (#39095)
* build(deps): update dependency p-queue to v9

| datasource | package | from  | to    |
| ---------- | ------- | ----- | ----- |
| npm        | p-queue | 8.1.1 | 9.0.0 |

* fix: option removed and it throws now always

* chore: lint

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2025-11-05 11:55:29 +00:00
Jamie Tanna f84305d7bf feat(hostRules): auto-wire a hostRule for api.github.com (#38733)
feat(hostRules): automagically use host rules for any `api.github.com` lookups

As noted in #38732, the Typst datasource performs API calls to the
GitHub APIs, but as we do not have explicit datasource mapping for the
API calls (via `GITHUB_API_USING_HOST_TYPES`), we end up sending
unauthenticated API calls, which then can result in rate limits.

We had previously attempted to fix this in #30490, for a different
datasource, and there are likely other datasources impacted.

To simplify this, we can auto-wire any `https://api.github.com/` API
calls with the `hostType: github` hostRule, when matching against the
hostname from the `url`.

This also adds a note to deprecate the usage of
`GITHUB_API_USING_HOST_TYPES`, unless it's explicitly needed.

Closes #38953.
2025-11-04 17:10:58 +00:00
Jamie Tanna 4a04436307 test(hostrules/github): add clearer precedence examples (#38961)
As part of #38953, we are changing the way that host rules work for
GitHub.com, and automagically wiring them in for datasources that
interact with `github.com`.

To do this, we should first provide a clearer definition of how host
rules should work, especially when there may be conflicting sources of
tokens, or where we may be on GitHub Enterprise Server vs GitHub.com.
2025-10-31 09:07:13 +00:00
renovate[bot] b4ed9e65d9 chore(deps): update dependency @vitest/eslint-plugin to v1.3.23 (main) (#38702)
* chore(deps): update dependency @vitest/eslint-plugin to v1.3.23

| datasource | package               | from   | to     |
| ---------- | --------------------- | ------ | ------ |
| npm        | @vitest/eslint-plugin | 1.3.16 | 1.3.23 |

* remove now unnecessary exceptions

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: secustor <sebastian@poxhofer.at>
2025-10-31 07:50:48 +00:00
renovate[bot] 91f10ff88f chore(deps): update linters (main) (#38166)
* chore(deps): update linters

| datasource | package           | from   | to     |
| ---------- | ----------------- | ------ | ------ |
| npm        | @eslint/js        | 9.35.0 | 9.37.0 |
| npm        | eslint            | 9.35.0 | 9.37.0 |
| npm        | typescript-eslint | 8.43.0 | 8.45.0 |

* chore: fix linting issue

* fixup merge problem

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: secustor <sebastian@poxhofer.at>
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
2025-10-28 12:54:27 +00:00
renovate[bot] 1280fe4dc7 chore(deps): update dependency @vitest/eslint-plugin to v1.3.16 (main) (#38502)
* chore(deps): update dependency @vitest/eslint-plugin to v1.3.16

| datasource | package               | from   | to     |
| ---------- | --------------------- | ------ | ------ |
| npm        | @vitest/eslint-plugin | 1.3.13 | 1.3.16 |

* fix linting errors

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: secustor <sebastian@poxhofer.at>
2025-10-13 09:24:15 +00:00
Sergei Zharinov 655171a0b0 docs: Improve cache TTL docs and log messages (#38305) 2025-10-01 06:44:27 +00:00
Sergei Zharinov ad48b22d3b feat(bitbucket): Better cache invalidation for branch status cache (#38084) 2025-09-18 19:36:43 +00:00
Sergei Zharinov b3d5d7389f feat(bitbucket): Replace mem cache with aggressive repo cache (#37975) 2025-09-12 04:39:57 +00:00
Sergei Zharinov 500a8bc59e feat(cache): Reuse repo-cached HTTP responses during a single run (#37568) 2025-09-11 22:06:19 +00:00
Sergei Zharinov 38842a61b2 fix(http): Cache HEAD requests separately from GET requests (#37862) 2025-09-05 14:40:40 +00:00
Sergei Zharinov 3252d42706 feat(gitlab): Improved PR cache (#37076)
Co-authored-by: RahulGautamSingh <rahultesnik@gmail.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2025-08-18 12:30:06 +00:00
Michael Kriese 3211d56e21 refactor(zod): rename schema to match our best practices guide (#37499) 2025-08-14 10:35:03 +00:00
Michael Kriese a5f3956210 refactor: remove default radix from parseInt (#37489) 2025-08-13 15:36:30 +00:00
Patrick Schratz 6c2bd9d197 feat: add forgejo as a standalone platform (#37075)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2025-07-21 14:24:07 +00:00
Sergei Zharinov 05d42780ad fix(cache): Make TTL overrides work for all namespaces (#36903)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2025-07-16 11:40:48 +00:00
Sergei Zharinov 02ef48048e fix: Update timestamp on cache revalidate (#36991) 2025-07-15 06:13:16 +00:00
Sergei Zharinov 916044e8a8 feat: Implement cacheTtlOverride for datasource index cache (#36842) 2025-07-10 06:40:41 +00:00
RahulGautamSingh c477fb09e1 feat(datasource/custom): add toml support (#36136)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2025-06-29 09:08:39 +00:00
renovate[bot] 34792f0b4f build(deps): update dependency p-queue to v8 (main) (#36427)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2025-06-10 12:40:23 +00:00
Tobias b7347fd1c9 fix(util/host-rules): compare normalized URLs when matching hostRules (#36311) 2025-06-05 06:34:39 +00:00
Rhys Arkins a0895e6c28 feat: log one warning for 401 github (#36235) 2025-06-01 09:13:56 +00:00
Sergei Zharinov f478e1d664 feat(cache): Experimental env var to disable HTTP memory cache (#36124) 2025-05-24 16:18:27 +00:00