[dmt] feat: add helmignore coverage rule - #475
Open
fuldaxxx wants to merge 6 commits into
Open
Conversation
Signed-off-by: Ruslan Gorbunov <ruslan.gorbunov@flant.com>
Signed-off-by: Ruslan Gorbunov <ruslan.gorbunov@flant.com>
Signed-off-by: Ruslan Gorbunov <ruslan.gorbunov@flant.com>
Signed-off-by: Ruslan Gorbunov <ruslan.gorbunov@flant.com>
Signed-off-by: Ruslan Gorbunov <ruslan.gorbunov@flant.com>
Signed-off-by: Ruslan Gorbunov <ruslan.gorbunov@flant.com>
fuldaxxx
marked this pull request as ready for review
September 7, 2026 20:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
helmignorein thestaticscope now validates only the file itself: it exists, it says something, its patterns are well formed. The package-root coverage scan it also ran is gone from the source tree.helmignore-coveragerule joins thebundlescope. It walks the bundle image root and reports entries that no.helmignorepattern excludes — the files Helm would otherwise pull into every chart packed from the module. Reported atwarn; severity is tunable through theremote.bundlesection.templates/,charts/,monitoring/,Chart.yaml,values.yaml, plus the build-generatedimages_digests.json, which exists in no source tree and so can never be named by a hand-written.helmignore.scopes.Staticonly, so a bundle-scope rule has no fixture path there; unit tests cover it instead.Against a real published module (
.helmignorelistingcrds docs enabled hooks images lib Makefile openapi *.md release.yaml werf*.yaml NOTES.txt, bundle assembled by the standard werf template):Why do we need it, and what problem does it solve?
The
helmignorerule failed CI on files CI itself had written into the checkout. Anything a job drops in the module root beforedmt lintruns — a build cache, a generated manifest, a scratch artifact — read asis not listed in .helmignore, and the module owner had nothing to fix.The root cause is that the coverage half of the rule asked a question about what a module ships, but asked it of the working tree. The working tree is not what ships: werf assembles the bundle image from an
includePathsallowlist, so a scratch file never reaches the image in the first place, and.helmignoreonly governs what does. The rule was reading the wrong tree.So the fix follows the scope boundary rather than patching the scan. What is answerable from the file alone stays on
static, where a developer still catches a broken pattern locally with onedmt lint. The tree comparison moves tobundle, where the tree is the built image and holds only what werf let through — no CI scratch, and every finding describes a file that actually reached the registry.An inverted formulation was built first and dropped: nothing
.helmignoreexcludes may still be present in the image. It cannot work, because nothing ever applies.helmignoreto an image — Helm applies it when packing a chart, werf never does. Every deliberately-shipped-but-ignored path (hooks/,openapi/,crds/,docs/: the metadata Deckhouse reads off the module filesystem rather than through Helm) was therefore a false positive, and silencing them took a 13-entry allowlist of legitimate paths. With that allowlist complete the rule had no reachable finding left.The accepted trade-off: an uncovered root file that
includePathsnever ships is no longer reported at all. That file costs nothing — not a byte in the chart, no risk in a cluster — and in exchange the rule stops failing builds over files the module never publishes.Signed-off-by: Ruslan Gorbunov ruslan.gorbunov@flant.com