Skip to content

Commit dee506b

Browse files
committed
Limit DedupT(AI) query output to 20000 characters
related: runtimes/automation/issues/667 Signed-off-by: Lan Xia <[email protected]>
1 parent fbf78a2 commit dee506b

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

TestResultSummaryService/routes/getPossibleIssuesByAI.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ module.exports = async (req, res) => {
2626
// TODO: output should be refined to error and exeception only
2727
}
2828
if (output) {
29-
output += testName + ' ';
29+
// DedupT API has character limit of 20000.
30+
// If the testName + output is > 20000 characters, get only last 20000 characters in the output.
31+
output = output.substring(
32+
Math.max(0, output.length + (testName.length + 1) - 20000),
33+
output.length
34+
);
3035
const response = await got.post(
3136
'http://9.46.100.175:8080/search',
3237
{

test-result-summary-client/src/Build/PossibleIssuesByAI.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ const PossibleIssuesByAI = ({
5858
dataIndex: 'rationale',
5959
key: 'rationale',
6060
render: (value) => {
61-
return <pre>{value}</pre>;
61+
return value.map((item) => {
62+
return <pre>{item}</pre>;
63+
});
6264
},
6365
},
6466
];

0 commit comments

Comments
 (0)