Skip to content

Commit

Permalink
chore(NA): include progress on Bazel tasks (#144275)
Browse files Browse the repository at this point in the history
* chore(NA): include progress on Bazel tasks

* docs(NA): include docs on changed logic

* chore(NA): removes warning about no progress when building types for typechecking

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
mistic and kibanamachine committed Nov 1, 2022
1 parent 5c50cd4 commit 73f1878
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
9 changes: 5 additions & 4 deletions .bazelrc.common
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ query --incompatible_no_implicit_file_export
# Log configs
## different from default
common --color=yes
common --noshow_progress
common --show_progress
common --show_task_finish
build --noshow_loading_progress
query --noshow_loading_progress
build --show_result=0
common --progress_report_interval=10
common --show_progress_rate_limit=10
common --show_loading_progress
build --show_result=1

# Specifies desired output mode for running tests.
# Valid values are
Expand Down
10 changes: 10 additions & 0 deletions packages/kbn-bazel-runner/src/bazel_runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,18 @@ async function printLines(stream, prefix) {
crlfDelay: Infinity,
});

// A validation between the previous logged line and the new one to log was introduced
// as the last line of the Bazel task when ran with progress enabled was being logged
// twice after parsing the log output with the logic we have here.
// The original output when letting Bazel taking care of it on its own doesn't include the repeated line
// so this check logic is useful until we get rid of Bazel.
let prevLine = null;
for await (const line of int) {
if (prevLine === line) {
continue;
}
console.log(prefix ? `${prefix} ${line}` : line);
prevLine = line;
}
}

Expand Down
3 changes: 0 additions & 3 deletions src/dev/typescript/run_type_check_cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ function createTypeCheckConfigs(projects: Project[], bazelPackages: BazelPackage
export async function runTypeCheckCli() {
run(
async ({ log, flagsReader, procRunner }) => {
log.warning(
`Building types for all bazel packages. This can take a while depending on your changes and won't show any progress while it runs.`
);
await runBazel(['build', '//packages:build_types', '--show_result=1'], {
cwd: REPO_ROOT,
logPrefix: '\x1b[94m[bazel]\x1b[39m',
Expand Down

0 comments on commit 73f1878

Please sign in to comment.