Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
b727647
Compile worked targetting Java 17.
MikeNeilson Sep 29, 2026
a53305e
Start shifting annotations.
MikeNeilson Sep 29, 2026
0fb5ac8
Batch of controllers.
MikeNeilson Sep 30, 2026
bff5519
Batch of controllers.
MikeNeilson Sep 30, 2026
1c9f91c
Disable ci build while changes are worked through.
MikeNeilson Sep 30, 2026
e3fcba9
Another batch.
MikeNeilson Sep 30, 2026
c8ac9c9
Batch of controllers.
MikeNeilson Sep 30, 2026
6f6d3d6
Last controllers.
MikeNeilson Sep 30, 2026
2fe5e11
Start on baseline javalin changes.
MikeNeilson Sep 30, 2026
186e8f2
Start on tests
MikeNeilson Oct 1, 2026
4a5420f
'./gradlew run' 'works'
MikeNeilson Oct 1, 2026
e8172f8
UI renders. (at root context.)
MikeNeilson Oct 1, 2026
b86f739
Tests compile.
MikeNeilson Oct 1, 2026
fe8b041
Fix compile issue.
MikeNeilson Oct 1, 2026
0eb804f
At least AccessManagerTestIt runs and passes.
MikeNeilson Oct 2, 2026
77dca6d
Update behavior.
MikeNeilson Oct 2, 2026
595acb0
Centralized validation setup.
MikeNeilson Oct 5, 2026
0d5cfbb
Sort out behavioral different with content type charasets.
MikeNeilson Oct 5, 2026
70c101b
Correct value retrieval for updated Validation class.
MikeNeilson Oct 5, 2026
cc9d82b
restore rate limiting.
MikeNeilson Oct 5, 2026
75f608b
Rate limiting actually working.
MikeNeilson Oct 5, 2026
106ad5d
Primary intergration tests pass.
MikeNeilson Oct 5, 2026
effdd0b
Enable integration tests for CI build.
MikeNeilson Oct 5, 2026
439f8e2
Restore base feature properties file.
MikeNeilson Oct 5, 2026
cd5fa88
Start on unit/functional tests.
MikeNeilson Oct 5, 2026
c0bd30f
ControllerTest passing with new Context test double.
MikeNeilson Oct 6, 2026
78fd1ed
Non integration tests working or removed.
MikeNeilson Oct 6, 2026
3c710a9
Enable test runs.
MikeNeilson Oct 6, 2026
571362e
Open API tests passing.
MikeNeilson Oct 6, 2026
8a1fe85
Cleanup.
MikeNeilson Oct 6, 2026
a622d0b
Fix path matching logic.
MikeNeilson Oct 6, 2026
65fb5ac
Correctly reanable tests.
MikeNeilson Oct 6, 2026
a80d21b
Correct? spec modification.
MikeNeilson Oct 6, 2026
41049f5
config changes for plugin update.
MikeNeilson Oct 6, 2026
2061710
Can run from app installDist directory.
MikeNeilson Oct 6, 2026
9ef7959
use provided port. docker compose instance starts.
MikeNeilson Oct 6, 2026
a788d7c
allow UI to render in treafik proxy url.
MikeNeilson Oct 6, 2026
532a156
Initial start on OpenAPI output spec modification.
MikeNeilson Oct 6, 2026
49599e6
Update Security Scheme processing.
MikeNeilson Oct 6, 2026
a0f3b4a
Work on cleaning up the OpenAPI output.
MikeNeilson Oct 7, 2026
0caaa5b
Cleanup API spec.
MikeNeilson Oct 7, 2026
9990310
Enable ci jobs.
MikeNeilson Oct 7, 2026
6e58867
Correct test.
MikeNeilson Oct 7, 2026
d54b2c4
Correct test for non-null contraint.
MikeNeilson Oct 7, 2026
9419aee
Additional corrections from #1908
MikeNeilson Oct 7, 2026
6e0da0b
Correct tests.
MikeNeilson Oct 7, 2026
a6bfbfc
TypeScript generate builds.
MikeNeilson Oct 7, 2026
49daea5
Cleanup.
MikeNeilson Oct 7, 2026
a1c1fd8
update checkout action.
MikeNeilson Oct 7, 2026
903ede5
Correct test and auth change given UI moved to root.
MikeNeilson Oct 7, 2026
4f2ccb1
Actually correct reference URL.
MikeNeilson Oct 7, 2026
2fba62e
Fix docker file.
MikeNeilson Oct 7, 2026
4b7ffaf
reorder Dockerfile build stage.
MikeNeilson Oct 7, 2026
fb0459b
Fix test.
MikeNeilson Oct 7, 2026
262122c
Attempt to fix user role tests.
MikeNeilson Oct 7, 2026
e70b08d
Tweak logging.
MikeNeilson Oct 7, 2026
c71100c
Apply batched suggestions from code review
MikeNeilson Oct 8, 2026
f33701d
Apply batched suggestions from code review
MikeNeilson Oct 8, 2026
456f177
MOve test code to test directory.
MikeNeilson Oct 8, 2026
9480ab8
Correct comment.
MikeNeilson Oct 8, 2026
2874736
Cleanup.
MikeNeilson Oct 8, 2026
ccaf4d7
PR review cleanup.
MikeNeilson Oct 8, 2026
4d117d6
Correction after rebase.
MikeNeilson Oct 9, 2026
68df56a
Make use of newly created RatingsDocument reference.
MikeNeilson Oct 9, 2026
a7ed56c
Obtain actual version.
MikeNeilson Oct 9, 2026
962946a
Additional PR review and cleanup.
MikeNeilson Oct 9, 2026
f0bacfe
Update defaults, move retry-after to most appropriate location.
MikeNeilson Oct 9, 2026
e45b6d7
Correct module behavior or undefined paths.
MikeNeilson Oct 9, 2026
e63f15d
Set LRTS header only on paths that handle timeseries.
MikeNeilson Oct 9, 2026
5e8f76f
Some progress toward getting the correct security requirements setup.
MikeNeilson Oct 9, 2026
eece992
Security scheme assignments now set correctly.
MikeNeilson Oct 15, 2026
2a1921a
Clean and decision on examples.
MikeNeilson Oct 15, 2026
b34c4d2
Cleanup a few paths.
MikeNeilson Oct 15, 2026
2c3a657
Delete cwms-data-api/src/main/java/picocli directory
MikeNeilson Oct 15, 2026
dfe6eaa
Additional corrections.
MikeNeilson Oct 16, 2026
a136789
Additional corrections.
MikeNeilson Oct 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
- name: checkout code
uses: actions/checkout@v5.0.0
uses: actions/checkout@v7.0.1
- name: setup java
uses: actions/setup-java@v5.2.0
with:
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
OPEN_API_TEST: "true"
steps:
- name: checkout code
uses: actions/checkout@v5.0.0
uses: actions/checkout@v7.0.1
- name: setup java
uses: actions/setup-java@v5.2.0
with:
Expand All @@ -118,14 +118,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v5.0.0
uses: actions/checkout@v7.0.1
- name: Build docker image
run: docker build -t cda:build-latest .
build-schema-migration-image:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v5.0.0
uses: actions/checkout@v7.0.1
# No uploads, we're just verifying that nothing broke the docker image.
- name: Build Migration image
uses: ./.github/actions/database-migration-image
Expand All @@ -143,7 +143,7 @@ jobs:
if: always() && (github.ref_name == 'develop')
steps:
- name: Badge Branch
uses: actions/checkout@v5.0.0
uses: actions/checkout@v7.0.1
with:
ref: badges
fetch-depth: 1
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/web-gui-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ on:
jobs:
audit:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/checkout@v7.0.1
- name: install node for cda-gui audit
uses: actions/setup-node@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Guidance for coding agents working in `USACE/cwms-data-api`.
- GitHub repository: `USACE/cwms-data-api`
- Primary branch: `develop`
- Product: CWMS Data API (CDA), formerly RADAR, a REST API for USACE CWMS water data.
- Runtime/build target: Java 11. Newer JDKs may work, but do not introduce Java APIs beyond Java 11.
- Runtime/build target: Java 17. Newer JDKs may work, but do not introduce Java APIs beyond Java 17.
- License/contribution model: MIT license with DCO sign-off expectations in `CONTRIBUTING.md` and `CONTRIBUTORS.md`.
- Formal `CODEOWNERS` is not present. Treat maintainership/review routing as social context, not policy. Visible long-running contributors include Mike Neilson, Ryan Ripken/RMA, Adam Korynta, Bryson Spilman, Ryan Miles, Zach Olson, and Charles Graham. Verify current reviewers on GitHub before assigning or naming people in PR text.

