Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
e4faecf
Compile worked targetting Java 17.
MikeNeilson Sep 29, 2026
0ba23dc
Start shifting annotations.
MikeNeilson Sep 29, 2026
2c20fd9
Batch of controllers.
MikeNeilson Sep 30, 2026
7da3cf1
Batch of controllers.
MikeNeilson Sep 30, 2026
24e4331
Disable ci build while changes are worked through.
MikeNeilson Sep 30, 2026
bde2b87
Another batch.
MikeNeilson Sep 30, 2026
44367b1
Batch of controllers.
MikeNeilson Sep 30, 2026
d576e6d
Last controllers.
MikeNeilson Sep 30, 2026
fa421c5
Start on baseline javalin changes.
MikeNeilson Sep 30, 2026
bfbfc76
Start on tests
MikeNeilson Oct 1, 2026
5fe0f7c
'./gradlew run' 'works'
MikeNeilson Oct 1, 2026
45cd53f
UI renders. (at root context.)
MikeNeilson Oct 1, 2026
18ef5e3
Tests compile.
MikeNeilson Oct 1, 2026
c5ee509
Fix compile issue.
MikeNeilson Oct 1, 2026
188e46a
At least AccessManagerTestIt runs and passes.
MikeNeilson Oct 2, 2026
424e6e1
Update behavior.
MikeNeilson Oct 2, 2026
94fb4ce
Centralized validation setup.
MikeNeilson Oct 5, 2026
c93e307
Sort out behavioral different with content type charasets.
MikeNeilson Oct 5, 2026
323dbc6
Correct value retrieval for updated Validation class.
MikeNeilson Oct 5, 2026
26d875a
restore rate limiting.
MikeNeilson Oct 5, 2026
c8f28c3
Rate limiting actually working.
MikeNeilson Oct 5, 2026
3d16bd6
Primary intergration tests pass.
MikeNeilson Oct 5, 2026
f26d82b
Enable integration tests for CI build.
MikeNeilson Oct 5, 2026
13f4c26
Restore base feature properties file.
MikeNeilson Oct 5, 2026
93bf820
Start on unit/functional tests.
MikeNeilson Oct 5, 2026
2bfbf12
ControllerTest passing with new Context test double.
MikeNeilson Oct 6, 2026
2ef1a43
Non integration tests working or removed.
MikeNeilson Oct 6, 2026
36afb08
Enable test runs.
MikeNeilson Oct 6, 2026
75add96
Open API tests passing.
MikeNeilson Oct 6, 2026
e575813
Cleanup.
MikeNeilson Oct 6, 2026
341d09b
Fix path matching logic.
MikeNeilson Oct 6, 2026
a92ccd5
Correctly reanable tests.
MikeNeilson Oct 6, 2026
2681150
Correct? spec modification.
MikeNeilson Oct 6, 2026
40a5340
config changes for plugin update.
MikeNeilson Oct 6, 2026
6689522
Can run from app installDist directory.
MikeNeilson Oct 6, 2026
4db2efc
use provided port. docker compose instance starts.
MikeNeilson Oct 6, 2026
1459ebc
allow UI to render in treafik proxy url.
MikeNeilson Oct 6, 2026
d7c70d8
Initial start on OpenAPI output spec modification.
MikeNeilson Oct 6, 2026
ca6b82d
Update Security Scheme processing.
MikeNeilson Oct 6, 2026
b2b1076
Work on cleaning up the OpenAPI output.
MikeNeilson Oct 7, 2026
34b48a6
Cleanup API spec.
MikeNeilson Oct 7, 2026
b2f5ce2
Enable ci jobs.
MikeNeilson Oct 7, 2026
de91d60
Correct test.
MikeNeilson Oct 7, 2026
7c880f5
Correct test for non-null contraint.
MikeNeilson Oct 7, 2026
c36af19
Additional corrections from #1908
MikeNeilson Oct 7, 2026
b950abf
Correct tests.
MikeNeilson Oct 7, 2026
1dcde93
TypeScript generate builds.
MikeNeilson Oct 7, 2026
381934b
Cleanup.
MikeNeilson Oct 7, 2026
88c1814
update checkout action.
MikeNeilson Oct 7, 2026
1840500
Correct test and auth change given UI moved to root.
MikeNeilson Oct 7, 2026
0263cc0
Actually correct reference URL.
MikeNeilson Oct 7, 2026
694d8c3
Fix docker file.
MikeNeilson Oct 7, 2026
b4258de
reorder Dockerfile build stage.
MikeNeilson Oct 7, 2026
78ddb3d
Fix test.
MikeNeilson Oct 7, 2026
596fc76
Attempt to fix user role tests.
MikeNeilson Oct 7, 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
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
}

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