Commit Graph

91 Commits

Author SHA1 Message Date
Sebastian Poxhofer c32e2391a0 refactor(linters): add prefer-coerce-object rule (#45493)
Refs #45216

The object counterpart to `prefer-coerce-array`: `x ?? {}` becomes
`coerceObject(x)`. The rule flags a `??` whose default is a bare `{}`
literal, so a populated default or an asserted `({} as Foo)` still
passes; a `x ?? y ?? {}` chain maps onto `coerceObject(x, y)`.

Every hit across `lib/` converted cleanly, so no disable comments were
needed.
2026-08-28 09:27:59 +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 41da033756 refactor: remove escapeRegExp and replace with RegExp.escape (#45322) 2026-08-18 06:24:47 +00:00
renovate[bot] 196101a6bb chore(deps): update dependency oxlint-tsgolint to v0.25.0 (main) (#44424)
* chore(deps): update dependency oxlint-tsgolint to v0.25.0

| datasource | package         | from   | to     |
| ---------- | --------------- | ------ | ------ |
| npm        | oxlint-tsgolint | 0.23.0 | 0.25.0 |

* chore: fix new no-unnecessary-type-assertion findings

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

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Sebastian Poxhofer <sebastian.poxhofer@stedi.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-28 07:04:21 +00:00
Sebastian Poxhofer 91e068f1fd test(linters): add linting rule to enforce v8 ignore reason declaration (#44726)
* ci(linter): add renovate/v8-ignore-reason rule

Flag coverage-ignore comments ("v8 ignore") that carry no justification.
Accepted forms: "-- reason" / "--- reason" (recommended) and the legacy
colon form "v8 ignore <kind>[ <count>]: reason", which is already
widespread in the codebase (29 sites). Bare "v8 ignore stop" markers are
exempt because the justification lives on the paired "start" marker. The
"v8 ignore next <N>" count form remains allowed; this rule only requires
a justification.

Registered as "warn" instead of "error": the repo currently has 119
reason-less v8 ignore comments, too many to fix mechanically in one PR,
so existing sites are left untouched and can be fixed incrementally.

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

* ci(linter): promote renovate/v8-ignore-reason to error

Record the empirical verdict on the contested "v8 ignore next <N>" count
semantics in the rule doc: verified against vitest 4 with
ast-v8-to-istanbul that the count is not honored - the ignore hint always
exempts exactly the next AST node regardless of N. Counts are therefore
inert and stay allowed; the rule keeps requiring only a justification.

Promoting to error so all remaining reason-less coverage-ignore comments
must be fixed; the burndown follows in subsequent commits.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RxHFNsSworLcv23xXk9Hk

* refactor: add justifications to coverage-ignore comments (batch 1)

Give every reason-less "v8 ignore" comment outside the large platform
index files a site-specific justification explaining why the exempted
branch is untestable or defensive, as now required by the
renovate/v8-ignore-reason rule.

Also guard against a nullish comment.loc in the rule itself; the
merged-in stricter tools typechecking flagged the unguarded access.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RxHFNsSworLcv23xXk9Hk

* refactor: add justifications to coverage-ignore comments (batch 2)

Cover the five large platform index files (github, bitbucket,
bitbucket-server, codecommit, gitlab) with site-specific reasons on
every "v8 ignore" comment, completing the renovate/v8-ignore-reason
burndown. Two meaningless ignore hints inside commented-out CodeCommit
mergePr code are dropped instead of annotated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RxHFNsSworLcv23xXk9Hk

* Apply suggestions from code review

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

* Update lib/util/regex.ts

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

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-07-20 13:01:39 +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
Elliot Courant 8776389291 feat(vulnerability): Add vulnerability alerts to deps-edn + lein (#42945)
* feat(vulnerability): Add vulnerability alerts to deps-end + lein

deps-edn and lein both essentially use maven upstream for several
packages. Some packages come from clojars directly but others are
typical java packages. If there is an OSV alert for a maven package
however, it will not propagate to the deps-edn or lein dependency update
from renovate. This tries to adjust that so that clojure can derive
dependency alerts from maven as well so that those dependencies are
treated the same way.

* chore: Code review feedback

* chore: Make ecosystem to datasource one to many

Technically datasource to ecosystem was already many to one in a way, as
maven appeared in the values twice. Once for clojure and once for maven
itself. This changes it so that the ecosystem to datasource is the same
way and looking up by ecosystem you will get multiple datasources
(should match the map above the modified code).

Then to make this work, instead of keying off of datasource for
vulnerabilities we key off of ecosystem so that all of the datasources
that are part of that ecosystem inherit the vulnerabilities for the same
dependency.

* chore: Tweaking to try to force CI/CD retry
2026-05-04 08:08:17 +00:00
Johannes Feichtner 08031afc95 fix(vulnerability): use datasource default versioning instead of hardcoded map (#42743)
refactor(vulnerability): use datasource default versioning instead of hardcoded map
2026-04-20 16:11:06 +00:00
Johannes Feichtner be2eacd8d2 feat(vulnerability): improve GitHub advisory PR body notes with summary, GHSA ID and references (#42670)
feat(vulnerability): improve GitHub advisory PR body notes with summary and GHSA ID
2026-04-17 15:33:56 +00:00
Johannes Feichtner 593a2b16c0 fix(vulnerability): remove matchFileNames restriction from GitHub vulnerability alerts (#42636) 2026-04-15 07:08:34 +00:00
Johannes Feichtner 1e906e8e33 feat(vulnerability): add severity and CVSS details to GitHub Dependabot alerts (#42568) 2026-04-14 18:05:08 +00:00
Johannes Feichtner 3a05ade06b refactor(github/vulnerability): use Zod-inferred types as single source of truth (#42494)
* refactor(github/vulnerability): use Zod-inferred types as single source of truth

* revert to false, since undefined means something else on GHES
2026-04-09 08:36:40 +00:00
Jamie Tanna 5e5af62224 refactor(vulnerability): extract ecosystem<->datasource translation (#42435)
As part of the addition of the new Enrichment modules, we should perform
a prefactor that'll introduce a shared helper for the how we translate
an "Ecosystem" according to OSV with a datasource that Renovate
understands.

Co-authored-by: Claude Opus 4.6 <jamie.tanna+claude-code@mend.io>
2026-04-08 14:41:28 +00:00
Jamie Tanna 76ae34045a refactor(vulnerability): extract shared functionality into util functions (#42433)
As part of the addition of the new Enrichment modules, we should perform
a prefactor that'll introduce helper methods that can be used across
both GitHub and OSV Vulnerability Alerts.

Because each module uses a slightly different input (Datasource ID or an
"Ecosystem" according to OSV) we need to handle both types of inputs.

Co-authored-by: Claude Opus 4.6 <jamie.tanna+claude-code@mend.io>
2026-04-08 07:25:37 +00:00
Johannes Feichtner 3eb6f5a31b feat(vulnerabilities): add support for github-actions vulnerability alerts (#40175)
* feat(vulnerabilities): add support for github-actions vulnerability alerts

* fix failed merge from main

* now for real

* review comments

* remove no longer needed assertion
2026-02-26 08:11:14 +00:00
Johannes Feichtner f52ed03963 fix(vulnerability): handle alerts with null or missing firstPatchedVersion (#41338) 2026-02-24 21:57:40 +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
Janus Troelsen 1caffcc310 feat(vulnerabilities): Add Hackage support (#33328)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2025-01-01 21:17:44 +00:00
renovate[bot] dc6bf16c37 chore(deps): update linters (#32318)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2024-12-20 15:02:34 +00:00
Rhys Arkins c4d4658569 chore: ensure versioning/versioningApi used consistently (#31856) 2024-10-08 15:24:46 +00:00
Rhys Arkins cf2b3c22e4 fix(vulnerabilities): correct range syntax for nuget (#31623) 2024-09-26 11:09:20 +00:00
Rhys Arkins b2e2b0d47b fix(vulnerabilities): set matchCurrentVersion for github alerts (#31612) 2024-09-25 16:39:56 +00:00
Rhys Arkins dce69127d2 feat: remediate to greater than or equal versions for github alerts (#31393)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2024-09-18 10:10:21 +00:00
Johannes Feichtner fbdb8c2478 fix(vulnerabilities): do not force exact patch version for NuGet datasource (#31127) 2024-08-31 12:53:22 +00:00
Sergei Zharinov 165e717edd refactor(rubygems): Rename RubyGemsDatasource to RubygemsDatasource (#30882) 2024-08-19 12:44:23 +00:00
Norbert Szulc 2e78a7117d fix!: normalize Python depName in every manager (#27733) 2024-07-25 15:28:16 +02:00
RahulGautamSingh 5ed97aa738 refactor(vulnerability-alerts): move to REST API (#27378) 2024-07-25 15:28:16 +02:00
Rhys Arkins b05f389c63 feat(npm)!: drop transitiveRemediation option (#27985)
This option only worked for npm <7, which is now EOL.

BREAKING CHANGE: Transitive remediation for npm <7 is no longer supported.
2024-07-25 15:28:16 +02:00
Johannes Feichtner 99cc62fa3c fix(vulnerabilities): do not force exact patch version in GitHub alerts (#29700) 2024-06-16 13:32:13 +00:00
Johannes Feichtner 32c96360d1 fix(vulnerabilities): strip equals for nuget in Github alerts (#29693) 2024-06-16 05:14:31 +00:00
Johannes Feichtner 38ce2ece69 fix(vulnerabilities): do not force exact patch version for PyPI datasource in GitHub alerts (#29586) 2024-06-11 06:44:25 +00:00
Norbert Szulc dbd17ed1d7 refactor(datasource/pypi): rename normalization function (#28584) 2024-04-22 15:37:37 +00:00
Norbert Szulc dfbb054aeb fix(worker/repository): add normalized match for pip alertPackageRules (#28214) 2024-04-18 16:26:04 +00:00
Sergei Zharinov b69416ce17 refactor(prettier): Force trailing commas (#25631) 2023-11-07 15:50:29 +00:00
Rhys Arkins 36e2b328bb chore: update types reference 2023-08-15 11:31:15 +02:00
Rhys Arkins e3d5f7df92 feat!: merge matchPaths and matchFiles into matchFileNames (#22406)
Closes #22395

BREAKING CHANGE: matchPaths and matchFiles are now combined into matchFileNames, supporting exact match and glob-only
2023-07-04 19:21:52 +02:00
Michael Kriese c79b209032 refactor(platform): optional getVulnerabilityAlerts (#21449) 2023-04-12 15:12:15 +00:00
Rhys Arkins aa53b42969 fix(vulnerability-alerts): strip equals for maven 2022-12-24 07:09:53 +01:00
Rhys Arkins e651fd34a5 feat(github-actions): support vulnerability alerts (#18735) 2022-11-03 15:42:42 +00:00
Rhys Arkins 5fb5dab455 feat(go): support github vulnerability alerts (#18730) 2022-11-03 10:19:11 +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
Michael Kriese e5c6f38d75 refactor: enable strict checks (#16168)
* refactor:  enable strict checks

* chore: revert changes

* chore: fix tsconfig
2022-06-21 13:00:21 +02:00
Sergei Zharinov 0cf4f48842 refactor: Strict null checks for all files except tests (#16071)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2022-06-20 11:47:07 +02:00
Rhys Arkins b547729039 fix: crate cargo vulnerability datasource mapping (#15348) 2022-04-28 07:52:07 +02:00
Rhys Arkins dca3418bbd refactor: lib/modules (#14488)
Moves datasource, manager, platform and versioning code from lib/ into new lib/modules/

BREAKING CHANGE: External tools must update paths to datasource, manager, platform and versioning
2022-03-04 09:04:02 +01:00
Rhys Arkins f3bdb9470c fix(composer): add support for github vulnerability alerts (#14301) 2022-02-18 16:48:40 +01:00
Sergei Zharinov 1e6ec07d8a refactor(datasource/npm): Convert to class (#14193) 2022-02-15 08:20:45 +00:00
Sergei Zharinov a86f23df09 refactor: Convert Maven-based datasources to class (#14188) 2022-02-15 05:12:30 +00:00
Sergei Zharinov b0ce30b59a refactor(datasource/nuget): Convert to class (#14140)
* refactor(datasource/nuget): Convert to class

* Fix strict nulls and obsolete URL

* Fixes

* Fix mutability

Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2022-02-13 13:55:03 +00:00
Rhys Arkins 98ed29c74b fix(npm): don't disable lock file updates when remediating (#14082) 2022-02-08 08:55:27 +01:00