Skip to content

Update MetricsDetails to add Save button to save both Test and Baseline Tables#1178

Merged
smlambert merged 4 commits intoadoptium:masterfrom
dennycjacob:save_updated_statistics
Mar 4, 2026
Merged

Update MetricsDetails to add Save button to save both Test and Baseline Tables#1178
smlambert merged 4 commits intoadoptium:masterfrom
dennycjacob:save_updated_statistics

Conversation

@dennycjacob
Copy link
Contributor

@dennycjacob dennycjacob commented Feb 23, 2026

Adding Save Button on MetricsDetails Page
Related:https://github.ibm.com/runtimes/automation/issues/875
Signed-off-by:Denny Chacko Jacob

@netlify
Copy link

netlify bot commented Feb 23, 2026

Deploy Preview for eclipsefdn-adoptium-trss canceled.

Name Link
🔨 Latest commit cb3ede3
🔍 Latest deploy log https://app.netlify.com/projects/eclipsefdn-adoptium-trss/deploys/699debbf6458c300087573f8

@dennycjacob
Copy link
Contributor Author

Screenshot 2026-02-23 at 1 48 18 PM Added Save Button to Save both TEST and BASELINE statistics

@dennycjacob dennycjacob changed the title Update MetricsDetails to add Save button to save both Test and Baseline Update MetricsDetails to add Save button to save both Test and Baseline Tables Feb 23, 2026
@dennycjacob dennycjacob force-pushed the save_updated_statistics branch from bcb53e3 to c3373a6 Compare February 24, 2026 18:03
@dennycjacob dennycjacob marked this pull request as ready for review February 24, 2026 18:03
@dennycjacob
Copy link
Contributor Author

@annaibm @smlambert - Please Take a look

@annaibm
Copy link
Contributor

annaibm commented Feb 24, 2026

Thanks @dennycjacob! I will set up the environment locally to test this out and will share my feedback soon.

Copy link
Contributor

@smlambert smlambert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@smlambert smlambert merged commit 1acdf53 into adoptium:master Mar 4, 2026
7 checks passed

return (
<div>
{/* One Save Button for bothH tables */}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix typo in comment: bothHboth

baselineDisabledIterations
} = req.body;

console.log('Received update request:', {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove the console.log before merging this into production?

Annotate bad runs for both test and baseline, then SAVE
</div>
</div>
<Button
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a Tooltip to the Save button to explain why it is disabled. For example, show "Waiting for data to load..." when testStats or baselineStats is null.

@@ -0,0 +1,132 @@
const { TestResultsDB } = require('../Database');
const ObjectID = require('mongodb').ObjectID;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ObjectID is deprecated , use ObjectId from mongodb

testDisabledIterations,
baselineDisabledIterations
});

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding validation for testId, baselineId and benchmarkName before the try block. If any of these required fields are missing, the current code will throw a MongoDB internal error which is hard to debug. An explicit validation check would return a clear error message.

}
export default MetricsDetails;

export default MetricsDetails; No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a newline here

...metric,

// original rawValues
rawValues: metric.rawValues,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant rawValues and statValues fields in metrics already.?

const item = doc.aggregateInfo[key];
if (item.benchmarkName === benchmarkName &&
item.buildName &&
item.buildName.includes(buildType)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

buildName.includes(buildType) could produce false positives if any build name contains test or baseline as a substring, for example "build-protest-aarch64" would accidentally match test. Consider using a regex?

error: error.message
});
}
}; No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a newline


if (!updated) {
console.error(`Benchmark ${benchmarkName} with type ${buildType} not found`);
return { success: false, error: `Benchmark not found` };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Misleading error message Benchmark not found when build type doesn't match.Consider separating the two checks with specific error messages for each case.Example:

if (!benchmarkFound) {
    return { 
        success: false, 
        error: `Benchmark "${benchmarkName}" not found` 
    };
}

if (!updated) {
    return { 
        success: false, 
        error: `Benchmark "${benchmarkName}" found but build type "${buildType}" did not match` 
    };
}

@smlambert
Copy link
Contributor

Apologies @annaibm - I merged this ahead of seeing your review comments. Will need a follow-up PR to apply the changes you have suggested.

@annaibm
Copy link
Contributor

annaibm commented Mar 4, 2026

No worries! I think review submit button for me didn't go properly. Created a follow-up issue to track the comments in review: https://github.ibm.com/runtimes/automation/issues/884

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants