Skip to content

Commit

Permalink
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
Browse files Browse the repository at this point in the history
…-fix'
  • Loading branch information
kibanamachine committed Dec 12, 2024
1 parent 4982f7f commit 47dbd14
Show file tree
Hide file tree
Showing 81 changed files with 152 additions and 190 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ const testMap = [
'xpack.synthetics',
],
['src/plugins/vis_types/gauge/public/editor/collections.ts', 'visTypeGauge'],
['src/platform/packages/shared/kbn-alerts-ui-shared/src/alert_lifecycle_status_badge/index.tsx', 'alertsUIShared'],
[
'src/platform/packages/shared/kbn-alerts-ui-shared/src/alert_lifecycle_status_badge/index.tsx',
'alertsUIShared',
],
];

describe('Get i18n Identifier for file', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ const testMap = [
['x-pack/plugins/observability/foo/bar/baz/header_actions.tsx', 'o11y'],
['x-pack/plugins/observability_solution/apm/baz/header_actions.tsx', 'apm'],
['x-pack/platform/plugins/shared/cases/public/components/foo.tsx', 'cases'],
['src/platform/packages/shared/kbn-alerts-ui-shared/src/alert_lifecycle_status_badge/index.tsx', 'kbnAlertsUiShared'],
[
'src/platform/packages/shared/kbn-alerts-ui-shared/src/alert_lifecycle_status_badge/index.tsx',
'kbnAlertsUiShared',
],
];

describe('Get App Name', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ module.exports = {
preset: '@kbn/test',
rootDir: '../../../../..',
roots: ['<rootDir>/src/platform/packages/shared/kbn-alerts-ui-shared'],
setupFilesAfterEnv: ['<rootDir>/src/platform/packages/shared/kbn-alerts-ui-shared/setup_tests.ts'],
setupFilesAfterEnv: [
'<rootDir>/src/platform/packages/shared/kbn-alerts-ui-shared/setup_tests.ts',
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ module.exports = {
preset: '@kbn/test',
rootDir: '../../../../..',
roots: ['<rootDir>/src/platform/packages/shared/kbn-cases-components'],
setupFilesAfterEnv: ['<rootDir>/src/platform/packages/shared/kbn-cases-components/setup_tests.ts'],
setupFilesAfterEnv: [
'<rootDir>/src/platform/packages/shared/kbn-cases-components/setup_tests.ts',
],
};
1 change: 0 additions & 1 deletion x-pack/platform/plugins/shared/actions/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

// TODO: https://github.com/elastic/kibana/issues/110895
/* eslint-disable @kbn/eslint/no_export_all */

export * from './types';
export * from './alert_history_schema';
Expand Down
4 changes: 3 additions & 1 deletion x-pack/platform/plugins/shared/actions/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ module.exports = {
roots: ['<rootDir>/x-pack/platform/plugins/shared/actions'],
coverageDirectory: '<rootDir>/target/kibana-coverage/jest/x-pack/platform/plugins/shared/actions',
coverageReporters: ['text', 'html'],
collectCoverageFrom: ['<rootDir>/x-pack/platform/plugins/shared/actions/{common,server}/**/*.{js,ts,tsx}'],
collectCoverageFrom: [
'<rootDir>/x-pack/platform/plugins/shared/actions/{common,server}/**/*.{js,ts,tsx}',
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { LicenseType } from '@kbn/licensing-plugin/server';
export const PLUGIN = {
ID: 'actions',
MINIMUM_LICENSE_REQUIRED: 'basic' as LicenseType, // TODO: supposed to be changed up on requirements
// eslint-disable-next-line @typescript-eslint/no-explicit-any

getI18nName: (i18n: any): string =>
i18n.translate('xpack.actions.appName', {
defaultMessage: 'Actions',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const AuthB64 = Buffer.from(Auth).toString('base64');

describe('axios connections', () => {
let testServer: http.Server | https.Server | null;
// eslint-disable-next-line @typescript-eslint/no-explicit-any

let savedAxiosDefaultsAdapter: any;

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const ServerResponse = 'A unique response returned by the server!';

describe('axios connections', () => {
let testServer: http.Server | https.Server | null;
// eslint-disable-next-line @typescript-eslint/no-explicit-any

let savedAxiosDefaultsAdapter: any;

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('ensureSufficientLicense()', () => {
ensureSufficientLicense({
...sampleActionType,
// we're faking an invalid value, this requires stripping the typing
// eslint-disable-next-line @typescript-eslint/no-explicit-any

minimumLicenseRequired: 'foo' as any,
})
).toThrowErrorMatchingInlineSnapshot(`"\\"foo\\" is not a valid license type"`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function addToStringDeep(object: unknown): void {
// walk arrays, but don't add a toString() as mustache already does something
if (Array.isArray(object)) {
// instead, add an asJSON()
// eslint-disable-next-line @typescript-eslint/no-explicit-any

(object as any).asJSON = () => JSON.stringify(object);
object.forEach((element) => addToStringDeep(element));
return;
Expand Down
35 changes: 17 additions & 18 deletions x-pack/platform/plugins/shared/actions/server/plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ describe('Actions Plugin', () => {

beforeEach(async () => {
// coreMock.createSetup doesn't support Plugin generics
// eslint-disable-next-line @typescript-eslint/no-explicit-any

setup = await plugin.setup(coreSetup as any, pluginsSetup);
});

Expand All @@ -307,7 +307,7 @@ describe('Actions Plugin', () => {
setup.registerType({
...sampleActionType,
// we're faking an invalid value, this requires stripping the typing
// eslint-disable-next-line @typescript-eslint/no-explicit-any

minimumLicenseRequired: 'foo' as any,
})
).toThrowErrorMatchingInlineSnapshot(`"\\"foo\\" is not a valid license type"`);
Expand Down Expand Up @@ -358,7 +358,7 @@ describe('Actions Plugin', () => {
it('should correctly return whether connector is preconfigured', async () => {
setup(getConfig());
// coreMock.createSetup doesn't support Plugin generics
// eslint-disable-next-line @typescript-eslint/no-explicit-any

const pluginSetup = await plugin.setup(coreSetup as any, pluginsSetup);

expect(pluginSetup.isPreconfiguredConnector('preconfiguredServerLog')).toEqual(true);
Expand Down Expand Up @@ -386,7 +386,7 @@ describe('Actions Plugin', () => {
it('should set connector type enabled', async () => {
setup(getConfig());
// coreMock.createSetup doesn't support Plugin generics
// eslint-disable-next-line @typescript-eslint/no-explicit-any

const pluginSetup = await plugin.setup(coreSetup as any, pluginsSetup);
const coreStart = coreMock.createStart();
const pluginsStart = {
Expand Down Expand Up @@ -429,7 +429,7 @@ describe('Actions Plugin', () => {
it('should set connector type enabled and check isActionTypeEnabled with plugin setup method', async () => {
setup(getConfig());
// coreMock.createSetup doesn't support Plugin generics
// eslint-disable-next-line @typescript-eslint/no-explicit-any

const pluginSetup = await plugin.setup(coreSetup as any, pluginsSetup);

pluginSetup.registerType({
Expand Down Expand Up @@ -466,7 +466,7 @@ describe('Actions Plugin', () => {
it('should set all the connector types enabled when null or ["*"] passed', async () => {
setup(getConfig());
// coreMock.createSetup doesn't support Plugin generics
// eslint-disable-next-line @typescript-eslint/no-explicit-any

const pluginSetup = await plugin.setup(coreSetup as any, pluginsSetup);
const coreStart = coreMock.createStart();
const pluginsStart = {
Expand Down Expand Up @@ -509,7 +509,7 @@ describe('Actions Plugin', () => {
it('should set all the connector types disabled when [] passed', async () => {
setup(getConfig());
// coreMock.createSetup doesn't support Plugin generics
// eslint-disable-next-line @typescript-eslint/no-explicit-any

const pluginSetup = await plugin.setup(coreSetup as any, pluginsSetup);
const coreStart = coreMock.createStart();
const pluginsStart = {
Expand Down Expand Up @@ -552,7 +552,7 @@ describe('Actions Plugin', () => {
it('should throw if the enabledActionTypes is already set by the config', async () => {
setup({ ...getConfig(), enabledActionTypes: ['.email'] });
// coreMock.createSetup doesn't support Plugin generics
// eslint-disable-next-line @typescript-eslint/no-explicit-any

const pluginSetup = await plugin.setup(coreSetup as any, pluginsSetup);

expect(() => pluginSetup.setEnabledConnectorTypes(['.index'])).toThrow(
Expand Down Expand Up @@ -702,7 +702,7 @@ describe('Actions Plugin', () => {
it('should handle preconfigured actions', async () => {
setup(getConfig());
// coreMock.createSetup doesn't support Plugin generics
// eslint-disable-next-line @typescript-eslint/no-explicit-any

const pluginSetup = await plugin.setup(coreSetup as any, pluginsSetup);
pluginSetup.registerType({
id: '.server-log',
Expand All @@ -728,7 +728,6 @@ describe('Actions Plugin', () => {
it('should handle preconfiguredAlertHistoryEsIndex = true', async () => {
setup(getConfig({ preconfiguredAlertHistoryEsIndex: true }));

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const pluginSetup = await plugin.setup(coreSetup as any, pluginsSetup);
pluginSetup.registerType({
id: '.index',
Expand Down Expand Up @@ -765,7 +764,7 @@ describe('Actions Plugin', () => {
})
);
// coreMock.createSetup doesn't support Plugin generics
// eslint-disable-next-line @typescript-eslint/no-explicit-any

await plugin.setup(coreSetup as any, pluginsSetup);
const pluginStart = await plugin.start(coreStart, pluginsStart);

Expand All @@ -780,7 +779,7 @@ describe('Actions Plugin', () => {
it('should set system actions correctly', async () => {
setup(getConfig());
// coreMock.createSetup doesn't support Plugin generics
// eslint-disable-next-line @typescript-eslint/no-explicit-any

const pluginSetup = await plugin.setup(coreSetup as any, pluginsSetup);

const platinumLicense = licensingMock.createLicense({
Expand Down Expand Up @@ -848,7 +847,7 @@ describe('Actions Plugin', () => {
);

// coreMock.createSetup doesn't support Plugin generics
// eslint-disable-next-line @typescript-eslint/no-explicit-any

const pluginSetup = await plugin.setup(coreSetup as any, pluginsSetup);

pluginSetup.registerType({
Expand Down Expand Up @@ -890,7 +889,7 @@ describe('Actions Plugin', () => {

it('passes through the notifyUsage option when set to true', async () => {
// coreMock.createSetup doesn't support Plugin generics
// eslint-disable-next-line @typescript-eslint/no-explicit-any

const pluginSetup = await plugin.setup(coreSetup as any, pluginsSetup);
pluginSetup.registerType(actionType);
const pluginStart = plugin.start(coreStart, pluginsStart);
Expand Down Expand Up @@ -918,7 +917,7 @@ describe('Actions Plugin', () => {

it('passes through the notifyUsage option when set to true', async () => {
// coreMock.createSetup doesn't support Plugin generics
// eslint-disable-next-line @typescript-eslint/no-explicit-any

const pluginSetup = await plugin.setup(coreSetup as any, pluginsSetup);
pluginSetup.registerType(actionType);
const pluginStart = plugin.start(coreStart, pluginsStart);
Expand All @@ -933,7 +932,7 @@ describe('Actions Plugin', () => {
describe('getActionsHealth()', () => {
it('should return hasPermanentEncryptionKey false if canEncrypt of encryptedSavedObjects is false', async () => {
// coreMock.createSetup doesn't support Plugin generics
// eslint-disable-next-line @typescript-eslint/no-explicit-any

const pluginSetup = await plugin.setup(coreSetup as any, pluginsSetup);
expect(pluginSetup.getActionsHealth()).toEqual({ hasPermanentEncryptionKey: false });
});
Expand All @@ -952,7 +951,7 @@ describe('Actions Plugin', () => {
describe('isSystemActionConnector()', () => {
it('should return true if the connector is a system connector', async () => {
// coreMock.createSetup doesn't support Plugin generics
// eslint-disable-next-line @typescript-eslint/no-explicit-any

const pluginSetup = await plugin.setup(coreSetup as any, pluginsSetup);

pluginSetup.registerType({
Expand All @@ -975,7 +974,7 @@ describe('Actions Plugin', () => {

it('should return false if the connector is not a system connector', async () => {
// coreMock.createSetup doesn't support Plugin generics
// eslint-disable-next-line @typescript-eslint/no-explicit-any

const pluginSetup = await plugin.setup(coreSetup as any, pluginsSetup);

pluginSetup.registerType({
Expand Down
2 changes: 1 addition & 1 deletion x-pack/platform/plugins/shared/actions/server/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export interface RawAction extends Record<string, unknown> {
export interface ActionTaskParams extends SavedObjectAttributes {
actionId: string;
// Saved Objects won't allow us to enforce unknown rather than any
// eslint-disable-next-line @typescript-eslint/no-explicit-any

params: Record<string, any>;
apiKey?: string;
executionId?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const PLUGIN = {
ID: 'alerting',
MINIMUM_LICENSE_REQUIRED: 'basic' as LicenseType, // TODO: supposed to be changed up on requirements
// all plugins seem to use getI18nName with any
// eslint-disable-next-line @typescript-eslint/no-explicit-any

getI18nName: (i18n: any): string =>
i18n.translate('xpack.alerting.appName', {
defaultMessage: 'Alerting',
Expand Down
2 changes: 1 addition & 1 deletion x-pack/platform/plugins/shared/alerting/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

// TODO: https://github.com/elastic/kibana/issues/110895
/* eslint-disable @kbn/eslint/no_export_all */

export * from './rule';
export * from './rules_settings';
export * from './rule_type';
Expand Down
7 changes: 5 additions & 2 deletions x-pack/platform/plugins/shared/alerting/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ module.exports = {
preset: '@kbn/test',
rootDir: '../../../../..',
roots: ['<rootDir>/x-pack/platform/plugins/shared/alerting'],
coverageDirectory: '<rootDir>/target/kibana-coverage/jest/x-pack/platform/plugins/shared/alerting',
coverageDirectory:
'<rootDir>/target/kibana-coverage/jest/x-pack/platform/plugins/shared/alerting',
coverageReporters: ['text', 'html'],
collectCoverageFrom: ['<rootDir>/x-pack/platform/plugins/shared/alerting/{common,public,server}/**/*.{ts,tsx}'],
collectCoverageFrom: [
'<rootDir>/x-pack/platform/plugins/shared/alerting/{common,public,server}/**/*.{ts,tsx}',
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ async function refreshFieldsInDocs(

// @ts-expect-error @elastic/elasticsearch _source is not in the type!
const freshDoc = freshResponse._source;
// eslint-disable-next-line @typescript-eslint/no-explicit-any

const conflictDoc = conflictRequest.doc as Record<string, any>;
if (!freshDoc || !conflictDoc) continue;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2054,13 +2054,11 @@ describe('Alerts Service', () => {
// leverage the outcome of the first retry
expect(
logger.info.mock.calls.filter(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(calls: any[]) => calls[0] === `Retrying resource initialization for context "test"`
).length
).toEqual(1);
expect(
logger.info.mock.calls.filter(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(calls: any[]) =>
calls[0] === `Resource installation for "test" succeeded after retry`
).length
Expand Down Expand Up @@ -2133,7 +2131,6 @@ describe('Alerts Service', () => {
// Should only log the retry once because the second and third retries should be throttled
expect(
logger.info.mock.calls.filter(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(calls: any[]) => calls[0] === `Retrying resource initialization for context "test"`
).length
).toEqual(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,16 @@ describe('retryTransientErrors', () => {
const errors = [
new EsErrors.NoLivingConnectionsError('no living connection', {
warnings: [],
// eslint-disable-next-line @typescript-eslint/no-explicit-any

meta: {} as any,
}),
new EsErrors.ConnectionError('no connection'),
new EsErrors.TimeoutError('timeout'),
// eslint-disable-next-line @typescript-eslint/no-explicit-any

new EsErrors.ResponseError({ statusCode: 503, meta: {} as any, warnings: [] }),
// eslint-disable-next-line @typescript-eslint/no-explicit-any

new EsErrors.ResponseError({ statusCode: 408, meta: {} as any, warnings: [] }),
// eslint-disable-next-line @typescript-eslint/no-explicit-any

new EsErrors.ResponseError({ statusCode: 410, meta: {} as any, warnings: [] }),
];

Expand Down
Loading

0 comments on commit 47dbd14

Please sign in to comment.