Skip to content

Commit

Permalink
[8.16] [CI] Quiet quickcheck i18n output (#197871) (#198472)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `8.16`:
- [[CI] Quiet quickcheck i18n output
(#197871)](#197871)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Alex
Szabo","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-31T08:47:17Z","message":"[CI]
Quiet quickcheck i18n output (#197871)\n\n## Summary\r\nThe i18n check
spews out ~5k lines of log. This makes it difficult to\r\nspot any
errors, or even break the check through some buffer issue.\r\n\r\nThis
PR quiets output from i18n quick check, yet keeping the
error\r\noutputs.\r\n\r\nWe've tested it in
#194379, and\r\nlocally (to see if
we still see the errors) - it seems to have fixed\r\nerrors from
@pgayvallet 's case.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic
Machine
<[email protected]>","sha":"2162c56b590da3545382739b4f865576f3b088b7","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Operations","release_note:skip","v9.0.0","backport:prev-minor","v8.16.0","backport:version"],"title":"[CI]
Quiet quickcheck i18n
output","number":197871,"url":"https://github.com/elastic/kibana/pull/197871","mergeCommit":{"message":"[CI]
Quiet quickcheck i18n output (#197871)\n\n## Summary\r\nThe i18n check
spews out ~5k lines of log. This makes it difficult to\r\nspot any
errors, or even break the check through some buffer issue.\r\n\r\nThis
PR quiets output from i18n quick check, yet keeping the
error\r\noutputs.\r\n\r\nWe've tested it in
#194379, and\r\nlocally (to see if
we still see the errors) - it seems to have fixed\r\nerrors from
@pgayvallet 's case.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic
Machine
<[email protected]>","sha":"2162c56b590da3545382739b4f865576f3b088b7"}},"sourceBranch":"main","suggestedTargetBranches":["8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197871","number":197871,"mergeCommit":{"message":"[CI]
Quiet quickcheck i18n output (#197871)\n\n## Summary\r\nThe i18n check
spews out ~5k lines of log. This makes it difficult to\r\nspot any
errors, or even break the check through some buffer issue.\r\n\r\nThis
PR quiets output from i18n quick check, yet keeping the
error\r\noutputs.\r\n\r\nWe've tested it in
#194379, and\r\nlocally (to see if
we still see the errors) - it seems to have fixed\r\nerrors from
@pgayvallet 's case.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic
Machine
<[email protected]>","sha":"2162c56b590da3545382739b4f865576f3b088b7"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Alex Szabo <[email protected]>
  • Loading branch information
kibanamachine and delanni authored Oct 31, 2024
1 parent 7f08c83 commit 0eac89c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/checks/i18n.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ set -euo pipefail
source .buildkite/scripts/common/util.sh

echo --- Check i18n
node scripts/i18n_check
node scripts/i18n_check --quiet
18 changes: 9 additions & 9 deletions src/dev/i18n_tools/bin/run_i18n_check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import { Listr } from 'listr2';
import { run } from '@kbn/dev-cli-runner';
import { ToolingLog } from '@kbn/tooling-log';
import { getTimeReporter } from '@kbn/ci-stats-reporter';
import { isFailError } from '@kbn/dev-cli-errors';
import { I18nCheckTaskContext, MessageDescriptor } from '../types';
Expand All @@ -24,13 +23,7 @@ import {
import { TaskReporter } from '../utils/task_reporter';
import { flagFailError, isDefined, undefinedOrBoolean } from '../utils/verify_bin_flags';

const toolingLog = new ToolingLog({
level: 'info',
writeTo: process.stdout,
});

const runStartTime = Date.now();
const reportTime = getTimeReporter(toolingLog, 'scripts/i18n_check');

const skipOnNoTranslations = ({ config }: I18nCheckTaskContext) =>
!config?.translations.length && 'No translations found.';
Expand All @@ -50,9 +43,13 @@ run(
namespace: namespace,
fix = false,
path,
silent,
quiet,
},
log,
}) => {
const reportTime = getTimeReporter(log, 'scripts/i18n_check');

if (
fix &&
(isDefined(ignoreIncompatible) ||
Expand Down Expand Up @@ -131,13 +128,15 @@ run(
{
concurrent: false,
exitOnError: true,
renderer: process.env.CI ? 'verbose' : ('default' as any),
forceTTY: false,
renderer:
((silent || quiet) && 'silent') || (process.env.CI ? 'verbose' : ('default' as any)),
}
);

try {
const messages: Map<string, MessageDescriptor[]> = new Map();
const taskReporter = new TaskReporter({ toolingLog });
const taskReporter = new TaskReporter({ toolingLog: log });
await list.run({ messages, taskReporter });

reportTime(runStartTime, 'total', {
Expand All @@ -150,6 +149,7 @@ run(
reportTime(runStartTime, 'error', {
success: false,
});
log.error(error);
} else {
log.error('Unhandled exception!');
log.error(error);
Expand Down

0 comments on commit 0eac89c

Please sign in to comment.