Skip to content

Commit

Permalink
review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
semd committed Oct 23, 2024
1 parent 36b25b4 commit 46804a0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ import { v4 as uuidV4 } from 'uuid';
import type { RuleMigration } from '../../../../../common/siem_migrations/model/rule_migration.gen';
import type { CreateRuleMigrationResponse } from '../../../../../common/siem_migrations/model/api/rules/rules_migration.gen';
import { CreateRuleMigrationRequestBody } from '../../../../../common/siem_migrations/model/api/rules/rules_migration.gen';
import { SIEM_RULE_MIGRATIONS_PATH } from '../../../../../common/siem_migrations/constants';
import {
SIEM_RULE_MIGRATIONS_PATH,
SiemMigrationsStatus,
} from '../../../../../common/siem_migrations/constants';
import type { SecuritySolutionPluginRouter } from '../../../../types';

export const registerSiemRuleMigrationsCreateRoute = (
Expand Down Expand Up @@ -45,7 +48,7 @@ export const registerSiemRuleMigrationsCreateRoute = (
'@timestamp': timestamp,
migration_id: migrationId,
original_rule: originalRule,
status: 'pending',
status: SiemMigrationsStatus.PENDING,
}));
await siemMigrationClient.rules.create(ruleMigrations);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ export const registerSiemRuleMigrationsRoutes = (
logger: Logger
) => {
registerSiemRuleMigrationsCreateRoute(router, logger);
// TODO: registerSiemRuleMigrationsGetRoute(router, logger);
};
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ describe('SiemRuleMigrationsDataStream', () => {
});

describe('installSpace', () => {
it('should install space', async () => {
it('should install space data stream', async () => {
const dataStream = new RuleMigrationsDataStream({ kibanaVersion: '8.13.0' });
const params: InstallParams = {
esClient,
Expand All @@ -95,7 +95,7 @@ describe('SiemRuleMigrationsDataStream', () => {
expect(dataStreamSpacesAdapter.installSpace).toHaveBeenCalledWith('space1');
});

it('should not install space if install not executed', async () => {
it('should not install space data stream if install not executed', async () => {
const dataStream = new RuleMigrationsDataStream({ kibanaVersion: '8.13.0' });
await expect(dataStream.installSpace('space1')).rejects.toThrowError();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ export class RuleMigrationsDataStream {
this.installPromise = this.dataStream.install(params);
await this.installPromise;
} catch (err) {
params.logger.error(
`Error installing siem rule migrations data stream. Data quality dashboard persistence may be impacted.- ${err.message}`,
err
);
params.logger.error(`Error installing siem rule migrations data stream. ${err.message}`, err);
}
}

Expand Down

0 comments on commit 46804a0

Please sign in to comment.