Skip to content

Commit 7d66396

Browse files
committed
remove kbn-change-history package FLAGS
1 parent 1b5bf66 commit 7d66396

5 files changed

Lines changed: 1 addition & 30 deletions

File tree

x-pack/platform/packages/shared/kbn-change-history/index.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,3 @@
77

88
export type * from './src/types';
99
export * from './src/client';
10-
/**
11-
* @internal exported for test use only — do NOT use in production code,
12-
* this could cause the index to be created before the feature is ready for GA
13-
*/
14-
export { FLAGS } from './src/constants';

x-pack/platform/packages/shared/kbn-change-history/integration_tests/client.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { loggingSystemMock } from '@kbn/core-logging-server-mocks';
1010
import { ToolingLog } from '@kbn/tooling-log';
1111
import type { EsTestCluster } from '@kbn/test';
1212
import { createTestEsCluster } from '@kbn/test';
13-
import { FLAGS } from '../src/constants';
1413
import { ChangeHistoryClient } from '..';
1514
import { DATA_STREAM_NAME } from '../src/client';
1615
import type { ObjectChange } from '..';
@@ -46,7 +45,6 @@ describe('ChangeHistoryClient', () => {
4645
};
4746

4847
beforeAll(async () => {
49-
FLAGS.FEATURE_ENABLED = true;
5048
jest.setTimeout(30_000);
5149
esServer = createTestEsCluster({
5250
log: new ToolingLog({ writeTo: process.stdout, level: 'debug' }),
@@ -56,7 +54,6 @@ describe('ChangeHistoryClient', () => {
5654

5755
afterAll(async () => {
5856
await esServer.stop();
59-
FLAGS.FEATURE_ENABLED = false;
6057
});
6158

6259
afterEach(async () => {

x-pack/platform/packages/shared/kbn-change-history/src/client.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import { elasticsearchServiceMock } from '@kbn/core/server/mocks';
99
import { loggingSystemMock } from '@kbn/core-logging-server-mocks';
1010
import { DataStreamClient } from '@kbn/data-streams';
11-
import { FLAGS } from './constants';
1211
import { ChangeHistoryClient } from './client';
1312

1413
jest.mock('@kbn/data-streams', () => ({
@@ -29,7 +28,6 @@ describe('ChangeHistoryClient.initialize', () => {
2928
};
3029

3130
beforeEach(() => {
32-
FLAGS.FEATURE_ENABLED = true;
3331
DataStreamClientMock.initialize.mockResolvedValue({} as never);
3432
});
3533

x-pack/platform/packages/shared/kbn-change-history/src/client.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,7 @@ import { type DataStreamDefinition, DataStreamClient } from '@kbn/data-streams';
1616
import type { ClientCreateRequest } from '@kbn/data-streams/src/types/es_api';
1717
import type { Logger } from '@kbn/logging';
1818
import { changeHistoryMappings } from './mappings';
19-
import {
20-
FLAGS,
21-
DATA_STREAM_NAME,
22-
SEPARATOR_CHAR,
23-
ECS_VERSION,
24-
DEFAULT_RESULT_SIZE,
25-
} from './constants';
19+
import { DATA_STREAM_NAME, SEPARATOR_CHAR, ECS_VERSION, DEFAULT_RESULT_SIZE } from './constants';
2620
import type {
2721
ChangeHistoryDocument,
2822
GetHistoryResult,
@@ -101,11 +95,6 @@ export class ChangeHistoryClient implements IChangeHistoryClient {
10195
* @throws An error if the data stream is not initialized properly.
10296
*/
10397
async initialize(elasticsearchClient: ElasticsearchClient) {
104-
if (!FLAGS.FEATURE_ENABLED) {
105-
const error = new Error(`Change history is disabled. Skipping initialization.`);
106-
this.logger.error(error);
107-
throw error;
108-
}
10998
const definition: DataStreamDefinition<typeof changeHistoryMappings.v1, ChangeHistoryDocument> =
11099
{
111100
name: DATA_STREAM_NAME,

x-pack/platform/packages/shared/kbn-change-history/src/constants.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,3 @@ export const ECS_VERSION = '9.3.0';
2222
* The default size of results when getting history.
2323
*/
2424
export const DEFAULT_RESULT_SIZE = 100;
25-
26-
/**
27-
* Acts like a feature flag for this package as it prevents initialization.
28-
* Remove this after General Availability
29-
* */
30-
export const FLAGS = {
31-
FEATURE_ENABLED: true,
32-
};

0 commit comments

Comments
 (0)