From 05aca846c59a888f27933cf7e157f6ed106631b2 Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Fri, 25 Sep 2026 14:15:16 -0700 Subject: [PATCH] Fix paths for devtools move --- .../org/labkey/devtools/ToolsController.java | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/modules/devtools/src/org/labkey/devtools/ToolsController.java b/modules/devtools/src/org/labkey/devtools/ToolsController.java index ff9a105202..1b3c98aaec 100644 --- a/modules/devtools/src/org/labkey/devtools/ToolsController.java +++ b/modules/devtools/src/org/labkey/devtools/ToolsController.java @@ -584,23 +584,25 @@ public ModelAndView getView(Object o, BindException errors) throws IOException return new SimpleErrorView(errors); } + // LABKEY_ROOT/repos/labkey/server + File serverDir = new File(sourcePath).getParentFile().getParentFile().getParentFile(); List actionIds = new LinkedList<>(); // As of now, these are the only classes that specify crawler actions for (String path : List.of( - sourcePath + "/../../clientModules/adjudication/test/src/org/labkey/test/tests/adjudication/AdjudicationAbstractBaseTest.java", - sourcePath + "/../../ehrModules/ehr/test/src/org/labkey/test/tests/ehr/ComplianceTrainingTest.java", - sourcePath + "/../../limsModules/biologics/test/src/org/labkey/test/tests/biologics/BiologicsReportTest.java", - sourcePath + "/../study/test/src/org/labkey/test/tests/study", - sourcePath + "/../../../testAutomation/src/org/labkey/test/stress/HarConverter.java", - sourcePath + "/../../../testAutomation/src/org/labkey/test/util/Crawler.java" + "modules/clientModules/adjudication/test/src/org/labkey/test/tests/adjudication/AdjudicationAbstractBaseTest.java", + "modules/ehrModules/ehr/test/src/org/labkey/test/tests/ehr/ComplianceTrainingTest.java", + "modules/limsModules/biologics/test/src/org/labkey/test/tests/biologics/BiologicsReportTest.java", + "modules/platform/study/test/src/org/labkey/test/tests/study", + "testAutomation/src/org/labkey/test/stress/HarConverter.java", + "testAutomation/src/org/labkey/test/util/Crawler.java" )) { - File file = new File(path); + File file = FileUtil.appendPath(serverDir, new org.labkey.api.util.Path(path)); if (!file.exists()) { errors.reject(ERROR_MSG, FileUtil.getAbsoluteCaseSensitiveFile(file).getAbsolutePath() + ": path not found!"); - return new SimpleErrorView(errors); + continue; } addActionIds(actionIds, file); } @@ -634,8 +636,6 @@ public ModelAndView getView(Object o, BindException errors) throws IOException .append("The following " + (missingModuleActions.size() > 1 ? "actions' controllers" : "action's controller") + " could not be resolved to a module running in this deployment:") .unsafeAppend("

\n"); missingModuleActions.forEach(id -> builder.append(id.toString()).unsafeAppend("
\n")); - builder.unsafeAppend("
\n"); - builder.append("The associated module(s) might not support " + DbScope.getLabKeyScope().getDatabaseProductName() + "."); builder.unsafeAppend("

\n"); } @@ -650,7 +650,7 @@ public ModelAndView getView(Object o, BindException errors) throws IOException return new HtmlView(builder); } - private void addActionIds(List actionIds, File file) throws IOException + private void addActionIds(List actionIds, File file) { if (file.isDirectory()) { @@ -676,6 +676,10 @@ private void addActionIds(List actionIds, File file) throws actionIds.add(new ControllerActionId(matcher.group(1), matcher.group(2))); } } + catch (IOException e) + { + throw new RuntimeException(e); + } } }