Skip to content

Commit 9ced639

Browse files
committed
Revert "Merge branch 'develop' into 26.3_fb_spring_boot_4_1_0"
This reverts commit 50126b9, reversing changes made to ca483d1.
1 parent 50126b9 commit 9ced639

55 files changed

Lines changed: 1976 additions & 1378 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ remoteapi/
2020
server/modules/
2121
server/testAutomation/
2222
tools/
23-
clientAPIs/*
24-
!clientAPIs/README.md
2523

2624
# Include the remoteapi README -- this line will override previous exclusion
2725
!remoteapi/README.md
@@ -52,13 +50,3 @@ clientAPIs/*
5250
.idea/misc.xml
5351
.idea/vcs.xml
5452
.idea/sqldialects.xml
55-
56-
# AI files
57-
.claude/settings.local.json
58-
.claude/hooks/*.log
59-
.playwright-mcp/
60-
.vscode/
61-
62-
# Python bytecode
63-
__pycache__/
64-
*.pyc

.idea/codeInsightSettings.xml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/fileTemplates/WebDriverTestClass.java

Lines changed: 0 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/fileTemplates/WebDriverTestComponent.java

Lines changed: 0 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/fileTemplates/WebDriverTestPage.java

Lines changed: 0 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 0 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CLAUDE.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
LabKey Server is a large Java web application platform for biomedical research data management. It uses a modular monolith architecture with 150+ Gradle modules, built on Spring Boot 4 / Spring Framework 7 with embedded Tomcat 11. It targets Java 25 and supports both PostgreSQL and MS SQL Server databases.
8+
9+
## Build Commands
10+
11+
```bash
12+
# Configure IntelliJ IDEA project files
13+
./gradlew ijConfigure
14+
15+
# Select database (populates application.properties from templates)
16+
./gradlew pickPg # PostgreSQL
17+
./gradlew pickMssql # MS SQL Server
18+
19+
# Build and deploy to embedded Tomcat
20+
./gradlew deployApp
21+
22+
# Build a specific module
23+
./gradlew :server:modules:platform:core:build
24+
25+
# Build with a predefined module set
26+
./gradlew -PmoduleSet=community build
27+
28+
# Exclude test modules for faster builds
29+
./gradlew -PexcludeTestModules build
30+
31+
# Build a distribution
32+
./gradlew -PmoduleSet=distributions :distributions:base:dist
33+
```
34+
35+
## Running Tests
36+
37+
**Unit tests** are static `TestCase` inner classes within production source files. They are registered via the module's `getUnitTests()` method and run within the server JVM.
38+
39+
**Integration tests** require a running server and database. They are registered via `getIntegrationTests()`.
40+
41+
**Selenium UI tests** (in `server/testAutomation/`):
42+
```bash
43+
./gradlew :server:testAutomation:initProperties # Generate test.properties
44+
./gradlew :server:testAutomation:uiTests -Psuite=DRT # Run a test suite
45+
```
46+
UI tests require a running LabKey server, a browser driver (ChromeDriver or Geckodriver) on PATH, and configured `test.properties`.
47+
48+
## Architecture
49+
50+
### Module System
51+
52+
Each module lives under `server/modules/` and contains:
53+
- `module.properties` — metadata including `ModuleClass`, `SchemaVersion`, `SupportedDatabases`
54+
- `build.gradle` — uses `org.labkey.build.module` plugin
55+
- A module class extending `SpringModule` (which extends `DefaultModule` implementing `Module`)
56+
57+
Module lifecycle methods in order: `init()``versionUpdate()``afterUpdate()``startup()``startupAfterSpringConfig()``startBackgroundThreads()``destroy()`
58+
59+
In `init()`, modules register controllers via `addController("name", Controller.class)` and set up service implementations. Controllers follow the pattern `*Controller.java`.
60+
61+
### Core Platform Modules (`server/modules/platform/`)
62+
63+
The `api` module provides the core framework (Module interface, SpringModule base class, services, utilities). Other key platform modules: `core` (auth, security, admin), `query` (SQL engine), `experiment`, `study`, `assay`, `pipeline` (job processing), `search`, `audit`, `visualization`.
64+
65+
### Entry Point
66+
67+
`server/embedded/src/org/labkey/embedded/LabKeyServer.java` — a `@SpringBootApplication` that configures embedded Tomcat, SSL/TLS, Content Security Policy, and Log4J2.
68+
69+
### Database
70+
71+
Dual database support (PostgreSQL and MS SQL Server). Configuration lives in `server/configs/application.properties`, populated by `pickPg`/`pickMssql` tasks from `pg.properties`/`mssql.properties` templates. Each module declares its `SchemaVersion` in `module.properties` and manages its own schema migrations.
72+
73+
### Frontend
74+
75+
Mix of JSPs, React (via `@labkey/components`, `@labkey/premium`), ExtJS, and vanilla JS. Modules with TypeScript have their own `package.json` and use Webpack builds (via `@labkey/build`). TypeScript code is linted and formatted with `@labkey/eslint-config`. Node.js and npm versions are pinned in `gradle.properties` and downloaded during build.
76+
77+
The path to the local copy of the `@labkey/components` package is located in the `LABKEY_UI_COMPONENTS_HOME` environment variable. The path to the local copy of `@labkey/premium` is located in the `LABKEY_UI_PREMIUM_HOME` environment variable. The local copies of the packages may contain changes related to the current branches in any of the modules that have an NPM build. For example there may be changes to the `@labkey/components` package that affect the package in the `server/modules/platform/core` module.
78+
79+
### Distributions
80+
81+
The `distributions/` directory defines 60+ distribution configurations that select which modules to package. Distributions inherit from each other (most inherit from `:distributions:base`). Distribution directory names must not collide with module names.
82+
83+
### Dependency Management
84+
85+
All external library versions are centralized in `gradle.properties` (200+ version properties). The root `build.gradle` forces consistent versions across all modules via `resolutionStrategy`. Always consult before adding, removing, or updating a third-party dependency.
86+
87+
## Java Coding Conventions
88+
89+
- **Java Streams**: Prefer `Stream` API over traditional for-loops for collection processing.
90+
- **Resources**: Use try-with-resources for automatic resource management.
91+
- **Nullability**: Use `org.jetbrains.annotations.NotNull` and `org.jetbrains.annotations.Nullable` annotations. Be explicit in public API signatures.
92+
- **Logging**: Use Log4J2. Name the static logger `LOG`, initialized via `LogHelper.getLogger()`:
93+
```java
94+
private static final Logger LOG = LogHelper.getLogger(MyClass.class, "optional description");
95+
```
96+
- **Unit tests**: Create a static `TestCase` inner class extending `Assert` in the same file as production code. Use JUnit 4 annotations (`@Test`). Register new test classes in the owning module's `getUnitTests()`.
97+
- **Selenium tests**: Subclass `BaseWebDriverTest`. Use a `@BeforeClass` for setup and override `doCleanup()` for cleanup. See `SecurityTest` as an example.
98+
- **Formatting**: Follow IntelliJ IDEA project settings in `.idea/codeStyles/Project.xml`.
99+
100+
## Key Build Properties (`gradle.properties`)
101+
102+
- `sourceCompatibility`/`targetCompatibility`: Java 25
103+
- `buildFromSource`: true (build modules from source vs. pulling artifacts)
104+
- `useLocalBuild`: use locally built artifacts
105+
- `moduleSet`: select a predefined set of modules (e.g., `community`, `all`, `distributions`)
106+
- `excludedModules`: comma-separated list of modules to exclude
107+
108+
## Search Tips
109+
110+
When searching for Java method usages, always include `*.jsp` and `*.jspf` files in addition to `*.java`. JSP files contain inline Java code and are significant callers of API methods (especially anything in `JspBase`).
111+
112+
## Pull Request Format
113+
114+
PRs should include sections for: **Rationale** (why the change is needed), **Related Pull Requests**, and **Changes** (notable items).

0 commit comments

Comments
 (0)