[Reporting] Remove unused priority field (#92552)
* [Reporting] Remove unused priority field * fix test Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
348472cd59
commit
40fa961d53
|
@ -76,7 +76,6 @@ export interface ReportSource {
|
||||||
started_at?: string;
|
started_at?: string;
|
||||||
completed_at?: string;
|
completed_at?: string;
|
||||||
created_at: string;
|
created_at: string;
|
||||||
priority?: number;
|
|
||||||
process_expiration?: string;
|
process_expiration?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,7 +112,6 @@ export interface ReportApiJSON {
|
||||||
kibana_id: string;
|
kibana_id: string;
|
||||||
browser_type: string | undefined;
|
browser_type: string | undefined;
|
||||||
created_at: string;
|
created_at: string;
|
||||||
priority?: number;
|
|
||||||
jobtype: string;
|
jobtype: string;
|
||||||
created_by: string | false;
|
created_by: string | false;
|
||||||
timeout?: number;
|
timeout?: number;
|
||||||
|
|
|
@ -87,7 +87,6 @@ export class ReportInfoButton extends Component<Props, State> {
|
||||||
|
|
||||||
const attempts = info.attempts ? info.attempts.toString() : NA;
|
const attempts = info.attempts ? info.attempts.toString() : NA;
|
||||||
const maxAttempts = info.max_attempts ? info.max_attempts.toString() : NA;
|
const maxAttempts = info.max_attempts ? info.max_attempts.toString() : NA;
|
||||||
const priority = info.priority ? info.priority.toString() : NA;
|
|
||||||
const timeout = info.timeout ? info.timeout.toString() : NA;
|
const timeout = info.timeout ? info.timeout.toString() : NA;
|
||||||
const warnings = info.output && info.output.warnings ? info.output.warnings.join(',') : null;
|
const warnings = info.output && info.output.warnings ? info.output.warnings.join(',') : null;
|
||||||
|
|
||||||
|
@ -153,10 +152,6 @@ export class ReportInfoButton extends Component<Props, State> {
|
||||||
title: 'Max Attempts',
|
title: 'Max Attempts',
|
||||||
description: maxAttempts,
|
description: maxAttempts,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: 'Priority',
|
|
||||||
description: priority,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: 'Timeout',
|
title: 'Timeout',
|
||||||
description: timeout,
|
description: timeout,
|
||||||
|
|
|
@ -18,7 +18,6 @@ describe('Class Report', () => {
|
||||||
payload: { headers: 'payload_test_field', objectType: 'testOt', title: 'cool report' },
|
payload: { headers: 'payload_test_field', objectType: 'testOt', title: 'cool report' },
|
||||||
meta: { objectType: 'test' },
|
meta: { objectType: 'test' },
|
||||||
timeout: 30000,
|
timeout: 30000,
|
||||||
priority: 1,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(report.toEsDocsJSON()).toMatchObject({
|
expect(report.toEsDocsJSON()).toMatchObject({
|
||||||
|
@ -32,7 +31,6 @@ describe('Class Report', () => {
|
||||||
max_attempts: 50,
|
max_attempts: 50,
|
||||||
meta: { objectType: 'test' },
|
meta: { objectType: 'test' },
|
||||||
payload: { headers: 'payload_test_field', objectType: 'testOt' },
|
payload: { headers: 'payload_test_field', objectType: 'testOt' },
|
||||||
priority: 1,
|
|
||||||
started_at: undefined,
|
started_at: undefined,
|
||||||
status: 'pending',
|
status: 'pending',
|
||||||
timeout: 30000,
|
timeout: 30000,
|
||||||
|
@ -47,7 +45,6 @@ describe('Class Report', () => {
|
||||||
max_attempts: 50,
|
max_attempts: 50,
|
||||||
payload: { headers: 'payload_test_field', objectType: 'testOt' },
|
payload: { headers: 'payload_test_field', objectType: 'testOt' },
|
||||||
meta: { objectType: 'test' },
|
meta: { objectType: 'test' },
|
||||||
priority: 1,
|
|
||||||
status: 'pending',
|
status: 'pending',
|
||||||
timeout: 30000,
|
timeout: 30000,
|
||||||
});
|
});
|
||||||
|
@ -65,7 +62,6 @@ describe('Class Report', () => {
|
||||||
payload: { headers: 'payload_test_field', objectType: 'testOt', title: 'hot report' },
|
payload: { headers: 'payload_test_field', objectType: 'testOt', title: 'hot report' },
|
||||||
meta: { objectType: 'stange' },
|
meta: { objectType: 'stange' },
|
||||||
timeout: 30000,
|
timeout: 30000,
|
||||||
priority: 1,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const metadata = {
|
const metadata = {
|
||||||
|
@ -88,7 +84,6 @@ describe('Class Report', () => {
|
||||||
max_attempts: 50,
|
max_attempts: 50,
|
||||||
meta: { objectType: 'stange' },
|
meta: { objectType: 'stange' },
|
||||||
payload: { objectType: 'testOt' },
|
payload: { objectType: 'testOt' },
|
||||||
priority: 1,
|
|
||||||
started_at: undefined,
|
started_at: undefined,
|
||||||
status: 'pending',
|
status: 'pending',
|
||||||
timeout: 30000,
|
timeout: 30000,
|
||||||
|
@ -105,7 +100,6 @@ describe('Class Report', () => {
|
||||||
max_attempts: 50,
|
max_attempts: 50,
|
||||||
meta: { objectType: 'stange' },
|
meta: { objectType: 'stange' },
|
||||||
payload: { headers: 'payload_test_field', objectType: 'testOt' },
|
payload: { headers: 'payload_test_field', objectType: 'testOt' },
|
||||||
priority: 1,
|
|
||||||
started_at: undefined,
|
started_at: undefined,
|
||||||
status: 'pending',
|
status: 'pending',
|
||||||
timeout: 30000,
|
timeout: 30000,
|
||||||
|
|
|
@ -36,7 +36,6 @@ export class Report implements Partial<ReportSource> {
|
||||||
public readonly started_at?: ReportSource['started_at'];
|
public readonly started_at?: ReportSource['started_at'];
|
||||||
public readonly completed_at?: ReportSource['completed_at'];
|
public readonly completed_at?: ReportSource['completed_at'];
|
||||||
public readonly process_expiration?: ReportSource['process_expiration'];
|
public readonly process_expiration?: ReportSource['process_expiration'];
|
||||||
public readonly priority?: ReportSource['priority'];
|
|
||||||
public readonly timeout?: ReportSource['timeout'];
|
public readonly timeout?: ReportSource['timeout'];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -63,7 +62,6 @@ export class Report implements Partial<ReportSource> {
|
||||||
this.created_by = opts.created_by || false;
|
this.created_by = opts.created_by || false;
|
||||||
this.meta = opts.meta || { objectType: 'unknown' };
|
this.meta = opts.meta || { objectType: 'unknown' };
|
||||||
this.browser_type = opts.browser_type;
|
this.browser_type = opts.browser_type;
|
||||||
this.priority = opts.priority;
|
|
||||||
|
|
||||||
this.status = opts.status || JOB_STATUSES.PENDING;
|
this.status = opts.status || JOB_STATUSES.PENDING;
|
||||||
this.output = opts.output || null;
|
this.output = opts.output || null;
|
||||||
|
@ -98,7 +96,6 @@ export class Report implements Partial<ReportSource> {
|
||||||
meta: this.meta,
|
meta: this.meta,
|
||||||
timeout: this.timeout,
|
timeout: this.timeout,
|
||||||
max_attempts: this.max_attempts,
|
max_attempts: this.max_attempts,
|
||||||
priority: this.priority,
|
|
||||||
browser_type: this.browser_type,
|
browser_type: this.browser_type,
|
||||||
status: this.status,
|
status: this.status,
|
||||||
attempts: this.attempts,
|
attempts: this.attempts,
|
||||||
|
@ -124,7 +121,6 @@ export class Report implements Partial<ReportSource> {
|
||||||
meta: this.meta,
|
meta: this.meta,
|
||||||
timeout: this.timeout,
|
timeout: this.timeout,
|
||||||
max_attempts: this.max_attempts,
|
max_attempts: this.max_attempts,
|
||||||
priority: this.priority,
|
|
||||||
browser_type: this.browser_type,
|
browser_type: this.browser_type,
|
||||||
status: this.status,
|
status: this.status,
|
||||||
attempts: this.attempts,
|
attempts: this.attempts,
|
||||||
|
|
|
@ -203,7 +203,6 @@ describe('ReportingStore', () => {
|
||||||
browserTimezone: 'ABC',
|
browserTimezone: 'ABC',
|
||||||
},
|
},
|
||||||
timeout: 30000,
|
timeout: 30000,
|
||||||
priority: 1,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
await store.setReportClaimed(report, { testDoc: 'test' } as any);
|
await store.setReportClaimed(report, { testDoc: 'test' } as any);
|
||||||
|
@ -244,7 +243,6 @@ describe('ReportingStore', () => {
|
||||||
browserTimezone: 'BCD',
|
browserTimezone: 'BCD',
|
||||||
},
|
},
|
||||||
timeout: 30000,
|
timeout: 30000,
|
||||||
priority: 1,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
await store.setReportFailed(report, { errors: 'yes' } as any);
|
await store.setReportFailed(report, { errors: 'yes' } as any);
|
||||||
|
@ -285,7 +283,6 @@ describe('ReportingStore', () => {
|
||||||
browserTimezone: 'CDE',
|
browserTimezone: 'CDE',
|
||||||
},
|
},
|
||||||
timeout: 30000,
|
timeout: 30000,
|
||||||
priority: 1,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
await store.setReportCompleted(report, { certainly_completed: 'yes' } as any);
|
await store.setReportCompleted(report, { certainly_completed: 'yes' } as any);
|
||||||
|
@ -326,7 +323,6 @@ describe('ReportingStore', () => {
|
||||||
browserTimezone: 'utc',
|
browserTimezone: 'utc',
|
||||||
},
|
},
|
||||||
timeout: 30000,
|
timeout: 30000,
|
||||||
priority: 1,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
await store.setReportCompleted(report, {
|
await store.setReportCompleted(report, {
|
||||||
|
|
|
@ -158,7 +158,6 @@ describe('POST /api/reporting/generate', () => {
|
||||||
|
|
||||||
it(`returns 200 if job handler doesn't error`, async () => {
|
it(`returns 200 if job handler doesn't error`, async () => {
|
||||||
callClusterStub.withArgs('index').resolves({ _id: 'foo', _index: 'foo-index' });
|
callClusterStub.withArgs('index').resolves({ _id: 'foo', _index: 'foo-index' });
|
||||||
|
|
||||||
registerJobGenerationRoutes(core, mockLogger);
|
registerJobGenerationRoutes(core, mockLogger);
|
||||||
|
|
||||||
await server.start();
|
await server.start();
|
||||||
|
@ -180,9 +179,7 @@ describe('POST /api/reporting/generate', () => {
|
||||||
test1: 'yes',
|
test1: 'yes',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
priority: 10,
|
|
||||||
status: 'pending',
|
status: 'pending',
|
||||||
timeout: 10000,
|
|
||||||
},
|
},
|
||||||
path: 'undefined/api/reporting/jobs/download/foo',
|
path: 'undefined/api/reporting/jobs/download/foo',
|
||||||
});
|
});
|
||||||
|
|
|
@ -45,7 +45,6 @@ export default function ({ getService }: FtrProviderContext) {
|
||||||
created_by: false,
|
created_by: false,
|
||||||
jobtype: 'csv',
|
jobtype: 'csv',
|
||||||
max_attempts: 1,
|
max_attempts: 1,
|
||||||
priority: 10,
|
|
||||||
status: 'pending',
|
status: 'pending',
|
||||||
timeout: 120000,
|
timeout: 120000,
|
||||||
browser_type: 'chromium', // TODO: remove this field from the API response
|
browser_type: 'chromium', // TODO: remove this field from the API response
|
||||||
|
|
Loading…
Reference in a new issue