36 Commits

Author SHA1 Message Date
Gaël Jourdan-Weil 1d34441882 fix(http): improve warning message for ignored cross origin requests (#45802)
🐛 fix: improve warning message for ignored cross origin requests
2026-09-09 09:53:34 +00:00
renovate[bot] 2561284dc4 build(deps): update dependency got to v15 (main) (#43120)
* build(deps): update dependency got to v15

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

* chore: adapt code to breaking changes

* test: fix test

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: secustor <sebastian@poxhofer.at>
Co-authored-by: Michael Kriese <michael.kriese@mend.io>
2026-09-09 09:01:11 +00:00
Jamie Tanna a160e39c7a fix(platform/gitlab): don't follow Link headers with different hosts
To prevent potential SSRF attempts, we can ignore a
misconfigured/malicious `next` link, and log a warning.

Co-authored-by: Claude Opus 4.8 <jamie.tanna+claude-code@mend.io>
2026-08-04 09:09:26 +01:00
Vincent Pizzo 12b2f4f405 fix(platform/gitlab): retry MR creation on transient source_branch race. (#44502)
fix(platform/gitlab): retry MR creation on transient source_branch race

GitLab occasionally rejects a merge request POST with
`400 {"message":{"source_branch":["does not exist"]}}` immediately after
a branch push succeeds, because the freshly pushed ref is not yet visible
to the API due to Gitaly eventual consistency. The request was not
retried, leaving an orphaned branch until the next run.

Extend the existing `calculateRetryDelay` hook (which already retries
transient `409 Resource lock` POST errors) to also retry this
`400 source_branch does not exist` case, reusing got's bounded
exponential backoff.
2026-07-25 18:42:41 +00:00
Sebastian Poxhofer 58771bb183 refactor(linters): enabled oxlints func-style (#44691)
* refactor(oxlint): enable func-style

Enable the built-in func-style rule as ["warn", "declaration"] so that
named functions are written as function declarations instead of arrow or
function expressions assigned to variables, matching the convention in
docs/development/best-practices.md (Functions section). Inline arrow
callbacks are unaffected; prefer-arrow-callback continues to cover the
callback direction.

Severity is "warn" instead of "error" as a fallback: a repo-wide run
found 196 pre-existing violations (70 in spec files, 126 in production
code), exceeding the 80-violation fix threshold for this change, so no
violations were fixed here. Follow-up work can convert the offenders
(largest clusters: lib/modules/versioning/ruby, lib/util/cache/package,
lib/modules/versioning/maven, lib/modules/versioning/gradle) and then
raise the rule to "error". Note oxlint 1.72 also supports an
allowTypeAnnotation option if typed consts should remain arrows.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* ci(linter): enforce func-style at error

* refactor(func-style): convert const-arrow functions to declarations in with-cache spec and ruby versioning

* refactor(func-style): convert const-arrow functions to declarations in maven/gradle modules

* refactor(func-style): convert const-arrow functions to declarations in remaining versioning modules

* refactor(func-style): convert const-arrow functions to declarations in platform modules

Discriminated-union closures (ensureCommentRemoval byTopic/byContent
helpers in github, gitlab, bitbucket, bitbucket-server) needed the
narrowed field passed explicitly as a parameter, since function
declarations are hoisted and lose the outer if-narrowing that inline
arrow-function closures previously relied on.

* refactor(func-style): convert const-arrow functions to declarations across util/manager/datasource modules

One case (logger/renovate-logger.ts logOnceFn) is kept as an arrow
function with a documented oxlint-disable: it is stored on
this.logger.once[level] and relies on lexically-bound this, which a
hoisted function declaration would not preserve.

* refactor(func-style): convert remaining const-arrow test helpers to declarations

get-updated.spec.ts: hoisted expectPipCompilePackageAndLockFile to
module scope (it only closes over the module-level pipCompile mock)
and added a documented oxlint-disable for vitest/expect-expect on its
caller test, since oxlint's expect-expect check does not trace
assertions through an externally-defined helper function.

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 11:14:22 +00:00
Sebastian Poxhofer 03baf6ee4a test(noNewURL): add new rule enforcing parseUrl() from 'lib/util/url.ts' (#43247)
* test(noNewURL): add new rule enforcing parseUrl() from 'lib/util/url.ts'

* replace newURL with parseUrl

* remove non-null assertions marks if appropiate

* test: add additional tests

* test: add additional tests and ignore where it makes sense

* implement suggestions

* test: further improve coverage

* apply suggestion
2026-05-13 16:23:10 +00:00
Michael Kriese 99f4a76dc9 fix(got): normalize options (#41298) 2026-02-18 14:01:37 +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
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
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
RahulGautamSingh 49fa1be464 feat(util): getEnv (#35161)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2025-05-06 18:37:28 +00:00
Sergei Zharinov db8dda2378 fix: Explicitly disable memCache when caching is switched on/off (#35060)
Co-authored-by: Felipe Santos <felipecassiors@gmail.com>
2025-03-30 08:02:36 +00:00
Michael Kriese 5897f3057d fix: refactor http (take 2) (#34558) 2025-02-28 17:17:09 +00:00
Michael Kriese 593a92655e feat: refactor http (#34550) 2025-02-28 14:40:04 +00:00
Florian Greinacher c608ceeaac feat(gitlab): retry requests on resource locks (#29019)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2024-05-14 09:15:12 +00:00
Sergei Zharinov c25804194d refactor(http): Remove unused HTTP etag caching implementation (#28000) 2024-03-18 13:58:31 +00:00
Sergei Zharinov b69416ce17 refactor(prettier): Force trailing commas (#25631) 2023-11-07 15:50:29 +00:00
Sergei Zharinov 290b78d87d feat(http): Etag support (#22302) 2023-05-25 12:17:43 +00:00
RahulGautamSingh c56588eaba refactor: convert PlatformmId to union (#18458) 2022-11-01 14:46:09 +00:00
Sergei Zharinov 3e3023fd5e refactor(http): Simplify base types (#18088) 2022-10-03 10:53:20 +02:00
Michael Kriese 1bc8fee494 refactor: cleanup http option interface (#16967) 2022-08-04 12:54:52 +02:00
MaronHatoum b121deb969 refactor(util/http): move interfaces from index.ts to types.ts (#14335)
* refactor:util/http move interfaces and types from index.ts to types.ts

* refactor:reorder imports

* refactor:move HttpError from type.ts to index.ts

* refactor:change imports after moving HttpError from type.ts to index.ts

* refactor:revert white spaces

* refactor:revert moving httpError from types.ts to index.ts

* refactor: moving httpError from types.ts to index.ts

* refactor: change import

* refactor: change import

* refactor: change import

* refactor: fix circular dependencies (lint build)

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2022-02-24 08:50:17 +00:00
renovate[bot] b0acc97579 build(deps): update dependency parse-link-header to v2 [security] (#13412) 2022-01-13 06:45:50 +01:00
Michael Kriese 9d61bd9678 refactor: strong type http headers (#13520) 2022-01-12 22:08:09 +01:00
Sergei Zharinov 030b1a61a4 refactor(util/http): Strict null checks for http utils (#13416)
* refactor(util/http): Strict null checks for http utils

* More tests for queue.ts

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2022-01-09 21:22:27 +00:00
Maksim 1f86b71fd5 refactor: constants (#11690) 2021-10-06 07:43:32 +02:00
Sebastian Poxhofer 443b22b0ae feat(gitlab-release): implement datasource (#11226)
Co-authored-by: Nejc Habjan <hab.nejc@gmail.com>
Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2021-09-01 09:36:38 +00:00
Jamie Magee a6f4e99e27 refactor: no implicit override (#11395)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2021-08-23 20:50:37 +00:00
David 56299fe581 fix: GITLAB_IGNORE_REPO_URL with relative URL (#9969)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2021-05-27 14:54:05 +02:00
Sergei Zharinov e18259c2a5 refactor(http): Remove URL functions from platform-specific wrappers (#7933) 2020-12-10 08:50:04 +01:00
Jamie Magee 456245aabe chore(eslint): enable typescript 3.7 rules (#6765) 2020-07-18 08:42:32 +02:00
Michael Kriese 76d8574581 chore(internal): fix http coverage (#6746) 2020-07-14 09:51:27 +02:00
Rhys Arkins 031ad87b62 refactor: move ExternalHostError 2020-06-23 11:44:52 +02:00
Rhys Arkins 52a074e041 refactor: ExternalHostError (#6563) 2020-06-22 21:28:02 +02:00
Sergio Zharinov 9617248f86 refactor(gitlab): Use new http wrapper for Gitlab platform (#6275) 2020-05-29 07:52:40 +02:00