Expand Down
62 changes: 11 additions & 51 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
FROM gradle:8.5-jdk11 AS builder
FROM gradle:8.5-jdk17 AS builder
USER $USER
RUN --mount=type=cache,target=/home/gradle/.gradle
WORKDIR /builddir
COPY . /builddir/
RUN apt update && apt install -y curl
ENV NVM_DIR="/root/.nvm"
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
Expand All @@ -12,55 +10,15 @@ SHELL ["/bin/bash", "-c"]
RUN . "$NVM_DIR/nvm.sh" && nvm install $NODE_VERSION && nvm use $NODE_VERSION
ENV NODE_PATH=$NVM_DIR/v$NODE_VERSION/lib/node_modules
ENV PATH=$NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
RUN gradle prepareDockerBuild --info --no-daemon

FROM alpine:3.23.5 AS tomcat_base
RUN apk --no-cache upgrade && \
apk --no-cache add \
openjdk11-jre \
curl \
bash


RUN mkdir /download && \
cd /download && \
wget https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.121/bin/apache-tomcat-9.0.121.tar.gz && \
echo "16494dd4745f808d3c506807b5275521fd71044d976f441d18eeeab0f5a38bc1b5344ca395292f6f26eb7612cd8c8e746d01ccdfb29893d394052d9f4b1f4c11 *apache-tomcat-9.0.121.tar.gz" > checksum.txt && \
sha512sum -c checksum.txt && \
tar xzf apache-tomcat-*tar.gz && \
mv apache-tomcat-9.0.121 /usr/local/tomcat/ && \
cd / && \
rm -rf /usr/local/tomcat/webapps/* && \
mkdir /usr/local/tomcat/webapps/ROOT && \
printf "<%% response.sendRedirect(\"/cwms-data/\"); %%>\n" > /usr/local/tomcat/webapps/ROOT/index.jsp && \
printf "User-agent: *\nAllow: /cwms-data/\nDisallow: /cwms-data/auth/\nDisallow: /cwms-data/catalog/\nDisallow: /cwms-data/timeseries/\nDisallow: /cwms-data/swagger-docs\nDisallow: /auth/\nSitemap: https://cwms-data.usace.army.mil/sitemap.xml\n" > /usr/local/tomcat/webapps/ROOT/robots.txt && \
mkdir -p /usr/local/tomcat/conf/Catalina/localhost
# Now replace the Tomcat logging with logback
# NOTE: I have reviewed this jar in jd-gui and do not see anything malicious, packages are isolated to avoid issues
# with other code.
# Additionally, when we are not also accounting for some legacy systems, we will likely shift to
# Jetty, or Embedded Tomcat, to simplify the deployment process, making this subtitution unnecessary.
RUN cd /download && \
wget https://repo1.maven.org/maven2/com/github/tomcat-slf4j-logback/tomcat9-slf4j-logback/9.0.120/tomcat9-slf4j-logback-9.0.120.jar && \
echo "a24f49d57012472701172d8ec4509faa781a57a51e63b329441bdef80861e4550577fe703a333a7c5a6d5159ff14e96a16be631acef5df2ce14ec3c8cd6dae75 tomcat9-slf4j-logback-9.0.120.jar" > checksum.logback.txt && \
sha512sum -c checksum.logback.txt
RUN cd /download && \
cp tomcat9-slf4j-logback-9.0.120.jar /usr/local/tomcat/bin/tomcat-juli.jar && \
rm /usr/local/tomcat/conf/logging.properties && \
rm -rf /download
CMD ["/usr/local/tomcat/bin/catalina.sh","run"]

FROM tomcat_base AS api
# Do this last no everything above can cache
COPY . /builddir/
WORKDIR /builddir
RUN ./gradlew installDist -x test --info --no-daemon

COPY --from=builder /builddir/cda-gui/dist/sitemap.xml /usr/local/tomcat/webapps/ROOT/sitemap.xml
COPY --from=builder /builddir/cwms-data-api/build/docker/cda/ /usr/local/tomcat
COPY --from=builder /builddir/cwms-data-api/build/docker/context.xml /usr/local/tomcat/conf
COPY --from=builder /builddir/cwms-data-api/build/docker/server.xml /usr/local/tomcat/conf
COPY --from=builder /builddir/cwms-data-api/build/docker/setenv.sh /usr/local/tomcat/bin
COPY --from=builder /builddir/cwms-data-api/build/docker/libs/ /usr/local/tomcat/lib
COPY --from=builder /builddir/cwms-data-api/build/docker/logback.xml /logback.xml
COPY --from=builder /builddir/cwms-data-api/build/docker/logback-juli.xml /logback-juli.xml
COPY --from=builder /builddir/cwms-data-api/build/docker/app-context.xml /usr/local/tomcat/conf/Catalina/localhost/cwms-data.xml
FROM eclipse-temurin:17-jre-alpine-3.24 AS api
RUN adduser -D cda
COPY --from=builder /builddir/cwms-data-api/build/install/cwms-data-api /cda
COPY --from=builder /builddir/cwms-data-api/src/docker/logback.xml /logback.xml

ENV CDA_JDBC_DRIVER="oracle.jdbc.driver.OracleDriver"
ENV CDA_JDBC_URL=""
Expand All @@ -83,3 +41,5 @@ ENV cwms.dataapi.access.openid.idpHint=federation-eams
# used to simplify redeploy in certain contexts. Update to match -<marker> in image label
ENV IMAGE_MARKER="a"
EXPOSE 7000
USER cda
CMD ["/cda/bin/cwms-data-api", "/cwms-data", "/cda/wars/ui.war"]
1 change: 1 addition & 0 deletions access-manager-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ dependencies {
exclude group: "org.eclipse.jetty"
exclude group: "org.eclipse.jetty.websocket"
}
compileOnly (libs.bundles.javalin.openapi)
compileOnly(libs.swagger.core) {
exclude group: "jakarta.xml.bind", module: "*"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package cwms.cda.spi;

import io.javalin.http.Context;
import io.swagger.v3.oas.models.security.SecurityScheme;
//import io.swagger.v3.oas.models.security.SecurityScheme;
import io.javalin.openapi.SecurityScheme;
import java.security.Principal;


Expand Down
3 changes: 0 additions & 3 deletions buildSrc/src/main/groovy/cda.deps-conventions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ repositories {
excludeModule("javax.media", "jai_core")
}

maven {
url = uri('https://repo.maven.apache.org/maven2')
}
gradlePluginPortal()
}

Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/groovy/cda.java-conventions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ eclipse {

tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
sourceCompatibility = '11'
targetCompatibility = '11'
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
Comment thread
rma-rripken marked this conversation as resolved.
}

test {
Expand Down
1 change: 1 addition & 0 deletions cda-gui/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist
storybook-static
build
bin
34 changes: 22 additions & 12 deletions cda-gui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import com.github.gradle.node.npm.task.NpmTask
import com.github.gradle.node.npm.task.NpxTask

plugins {
id 'java'
id 'base'
id 'cda.deps-conventions'
id 'cda.java-conventions'
id 'war'
id 'com.github.node-gradle.node' version '7.1.0'
}

Expand All @@ -20,6 +23,17 @@ def cdaGuiViteMode = providers.gradleProperty('cdaGuiMode')
.orElse(providers.environmentVariable('CDA_GUI_MODE'))
.orElse('production')

dependencies {
compileOnly(libs.javalin.core) // TO get the transitive web-api spec
testImplementation(libs.javalin.core)
testImplementation(libs.bundles.junit)
testImplementation(libs.mockito.core)
}

configurations {
warOutput
}

task buildGuiVite(type:NpxTask) {
dependsOn npmInstall
command = "vite"
Expand Down Expand Up @@ -62,16 +76,12 @@ task runGuiDev(type: Exec) {
workingDir project.layout.projectDirectory
}

sourceSets {
java {
main {
resources {
srcDir(project.layout.projectDirectory.dir('dist'))
}
}
}
}

tasks.named('processResources') {
war {
dependsOn buildGui
archiveBaseName = 'cwms-data-ui'
from(project.layout.projectDirectory.dir('dist'))
}

artifacts {
warOutput tasks.war
}
21 changes: 0 additions & 21 deletions cda-gui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cda-gui/playwright.api-keys.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default defineConfig({
webServer: {
command:
"npx vite --mode dev-cda-compose --host 127.0.0.1 --port 5178 --strictPort",
url: "http://127.0.0.1:5178/cwms-data/",
url: "http://127.0.0.1:5178",
timeout: 120000,
env: {
VITE_CDA_API_ROOT: "/cwms-data",
Expand Down
2 changes: 1 addition & 1 deletion cda-gui/playwright.auth.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ export default defineConfig({
use: { baseURL: "http://127.0.0.1:18741", headless: true },
webServer: {
command: "npx vite --mode test --host 127.0.0.1 --port 18741 --strictPort",
url: "http://127.0.0.1:18741/cwms-data/",
url: "http://127.0.0.1:18741/",
},
});
2 changes: 1 addition & 1 deletion cda-gui/playwright.data-query.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default defineConfig({
webServer: {
command:
"npx vite --mode dev-cda-compose --host 127.0.0.1 --port 5184 --strictPort",
url: "http://127.0.0.1:5184/cwms-data/",
url: "http://127.0.0.1:5184",
timeout: 120000,
env: { VITE_CDA_API_ROOT: "/cwms-data" },
},
Expand Down
5 changes: 3 additions & 2 deletions cda-gui/playwright.user-roles.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ export default defineConfig({
workers: 1,
webServer: {
command: "npm run dev:onboarding",
url: "http://127.0.0.1:18742/cwms-data/",
reuseExistingServer: true,
url: "http://127.0.0.1:18742",
//reuseExistingServer: true,
env: { VITE_CDA_API_ROOT: "/cwms-data" },
},
});
8 changes: 8 additions & 0 deletions cda-gui/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
User-agent: *
Allow: /
Disallow: /auth/
Disallow: /cwms-data/auth/
Disallow: /cwms-data/catalog/
Disallow: /cwms-data/timeseries/
Disallow: /cwms-data/swagger-docs
Sitemap: https://cwms-data.usace.army.mil/sitemap.xml
2 changes: 1 addition & 1 deletion cda-gui/scripts/generate-sitemap.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const outputPath = path.join(projectDir, "dist", "sitemap.xml");
const siteOrigin = (
process.env.SITE_ORIGIN ?? "https://cwms-data.usace.army.mil"
).replace(/\/+$/, "");
const siteBasePath = (process.env.SITE_BASE_PATH ?? "/cwms-data").replace(/\/+$/, "");
const siteBasePath = (process.env.SITE_BASE_PATH ?? "").replace(/\/+$/, "");

const urls = sitemapPaths.map((routePath) => {
const normalizedPath = routePath ? `/${routePath}` : "";
Expand Down
2 changes: 1 addition & 1 deletion cda-gui/src/components/GlobalErrorBoundary.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class GlobalErrorBoundary extends Component {
<p className="mt-2 text-slate-700">
{this.state.error?.message ?? "An unexpected error occurred."}
</p>
<a className="mt-4 inline-block text-blue-700 underline" href="/cwms-data/">
<a className="mt-4 inline-block text-blue-700 underline" href="/">
Return to CDA
</a>
</main>
Expand Down
4 changes: 3 additions & 1 deletion cda-gui/src/links/header-links.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { getBasePath } from "../utils/base";

export default [
{
id: "home",
Expand All @@ -17,7 +19,7 @@ export default [
{
id: "swagger-schema",
text: "Swagger Docs Schema",
href: "/swagger-docs",
href: `${getBasePath()}swagger-docs`,
},
],
},
Expand Down
2 changes: 1 addition & 1 deletion cda-gui/src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const router = createBrowserRouter(
],
},
],
{ basename: "/cwms-data" },
{ basename: "/" },
);

ReactDOM.createRoot(document.getElementById("root")).render(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package cwms.cda.servlet;
package cwms.cda.ui;

import java.io.IOException;
import java.util.Set;
import javax.servlet.DispatcherType;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.DispatcherType;
import jakarta.servlet.Filter;
import jakarta.servlet.FilterChain;
import jakarta.servlet.RequestDispatcher;
import jakarta.servlet.ServletException;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.annotation.WebFilter;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

/**
* Converts the error dispatch used to load known client-side routes into a successful response.
Expand Down
Loading
Loading