[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:
Tim Sullivan 2021-03-01 10:41:08 -07:00 committed by GitHub
parent 348472cd59
commit 40fa961d53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 0 additions and 25 deletions

View file

@ -76,7 +76,6 @@ export interface ReportSource {
started_at?: string;
completed_at?: string;
created_at: string;
priority?: number;
process_expiration?: string;
}
@ -113,7 +112,6 @@ export interface ReportApiJSON {
kibana_id: string;
browser_type: string | undefined;
created_at: string;
priority?: number;
jobtype: string;
created_by: string | false;
timeout?: number;

View file

@ -87,7 +87,6 @@ export class ReportInfoButton extends Component<Props, State> {
const attempts = info.attempts ? info.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 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',
description: maxAttempts,
},
{
title: 'Priority',
description: priority,
},
{
title: 'Timeout',
description: timeout,

View file

@ -18,7 +18,6 @@ describe('Class Report', () => {
payload: { headers: 'payload_test_field', objectType: 'testOt', title: 'cool report' },
meta: { objectType: 'test' },
timeout: 30000,
priority: 1,
});
expect(report.toEsDocsJSON()).toMatchObject({
@ -32,7 +31,6 @@ describe('Class Report', () => {
max_attempts: 50,
meta: { objectType: 'test' },
payload: { headers: 'payload_test_field', objectType: 'testOt' },
priority: 1,
started_at: undefined,
status: 'pending',
timeout: 30000,
@ -47,7 +45,6 @@ describe('Class Report', () => {
max_attempts: 50,
payload: { headers: 'payload_test_field', objectType: 'testOt' },
meta: { objectType: 'test' },
priority: 1,
status: 'pending',
timeout: 30000,
});
@ -65,7 +62,6 @@ describe('Class Report', () => {
payload: { headers: 'payload_test_field', objectType: 'testOt', title: 'hot report' },
meta: { objectType: 'stange' },
timeout: 30000,
priority: 1,
});
const metadata = {
@ -88,7 +84,6 @@ describe('Class Report', () => {
max_attempts: 50,
meta: { objectType: 'stange' },
payload: { objectType: 'testOt' },
priority: 1,
started_at: undefined,
status: 'pending',
timeout: 30000,
@ -105,7 +100,6 @@ describe('Class Report', () => {
max_attempts: 50,
meta: { objectType: 'stange' },
payload: { headers: 'payload_test_field', objectType: 'testOt' },
priority: 1,
started_at: undefined,
status: 'pending',
timeout: 30000,

View file

@ -36,7 +36,6 @@ export class Report implements Partial<ReportSource> {
public readonly started_at?: ReportSource['started_at'];
public readonly completed_at?: ReportSource['completed_at'];
public readonly process_expiration?: ReportSource['process_expiration'];
public readonly priority?: ReportSource['priority'];
public readonly timeout?: ReportSource['timeout'];
/*
@ -63,7 +62,6 @@ export class Report implements Partial<ReportSource> {
this.created_by = opts.created_by || false;
this.meta = opts.meta || { objectType: 'unknown' };
this.browser_type = opts.browser_type;
this.priority = opts.priority;
this.status = opts.status || JOB_STATUSES.PENDING;
this.output = opts.output || null;
@ -98,7 +96,6 @@ export class Report implements Partial<ReportSource> {
meta: this.meta,
timeout: this.timeout,
max_attempts: this.max_attempts,
priority: this.priority,
browser_type: this.browser_type,
status: this.status,
attempts: this.attempts,
@ -124,7 +121,6 @@ export class Report implements Partial<ReportSource> {
meta: this.meta,
timeout: this.timeout,
max_attempts: this.max_attempts,
priority: this.priority,
browser_type: this.browser_type,
status: this.status,
attempts: this.attempts,

View file

@ -203,7 +203,6 @@ describe('ReportingStore', () => {
browserTimezone: 'ABC',
},
timeout: 30000,
priority: 1,
});
await store.setReportClaimed(report, { testDoc: 'test' } as any);
@ -244,7 +243,6 @@ describe('ReportingStore', () => {
browserTimezone: 'BCD',
},
timeout: 30000,
priority: 1,
});
await store.setReportFailed(report, { errors: 'yes' } as any);
@ -285,7 +283,6 @@ describe('ReportingStore', () => {
browserTimezone: 'CDE',
},
timeout: 30000,
priority: 1,
});
await store.setReportCompleted(report, { certainly_completed: 'yes' } as any);
@ -326,7 +323,6 @@ describe('ReportingStore', () => {
browserTimezone: 'utc',
},
timeout: 30000,
priority: 1,
});
await store.setReportCompleted(report, {

View file

@ -158,7 +158,6 @@ describe('POST /api/reporting/generate', () => {
it(`returns 200 if job handler doesn't error`, async () => {
callClusterStub.withArgs('index').resolves({ _id: 'foo', _index: 'foo-index' });
registerJobGenerationRoutes(core, mockLogger);
await server.start();
@ -180,9 +179,7 @@ describe('POST /api/reporting/generate', () => {
test1: 'yes',
},
},
priority: 10,
status: 'pending',
timeout: 10000,
},
path: 'undefined/api/reporting/jobs/download/foo',
});

View file

@ -45,7 +45,6 @@ export default function ({ getService }: FtrProviderContext) {
created_by: false,
jobtype: 'csv',
max_attempts: 1,
priority: 10,
status: 'pending',
timeout: 120000,
browser_type: 'chromium', // TODO: remove this field from the API response