Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[7.17] [kbn-failed-test-reporter-cli] truncate report message to fix …
…github api call failure (#155141) (#155285) # Backport This will backport the following commits from `main` to `7.17`: - [[kbn-failed-test-reporter-cli] truncate report message to fix github api call failure (#155141)](#155141) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Dzmitry Lemechko","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-04-19T14:39:35Z","message":"[kbn-failed-test-reporter-cli] truncate report message to fix github api call failure (#155141)\n\n## Summary\r\n\r\nWe recently had a\r\n[failure](https://buildkite.com/elastic/kibana-on-merge/builds/29020#018792bc-498a-46d1-9343-fb791823d92e)\r\nwhile calling Github API to open new issue:\r\n\r\n```\r\n2023-04-18 07:56:26 CEST\tERROR Error: [post https://api.github.com/repos/elastic/kibana/issues] 422 Unprocessable Entity Error: {\"message\":\"Validation Failed\",\"errors\":[{\"resource\":\"Issue\",\"code\":\"custom\",\"field\":\"body\",\"message\":\"body is too long\"},{\"resource\":\"Issue\",\"code\":\"custom\",\"field\":\"body\",\"message\":\"body is too long (maximum is 65536 characters)\"}],\"documentation_url\":\"https://docs.github.com/rest/reference/issues#create-an-issue\"}\r\n2023-04-18 07:56:26 CEST\t at GithubApi.request (github_api.ts:177:17)\r\n2023-04-18 07:56:26 CEST\t at processTicksAndRejections (node:internal/process/task_queues:96:5)\r\n2023-04-18 07:56:26 CEST\t at GithubApi.createIssue (github_api.ts:106:18)\r\n2023-04-18 07:56:26 CEST\t at createFailureIssue (report_failure.ts:39:10)\r\n2023-04-18 07:56:26 CEST\t at description (failed_tests_reporter_cli.ts:153:28)\r\n2023-04-18 07:56:26 CEST\t at run.ts:70:7\r\n2023-04-18 07:56:26 CEST\t at withProcRunner (with_proc_runner.ts:29:5)\r\n2023-04-18 07:56:26 CEST\t at run (run.ts:69:5)\r\n```\r\n\r\nIt seems like some test might have a very long failure message that\r\nreaches Github body length limit and causes a failure.\r\n\r\nSince mocha truncates failure message to 8192 chars, I thought it might\r\nbe a good option for Github issues as well (Having too long message is\r\nnot very useful anyway)","sha":"271d9aa68cf93ae9a3d398e909a0c4fb06a409b5","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v7.17.10","v8.8.0","v8.7.2"],"number":155141,"url":"https://github.com/elastic/kibana/pull/155141","mergeCommit":{"message":"[kbn-failed-test-reporter-cli] truncate report message to fix github api call failure (#155141)\n\n## Summary\r\n\r\nWe recently had a\r\n[failure](https://buildkite.com/elastic/kibana-on-merge/builds/29020#018792bc-498a-46d1-9343-fb791823d92e)\r\nwhile calling Github API to open new issue:\r\n\r\n```\r\n2023-04-18 07:56:26 CEST\tERROR Error: [post https://api.github.com/repos/elastic/kibana/issues] 422 Unprocessable Entity Error: {\"message\":\"Validation Failed\",\"errors\":[{\"resource\":\"Issue\",\"code\":\"custom\",\"field\":\"body\",\"message\":\"body is too long\"},{\"resource\":\"Issue\",\"code\":\"custom\",\"field\":\"body\",\"message\":\"body is too long (maximum is 65536 characters)\"}],\"documentation_url\":\"https://docs.github.com/rest/reference/issues#create-an-issue\"}\r\n2023-04-18 07:56:26 CEST\t at GithubApi.request (github_api.ts:177:17)\r\n2023-04-18 07:56:26 CEST\t at processTicksAndRejections (node:internal/process/task_queues:96:5)\r\n2023-04-18 07:56:26 CEST\t at GithubApi.createIssue (github_api.ts:106:18)\r\n2023-04-18 07:56:26 CEST\t at createFailureIssue (report_failure.ts:39:10)\r\n2023-04-18 07:56:26 CEST\t at description (failed_tests_reporter_cli.ts:153:28)\r\n2023-04-18 07:56:26 CEST\t at run.ts:70:7\r\n2023-04-18 07:56:26 CEST\t at withProcRunner (with_proc_runner.ts:29:5)\r\n2023-04-18 07:56:26 CEST\t at run (run.ts:69:5)\r\n```\r\n\r\nIt seems like some test might have a very long failure message that\r\nreaches Github body length limit and causes a failure.\r\n\r\nSince mocha truncates failure message to 8192 chars, I thought it might\r\nbe a good option for Github issues as well (Having too long message is\r\nnot very useful anyway)","sha":"271d9aa68cf93ae9a3d398e909a0c4fb06a409b5"}},"sourceBranch":"main","suggestedTargetBranches":["7.17","8.7"],"targetPullRequestStates":[{"branch":"7.17","label":"v7.17.10","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/155141","number":155141,"mergeCommit":{"message":"[kbn-failed-test-reporter-cli] truncate report message to fix github api call failure (#155141)\n\n## Summary\r\n\r\nWe recently had a\r\n[failure](https://buildkite.com/elastic/kibana-on-merge/builds/29020#018792bc-498a-46d1-9343-fb791823d92e)\r\nwhile calling Github API to open new issue:\r\n\r\n```\r\n2023-04-18 07:56:26 CEST\tERROR Error: [post https://api.github.com/repos/elastic/kibana/issues] 422 Unprocessable Entity Error: {\"message\":\"Validation Failed\",\"errors\":[{\"resource\":\"Issue\",\"code\":\"custom\",\"field\":\"body\",\"message\":\"body is too long\"},{\"resource\":\"Issue\",\"code\":\"custom\",\"field\":\"body\",\"message\":\"body is too long (maximum is 65536 characters)\"}],\"documentation_url\":\"https://docs.github.com/rest/reference/issues#create-an-issue\"}\r\n2023-04-18 07:56:26 CEST\t at GithubApi.request (github_api.ts:177:17)\r\n2023-04-18 07:56:26 CEST\t at processTicksAndRejections (node:internal/process/task_queues:96:5)\r\n2023-04-18 07:56:26 CEST\t at GithubApi.createIssue (github_api.ts:106:18)\r\n2023-04-18 07:56:26 CEST\t at createFailureIssue (report_failure.ts:39:10)\r\n2023-04-18 07:56:26 CEST\t at description (failed_tests_reporter_cli.ts:153:28)\r\n2023-04-18 07:56:26 CEST\t at run.ts:70:7\r\n2023-04-18 07:56:26 CEST\t at withProcRunner (with_proc_runner.ts:29:5)\r\n2023-04-18 07:56:26 CEST\t at run (run.ts:69:5)\r\n```\r\n\r\nIt seems like some test might have a very long failure message that\r\nreaches Github body length limit and causes a failure.\r\n\r\nSince mocha truncates failure message to 8192 chars, I thought it might\r\nbe a good option for Github issues as well (Having too long message is\r\nnot very useful anyway)","sha":"271d9aa68cf93ae9a3d398e909a0c4fb06a409b5"}},{"branch":"8.7","label":"v8.7.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Dzmitry Lemechko <[email protected]>
- Loading branch information