Adding a unit test to detect when StackTemplateRegistry#REGISTRY_VERSION needs to be incremented#136666
Merged
eyalkoren merged 5 commits intoelastic:mainfrom Oct 19, 2025
Merged
Conversation
Collaborator
|
Pinging @elastic/es-data-management (Team:Data Management) |
felixbarny
reviewed
Oct 16, 2025
Member
felixbarny
left a comment
There was a problem hiding this comment.
Looks good! I like the approach of starting with the StackTemplateRegistry and then extending this to others.
To prepare for that, I think that slight adjustments would could make it easier for other registries to leverage the checksum validation. I'm thinking of the OTel one in particular. I'll add some comments regarding that inline.
x-pack/plugin/stack/src/test/java/org/elasticsearch/xpack/stack/StackTemplateRegistryTests.java
Show resolved
Hide resolved
… into hash-for-registry-components
felixbarny
approved these changes
Oct 16, 2025
x-pack/plugin/stack/src/test/java/org/elasticsearch/xpack/stack/StackTemplateRegistryTests.java
Show resolved
Hide resolved
nielsbauman
approved these changes
Oct 19, 2025
Contributor
nielsbauman
left a comment
There was a problem hiding this comment.
LGTM. I like this idea! When Jimmy has had time to make progress with his revamp of this registry system, we can see how we can incorporate a check like this on a larger scale.
chrisparrinello
pushed a commit
to chrisparrinello/elasticsearch
that referenced
this pull request
Oct 24, 2025
…SION` needs to be incremented (elastic#136666)
fzowl
pushed a commit
to voyage-ai/elasticsearch
that referenced
this pull request
Nov 3, 2025
…SION` needs to be incremented (elastic#136666)
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.
Adding a constant to
StackTemplateRegistrythat represents the checksum of all components registered to it and a test that verifies that the checksum matches it. If the checksum is not equal, it indicates that one of the registered components have been change, triggering the test failure with a message that instructs how to update the checksum and version.It is a low-risk change with very minimal refactoring of production code. Logic is only added in the test.
It's added specifically to
StackTemplateRegistry, but can potentially be ported later on toIndexTemplateRegistryfor use by all registries, just would require a bit more refactoring. Proposing to start with this one.