Skip to content

[dmt] require disable.message fallback for disable.messages on Deckhouse < 1.77#417

Open
Fkuloff wants to merge 1 commit into
mainfrom
feature/disable-messages-fallback
Open

[dmt] require disable.message fallback for disable.messages on Deckhouse < 1.77#417
Fkuloff wants to merge 1 commit into
mainfrom
feature/disable-messages-fallback

Conversation

@Fkuloff

@Fkuloff Fkuloff commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Description

Makes the definition-file rule (module linter) enforce the disable.messages / disable.message split by Deckhouse version: disable.messages (localized ru/en) is read by Deckhouse >= 1.77, while disable.message is what < 1.77 reads.

Rules:

  • disable.messages must define both ru and en — otherwise an error.
  • disable.messages on a module that allows Deckhouse < 1.77 needs a disable.message fallback (or requirements.deckhouse pinned to >= 1.77) — otherwise an error (< 1.77 does not read disable.messages).
  • disable.message on a module pinned to Deckhouse >= 1.77 must be removed (only disable.messages is read there) — otherwise an error.
  • disable.message kept alongside disable.messages while the module still allows < 1.77 — a warning: it is the < 1.77 fallback and must be removed once requirements.deckhouse is pinned to >= 1.77.
  • a lone disable.message on a module that allows < 1.77 is the correct field — no finding.

Follow-up to #411.

@Fkuloff Fkuloff self-assigned this Jul 6, 2026
@Fkuloff Fkuloff requested review from ipaqsa and ldmonster July 6, 2026 08:56
Signed-off-by: Artem Kuleshov <artem.kuleshov@flant.com>
@Fkuloff Fkuloff force-pushed the feature/disable-messages-fallback branch from 25be917 to a9b7f64 Compare July 6, 2026 10:30
@Fkuloff Fkuloff marked this pull request as ready for review July 6, 2026 10:59
@Fkuloff Fkuloff added the enhancement New feature or request label Jul 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the module linter’s definition-file rule to enforce correct usage of disable.messages vs disable.message depending on the module’s supported Deckhouse versions, ensuring pre-1.77 compatibility is handled explicitly.

Changes:

  • Enforce a disable.message fallback when disable.messages is used but requirements.deckhouse still allows < 1.77, and error on disable.message when pinned to >= 1.77.
  • Refresh unit tests and e2e fixtures to cover the new error/warn matrix, and remove the old “disable-message-deprecated” fixture.
  • Update module linter documentation and e2e case list to reflect the new rules.

Reviewed changes

Copilot reviewed 12 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/e2e/testdata/module/disable-messages-invalid/expected.yaml Updates expected errors to match new “missing fallback on <1.77” behavior.
test/e2e/testdata/module/disable-message-on-supported-version/module/openapi/values.yaml Adds minimal OpenAPI scaffold for the new e2e fixture.
test/e2e/testdata/module/disable-message-on-supported-version/module/openapi/config-values.yaml Adds minimal OpenAPI schema for the new e2e fixture.
test/e2e/testdata/module/disable-message-on-supported-version/module/module.yaml Pins fixture to >= 1.77 to exercise the “disable.message must be removed” error.
test/e2e/testdata/module/disable-message-on-supported-version/expected.yaml New e2e expectation for the disable.message removal error on >= 1.77.
test/e2e/testdata/module/disable-message-fallback/module/openapi/values.yaml Adds/updates minimal OpenAPI scaffold for the fallback warning fixture.
test/e2e/testdata/module/disable-message-fallback/module/openapi/config-values.yaml Adds/updates minimal OpenAPI schema for the fallback warning fixture.
test/e2e/testdata/module/disable-message-fallback/module/module.yaml New fixture covering disable.message + disable.messages on < 1.77 (warning).
test/e2e/testdata/module/disable-message-fallback/expected.yaml New e2e expectation for the fallback warning.
test/e2e/testdata/module/disable-message-deprecated/expected.yaml Removes the obsolete “disable.message deprecated” e2e expectation.
test/e2e/README.md Updates the catalog of e2e cases to reflect new fixtures and removed one.
pkg/linters/module/rules/module_yaml.go Implements the updated version-aware validation logic for disable messaging fields.
pkg/linters/module/rules/module_yaml_test.go Updates/extends unit tests to cover new behaviors and messages.
pkg/linters/module/README.md Documents the updated rule behavior and severities.
Comments suppressed due to low confidence (1)

test/e2e/testdata/module/disable-message-on-supported-version/module/module.yaml:8

  • The fixture’s description still says it verifies a deprecation lint, but in this PR disable.message on requirements.deckhouse: ">= 1.77" is enforced as an error requiring removal. Updating the fixture description will keep the testdata self-explanatory and aligned with the new rule.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants