Skip to content

Commit

Permalink
[Reporting] Remove unused priority field (#92552)
Browse files Browse the repository at this point in the history
* [Reporting] Remove unused priority field

* fix test

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
tsullivan and kibanamachine authored Mar 1, 2021
1 parent 348472c commit 40fa961
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 25 deletions.
2 changes: 0 additions & 2 deletions x-pack/plugins/reporting/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ export interface ReportSource {
started_at?: string;
completed_at?: string;
created_at: string;
priority?: number;
process_expiration?: string;
}

Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -153,10 +152,6 @@ export class ReportInfoButton extends Component<Props, State> {
title: 'Max Attempts',
description: maxAttempts,
},
{
title: 'Priority',
description: priority,
},
{
title: 'Timeout',
description: timeout,
Expand Down
6 changes: 0 additions & 6 deletions x-pack/plugins/reporting/server/lib/store/report.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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,
Expand All @@ -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,
});
Expand All @@ -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 = {
Expand All @@ -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,
Expand All @@ -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,
Expand Down
4 changes: 0 additions & 4 deletions x-pack/plugins/reporting/server/lib/store/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'];

/*
Expand All @@ -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;
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down
4 changes: 0 additions & 4 deletions x-pack/plugins/reporting/server/lib/store/store.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ describe('ReportingStore', () => {
browserTimezone: 'ABC',
},
timeout: 30000,
priority: 1,
});

await store.setReportClaimed(report, { testDoc: 'test' } as any);
Expand Down Expand Up @@ -244,7 +243,6 @@ describe('ReportingStore', () => {
browserTimezone: 'BCD',
},
timeout: 30000,
priority: 1,
});

await store.setReportFailed(report, { errors: 'yes' } as any);
Expand Down Expand Up @@ -285,7 +283,6 @@ describe('ReportingStore', () => {
browserTimezone: 'CDE',
},
timeout: 30000,
priority: 1,
});

await store.setReportCompleted(report, { certainly_completed: 'yes' } as any);
Expand Down Expand Up @@ -326,7 +323,6 @@ describe('ReportingStore', () => {
browserTimezone: 'utc',
},
timeout: 30000,
priority: 1,
});

await store.setReportCompleted(report, {
Expand Down
3 changes: 0 additions & 3 deletions x-pack/plugins/reporting/server/routes/generation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -180,9 +179,7 @@ describe('POST /api/reporting/generate', () => {
test1: 'yes',
},
},
priority: 10,
status: 'pending',
timeout: 10000,
},
path: 'undefined/api/reporting/jobs/download/foo',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 40fa961

Please sign in to comment.