Skip to content

Added Retrain All feature and improved menu styling#599

Open
brendanx67 wants to merge 1 commit intorelease25.11-SNAPSHOTfrom
25.11_fb_testresults-retrain-all-and-menu-styling
Open

Added Retrain All feature and improved menu styling#599
brendanx67 wants to merge 1 commit intorelease25.11-SNAPSHOTfrom
25.11_fb_testresults-retrain-all-and-menu-styling

Conversation

@brendanx67
Copy link
Collaborator

Summary

  • 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

Details

Retrain All Feature

  • Reset mode: Deletes all existing training data and rebuilds from the most recent clean runs within a lookback period (1.5x max runs = 30 days by default)
  • Incremental mode: Rolling window that replaces oldest training runs with newer clean runs while maintaining continuity
  • Min runs (default 5): Minimum clean runs required to create training data for a computer
  • Max runs (default 20): Maximum training runs per computer; also determines lookback period
  • Clean run criteria: 0 failures, 0 leaks, no hang, full duration, not flagged, passedtests > 0

Menu Improvements

  • Active tab highlighting with rounded corners and semi-transparent background
  • Gold hover color matching original UW branding
  • Consistent activeTab attribute across all pages
  • Improved CSS organization using classes instead of inline styles

Test plan

  • Tested Reset mode on Performance Tests container
  • Verified lookback period filters out ancient data
  • Verified computers with partial data (>= minRuns but < maxRuns) appear with training data but inactive
  • Verified menu highlighting works on all pages

Co-Authored-By: Claude noreply@anthropic.com

* 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>
@brendanx67 brendanx67 requested review from vagisha February 5, 2026 18:32
}

@RequiresSiteAdmin
public static class RetrainAllAction extends MutatingApiAction<Object>
Copy link
Collaborator

Choose a reason for hiding this comment

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

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)
Copy link
Collaborator

Choose a reason for hiding this comment

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

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"); %>
Copy link
Collaborator

Choose a reason for hiding this comment

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

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); %>

@vagisha
Copy link
Collaborator

vagisha commented Feb 5, 2026

I left a few comments. We should refactor the testresults, signup and SkylineToolsStore modules to use standard LabKey base action classes (FormViewAction, FormHandlerAction, etc.), and other standard LabKey patterns as well as some basic tests. This could be a good exercise for Claude Code?

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.

2 participants