Skip to content

Commit

Permalink
[APM] Disable incremental builds for APM-only type check (#77581)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgieselaar authored Sep 16, 2020
1 parent 5511f0f commit 78774e4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion x-pack/plugins/apm/scripts/optimize-tsconfig/optimize.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const { promisify } = require('util');
const path = require('path');
const json5 = require('json5');
const execa = require('execa');
const { omit } = require('lodash');

const readFile = promisify(fs.readFile);
const writeFile = promisify(fs.writeFile);
Expand All @@ -27,6 +28,7 @@ function prepareParentTsConfigs() {
return Promise.all(
[
path.resolve(xpackRoot, 'tsconfig.json'),
path.resolve(kibanaRoot, 'tsconfig.base.json'),
path.resolve(kibanaRoot, 'tsconfig.json'),
].map(async (filename) => {
const config = json5.parse(await readFile(filename, 'utf-8'));
Expand All @@ -35,7 +37,11 @@ function prepareParentTsConfigs() {
filename,
JSON.stringify(
{
...config,
...omit(config, 'references'),
compilerOptions: {
...config.compilerOptions,
incremental: false,
},
include: [],
},
null,
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/apm/scripts/optimize-tsconfig/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const tsconfigTpl = path.resolve(__dirname, './tsconfig.json');
const filesToIgnore = [
path.resolve(xpackRoot, 'tsconfig.json'),
path.resolve(kibanaRoot, 'tsconfig.json'),
path.resolve(kibanaRoot, 'tsconfig.base.json'),
];

module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/apm/server/lib/traces/get_trace_items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export async function getTraceItems(
// explicit intermediary types to avoid TS "excessively deep" error
PromiseValueType<typeof errorResponsePromise>,
PromiseValueType<typeof traceResponsePromise>
] = await Promise.all([errorResponsePromise, traceResponsePromise]);
] = (await Promise.all([errorResponsePromise, traceResponsePromise])) as any;

const exceedsMax = traceResponse.hits.total.value > maxTraceItems;

Expand Down

0 comments on commit 78774e4

Please sign in to comment.