Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -203,19 +203,19 @@ describe('DocumentMigrator', () => {
);
});

it('validates convertToMultiNamespaceTypeVersion is not greater than the current Kibana version', () => {
it('validates convertToMultiNamespaceTypeVersion is not greater than 8.0.0', () => {
const invalidDefinition = {
kibanaVersion: '3.2.3',
kibanaVersion: '8.7.0',
typeRegistry: createRegistry({
name: 'foo',
convertToMultiNamespaceTypeVersion: '3.2.4',
convertToMultiNamespaceTypeVersion: '8.7.0',
namespaceType: 'multiple',
}),
minimumConvertVersion: '0.0.0',
log: mockLogger,
};
expect(() => new DocumentMigrator(invalidDefinition)).toThrowError(
`Invalid convertToMultiNamespaceTypeVersion for type foo. Value '3.2.4' cannot be greater than the current Kibana version '3.2.3'.`
`Invalid convertToMultiNamespaceTypeVersion for type foo. Value '8.7.0' cannot be greater than '8.0.0'.`
);
});

Expand Down Expand Up @@ -784,17 +784,17 @@ describe('DocumentMigrator', () => {
name: 'ccc',
namespaceType: 'multiple',
migrations: {
'9.0.0': (doc: SavedObjectUnsanitizedDoc) => doc,
'7.0.0': (doc: SavedObjectUnsanitizedDoc) => doc,
},
convertToMultiNamespaceTypeVersion: '11.0.0', // this results in reference transforms getting added to other types, but does not increase the migrationVersion of those types
convertToMultiNamespaceTypeVersion: '8.0.0', // this results in reference transforms getting added to other types, but does not increase the migrationVersion of those types
}
),
});
migrator.prepareMigrations();
expect(migrator.migrationVersion).toEqual({
aaa: '10.4.0',
bbb: '3.2.3',
ccc: '11.0.0',
ccc: '8.0.0',
[LEGACY_URL_ALIAS_TYPE]: '0.1.2',
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,9 @@ function validateMigrationDefinition(
throw new Error(
`Invalid convertToMultiNamespaceTypeVersion for type ${type}. Value '${convertToMultiNamespaceTypeVersion}' cannot be less than '${minimumConvertVersion}'.`
);
} else if (Semver.gt(convertToMultiNamespaceTypeVersion, kibanaVersion)) {
} else if (Semver.gt(convertToMultiNamespaceTypeVersion, '8.0.0')) {
throw new Error(
`Invalid convertToMultiNamespaceTypeVersion for type ${type}. Value '${convertToMultiNamespaceTypeVersion}' cannot be greater than the current Kibana version '${kibanaVersion}'.`
`Invalid convertToMultiNamespaceTypeVersion for type ${type}. Value '${convertToMultiNamespaceTypeVersion}' cannot be greater than '8.0.0'.`
);
} else if (Semver.patch(convertToMultiNamespaceTypeVersion)) {
throw new Error(
Expand Down