Commit Graph

400 Commits

Author SHA1 Message Date
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
Jamie Tanna f963528d48 chore(logger): serialize DateTime to ISO strings (#41363)
* chore(logger): serialize `DateTime` to ISO strings

As an alternative to 2228a79015, we can
instead serialize any `DateTime` objects that are present in our logging
fields.

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

* Revert "fix(util/git): log date as string (#41360)"

This reverts commit 2228a79015.

* test(logger): clarify Luxon dates

As we'll follow-up with native dates in the future.

---------

Co-authored-by: Claude Sonnet 4.5 <jamie.tanna+github-copilot@mend.io>
2026-02-27 15:05:30 +00:00
Jamie Tanna c985ca29dd fix(util): don't log "Hidden Unicode" warning when reading a binary file (#41470)
In the case that we are reading binary files in repositories, we should
not log a WARN that there are "hidden" characters in it, as it's a
binary file.

We can use a common heuristic (at least according to Claude Sonnet 4.5)
to look for null bytes at the beginning of our files, and not log the
warning in that case.

Co-authored-by: Claude Sonnet 4.5 <jamie.tanna+github-copilot@mend.io>
2026-02-25 08:36:16 +00:00
Jamie Tanna 5949dd4aca fix(util): don't include filename in "Hidden Unicode" warning (#41468)
fix(logger): don't include filename in "Hidden Unicode" warning

As noted in #41467, if a repository has many files with these warnings,
the Dependency Dashboard can be flooded, which can reduce the utility,
especially if some of these may be false positives.

We can remove the filename from the WARN message, which will ensure that
only a single message is logged.

However, this will reduce the utility of the log message, as then users
need to check their logs to see the `file`.
2026-02-24 17:57:47 +00:00
Jamie Tanna 2228a79015 fix(util/git): log date as string (#41360)
As a follow-up to changes in 7ebba26236
which accidentally changed this behaviour, as we're now passing in the
`DateTime`.
2026-02-20 17:46:52 +00:00
Jamie Tanna 9dcd32dc72 feat(util): log warning if file(s) contain hidden Unicode characters (#41353)
feat(utilgit): log warning if file(s) contain hidden Unicode characters

With the rise of prompt injection, there is an increased number of
attacks occurring using hidden Unicode characters.

These hidden characters can also confuse other tools, so it's best for
Renovate to surface these to repository owners, as we read files that
may be problematic.

To avoid multiple reads of files, we can do this every time our
`readLocalFile` function is called, as we already have the file content.

An alternate option would be that in `workers/repository` we could check
the read package files, but given `extractAllPackageFiles` may be used
by a Manager, we can't inject the logic in, without Managers needing to
implement the logic themselves.

This should be performant, and not introduce too many false-positives,
but this will also depend on how (package) files are set up in
repositories.

The list of suspicious characters has been largely compiled by Claude
Sonnet 4.5.

Co-authored-by: Claude Sonnet 4.5 <jamie.tanna+github-copilot@mend.io>
2026-02-20 14:15:45 +00:00
Felipe Santos 7ebba26236 feat: add commitHourlyLimit (#36226)
* feat: add `commitHourlyLimit`

Signed-off-by: Felipe Santos <felipe.santos@ericsson.com>

* Update docs/usage/configuration-options.md

Co-authored-by: RahulGautamSingh <rahultesnik@gmail.com>

* Remove date optionality

* Fix lint comment

* Fix coverage

* Restore contents of commit.spec.ts

* Use ! somewhere else too

* Change optional parameter to nullish

* Refactor `!` to use proper check

* Fix set-branch-commit.spec.ts lint

* Fix test coverage

* Apply suggestions from code review

Co-authored-by: RahulGautamSingh <rahultesnik@gmail.com>

* Split commit-limit-reached into two

* Fix review comments

* Use toUTC() where applicable

* Simplify another test to utc()

---------

Signed-off-by: Felipe Santos <felipe.santos@ericsson.com>
Co-authored-by: RahulGautamSingh <rahultesnik@gmail.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-02-19 18:00:32 +00:00
Sergei Zharinov b02897fab1 refactor(lint): Fix lint violations (#40965)
* refactor(lint): Fix lint violations

* Update lib/modules/versioning/versioning-metadata.spec.ts

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

---------

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-02-06 15:34:33 +00:00
Sergei Zharinov 9d857c1f68 refactor(lint): Organize imports with biome (#40966) 2026-02-06 13:40:01 +00:00
Michael Kriese 17a1bbad96 refactor: use named simpleGit imports (#40759) 2026-01-28 16:55:14 +00:00
Sergei Zharinov c07814ca4d refactor: Remove decorators for ESM compatibility (#40736)
* refactor: Migrate to decorator alternatives

* refactor: Remove decorators

* Fixes

* build: Remove decorator support from build pipeline

* fix: Remove extra brace in cdnjs getDigest cache key
2026-01-28 13:22:53 +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 0785d0b8bc test: add coverage (part2) (#40643) 2026-01-23 20:57:46 +00:00
Michael Kriese 9fe353adb4 test: add coverage (part1) (#40636) 2026-01-23 15:09:01 +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
Adam Setch bc86d7394b refactor(git): add debug logging for baseBranch (#40307)
* refactor: log baseBranch name in isBranchModified

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

* refactor: log baseBranch name

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

---------

Signed-off-by: Adam Setch <adam.setch@outlook.com>
2026-01-07 16:29:15 +00:00
renovate[bot] 225e2b73eb chore(deps): update dependency @vitest/eslint-plugin to v1.5.2 (main) (#39675)
* chore(deps): update dependency @vitest/eslint-plugin to v1.5.2

| datasource | package               | from  | to    |
| ---------- | --------------------- | ----- | ----- |
| npm        | @vitest/eslint-plugin | 1.4.4 | 1.5.2 |

* chore: fixup

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2025-12-15 10:26:19 +00:00
Matthew Gamble 7b1eddb8cd test: don't sign commits made in submodules created by test suite (#39748)
fix: don't sign commits made in submodules created by test suite

The 'commit.gpgsign=false' configuration was already in place for some
tests in this file, but not all of them. I'm pretty sure that with this
change in place, there's no more commit signing happening in this test
suite.
2025-12-05 16:49:28 +00:00
Jamie Tanna b5cd0317cf fix(git): report Git operation statistics at end of run (#39596)
Now we have instrumented our Git operations with tracing, we can make
sure that users who are not using OpenTelemetry still get insights into
their Git operation usage using a debug log output.

Following how other insights are produced, we can introduce a new type
in `lib/util/stats` for `GitOperationStats`, which will track the
overall execution for each operation type, and output them in the same
style as we use for other timing reports.

At the end of a Renovate run, we'll then make sure that this is logged
into a debug log for further investigation.

To create the report, we can make sure that we introduce a new
OpenTelemetry `SpanProcessor`, which will run when we end our Run, and
store any Git operations in `GitOperationStats`.

This adapts code from GPT-4.1 and code from [0].

Co-authored-by: gpt-4.1 <jamie.tanna+github-copilot@mend.io>

[0]: https://github.com/yurisouza/monitoria-sdk/blob/ca9d751fa7c3a785a04f87b8966bb782b4617021/src/adapters/nestjs/span-duration-tracker.ts#L18-L27
2025-12-01 15:53:26 +00:00
Jamie Tanna b44544b72d fix(git): instrument SimpleGit operations (#39591)
* fix(git): instrument `SimpleGit` operations

Now we have the basis for instrumentation for SimpleGit, we can now
fully integrate it.

This creates a wrapper, `InstrumentedSimpleGit`, which has a simplified
interface for `SimpleGit` to allow us to focus on the important parts of
the interface for what we need, instead of trying to correctly extend /
implement SimpleGit's interface (and slightly complex types).

In each of our methods, we then make sure we instrument it with the
relevant Git subcommand being invoked.

Co-authored-by: gpt-4.1 <jamie.tanna+github-copilot@mend.io>

* test(instrumentation): remove unused path

Currently, SimpleGit's `getRemotes` function being passed a `verbose:
false` is the same as not providing a `verbose`.

This fixes the code coverage failures, as we do not call this.

---------

Co-authored-by: gpt-4.1 <jamie.tanna+github-copilot@mend.io>
2025-12-01 10:30:50 +00:00
Jamie Tanna bb80ec8bd0 chore(instrumentation): instrument syncGit (#39622)
As an important function for checking that we've got a repository synced
with the remote, we can add some additional instrumentation to key
areas.
2025-12-01 10:07:40 +00:00
Jamie Tanna fe8fe42471 chore(instrumentation): add helpers for Git instrumentation (#38582)
As part of being able to fully instrument our Git operations - using
SimpleGit - we can introduce some Git-specific instrumentation helpers.

These helpers will be used as part of a future change, where we will
instrument methods of SimpleGit that we're using.

This provides a set of types which will be used as OpenTelemetry
Attributes to categorise command types.

A number of subcommands that aren't currently deemed to be too important
are bucketed into an `other` category.
2025-12-01 09:51:59 +00:00
Michael Kriese 050ac8d23b chore: better code coverage (#39518) 2025-11-25 15:01:54 +00:00
renovate[bot] f609b6f472 chore(deps): update vitest monorepo to v4 (main) (major) (#39505)
* chore(deps): update vitest monorepo to v4

| datasource | package             | from  | to     |
| ---------- | ------------------- | ----- | ------ |
| npm        | @vitest/coverage-v8 | 3.2.4 | 4.0.10 |
| npm        | vitest              | 3.2.4 | 4.0.10 |

* chore: migration

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2025-11-24 15:30:57 +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
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
Sergei Zharinov 7e353b9cca refactor(git): use non-capturing groups in SSH key regex (#38801) 2025-10-23 06:14:59 +00:00
RahulGautamSingh a86b32ea0f feat: configurable repo config filenames (#36644)
* feat: configurable repo config filenames

* docs: configFileNames

* fix tests

* update tests

* fix coverage

* Apply Suggestions

* refactor: remove platform-based filename filtering

* docs

* refactor

* docs: add note for config-validator use

* feat: add inherited config support

* fix: build

* fix lint

* fix test
2025-10-20 06:19:01 +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
Richard Sahrakorpi 8e1107b23f feat(submodules): use env vars from getGitEnvironmentVariables (#35180) 2025-09-12 16:07:16 +00:00
RahulGautamSingh fee09ec990 fix(platform/local): handle local git repo (#37680) 2025-08-24 09:30:23 +00:00
Sergei Zharinov b7d2f4688e feat: Add support for Base64-encoded keys (#37522) 2025-08-14 16:12:38 +00:00
Michael Kriese 798b7c7ab5 fix: use shared email type (#37512) 2025-08-14 13:34:03 +00:00
Michael Kriese a5f3956210 refactor: remove default radix from parseInt (#37489) 2025-08-13 15:36:30 +00:00
Sergei Zharinov 5ca2a1c128 feat: Add gitPrivateKeyPassphrase config option (#37326) 2025-08-07 12:49:30 +00:00
RahulGautamSingh 3691ff90b2 feat(config): baseBranchPatterns (#35579) 2025-07-14 19:05:27 +00:00
RahulGautamSingh 587b9a9cda refactor: use re2 (#36957) 2025-07-12 16:27:13 +00:00
Johannes Utzig 4d954026d9 fix(gerrit): add codeowners support for gerrit (#36466)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2025-07-10 10:28:51 +00:00
Felipe Santos 8db486bf2e feat(gerrit): add support for labels through hashtags (#35900) 2025-07-04 08:44:34 +00:00
Rhys Arkins dffabcbc87 fix(git): remotes sync (#36180)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2025-05-27 16:51:26 +00:00
Rhys Arkins f90b4c5ff9 fix(git): use custom name for upstream (#36149) 2025-05-26 14:24:47 +00:00
RahulGautamSingh 99411970a1 feat(git): Support baseBranches in fork mode (#36054)
Signed-off-by: Jan Høydahl <janhoy@users.noreply.github.com>
Signed-off-by: Jan Høydahl <jan.git@cominvent.com>
Co-authored-by: Jan Høydahl <janhoy@users.noreply.github.com>
Co-authored-by: Jan Høydahl <jan.git@cominvent.com>
Co-authored-by: Jan Høydahl <jh@cominvent.com>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2025-05-24 07:06:07 +00:00
Rhys Arkins 68b5193213 fix(git): Revert "feat(git): use git fetching for forkMode" (#36045) 2025-05-20 11:03:36 +00:00
RahulGautamSingh 4e12e52b49 feat(git): use git fetching for forkMode (#36024) 2025-05-19 15:05:48 +00:00
Rhys Arkins 68fd1278b2 fix(git): handle tag/branch collision (#35998) 2025-05-17 14:58:25 +00:00
Michael Kriese bb9faed9c3 fix: properly pass configured env (#35835) 2025-05-09 11:31:00 +00:00
Michael Kriese 3534b66e2a fix(datasources): use child env for git (#35764) 2025-05-07 07:53:21 +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