Commit Graph

17 Commits

Author SHA1 Message Date
renovate[bot] 9d74625d93 build(deps): update dependency prettier to v3.9.6 (main) (#45815)
* build(deps): update dependency prettier to v3.9.6

| datasource | package  | from  | to    |
| ---------- | -------- | ----- | ----- |
| npm        | prettier | 3.8.1 | 3.9.6 |

* chore: prettier fixes

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@mend.io>
2026-09-09 13:50:03 +00:00
Sebastian Poxhofer 05e1271376 test: use expect().resolves instead of awaiting inside expect (#45672)
Enables the vitest/prefer-expect-resolves oxlint rule and applies its
autofix across the spec suite.
2026-09-04 10:40:46 +00:00
Sebastian Poxhofer 97327c3d28 refactor(linters): add prefer-coerce-array rule (#45492)
* refactor(linters): add prefer-coerce-array rule

Refs #45217

`x ?? []` and `coerceArray(x)` say the same thing, but only the second
one is searchable and consistent. The rule flags a `??` whose default is
a bare `[]` literal; a non-empty default or an asserted `([] as Foo[])`
still passes.

Applying it across `lib/` surfaced three spots the helper cannot cover,
which keep `?? []` with a disable comment or a narrower fix:

- `package-files.ts` destructures a tuple, which `coerceArray()` widens
- `generate.spec.ts` defaults `matchAll()`, an iterator rather than an array
- `mise/upgradeable-tooling.ts` declares a `Record` return, so its
  `?? []` fallback was wrong to begin with and becomes `coerceObject()`

* refactor(platform/github): hoist the GHE version header lookup

`Object.entries(...).find()` returns a tuple, and defaulting it with
`?? []` only to destructure the second element reads as an array
default when it is not one. Name the found entry instead, which drops
the `?? []` rather than routing a tuple through `coerceArray()`.
2026-08-28 09:27:58 +00:00
Sebastian Poxhofer c41b46bac3 feat(logging): do not use dynamic fields in log messages with severity WARN or higher (#44560)
* ci(linter): add renovate/logger-static-message rule

Adds a custom oxlint rule that enforces a static msg component for
logger.warn/error/fatal calls (including logger.once variants) so the
messages can be grouped in metrics and error catching services, per
docs/development/best-practices.md. It also flags metadata properties
named 'error' that hold error-ish values, because the bunyan serializer
only handles the 'err' key.

The rule is enabled as an error for lib/ production code and disabled
for spec files. All 33 pre-existing violations are fixed by moving
interpolated values into the metadata object, making messages static,
and renaming 'error' metadata keys to 'err'. Affected log-message
assertions in co-located specs are updated accordingly.

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

* ci: ignore validator output

* fixup new merged in log messages

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 06:53:37 +00:00
Sebastian Poxhofer 7436b80cda test(linter): add renovate/no-redundant-mock-reset rule (#44557)
ci(linter): add renovate/no-redundant-mock-reset rule

Vitest sets mockReset: true globally in vitest.config.mts, which resets
all mocks before each test. This makes vi.resetAllMocks() /
vi.clearAllMocks() and per-mock .mockReset() / .mockClear() calls inside
beforeEach/afterEach hooks redundant. Add a custom oxlint rule (enabled
for **/*.spec.ts and test/**) flagging such calls, and remove the 40
redundant calls it found. restoreAllMocks/mockRestore are not flagged
because restoreMocks is not enabled globally.

Two sites keep an inline disable with a reason: nested beforeEach hooks
in filter-checks.spec.ts and onboarding/pr/index.spec.ts intentionally
call mockReset() to discard once-values queued by an outer beforeEach.

Requested by maintainer review feedback (review comment 3052324877).

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 11:26:20 +00:00
Sebastian Poxhofer a31f9cf0f9 refactor(schemas): prefer Nullish schema utils instead of z.nullish() (#44565)
* ci(linter): add renovate/prefer-zod-nullish rule

Add a custom oxlint rule that flags zod chains calling .optional() and
.nullable() adjacently (in either order) and suggests .nullish(), which
is equivalent (both accept undefined | null in zod v4).

Fix all 26 pre-existing violations across 6 schema files.

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

* ci(linter): prefer schema-utils Nullish over zod .nullish()

Rename prefer-zod-nullish to prefer-nullish-util and extend it to flag
.nullish() itself, including the standalone forms z.nullish(x) and
z.optional(z.nullable(x)). Migrate all call sites to Nullish() and
DeepNullish() from schema-utils, which normalize null to undefined in
parsed output. Schemas with more than one nullish position are wrapped
in DeepNullish(); nullish object properties with nullish members use
Nullish(DeepNullish(...)) to keep the optional property type marker.

Spec files are exempt (result.spec.ts intentionally tests
null-preserving parses). Spec assertions expecting null in parsed
output were updated to undefined. Note: docker manifests with an
explicit "mediaType": null are now accepted and treated like an absent
mediaType instead of failing the discriminated union.

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

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 10:15:55 +00:00
Sebastian Poxhofer ad0b59f8b7 refactor(oxlint): enable vitest/require-to-throw-message (#44421) 2026-07-07 17:47:04 +00:00
Sebastian Poxhofer 914c64afbd test(linter): zod schema and infered type naming rule (#43736)
* ci: add linting rule for schema and infered types

* refactor: remove usages of Schema and differently named types
2026-06-02 12:07:35 +00:00
Sebastian Poxhofer 15f4bd8eff chore: migrate from zod/v3 to zod/v4 (#43691)
* chore: migrate from zod/v3 to zod/v4

This commit contains the logic changes

* chore: migrate imports from zod/v3 to zod/v4

This contains import updates and adds explicit record keys as zod/v4 requires these now

* ci: enforce usage of zod/v4
2026-05-30 16:01:58 +00:00
Jamie Tanna ff6761ed23 fix(config/global): return default values for GlobalConfig.get (#42113)
* fix(config/global): return default values for `GlobalConfig.get`

As noted in #39949, it can be awkward working with in `GlobalConfig.get`, where
we would previously need to specify the default value when calling `.get`,
which could lead to drift with the defaults for a given config option.

To reduce this risk, we can rely on a given `default` for a configuration
option, providing that as a default.

Because this now definitely returns a value that matches the config option, it
now allows us to remove `!` assertions.

* fixup! fix(config/global): return default values for `GlobalConfig.get`

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

* fixup! fix(config/global): return default values for `GlobalConfig.get`

* test(presets): remove impossible test

As it's now not possible to set a value as `undefined` (as
`GlobalConfig` will then use the default), this test no longer validates
anything.

* test(workers/repository): add mock

Now `platform` defaults to `github`, we need to mock out the call to
fetch config.

Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>

* test: coverage

* test: coverage

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>
2026-05-15 17:10:38 +00:00
zT-1337 55eafb52e2 fix(scm-manager): add mapping of SCM-Manager specific PR states to the matching Renovate PR states (#43237)
Add mapping of SCM-Manager specific PR states to the matching Renovate PR states
2026-05-11 14:52:40 +00:00
RahulGautamSingh ff27ebee2b docs: use unicode arrow (→) instead of ASCII (->) (#42896)
* chore(docs): use unicode arrow (→) instead of ASCII (->)

* more changes
2026-04-27 07:11:16 +00:00
Sergei Zharinov 7df11ed734 chore(lint): add enforce-ts-extension oxlint rule (#42389)
* refactor(lint): extract custom oxlint rules into separate files

Split `tools/lint/rules.js` into one file per rule under
`tools/lint/rules/`. Also simplify `test-root-describe` with
early-exit guard clauses.

* feat(lint): add `enforce-ts-extension` oxlint rule

Add a custom JS-based oxlint rule that enforces `.ts` extensions on
local imports. The rule catches two problems:

- `.js` extension used instead of `.ts` (auto-fixable)
- missing file extension entirely (report only)

Checked locations:
- static import/export declarations
- dynamic `import()` expressions
- vitest module APIs: `vi.mock`, `vi.doMock`, `vi.unmock`,
  `vi.doUnmock`, `vi.importActual`, `vi.importMock`

Both relative paths (`./`, `../`) and path aliases (`~test/`)
are treated as local. Package imports are ignored.

Also fixes 26 pre-existing violations across 18 spec files.

* Update tools/lint/rules/enforce-ts-extension.js

Co-authored-by: Anne Stellingwerf <1637358+astellingwerf@users.noreply.github.com>

---------

Co-authored-by: Anne Stellingwerf <1637358+astellingwerf@users.noreply.github.com>
2026-04-07 15:36:16 +00:00
zT-1337 bcf3fcd60d fix(scm-manager): invalid base url, due to double slashes and a fixed context path (#42068)
* Fix double slash error

Endpoint will always have a trailing slash, therefore the path must not start with a slash

* Remove servlet context from path

Since the `scm` part can be reconfigured to another value, it should not be hardcoded, but a part of the endpoint config

* Fix invalid test setup

* Ensure the trailing slash on the endpoint
2026-03-24 08:09:37 +00:00
Sergei Zharinov b57fc5dd13 feat: enable vitest plugin in oxlint (#41579)
* chore: Add vitest plugin to oxlint

* Remove unused line in versioning spec

* Remove coverage threshold check job

The coverage threshold check has been removed from the build workflow. This job was redundant as
coverage is already handled by the codecov job.

* Refine versioning API schema with existence check

* Revert "Remove coverage threshold check job"

This reverts commit f2c9dd872b.

* Remove vitest ESLint plugin

The vitest ESLint plugin and its configurations have been removed. ESLint will no longer enforce
vitest-specific rules.

* Remove unused vitest eslint plugin

The `@vitest/eslint-plugin` is no longer used and can be safely removed.
2026-03-02 13:02:25 +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