Skip to content

feat(helm): detect image references anywhere in a values file - #35

Merged
CptSchnitz merged 1 commit into
masterfrom
ticket-20/structural-image-reference-detection
Sep 14, 2026
Merged

CptSchnitz merged 1 commit into
masterfrom
ticket-20/structural-image-reference-detection

Conversation

@CptSchnitz

Copy link
Copy Markdown
Collaborator

What

Generalizes extractImageReferences (packages/helm) from matching only a conventional sibling repository+tag pair to structural detection: any mapping carrying a repository key, at any depth, corroborated by a sibling tag, pullPolicy or registry key, or a parent key of image or one ending in Image.

  • tag is now optional on ImageReference. A mapping with no tag key (or an empty tag:) reports as tagless (tag: undefined) instead of being dropped — resolving it through the chart's appVersion is a later ticket.
  • A repository or tag whose raw text contains unresolved Helm template syntax ({{ ... }}) is skipped: a templated repository drops the whole candidate, a templated tag is treated as tagless.
  • A key with nothing after the colon (repository:) is treated as absent, not as an empty-string value.
  • apps/vscode/src/extension.ts filters out tagless references before existence checks, since there's nothing to check yet.

Closes #20

Testing

  • packages/helm: 25 tests covering every acceptance criterion (structural detection at depth, each corroborating signal independently, tagless reporting, template-syntax skipping, empty-scalar handling, multi-reference source ranges).
  • Full workspace build, lint, type-check, test via turbo pass.

Detection was previously narrow, matching only a mapping with both a
sibling repository and tag key. Generalise it to be structural: any
mapping carrying a repository key is a candidate, corroborated by a
sibling tag, pullPolicy or registry key, or by a parent key of image
or one ending in Image. This catches references at any depth and
parent-key naming without requiring a chart to follow a convention.

A tag sibling is now optional rather than required. A reference with
no tag key is reported as tagless (tag: undefined) instead of being
dropped, since resolving it through the chart's appVersion is a later
ticket's job. extension.ts filters tagless references out before
existence checks accordingly, since there is nothing to check yet.

A repository or tag whose raw text carries unresolved Helm template
syntax is skipped: a templated repository drops the whole candidate,
a templated tag is treated as tagless.

Refs #20
@CptSchnitz
CptSchnitz force-pushed the ticket-20/structural-image-reference-detection branch from 75cbe44 to ac62490 Compare September 14, 2026 04:46
@CptSchnitz
CptSchnitz merged commit 3a7886c into master Sep 14, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Structural detection of image references anywhere in a values file

1 participant