Commit Graph

47 Commits

Author SHA1 Message Date
Sebastian Poxhofer b2d3b64c48 refactor(lint): enforce err key for errors in logger metadata (#45759)
* refactor(lint): enforce err key for errors in logger metadata

* refactor(lint): flag error message and stack strings in logger-err-key
2026-09-09 13:55:14 +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 73b90e958b refactor: remove string concetation for production code (#43442)
refactor: prefer templates rather than `+`
2026-05-19 13:31:27 +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
Simon Berger cb1bd5a81b feat: allow configFileNames to be set through env (#39144)
* test: add failing test for reading configFileNames from env

* fix: move configFileNames handling to shared config parsing

* feat: allow configFileNames to be set through env

* fix: move unit test from file to index

* test: add test for setting configFileNames through cli

* fix: fix merge

* test: use multiple config file names in tests

* test: add a length check after adding custom filenames
2025-11-17 15:27:28 +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
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
RahulGautamSingh 37a1a93a06 refactor(config): move code for easier testing (#37297)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2025-08-04 15:04:55 +00:00
RahulGautamSingh 8c7e931da3 feat(config)!: support jsonc in existing config + preset files (#36141)
Use JSONC parser for JSON config files.

Renovate will now officially support JSONC syntax in config files which are either explicitly (e.g. `renovate.json`) or implicitly (e.g. `.renovaterc`) JSON files.
You may continue using "pure" JSON in such files, or use JSONC syntax instead (e.g. trailing commas, comments).
Support for files ending in `.jsonc` will be added soon.

Note: this is not technically a breaking change as it is backwards-compatible with existing JSON support.
2025-06-19 11:01:54 +02:00
renovate[bot] 86408be681 build(deps): update dependency @sindresorhus/is to v7 (main) (#35682)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2025-05-02 09:43:35 +00:00
renovate[bot] 94c073ab6b chore(deps): update linters (main) (#34869)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: secustor <sebastian@poxhofer.at>
2025-03-23 17:57:04 +00:00
Michael Kriese b5ff90f2bd fix: improve coverage (#34667) 2025-03-06 17:05:19 +00:00
Michael Kriese a60c1c4752 fix(global): import config file as url (#34637) 2025-03-05 17:35:12 +00:00
Michael Kriese b88eabcb9f feat(config): support .mjs config files (#34626) 2025-03-05 09:53:09 +01:00
RahulGautamSingh e5fb2e57ee feat(config/self-hosted): processEnv (#34137)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2025-02-17 11:21:19 +00:00
RahulGautamSingh f2acf6a9a2 refactor(logger): remove templating from FATAL logs (#33490) 2025-01-10 11:15:01 +00:00
Rich DiCroce de518af333 feat(config): Log unknown parsing error at debug level (#32512)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2024-11-13 14:10:49 +00:00
Sebastian Poxhofer d74ba704fd refactor: use yaml instead of js-yaml for parsing YAML files (#31336) 2024-09-16 18:03:23 +00:00
RahulGautamSingh 3857332a9e feat(self-hosted): convert experimental env vars to config options (#29154)
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
2024-08-07 07:28:34 +00:00
RahulGautamSingh de65584bf8 feat(config): validate file config on repo runs (#26379)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2024-04-13 08:52:28 +00:00
Sigurd Spieckermann 1391570e44 fix(validator): use absolute path for all .js configs (#27139) 2024-02-13 16:51:20 +00:00
Leroy Korterink 6fcd7d5d23 fix: Update custom config file parse error (#26914) 2024-01-29 11:22:46 +00:00
Michael Kriese 6c2263eeb3 chore: fix types for linting (#26695) 2024-01-17 11:30:45 +00:00
Sebastian Poxhofer 3c33a26441 refactor(util/yaml): rename load and loadAll to parseSingleYaml and parseYaml (#26084) 2023-12-01 20:13:01 +00:00
Jamie Haywood 178cc71838 feat(config): add .cjs file extension config support (#26075)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2023-12-01 13:07:10 +00:00
Sebastian Poxhofer f42d0583d5 refactor(utils/yaml): centralize YAML parsing to allow central templating handling (#26068) 2023-12-01 11:58:43 +00:00
Sergei Zharinov b69416ce17 refactor(prettier): Force trailing commas (#25631) 2023-11-07 15:50:29 +00:00
RahulGautamSingh 4231b1ae09 feat: predictible json/json5 handling (#24612)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2023-11-06 10:30:11 +00:00
Michael Kriese 2431c5a6b6 fix: better branch code coverage (#24274) 2023-09-06 13:35:52 +00:00
Shunsuke Suzuki dd4200ae25 fix(renovate-config-validator): support .renovaterc (#22991) 2023-08-25 08:16:30 +00:00
HonkingGoose 76c9c63417 docs: use simple words (#23989) 2023-08-22 14:07:21 +02:00
Gabriel-Ladzaretti ee9c45aa51 feat(config): optionally remove self-hosted config file once read (#22857)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
2023-06-20 21:01:25 +00:00
Michael Kriese 8270d5512d refactor: fix lint issues (#16779)
* refactor: fix lint issues

* Update lib/renovate.ts

* chore: revert toplevel await for ts
2022-07-26 08:32:12 +00:00
Sergei Zharinov 2b43f273bf refactor(fs): Remove proxies.ts file (#16325)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2022-07-01 14:57:30 +02:00
Michael Kriese 5723be1ac5 refactor: add strict null checks (#14169) 2022-02-11 11:02:30 +01:00
Michael Kriese c5d50f6da3 refactor: more esm imports (#13233)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2021-12-22 11:28:20 +00:00
Oleg Krivtsov dad3863e8a fix(config): detect missing RENOVATE_CONFIG_FILE (#13196)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2021-12-22 08:38:49 +01:00
Michael Kriese 1e1bea200a fix: use @sindresorhus/is instead of is (#13183) 2021-12-18 14:50:51 +00:00
Sebastian Poxhofer 5eea19b5be feat(autodiscover): reverts autodiscoverfilter as array (#13169)
This reverts commit a0a770338f.
2021-12-17 13:44:40 +01:00
Sebastian Poxhofer a0a770338f feat(autodiscover): allow array for autodiscoverfilter (#13100) 2021-12-16 15:12:35 +00:00
Peter Valdemar Mørch c7a7ffbeed feat(config): allow exporting async config (#13075)
* feat(config): allow exporting async config (#13035)

module.exports can now be a function and it can be/return a Promise,
allowing the results of asynchronous operations to be used in the
configuration.

The discussion leading up to this PR in #13035 assumed that
module.exports had to be a plain object.

But this commit:

  commit 9aa97af5b3
  Author: Nejc Habjan <hab.nejc@gmail.com>
  Date:   Thu Dec 9 13:45:48 2021 +0100

      feat(config)!: parse JSON5/YAML self-hosted admin config (#12644)

      Adds support for alternative admin config file formats.

      BREAKING CHANGE: Renovate will now fail if RENOVATE_CONFIG_FILE is specified without a file extension

Had as an undocumented side effect, that it also handled transparenty
if module.exports was assigned a Promise. With that commit, the
promise will be await-ed so the resolved value is returned from
getConfig(). That was not the case before that commit.

So in this commit, configs that export functions are handled, and
test cases for both promises and functions have been added.

* Update lib/workers/global/config/parse/__fixtures__/fileAsyncFunction.js

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update lib/workers/global/config/parse/__fixtures__/fileFunctionPromise.js

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* feat(config): Fixed linter problems (#13035)

* feat(config)!: Add doc for JSON5/YAML self-hosted admin config (#12644)

The code was introduced in 9aa97af5b and here is the documentation to
go with it

* feat(config): Document config.js exports (#13035)

* feat(config): Rename file*.js to config*.js because they really are config (#13035)

* Update docs/usage/getting-started/running.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update docs/usage/getting-started/running.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2021-12-13 21:51:36 +00:00
Nejc Habjan 9aa97af5b3 feat(config)!: parse JSON5/YAML self-hosted admin config (#12644)
Adds support for alternative admin config file formats.

BREAKING CHANGE: Renovate will now fail if RENOVATE_CONFIG_FILE is specified without a file extension
2021-12-09 13:45:48 +01:00
Nejc Habjan 0f1256317c refactor(config): use async readFile and dynamic import to load config file (#12649)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2021-11-17 06:49:53 +00:00
HonkingGoose ab018191fa chore: report and fix unused ESLint disable directives (#12548) 2021-11-08 20:20:03 +01:00
Rhys Arkins ea6863b367 test: fix config.js test for when it's present (#11466) 2021-08-29 21:57:34 +02:00
Wei Kang 5d9eeb030c feat: fatal error config not found (#11462)
* fatal error and exit when config not found

* update file.ts

* fix fatal error and exit only for custom config file

* update test name to be clearer for custom file only

* revert changes for no config file found

* update test name to be clearer

* add space between test as suggested

* fix test due to invalid file

* fix typo

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2021-08-29 11:23:49 +00:00
Rhys Arkins 11694e9294 refactor: move config/parse into global worker (#10282) 2021-06-02 12:06:16 +02:00