Skip to content

[dmt] feat: validate module changelog files - #476

Merged
ldmonster merged 8 commits into
mainfrom
feat/changelog-bundle-scope
Sep 8, 2026
Merged

[dmt] feat: validate module changelog files#476
ldmonster merged 8 commits into
mainfrom
feat/changelog-bundle-scope

Conversation

@fuldaxxx

@fuldaxxx fuldaxxx commented Sep 7, 2026

Copy link
Copy Markdown
Member

Description

  • Changelog validation moved from the documentation linter to the module linter and now runs only where a changelog is actually published — the release and bundle scopes. The source tree is no longer checked for changelog.yaml.
  • The single documentation/changelog rule is replaced by two module rules:
    • has-changelog — the published image carries a changelog.yaml and it is not empty;
    • changelog-valid — that file parses as YAML; stays quiet when the file is absent. Both report at warn instead of error.
  • bundle-layout now requires changelog.yaml: the file ships in the bundle image, not only in the sibling release image, as the earlier comment assumed.
  • Config keys: documentation.rules.changelog is gone; module.rules.has-changelog and module.rules.changelog-valid take its place. A config that still sets the old key loses that setting silently.
  • Repository detection centralized in pkg.RepositoryOriginURL and pkg.IsDeckhouseRepo. Three copies of getModuleNameFromRepository / getGitConfigFile / convertURLToModuleName (module linter, templates registry rule, metrics) are deleted, and the exported global pkg.IgnoreDeckhouseReposList is now a local list behind IsDeckhouseRepo. A module linted from inside the Deckhouse monorepo keeps the same exemptions it had before.

What the new findings look like:

🐒 [has-changelog (#module)]
     Message:      changelog.yaml file is missing
     Module:       r-g-test
     Object:       bundle
     FilePath:     changelog.yaml

🐒 [has-changelog (#module)]
     Message:      changelog.yaml file is missing
     Module:       r-g-test
     Object:       release
     FilePath:     changelog.yaml

🐒 [changelog-valid (#module)]
     Message:      invalid YAML in changelog.yaml:
                   error converting YAML to JSON: yaml: line 2: mapping values are not allowed in this context
     Module:       r-g-test
     Object:       bundle
     FilePath:     changelog.yaml

🐒 [changelog-valid (#module)]
     Message:      invalid YAML in changelog.yaml:
                   error converting YAML to JSON: yaml: line 2: mapping values are not allowed in this context
     Module:       r-g-test
     Object:       release
     FilePath:     changelog.yaml

Why do we need it, and what problem does it solve?

Deckhouse renders release notes from changelog.yaml in the published images. A file that is missing, empty, or unparseable means the release lands with nothing to show for it, and nothing between the build and the registry catches that — the gap only becomes visible when someone opens the release page.

The old documentation/changelog rule checked the wrong place: it ran over the module source tree, where the file's presence proves nothing about what got published, and it never looked inside the file, so a changelog.yaml that fails to parse passed the linter. It also assumed the changelog ships only in the release image, which is why bundle-layout did not ask for it — the published CE bundles do carry it.

Moving the checks into the release and bundle scopes puts them on the artifacts that are actually consumed, and splitting presence from validity keeps one missing file from producing three findings — the split definition-file and package-yaml already follow. Severity is warn rather than error: this catches existing modules mid-flight, and a
changelog problem should not fail a lint run that is otherwise clean.

Modules built into the Deckhouse monorepo need no exemption: they publish no images of their own, so neither scope ever runs over them.

The repository-detection cleanup came out of the same work — the changelog rules needed to know whether a module comes from the monorepo, and the answer lived in three copied private helpers plus an exported mutable global. One function, one list, one place to change when the list of monorepo checkouts changes.

@fuldaxxx fuldaxxx self-assigned this Sep 7, 2026
@fuldaxxx fuldaxxx added enhancement New feature or request go Pull requests that update go code labels Sep 7, 2026
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
fuldaxxx force-pushed the feat/changelog-bundle-scope branch from cac0f77 to 30853cf Compare September 8, 2026 09:22
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
fuldaxxx requested a review from ldmonster September 8, 2026 12:45
Signed-off-by: Ruslan Gorbunov <ruslan.gorbunov@flant.com>
@fuldaxxx
fuldaxxx marked this pull request as ready for review September 8, 2026 13:31
@ldmonster
ldmonster merged commit cb11aef into main Sep 8, 2026
8 checks passed
@ldmonster
ldmonster deleted the feat/changelog-bundle-scope branch September 8, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants