Skip to content

Commit 5276363

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

6 files changed

Lines changed: 1 addition & 35 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-
};

x-pack/platform/test/alerting_api_integration/common/plugins/alerts/server/plugin.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import type { IEventLogClientService, IEventLogService } from '@kbn/event-log-pl
3030
import type { NotificationsPluginStart } from '@kbn/notifications-plugin/server';
3131
import { RULE_SAVED_OBJECT_TYPE } from '@kbn/alerting-plugin/server';
3232
import { ALERTING_FEATURE_ID } from '@kbn/alerting-plugin/common';
33-
import { FLAGS as CHANGE_HISTORY_FLAGS } from '@kbn/change-history';
3433
import { defineRoutes } from './routes';
3534
import { defineActionTypes } from './action_types';
3635
import { defineRuleTypes } from './rule_types';
@@ -111,7 +110,6 @@ export class FixturePlugin implements Plugin<void, void, FixtureSetupDeps, Fixtu
111110
core: CoreSetup<FixtureStartDeps>,
112111
{ features, actions, alerting, ruleRegistry, eventLog }: FixtureSetupDeps
113112
) {
114-
CHANGE_HISTORY_FLAGS.FEATURE_ENABLED = true;
115113
features.registerKibanaFeature({
116114
id: 'alertsFixture',
117115
name: 'Alerts',
@@ -226,7 +224,4 @@ export class FixturePlugin implements Plugin<void, void, FixtureSetupDeps, Fixtu
226224
this.notificationsStart$.next(notifications);
227225
this.notificationsStart$.complete();
228226
}
229-
public stop() {
230-
CHANGE_HISTORY_FLAGS.FEATURE_ENABLED = false;
231-
}
232227
}

0 commit comments

Comments
 (0)