-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds tests to ensure registered SO types aren't removed #207142
Adds tests to ensure registered SO types aren't removed #207142
Conversation
…ackage, moves registration test to dedicated subfolder
@elasticmachine merge upstream |
|
||
// set minimum number of registered saved objects to ensure no object types are removed after 8.8 | ||
// declared in internal implementation exclicilty to prevent unintended changes. | ||
export const MIN_SAVED_OBJECT_TYPES_COUNT = 127 as const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exporting the constant from an internal package on purpose to avoid messing with the public types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT we're comparing for equalty
, so perhaps this should be called SAVED_OBJECT_TYPES_COUNT
.
I suppose that folks will have to update this const every time they add a new type, which is a good thing, cause the description next to it tells us that it cannot go down.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in 5dc727a
@@ -46,6 +47,8 @@ describe('checking migration metadata changes on all registered SO types', () => | |||
// This test is meant to fail when any change is made in registered types that could potentially impact the SO migration. | |||
// Just update the snapshot by running this test file via jest_integration with `-u` and push the update. | |||
// The intent is to trigger a code review from the Core team to review the SO type changes. | |||
// The number of types in the hashMap should never be reduced, it can only increase. | |||
// Removing saved object types is forbidden after 8.8. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These comments are ment to warn against removing saved object types for anyone who ends up having to make changes to the tests to get them to pass.
'<rootDir>/src/core/server/integration_tests/saved_objects/routes', | ||
'<rootDir>/src/core/server/integration_tests/saved_objects/service', | ||
'<rootDir>/src/core/server/integration_tests/saved_objects/validation', | ||
'<rootDir>/src/core/server/integration_tests/saved_objects/registration', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved the type_registration to its own subfolder because it was getting "lost" within group3 in the migrations integration tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self review
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Public APIs missing comments
Unknown metric groupsAPI count
History
|
fix elastic#207128 We have an integration test to check that saved objects aren't removed and another that catches mappings changes. This PR adds another assertion to ensure that the message is clear: Removing a saved object type is not allowed after 8.8. --------- Co-authored-by: Elastic Machine <[email protected]>
fix elastic#207128 We have an integration test to check that saved objects aren't removed and another that catches mappings changes. This PR adds another assertion to ensure that the message is clear: Removing a saved object type is not allowed after 8.8. --------- Co-authored-by: Elastic Machine <[email protected]>
fix #207128
We have an integration test to check that saved objects aren't removed and another that catches mappings changes.
This PR adds another assertion to ensure that the message is clear: Removing a saved object type is not allowed after 8.8.