Commit Graph

44 Commits

Author SHA1 Message Date
Sebastian Poxhofer be13c9f5f7 feat(manager): share OCI Helm chart resolution across managers (#45760)
* feat(manager): share OCI Helm chart resolution across managers

Add getOciChartDep() to helmv3/oci.ts and use it in argocd, fleet, flux,
helmfile, helmsman, helmv3, kustomize, sveltos, terraform and vendir.

- set pinDigests: false for OCI charts in all of them
- apply registryAliases to OCI charts in argocd, helmfile and helmsman
- keep the registry port in terraform helm_release repositories
- skip fleet OCI charts without a version instead of using 'undefined'

* docs(manager/helmv3): correct the OCI chart pinDigests rationale

* refactor(manager/helmfile): drop redundant OCI repository url guard

The repository schema already requires url to be a string, so the falsy
branch could not be reached by parsed input and left the patch partially
covered.
2026-09-09 13:51:30 +00:00
Colden Cullen 029663d169 fix(manager/flux): strip templates from resource files (#43198)
This allows flux resources to be checked when inside helm templates.
2026-09-03 12:51:18 +00:00
Sebastian Poxhofer a1971afa78 fix(linters): add linting rule to enforce usage of our regEx utility (#44690)
* ci(linter): add renovate/require-regex-util rule

Adds a custom oxlint rule that flags raw RegExp usage in lib/
production code: any `new RegExp(...)` call and any regex literal
that is not the direct first argument of `regEx(...)`. The regEx()
helper from lib/util/regex.ts uses the RE2 engine for ReDoS-safe
matching and caches compiled patterns. lib/util/regex.ts itself is
exempt.

The rule is disabled for **/*.spec.ts, test/**, and tools/** via
config overrides, because vitest APIs such as expect.stringMatching
need bare RegExp instances (a past commit reverted regEx() there).

Severity is set to "warn" instead of "error": the repo currently has
197 pre-existing violations (above the agreed mechanical-fix
threshold of 80), and a number of them are deliberately
RE2-incompatible patterns (lookahead/lookbehind/named backreferences,
see TODO #12872/#12875 markers in e.g. lib/modules/versioning/rez/
pattern.ts and lib/modules/manager/dockerfile/extract.ts) that need
per-site judgment before they can be wrapped in regEx() or suppressed
with a justified disable comment. No violation fixes are included in
this commit.

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

* ci(linter): enforce renovate/require-regex-util at error

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

* refactor: use regEx() for regex literals and RegExp construction in lib

Burn down all renovate/require-regex-util violations (197):

- wrap RE2-compatible regex literals and RegExp constructions in regEx()
- rewrite lookaround patterns where behavior is provably preserved:
  goproxy separator split, sbt-package link extraction, leiningen
  comment stripping and keyword search, npm GitHub owner validation
  (unit-count bound replaced by an explicit length check)
- keep native RegExp with disable comments where RE2 cannot be used:
  moo / good-enough-parser lexer patterns (moo rejects RE2 instances),
  MigrationsService propertyName (matched via isRegExp, which RE2
  instances fail), rez named backreferences and lookaheads, GitHub
  markdown link negative lookbehind, emoji astral-plane matching
- drop stale TODO #12875 comments for patterns current re2 handles

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

* refactor: reduce require-regex-util disable comments

Rewrite the github massage-markdown-links URL regex to capture an
optional `api.` prefix in a named group (skipped in code) instead of
relying on a negative lookbehind, so both the base and global variants
can use regEx()/RE2 and their two disable comments are removed. Add
spec cases for api-prefixed URLs that match the URL shape.

Consolidate the four related line disables in rez/pattern.ts (bound and
range patterns emulating Python conditional patterns via named
backreferences and lookaheads, which RE2 cannot express) into a single
block disable/enable pair, matching the treatment of the lexer files.

Disable comment count drops from 13 to 8.

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

* refactor(datasource/sbt-package): use named capture group in link regex

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

* refactor(manager/cake): restore original multiLineComment regex spelling

The [^] -> [\\s\\S] rewrite was only needed for an RE2 wrap that was
later reverted; keep the diff minimal.

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

* fix(datasource/go): skip empty GOPROXY segments

The switch from a lookahead split to a capture-group split (needed because
RE2 has no lookahead support) changed how empty GOPROXY segments parse:
`a|,b` yielded `{ url: ',', fallback: '|' }` before and
`{ url: '', fallback: ',' }` after. The comma fallback only continues on
404/410, so a failing proxy ahead of an empty segment silently stopped the
lookup instead of falling through to the remaining proxies.

Empty segments carry no url to query, so drop them.

* refactor(datasource/go): use isTruthy for empty segment filter

* fix(datasource/go): filter empty segments before mapping

Filtering after the map broke the contextual typing from the
GoproxyItem[] annotation, widening fallback to string.

* refactor(platform/github): use regEx() for merge queue query stripping

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-14 14:30:46 +00:00
Sebastian Poxhofer 9717259ffc refactor(oxlint): enable no-else-return and unicorn/no-lonely-if (#44553)
Enable no-else-return (with allowElseIf: false) and unicorn/no-lonely-if
as errors in .oxlintrc.json and fix all 131 pre-existing violations
(91 no-else-return, 40 unicorn/no-lonely-if) across 98 files.

The no-else-return violations were fixed with the oxlint autofix
(iterated to a fixpoint, plus two else-if chains that required
--fix-dangerously) followed by Prettier formatting. One comment dropped
by the autofix in lib/modules/manager/pub/artifacts.ts was restored
manually. The unicorn/no-lonely-if violations were merged by hand,
preserving comments and coverage-ignore hints.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 12:11:21 +00:00
Yuchen Shi a8b864363c fix(manager/flux): extract both commit and branch for GitRepository (#43560) 2026-06-19 10:35:11 +00:00
Alex Waibel 5e4ef7486e fix(manager/flux): pin tag-only OCIRepository digests to spec.ref.digest (#43753)
* fix(flux): pin tag-only OCIRepository digests to separate ref.digest field

* fix(flux): simplify range checks in extractOCIRefTagRange function

* fix(extract): improve handling of OCI reference nodes by using Scalar types

* fix(extract): refactor findOCIRefNodes to accept parsed documents instead of raw content

* fix(extract): update OCIRepository handling to extract tag-only refs with YAML aliases
2026-06-08 19:22:12 +00:00
Robin Schneider e8614ed076 fix(manager/flux): extract both tag and digest for OCIRepository (#41882)
* fix(manager/flux): extract both tag and digest for OCIRepository

Signed-off-by: Robin Schneider <mail@robinschneider.dev>

* Use record instead of map

Signed-off-by: Robin Schneider <mail@robinschneider.dev>

* Avoid state duplication

Signed-off-by: Robin Schneider <mail@robinschneider.dev>

* Adjust regex

Signed-off-by: Robin Schneider <mail@robinschneider.dev>

* Adjust fallback

Signed-off-by: Robin Schneider <mail@robinschneider.dev>

* test(manager/flux): cover missing-header system manifest branch in extractAllPackageFiles

* fix(manager/flux): update both tag and digest for OCIRepository refs without regex

* test(manager/flux): cover extractOCIRefRange guard branches

* test(manager/flux): cover remaining extractOCIRefRange branches

---------

Signed-off-by: Robin Schneider <mail@robinschneider.dev>
2026-04-27 10:41:18 +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
Christoffer 2b6dbf4871 feat(flux): map Helm sourceRef names via registryAliases (#40158)
* feat(flux): map Helm sourceRef names via registryAliases

* fix: update docs with packageRules for registryAliases showcase

* fix: add tests to fill coverage

* fix: test for isOCIRegistry
2026-01-23 11:52:02 +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
Martin Blasco a84eb22242 fix(manager/flux): log resource name for better debugging (#35994) 2025-05-20 03:26:10 +00:00
Michael Kriese d28c7e1e29 fix(flux): always detect deps in values of HelmRelease (#35055) 2025-03-28 21:14:46 +00:00
Sebastian Poxhofer c43be225f9 refactor: use isHttpUrl where possible (#34982) 2025-03-25 05:51:22 +00:00
ssams bff5159bab feat(manager/flux): support chartRef in HelmRelease resources (#31962) 2025-02-07 09:47:34 +01:00
Michael Kriese 45bdc77844 refactor(manager): always set package name from docker image extract (#33917) 2025-01-29 15:36:24 +00:00
Michael Kriese 1d64a107ed feat(flux): update docker images of helm release values (#33671) 2025-01-17 14:50:52 +00:00
ssams 766d0c37cf refactor(manager/flux): extract helm repo handling to helper functions (#33462) 2025-01-08 15:17:04 +00:00
Michael Kriese 38edaccd00 fix(manager/flux): skip local charts (#32335) 2024-11-05 13:21:48 +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
Michael Kriese edf3c793dc refactor(yaml): drop unused argument (#30804) 2024-08-15 13:42:53 +00:00
Michael Kriese 80232795f3 feat(flux): support kustomization (#29224) 2024-05-24 07:49:39 +00:00
Michael Kriese 1de69069b8 feat(flux): support registry aliases (#29222) 2024-05-23 12:51:36 +00:00
Sebastian Poxhofer bf5eeb54da refactor: centralize OCI detection and deletion (#28544) 2024-04-20 11:16:24 +00:00
Sebastian Poxhofer 14cba69c58 refactor(managers): yaml schema checks (#26811) 2024-02-25 06:14:19 +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
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
James Lakin 78956f4e23 feat(manager/flux): Support system manifests outside flux-system subdirectory (#22966)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2023-09-23 08:00:26 +00:00
Rhys Arkins 36e2b328bb chore: update types reference 2023-08-15 11:31:15 +02:00
Michael Kriese 497d4c131f fix(manager): unify logging (#22398)
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
2023-05-25 16:53:05 +00:00
Skyler Mäntysaari e066924971 feat(manager/flux): Support OCI Helm repositories (#22291)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2023-05-25 16:43:36 +00:00
Skyler Mäntysaari ba6472643c fix(manager/flux): the parsing of ocirepository (#21070)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2023-03-22 14:20:18 +00:00
Adam Setch e29c8ad964 fix(bitbucket): use correct case (#21002) 2023-03-17 12:13:37 +00:00
Rhys Arkins cc33d34ca8 refactor: PackageFile types (#20498)
Co-authored-by: RahulGautamSingh <rahultesnik@gmail.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2023-02-20 14:58:49 +00:00
Rhys Arkins 3cef2f2e4f refactor: PackageFile -> PackageFileContent (#20502) 2023-02-19 12:43:48 +00:00
Devin Buhl 06d92d0592 feat(flux): add support for renovating OCIRespository (#19017) 2022-12-06 07:36:59 +00:00
Zodan Jodan e68419d546 feat: adding GitRepository resource support in flux (#18782)
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2022-11-21 22:35:13 +00:00
Jamie Magee d37e60514a refactor(manager): pass through UpdateArtifact generic type (#18205) 2022-10-08 23:13:43 +02:00
RahulGautamSingh 1657c16136 chore(lint): add object shortand rule (#18080) 2022-10-02 21:20:24 +02: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
Michael Kriese 0a582d31c7 refactor: fix nullable types (#16156)
* refactor: fix nullable types

* chore: revert changes

* chore: fix lint comments

* chore: revert changes
2022-06-20 16:15:40 +00:00
Michael Kriese da6ba6435f refactor(manager): strict null checks (#15151)
* refactor: strict null checks for util

* chore: fix type

* Update tsconfig.strict.json

* Update lib/util/package-rules.ts

* Update lib/util/package-rules.ts

* chore: fix test and coverage

* chore: fix package rules

* refactor(manager): strict null checks

* chore: revert config changes
2022-04-17 14:34:26 +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