chore(NA): include progress on Bazel tasks (#144275)

* 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>
This commit is contained in:
Tiago Costa 2022-11-01 01:03:52 +00:00 committed by GitHub
parent 5c50cd4ffd
commit 73f1878983
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 7 deletions

View file

@ -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

View file

@ -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;
}
}

View file

@ -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',