Commit Graph

370 Commits

Author SHA1 Message Date
Jonas Dittrich 069ace8cc0 fix(manager/npm): allow dots in github dependency repo names (#43493)
* fix(manager/npm): allow dots in github dependency repo names

* fixup! use regEx for githubRepoRegex
2026-05-26 08:57:20 +00:00
Sebastian Poxhofer 73b90e958b refactor: remove string concetation for production code (#43442)
refactor: prefer templates rather than `+`
2026-05-19 13:31:27 +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
Jamie Tanna 68cb7c71d5 test: ensure we set binarySource=global (#43382)
* test: ensure we set `binarySource=global`

As part of future changes, we'll correctly return the default value from
`GlobalConfig.get`, instead of `undefined` if no default is provided in
the `get` call.

As `binarySource=install` is the default, this then leads to these tests
failing, as they're intended to run with `binarySource=global`.

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

* fixup! test: ensure we set `binarySource=global`

* fixup! fixup! test: ensure we set `binarySource=global`

---------

Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>
2026-05-15 15:40:22 +00:00
Johannes Feichtner 0779ae8d06 fix(manager/npm): skip --before flag when .npmrc contains min-release-age (#43187) 2026-05-09 12:04:35 +00:00
Johannes Feichtner 77758459e9 feat(manager/npm): pass --before to npm install when minimumReleaseAge is set (#42552)
* feat(manager/npm): pass --before to npm install when minimumReleaseAge is set

* fix tests

* replace regex with `ini` parse
2026-05-07 13:14:48 +00:00
renovate[bot] 766db6fc6f build(deps): update dependency upath to v3 (main) (#43121)
* build(deps): update dependency upath to v3

| datasource | package | from  | to    |
| ---------- | ------- | ----- | ----- |
| npm        | upath   | 2.0.1 | 3.0.7 |

* chore: fix types

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-05-06 12:09:33 +00:00
Felipe Santos 3afa38511b refactor(datasource/npm): extract defaultRegistryUrl constant (#42794)
* feat(datasource/npm): extract defaultRegistryUrl constant

* Fix some other places

* Remove useless defaultRegistryUrls export

* Fix another place

* Undo rules.spec.ts changes, which are not related

* Fix npm presets

* Restore line removed by mistake

* Fix another test file

* Restore changes to a file which is not relevant

* Fix another small place
2026-04-27 15:24:01 +00:00
Jamie Tanna c5a87efec8 chore(types): add missing ConstraintName enforcement (#42745)
* chore(types): correct JSDoc

* chore(types): add missing `ConstraintName` enforcement

* fixup! chore(types): add missing `ConstraintName` enforcement

By simplifying this case, which should never happen, as the types
wouldn't allow it.

* chore: reorder for typechecking simplicity

* fixup! chore(types): add missing `ConstraintName` enforcement
2026-04-21 11:50:34 +00:00
Michael Kriese 6804768a1a feat(npm): support pnpm workspace file overrides (#42247)
* feat(npm): support pnpm workspace file overrides

* chore: fix comment

* refactor: use types

* feat(npm/pnpm): update overrides in workspace file

* test: fix test

* chore: fix coverage
2026-04-08 12:01:31 +00:00
Alex 0175429341 fix(manager/npm): apply minimumReleaseAgeExclude to pnpm catalog updates (#42050)
* Fix updating minimumReleaseAgeExclude with pnpm catalogs

* Try fixing coverage
2026-04-07 12:39:15 +00:00
Michael Kriese 440e353145 chore: use ts extension (#42300) 2026-04-01 07:46:34 +00:00
Jamie Tanna 2d239d2cc1 docs: explicitly document depTypes each manager supports (#42142)
* docs: explicitly document `depTypes` each manager supports

A long-standing question we receive is "what `depTypes` can I match
against in my project".

Although the best recommendation we usually have is "check the
`packageFiles with updates" log line (as a very key log line for users),
we can go one step further and try and create a stronger contract.

To do this, I've used Claude Sonnet 4.6 to work through the codebase,
determine areas that a `depType` is set in a manager (statically or
dynamically) and generate a structured, typed, means to document how
they're used.

Through a few iterations of the process, and attempts at human-written
documentation, we've settled on:

- prioritising autogenerated documentation (for humans to read) to note
  what `depTypes` are known, and what they are
- `knownDepTypes`, to describe any known, static, `depType`s and their
  human-readable meaning
  - with the `prettyDepType`, if used
- `supportsDynamicDepTypesNote`, to add a Markdown note to the generated
  documentation

While here, we also:

- make sure to note this in the "adding a new package manager"
  documentation
- remove any hand-written references to `depTypes` in each manager's
  documentation page
- correct the Gleam `depTypes`
- make sure to use the `knownDepTypes`'s `prettyDepType` definition if
  we know it, for a given `depType`

The descriptions have been generated by Claude Sonnet, with some
human-written tweaks where appropriate.

[0]: https://github.com/renovatebot/renovate/discussions/15176

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

* fixup! docs: explicitly document `depTypes` each manager supports

* docs(manager): display `depTypes` documentation if none present

For consistency, and to make it more explicit.

---------

Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>
2026-03-31 12:08:39 +00:00
Michael Kriese 3953a78123 refactor: pass packageFile to updateDependency (#42253) 2026-03-30 17:32:36 +00:00
Sergei Zharinov b79ea931a3 refactor(lint): Enable oxlint correctness category (#42218) 2026-03-28 19:48:52 +00:00
Jamie Tanna a74da77801 fix(manager/npm): revert passing --before to npm install when minimumReleaseAge is set (#42198)
Revert "feat(manager/npm): pass --before to npm install when minimumReleaseAg…"

This reverts commit c4d5697775.
2026-03-27 12:36:03 +00:00
Johannes Feichtner c4d5697775 feat(manager/npm): pass --before to npm install when minimumReleaseAge is set (#42051)
* feat(manager/npm): pass --before to npm install when minimumReleaseAge is set

* use logger metadata

* Apply suggestion from @viceice

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

---------

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-03-27 09:46:02 +00:00
Jamie Tanna 6061757b88 refactor(manager/npm): remove duplicate ArtifactError type (#41779) 2026-03-10 13:06:03 +00:00
Jamie Tanna 2d1e57532f refactor(types): rename lockFile to fileName in ArtifactError (#41631)
As `fileName` makes more sense (as it's not always a lock file we're
updating).

Also, if you set `fileName`, it would never actually output the
filename.

This renames the usages of `lockFile` to `fileName`.

Co-authored-by: Claude Sonnet 4.5 <jamie.tanna+github-copilot@mend.io>
2026-03-10 09:57:31 +00:00
Sergei Zharinov 41bfb8678e refactor(lint): use oxlint for type-aware rules (#41739)
* feat: enable oxlint type-aware linting

Move type-aware typescript-eslint rules from ESLint to oxlint,
leveraging oxlint-tsgolint for type information. This removes
the need for ESLint's projectService and parserOptions.

- Add `options.typeAware: true` to .oxlintrc.json with all
  type-aware rules (recommendedTypeChecked + stylisticTypeChecked)
- Switch ESLint to non-type-aware configs (recommended, stylistic)
- Remove projectService/parserOptions from ESLint config
- Drop @typescript-eslint/naming-convention (no oxlint equivalent)
- Update oxlint/eslint-plugin-oxlint to 1.51.0
- Add oxlint-tsgolint dependency
- Convert eslint-disable comments to oxlint-disable for type-aware rules
- Fix prefer-optional-chain violations newly caught by oxlint

* fix: revert unnecessary code changes, suppress with oxlint-disable instead

* fix: suppress remaining prefer-optional-chain violations

* fix: suppress last prefer-optional-chain violation

* fix: remove redundant --type-aware CLI flag, use config instead
2026-03-09 12:51:12 +00:00
Jamie Tanna bc82cff059 feat(managers/npm): allow specifying toolSettings.nodeMaxMemory (#40957)
* feat(managers/npm): allow specifying `toolSettings.nodeMaxMemory`

As noted in #40942, we're seeing an increase in memory usage across
`pnpm` and `yarn` users in Mend-hosted apps.

To allow limiting the maximum memory that any `node` child processes
will use, we can add a new `toolSettings.nodeMaxMemory` to (hopefully)
mitigate this.

Similar to the `toolSettings.jvmMaxMemory`, the self-hosted
administrator can set a maximum, which cannot be exceeded by repo-level
configuration.

* fixup! feat(managers/npm): allow specifying `toolSettings.nodeMaxMemory`
2026-03-05 12:56:02 +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
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
Jamie Tanna d9f8972156 refactor(manager/npm): extract function for resolving .npmrc (#41245)
* refactor(manager/npm): extract function for resolving `.npmrc`

As part of future changes in #41215 and/or #41216, we will resolve the
`.npmrc`, if it can be found, in multiple places.

Before we do this, we can prefactor this logic to extract this out into
its own function that can be used independently.

Co-authored-by: Claude Sonnet 4.5 <jamie.tanna+github-copilot@mend.io>

* test(manager/npm): add missing test coverage

This is coverage that we've never had on this function, and was reported
by CodeCov.

---------

Co-authored-by: Claude Sonnet 4.5 <jamie.tanna+github-copilot@mend.io>
2026-02-17 12:49:49 +00:00
RahulGautamSingh d024075d00 refactor: add lock file names to manager api (#41133)
* feat(nuget): add supportsLockFileMaintenance flag

The NuGet manager supports lock file maintenance via `packages.lock.json`
but was missing the `supportsLockFileMaintenance` export.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(manager): add lockFileNames metadata to all lock file managers

Add `lockFileNames` field to `ManagerApi` interface and export it from
all 24 managers that support lock file maintenance. This metadata will
be used to auto-generate the lock file support table in docs.

Also adds a validation test ensuring managers with
`supportsLockFileMaintenance` always provide `lockFileNames`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 22:56:16 +00:00
Sergei Zharinov 9d857c1f68 refactor(lint): Organize imports with biome (#40966) 2026-02-06 13:40:01 +00:00
Jamie Tanna 0c4912456e fix(pnpm): don't update workspace when no pnpm-lock.yaml found (#40780)
As noted in #40774, if a `pnpm-lock.yaml` isn't found, the
`pnpmShrinkwrap` is undefined, which then results in `upath.dirname`
throwing an error.

We can make sure that we have a value, and exit out early if not.

This is a short-term fix, and we should follow-up to make it so we can
find the `pnpm-workspace.yaml` if there's not a lockfile.
2026-01-29 11:21:08 +00:00
Michael Kriese cd0426babd feat(sidecar): use renovatebot/base-image instead of containerbase/sidecar (#40772)
* feat(sidecar): use `renovatebot/base-image` instead of `containerbase/sidecar`

* refactor: simplify sidecar handling

* test: fixup

* docs: fixup
2026-01-29 10:05:24 +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
Jamie Tanna 30eece1f61 fix(pnpm): de-duplicate version numbers in minimumReleaseAgeExclude (#40613)
As noted in #40611, we shouldn't reference the same version multiple
times in the same exclude directive.

This also handles the case where we could end up with multiple comments
for a given package.

This is slightly more complex logic, and slightly simplifes by
extracting out to a new helper method.

We also need to make sure that we use `getIn` so we get the raw node, so
we can look at the comment inside the `minimumReleaseAgeExclude`'s list,
but before the first element.
2026-01-23 08:54:20 +00:00
Jamie Tanna 8752c280fc fix(pnpm): use exact versions in minimumReleaseAgeExclude (#40612)
As noted in #40610, when `newVersion` contains a caret (or other
npm-specific versioning constraints) a generated
`minimumReleaseAgeExclude` directive will result in

    ERR_PNPM_INVALID_MINIMUM_RELEASE_AGE_EXCLUDE  Invalid value in
    minimumReleaseAgeExclude: Invalid versions union. Found: "...". Use
    exact versions only.

To handle this better, we can make sure we use `newVersion` over
`newValue`, as it'll provide the raw version number.

We also need to update an unrelated to test to make sure it's using
`newVersion`.
2026-01-22 17:17:41 +00:00
RahulGautamSingh 5922ab6ae4 feat(pnpm): update minimumReleaseAgeExclude for security updates (#40020)
* pnpm mra exclude

* move logic to npm:updateArtifacts

* only update pnpm workspace if security upgrade

* handle no matching setting found case

* refactor: minor

* fix tests

* variable name change

* in-between

* add tests

* refacto

* add test

* update helper function

* fix coverage

* fix coverage

* use AST based approach

makes the code more maintainable & readable

* add tests

* remove lockFileName

---------

Co-authored-by: Jamie Tanna <jamie.tanna@mend.io>
2026-01-22 09:36:43 +00:00
Jamie Tanna 19bd22ccff fix(util/exec): correctly pass commands around when using binarySource=docker (#40517)
As noted in #40513, when running Composer's `lockFileMaintenance`
against a repository with `symfony/flex`[0], we hit a case[1] where
Composer needs to be installed first, which then results in a failure
when running in `binarySource=docker`, which strips any options from
`CommandWithOptions`.

This is because we were stripping the options and was inadvertently left
in as it fixed Typescript type checking, but subtly broke
implementation.

This also corrects a test that was a sign that this wasn't quite working
for Yarn, but we'd expected that it was mocked, not actually broken.

[0]: https://github.com/renovatebot/renovate/blob/795a121b5486138fd65e344ac7feaf370278d791/lib/modules/manager/composer/utils.ts#L15
[1]: https://github.com/renovatebot/renovate/blob/795a121b5486138fd65e344ac7feaf370278d791/lib/modules/manager/composer/artifacts.ts#L170
2026-01-19 13:14:41 +00:00
renovate[bot] acacad57c6 chore(deps): update linters (main) (#40277)
* chore(deps): update linters

| datasource | package              | from   | to     |
| ---------- | -------------------- | ------ | ------ |
| npm        | eslint-plugin-oxlint | 1.36.0 | 1.38.0 |
| npm        | typescript-eslint    | 8.50.1 | 8.52.0 |

* chore: enable oxlint gha format

* chore: fix lint

* chore: fix lint

* chore: fix lint

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-01-14 15:32:48 +00:00
Jamie Tanna 4e6e29f74e fix(yarn): don't rely on shell semantics for ignoring command failures (#40292)
As reported in #40294, since f430552de4
we've seen Yarn 1 failing to update.

We can take advantage of the new `ignoreFailure` option to replace the
usage of shell semantics.

We also refactor `getOptimizeCommand` to make sure this always returns
the split command-and-arguments.
2026-01-08 12:59:44 +00:00
Jamie Tanna eda8991a7d fix(util/exec): remove hash for Containerbase installs (#40234)
After recent changes to remove `shell: true`, it's clear from #40231
that this breaks Containerbase's installing of tools, as we use the
`hash` shell built-in.

As we no longer need the `hash` call, we can remove it.
2025-12-31 12:51:09 +00:00
Jamie Tanna e773b32431 fix(util/exec): migrate to execa for command execution (#40212)
* fix(util/exec): migrate to `execa` for command execution

As part of a future change, we need to make sure that we have
cross-platform support for specific command executions.

By using `execa`'s functionality on top of `node:child_process`, we can
provide this functionality, as well as retain a consistent API with
internal users.

We need to make a couple of small tweaks to setting the `RawExecOptions`
as we're now bound by `readonly` properties.

As the `stdio` property's type is not exported, we can replace this with
an explicit setting of `stdin`, `stdout` and `stderr`.

This requires a number of test changes to make sure that the `stdin`,
`stdout` and `stderr` are set.

This doesn't migrate any calls under `tools`, as they can remain using
`node:child_process`.

* chore(util/exec): ignore floating promises `.on` calls

Since moving to use `execa`, we now have "floating promises" for the
`.on` method calls.

As we aren't handling them here, we can now mark them as `void` (as an
alternative to ignoring the ESLint rule).
2025-12-30 14:28:18 +00:00
Jamie Tanna 39bfc0975e refactor(util/exec): remove deprecated encoding property (#40199)
This has been deprecated since 2022-07, and is unused as we only ever
use UTF-8.

In `tools/utils/exec.ts` we make sure to specify it explicitly, so we
don't get a Buffer returned.
2025-12-30 09:55:31 +00:00
Adam Setch 7309d1897c refactor: use unicode right-arrow for changes template (#40033)
* refactor: use unicode right-arrow for changes template

Signed-off-by: Adam Setch <adam.setch@outlook.com>

* refactor: use unicode right-arrow for changes template

Signed-off-by: Adam Setch <adam.setch@outlook.com>

---------

Signed-off-by: Adam Setch <adam.setch@outlook.com>
2025-12-17 11:45:21 +00:00
Michael Kriese c641239c19 fix: use stricter types for renovate config (#39594)
* fix: use stricter types for renovate config

* fix: revert changes

* Apply suggestions from code review
2025-11-28 13:16:27 +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
Felipe Santos 3b811438d4 feat(manager/npm): use volta node pin as node version constraint (#38816) 2025-11-09 08:37:52 +00:00
RahulGautamSingh 98eef7e82d fix: skip npm installation if no constraint specified (#38974)
* only install npm if pinned version found

* only extract npm constraint from lockfile-version<3

* remove redundant log

* add test

* revert test removal
2025-11-07 19:03:21 +00:00
Mirko Kruschke d7a741b831 feat(npm)!: support yarn catalogs (#38215)
BREAKING CHANGE: communit plugin yarn-catalogs-plugin is not supported anymore
Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
2025-11-06 08:07:40 +00:00
RahulGautamSingh ac73347547 test: fix falky test (#38993)
fix test
2025-10-31 19:23:50 +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
Felipe Santos 8d0c50e1aa fix(npm): avoid updating lock files for engines, packageManager, and volta deps (#38598)
* fix(npm): avoid updating lock files for volta and packageManager deps

* Handle engines as well

* Improve test

* Improve version ranges in tests
2025-10-15 08:36:33 +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
Mirko Kruschke cb695e3907 feat(npm): support yarn catalogs via yarn-plugin-catalogs (#37293)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: RahulGautamSingh <rahultesnik@gmail.com>
2025-09-22 14:41:46 +00:00