feat/elasticsearch_watermarks#236
Merged
Merged
Conversation
…be set through elasticsearch.yml
…rk.*.max_headroom values
NavidSassan
reviewed
Apr 28, 2026
NavidSassan
left a comment
Member
There was a problem hiding this comment.
points from AI-review:
- CHANGELOG.md not updated (CONTRIBUTING.md:238). No ## [Unreleased] / ### Added entry for any of the five new variables.
- Inconsistent regex check between the four asserts (roles/elasticsearch/tasks/main.yml:143-178). Three asserts use the test form ... is
ansible.builtin.regex("..."), but the fourth (high_max_headroom, line 174) uses the filter form | ansible.builtin.regex_search(...). They
behave subtly differently (the filter returns the match or None; truthiness happens to work, but it's not the same as a boolean test). Make
all four use is ansible.builtin.regex(...). - Asserts are not in alphabetical order (CONTRIBUTING.md:76). Current order: flood_stage_frozen_max_headroom, flood_stage_max_headroom,
low_max_headroom, high_max_headroom. Should be: …flood_stage_max_headroom, high_max_headroom, low_max_headroom. The defaults/main.yml and
README ordering is already alphabetical — match it here too. - Stray extra blank line between the low_max_headroom and high_max_headroom asserts (lines 169–170). Tasks inside a block use a single
blank line; two blank lines are reserved for separating top-level - block:s (CONTRIBUTING.md:128). - Missing range validation for the new percentage variable. elasticsearch__cluster_routing_allocation_disk_watermark_flood_stage_frozen is
documented as Float (0 <= n <= 1), but unlike the existing three watermarks (asserts at lines 104–126), no 0 <= n <= 1 is number check was
added. Add one in the same style. - README example block missing the new variables (roles/elasticsearch/README.md:397-437).
- Regex case-sensitivity. ^[0-9]+(b|kb|mb|gb|tb|pb)$ rejects perfectly valid Elasticsearch values like 200MB, 1GB. Either add (?i) /
IGNORECASE semantics, or document in the README that lowercase is required. The linked byte size units doc shows mixed-case values are
accepted by ES. - when: style. The folded > scalar form is unusual in this codebase — most when: clauses are either single-line strings or a list of
strings (when: ['x is defined', 'x | length > 0']). The example role uses the list form (roles/example/tasks/main.yml:192-193). Switch for
consistency. - quiet: true on asserts (matches the example role pattern at roles/example/tasks/main.yml:54). The pre-existing asserts in this file also
lack it, so this is a wider inconsistency, but worth fixing now for the new ones at minimum. - Redundant is string guard in template. The four template if blocks gate on is defined and is string and (... | length) > 0. The is
string part is redundant given the variables are documented as Type: String, validated by regex when set, and | length > 0 already trips on
undefined-vs-empty. Drop is string. - Conventional Commits not followed for any of the branch's commits (CONTRIBUTING.md:30-51):
- fix typo in README
- extend validation checks for _max_headroom variables
- add link to elastic api conventions on byte size units
- fix whitespace, quotation for cluster.routing.allocation.disk.watermark.*.max_headroom values
- allow complete set of cluster.routing.allocation.disk.watermark.* to be set through elasticsearch.yml
- Duplicate flood_stage range assert at roles/elasticsearch/tasks/main.yml:120-134 — the same check exists twice (lines 120-126 and
128-134, identical). Pre-dates this PR; could be cleaned up while you're touching this file.
…mples in README.md, update asserts and move assert block after import_role
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.
No description provided.