Added Retrain All feature and improved menu styling#599
Added Retrain All feature and improved menu styling#599brendanx67 wants to merge 1 commit intorelease25.11-SNAPSHOTfrom
Conversation
* Added RetrainAllAction with Reset/Incremental modes for bulk training data management * Reset mode rebuilds training data from scratch using recent clean runs * Incremental mode uses rolling window to replace oldest runs with newer ones * Added Min/Max runs parameters (defaults 5/20) with 1.5x lookback period * Redesigned menu with active tab highlighting (rounded corners) and gold hover * All pages now set activeTab attribute for consistent menu state Co-Authored-By: Claude <noreply@anthropic.com>
| } | ||
|
|
||
| @RequiresSiteAdmin | ||
| public static class RetrainAllAction extends MutatingApiAction<Object> |
There was a problem hiding this comment.
This action extends MutatingApiAction<Object> but manually parses request parameters. Instead, you could define a form class and use MutatingApiAction<RetrainAllForm> to get automatic parameter binding, type safety, and default values.
Manual parsing like this:
String minRunsParam = req.getParameter("minRuns");
if (minRunsParam != null && !minRunsParam.isEmpty())
{
try { minRuns = Integer.parseInt(minRunsParam); }
catch (NumberFormatException ignored) { }
}
could be replaced with:
Integer minRuns = form.getMinRuns();
| public static class RetrainAllAction extends MutatingApiAction<Object> | ||
| { | ||
| @Override | ||
| public Object execute(Object o, BindException errors) |
There was a problem hiding this comment.
This method is too long. Consider refactoring. All the SQL code could be moved to the TestResultsManager class. That's the convention I normally follow.
| </style> | ||
|
|
||
| <div id="container"> | ||
| <% request.setAttribute("activeTab", "overview"); %> |
There was a problem hiding this comment.
Tab identifiers like "run", "overview", "trainingdata" are hardcoded across multiple JSPs. They could be added as constants in TestResultsController
public static class TabNames
{
public static final String OVERVIEW = "overview";
public static final String USER = "user";
public static final String RUN = "run";
public static final String LONGTERM = "longterm";
public static final String FLAGS = "flags";
public static final String TRAINING_DATA = "trainingdata";
public static final String ERRORS = "errors";
}
In the JSP
<%@ page import="static org.labkey.testresults.TestResultsController.TabNames" %>
<% request.setAttribute("activeTab", TabNames.OVERVIEW); %>
|
I left a few comments. We should refactor the |
Summary
Details
Retrain All Feature
Menu Improvements
Test plan
Co-Authored-By: Claude noreply@anthropic.com