Commit Graph

2547 Commits

Author SHA1 Message Date
Adam Setch ea267ba3f5 fix: branch error message logic (#39716)
Signed-off-by: Adam Setch <adam.setch@outlook.com>
2025-12-03 08:33:46 +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
Michael Kriese f212641b42 chore: lint fix (#39630) 2025-11-29 13:31:19 +00:00
Jamie Tanna e1ad5c2ddd fix(instrumentation): instrument manager extractions (#39613)
As a means to provide more insight into how long package manager
extractions take when using instrumentation, we can wrap the individual
manager's extractions, as well as the filtering of packageFiles for each
manager.
2025-11-28 19:32:13 +00:00
Jamie Tanna 55a447e805 chore(instrumentation): further instrument extract phase (#39614)
As it's interesting to see how much each of these take.
2025-11-28 14:19:09 +00:00
Jamie Tanna 498b9df2f0 fix(instrumentation): instrument manager lookups (#39612)
As a means to provide more insight into how long package manager lookups
take when using instrumentation, we can wrap the fetching of updates in
a trace per manager.
2025-11-28 14:07:42 +00:00
Jamie Tanna 5282a9ae27 fix(instrumentation): wrap branches in spans (#39608)
As part of ongoing work to improve OpenTelemetry instrumentation of
Renovate in #38609, we can instrument our branch creation with the
branch name (and relevant Semantic Convention attributes) for
visibility.
2025-11-28 13:49:04 +00:00
Jamie Tanna c1a8da0275 fix(instrumentation): correctly instrument extract and lookup (#39611)
When calling `extractDependencies`, we actually perform both `extract`
and `lookup` splits. However, we are instrumenting the whole method call
as the `extract` split, which results in incorrect tracing data.

To correct this, we can wrap the specific code responsible for the
extraction into `extract`, and then the separate code for `lookup`
accordingly.

This also makes sure that `emptyExtract` sets repository splits.
2025-11-28 13:47:29 +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
Jamie Tanna ce729a84c4 chore(telemetry): add span attribute for splits (#38633)
As part of a step towards better OpenTelemetry instrumentation as part
of #38609, we can start by introducing a known span attribute for the
repository "split" we're currently processing.

This requires a slight refactor of the `SpanOptions`, to use our custom
type, which enforces the `RenovateSplit` type when using the span name.

This adds it into each of the splits we currently instrument.

Co-authored-by: secustor <sebastian@poxhofer.at>
2025-11-28 12:32:00 +00:00
RahulGautamSingh 61c943c028 feat: prBodyHeadingDefinitons (#39460)
* feat: prBodyHeadingDefinitons

* Apply Suggestions

* Apply suggestions

* Update docs/usage/configuration-options.md

Co-authored-by: Jamie Tanna <github@jamietanna.co.uk>

---------

Co-authored-by: Jamie Tanna <github@jamietanna.co.uk>
Co-authored-by: Jamie Tanna <jamie.tanna@mend.io>
2025-11-26 10:15:41 +00:00
Michael Kriese 050ac8d23b chore: better code coverage (#39518) 2025-11-25 15:01:54 +00:00
Michael Kriese bbc27b2afb fix(minimumReleaseAge): treat minimumReleaseAge=0 days as disabled (#39494)
* fix: treat `minimumReleaseAge=0 days` as disabled

* fix: treat `minimumReleaseAge=0 days` as disabled
2025-11-24 11:24:26 +00:00
RahulGautamSingh 2f2f2ea8a4 chore: log prNotPendingHours (#39287)
* log-pr-not-pending-hrs

* Apply Suggestions
2025-11-18 18:35:56 +00:00
Jamie Tanna ccb0462820 fix(minimumReleaseAgeBehaviour): correct log message to use valid option (#39374) 2025-11-18 10:22:47 +00:00
Sergei Zharinov 558bdc159d feat: Cleanup mutexes before each run (#38987)
* feat: Cleanup mutexes before each run

* Update setup.ts

* Update mutex.spec.ts

* Update setup.ts

* Unmock mutex in deb datasource spec to prevent race condition

* Update index.spec.ts
2025-11-15 21:24:43 +00:00
Michael Kriese 2c96c9973f feat(bumpVersions): support short versions (#39280) 2025-11-13 11:22:01 +00:00
Dave 83d64647b7 feat: add configValidationError option to log config validation errors as errors instead of warnings (#39177)
* feat: add configValidationError option to log config validation errors as errors instead of warnings

* Moved `configValidationError` docs to correct file.
2025-11-10 17:09:20 +00:00
Sergei Zharinov 67b256aa3f fix: ignore .npmrc when the npmrc configuration is being used (#39205) 2025-11-10 16:12:45 +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 0d5d7a8669 refactor!: remove rangeStrategy=pin from versioning modules (#36261)
Refactors `getNewValue` logic to replace it with an optional
`getPinnedValue()` where rangeStrategy=pin. This way each versioning
module doesn't need to add and test extensive "pin" logic.

This should not be breaking, but out of an abundance of caution, we'll
mark it as such.
2025-11-06 08:07:40 +00:00
Jamie Tanna 1cf9b1c6a4 feat(minimumReleaseAge)!: require a release timestamp by default (#38843)
As noted in #37952, we've seen a significant increase in recent years on
a number of package ecosystems being targeted with supply chain security
attacks.

We're in a particularly strong position to improve the level of security
across the world by setting a default for `minimumReleaseAge` in the
`best-practices` config preset.

To do this, we can introduce a new preset,
`security:minimum-release-age` to house these recommended options.

We use new presets `security:minimum-release-age` and
`security:minimum-release-age-npm`, to allow consumers to utilise
`ignorePresets` to undo this configuration, if they so wish.

As a first step towards securing our users, we can set a default for
npm, which as a large ecosystem with an increased number of packages
that depend on other packages (compared to other ecosystems), has been a
more targeted area.

In the future, we can expand this for other managers, as it makes sense,
and as support is added for them to use `minimumReleaseAge`.

Closes #38457.
2025-11-06 08:07:40 +00:00
Rhys Arkins 4e4a0f99b0 fix!: remove the "Bot" from user-agent header (#37535) 2025-11-06 08:07:40 +00:00
Jamie Tanna 3c98e9dca5 chore(minimumReleaseAge): add missing word in log message (#39068) 2025-11-05 10:19:35 +00:00
Jamie Tanna ec91e744b1 chore(config-migration): capitalise Renovate (#38985)
* chore(config-migration): capitalise `Renovate`

* fixup! chore(config-migration): capitalise `Renovate`
2025-11-04 20:37:46 +00:00
Sergei Zharinov 14f69984cc fix: Reorder saveCache and pruneStaleBranches in repository finalization (#39072)
* fix: Reorder saveCache and pruneStaleBranches in repository finalization

* Remove unused variable in repository cache save method

* Update lib/workers/repository/finalize/index.ts
2025-11-04 19:13:10 +00:00
Jamie Tanna 1e2f87fb6b chore(minimumReleaseAge): log the updateType when skipping updates (#39070)
As part of future changes, where it's more important to know what
`updateType` is being filtered, we will want to have this information
output to the logs.

This also changes the log field outputting, as `depNames` no longer
makes sense now we have both `depName` and `updateType`.
2025-11-04 17:27:48 +00:00
Felix Breuer 19c396a44a chore(minimumReleaseAgeBehaviour): reduce number of WARN log lines (#39001)
* chore: debug log message when timestamp is optional

When setting minimumReleaseAgeBehaviour to optional
it is intended that packages that does not have a release timestamp
will get updated. Writing a warning to the console is spam for an
intentional setting.

* chore: re-add WARN log, once

To make sure that users are still aware, we can make sure a single
warning log message is emitted.

---------

Co-authored-by: Jamie Tanna <jamie.tanna@mend.io>
2025-11-04 10:20: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
RahulGautamSingh 34486b39b7 chore: log when pending upgrades are filtered (#38352)
* chore: add log if pending updates are filtered

* apply suggestions

* fix: filter pending upgrades logic

* add test

* fix typo

* add new test

* Update lib/workers/repository/updates/generate.ts

Co-authored-by: Jamie Tanna <github@jamietanna.co.uk>

* only add a log msg

* revert

* fix failing tests

---------

Co-authored-by: Jamie Tanna <github@jamietanna.co.uk>
2025-10-29 10:14:37 +00:00
RahulGautamSingh cdd0ab4b88 fix(workers/branch): skip branch update if pendingChecks=true (#38720)
* fix: skip branch update if pendingChecks=true

* no-work -> pending

* apply suggestions

* Apply Suggestions
2025-10-29 08:56:26 +00:00
RahulGautamSingh 3c4b2f6935 feat(logs): convert invalid config log level to warn (#38925)
logLevel: info -> warn
2025-10-29 07:12:50 +00:00
RahulGautamSingh c62635d6d1 fix(changelog): handle codeblocks in markdown (#38860)
* fix: do not modify # within codeblocks

* fix: parse fenced section in markdown

* add test

* Update lib/workers/repository/update/pr/changelog/release-notes.ts

* use re2
2025-10-25 17:35:45 +00:00
Jamie Tanna 1ec6ea4011 chore(instrumentation): instrument empty extraction (#38845)
To make sure that we're always providing a trace for the `extract`
split, we should instrument, regardless of whether it's a no-op.
2025-10-25 11:49:05 +00:00
RahulGautamSingh e148b9986e fix(workers): do not swallow init error (#38764) 2025-10-21 07:44:40 +00:00
Volker 086af99876 refactor(lookup): optimize version filtering logic in filterVersions and lookupUpdates (#38539)
* Optimize version filtering logic in filterVersions and lookupUpdates functions

* Simplifies version filtering optimization to cover conditions by existing tests.

* Further reduction of versioning API usage.

* Keeping compatibility of exported function filterVersions()
2025-10-20 10:53:13 +00:00
Jamie Tanna a62837ae95 chore(instrumentation): instrument the init repo split (#38607)
As part of a step towards better OpenTelemetry instrumentation as part
of #38609, we need to capture the `init` repository split, as the other
splits are currently instrumented.

Note that we've duplicated the error handling, as the `localDir` may be
unset, and we need to handle it.
2025-10-20 08:18:56 +00:00
RahulGautamSingh 95ea2c9078 fix(branchPrefix): include base branch name iff multiple bases expected (#35423)
* use branchPrefix if multiple base branches expected

* fix test

* fix coverage

* apply suggestions

* apply suggestions

* use utility fn

* refactor tests

* fix test

* major overhaul: use baseBranches field internally

suggested by @secustor

* refactor: cleanup

* test: use better descriptions

* add tests

* fix logic

* fix test

* exclude unlisted versions when finding latestStable

---------

Co-authored-by: Rhys Arkins <rhys@arkins.net>
2025-10-20 06:27:56 +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
Maxime Brunet 765a5eb5ae chore(minimumReleaseAgeBehaviour): correct warning message (#38663)
fix: correct minimumReleaseAgeBehaviour=timestamp-optional warning message
2025-10-17 10:46:45 +00:00
Jamie Tanna 4393503d55 feat(minimumReleaseAge): optionally enforce presence of releaseTimestamp (#38363)
As noted in #38290, #38348, a "rough edge" of the current implementation
of `minimumReleaseAge` is that:

- if we have set `minimumReleaseAge` to apply to a given dependency
- and we have 3 dependencies that need an update
  - 2 of which have a `releaseTimestamp` that is not yet "stable"
  - 1 of which does not have a `releaseTimestamp`

The dependency update that does not have a `releaseTimestamp` will be
treated as "stable", and will receive an update immediately.

To make this a little more predictable, and explicit, we should add a
new configuration item, `minimumReleaseAgeBehaviour`, to control this
behaviour.

This adds the new configuration field, as well as making it available as
a strongly typed field in the codebase.

In the case that `minimumReleaseAgeBehaviour=timestamp-optional` is
being used, we will WARN on any packages that are being updated, but
maybe shouldn't be, as a way to proactively inform the user of possible
misconfiguration.

Closes #38290, #38348.
2025-10-16 10:27:03 +00:00
Jamie Tanna 3d3224c581 test: document the test isn't intended to succeed (#38636)
While working on #38607 and #38633, I noticed that this doesn't actually
successfully return.

We should document this more clearly for the next person interacting
with it.
2025-10-15 13:53:21 +00:00
Jamie Tanna 06c6d2bb5f test: correctly override localDir (#38635)
While working on #38607 and #38633, I noticed that this doesn't actually
override the value of `localDir`, as `GlobalConfig.set` overrides any
existing configuration, and when we call `renovateRepository`, this also
calls `GlobalConfig` and overrides the value.
2025-10-15 13:48:07 +00:00
Jamie Tanna d43af5a5be chore(orphan): log skipped branch names (#38522)
As it makes it more straightforward to determine which branch is being
marked as "orphaned" when reading the logs.
2025-10-14 10:07:06 +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
Jamie Tanna a942f63bd5 fix(merge-confidence): use packageName for all lookups (#38468)
When performing lookups in Mend's Merge Confidence APIs, our contract
requires that we use the `packageName` not the `depName`.

In 9b7ae6aa98 and
b67eae2180 we made changes to make sure
that this wasn't the case, but we ended up missing a couple of cases.
2025-10-09 13:54:08 +00:00
Jamie Tanna 65d7080920 chore: add Repository Result metadata to "Repository Finished" log (#37089)
chore: add Repository Result metadata to log messages

The `Repository result` log message is useful for understanding
at-a-glance why a Renovate run may have not worked.

Adding the metadata that currently exists in the log line as Meta keys
would allow for logging tools to be able to more meaningfully
interpolate the data, without requiring parsing of the underlying
string.

Co-authored-by: Jamie Tanna <jamie.tanna@elastic.co>
2025-10-07 14:48:38 +00:00
Jamie Tanna ddfa560100 test: correct test name (#38364)
* chore(tests): correct test names

As they're not quite in line with reality.

* sq
2025-10-06 13:39:18 +00:00
Jamie Tanna d621588e1c test(minimumReleaseAge): document releaseTimestamp leads to immediate PRs (#38362)
As part of discussion in #38290, #38348 and #38324, the current
behaviour of `minimumReleaseAge` has been flagged as not particularly
great, as when we run with `minimumReleaseAge` enforced, a package that
does not return a `releaseTimestamp` will no longer be treated as
release that is bound by `minimumReleaseAge`'s checks to make it
pending.

As noted in the discussions, this can lead to cases where users are in a
"false sense of security", as they feel comfortable with
`minimumReleaseAge` in place, but it is not being enforced, only when
the `releaseTimestamp` is present.

Before we change this, we should add a test to document the existing
behaviour.

[0]: https://github.com/renovatebot/renovate/discussions/38290
[1]: https://github.com/renovatebot/renovate/discussions/38348
2025-10-06 12:00:55 +00:00