Skip to content

Commit ad150af

Browse files
authored
Merge branch 'develop' into feature/1392-use-flogger
2 parents 0d3e1b3 + c500e48 commit ad150af

File tree

178 files changed

+6879
-1717
lines changed

Some content is hidden

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

178 files changed

+6879
-1717
lines changed

.github/workflows/build.yml

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,6 @@ jobs:
3232
distribution: 'temurin'
3333
java-version: ${{matrix.jdk}}
3434
cache: 'gradle'
35-
- name: install node for cda-gui audit
36-
uses: actions/setup-node@v4
37-
with:
38-
node-version: '22'
39-
cache: 'npm'
40-
cache-dependency-path: cda-gui/package-lock.json
41-
42-
- name: run cda-gui audit for high CVE
43-
working-directory: ./cda-gui
44-
run: |
45-
npm install --package-lock-only
46-
npm audit --audit-level=high
4735
- name: build and test
4836
id: thebuild
4937
run: ./gradlew build --info --init-script init.gradle
@@ -56,6 +44,30 @@ jobs:
5644
annotate_only: true
5745
include_passed: true
5846
report_paths: '**/TEST-*.xml'
47+
open-api-static-analysis:
48+
name: OpenApi Static Analysis Tests
49+
runs-on: ubuntu-latest
50+
env:
51+
OPEN_API_TEST: "true"
52+
steps:
53+
- name: checkout code
54+
uses: actions/checkout@v5.0.0
55+
- name: setup java
56+
uses: actions/setup-java@v5.0.0
57+
with:
58+
distribution: 'temurin'
59+
java-version: 11
60+
cache: 'gradle'
61+
- name: build and test
62+
id: thebuild
63+
run: ./gradlew :cwms-data-api:test --tests "cwms.cda.api.OpenApiDocTest" --info --init-script init.gradle
64+
- name: Publish Test Report
65+
uses: mikepenz/action-junit-report@v5
66+
if: always()
67+
with:
68+
annotate_only: true
69+
include_passed: true
70+
report_paths: '**/TEST-*.xml'
5971
build-docker-image:
6072
runs-on: ubuntu-latest
6173
steps:
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: CDA Web GUI NPM Audit (CVE)
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
pull_request:
8+
branches:
9+
- develop
10+
# Only run when relevant files change (i.e. packages are bumped into new NPM versions)
11+
paths:
12+
- "cda-gui/**"
13+
- ".github/workflows/web-gui-*.yml"
14+
15+
# Allow running audits adhoc via "run task" in the UI
16+
workflow_dispatch:
17+
18+
jobs:
19+
audit:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: install node for cda-gui audit
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: '22'
29+
cache: 'npm'
30+
cache-dependency-path: cda-gui/package-lock.json
31+
32+
- name: run cda-gui audit for critical CVE
33+
working-directory: ./cda-gui
34+
# disable husky git hooks during CI runs
35+
run: |
36+
HUSKY=0 npm ci
37+
npm audit --audit-level=critical

.readthedocs.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ build:
1010
# Build documentation in the "docs/" directory with Sphinx
1111
sphinx:
1212
configuration: docs/source/conf.py
13+
fail_on_warning: true
1314
# Optionally, but recommended,
1415
# declare the Python requirements required to build your documentation
1516
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ This is a new implementation of a REST API for data retrieval of USACE Water Dat
3838

3939
See the [📃 Wiki](https://github.com/USACE/cwms-data-api/wiki) for how to get started
4040

41+
End user documentation available here: [📕 Read the Docs](https://cwms-data-api.readthedocs.io/latest)
4142

4243
## Development notes
4344

@@ -52,7 +53,7 @@ This will compile the jar and run the basic unit tests.
5253

5354
## Development stack
5455

55-
See the README.docker-compose.md for instructions using the docker-compose environment
56+
See the docker-compose.README.md for instructions using the docker-compose environment
5657

5758
## Testing
5859

cda-gui/.eslintrc.cjs

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,17 @@ module.exports = {
22
root: true,
33
env: { browser: true, es2020: true },
44
extends: [
5-
'eslint:recommended',
6-
'plugin:react/recommended',
7-
'plugin:react/jsx-runtime',
8-
'plugin:react-hooks/recommended',
5+
"eslint:recommended",
6+
"plugin:react/recommended",
7+
"plugin:react/jsx-runtime",
8+
"plugin:react-hooks/recommended",
99
],
10-
ignorePatterns: ['dist', '.eslintrc.cjs'],
11-
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
12-
settings: { react: { version: '18.2' } },
13-
plugins: ['react-refresh'],
10+
ignorePatterns: ["dist", ".eslintrc.cjs"],
11+
parserOptions: { ecmaVersion: "latest", sourceType: "module" },
12+
settings: { react: { version: "18.2" } },
13+
plugins: ["react-refresh"],
1414
rules: {
15-
'react/jsx-no-target-blank': 'off',
16-
'react-refresh/only-export-components': [
17-
'warn',
18-
{ allowConstantExport: true },
19-
],
15+
"react/jsx-no-target-blank": "off",
16+
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
2017
},
21-
}
18+
};

cda-gui/.husky/pre-commit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
cd cda-gui
2+
npx lint-staged

cda-gui/.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"printWidth": 88,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"jsxSingleQuote": false,
6+
"singleQuote": false
7+
}

cda-gui/README.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,30 @@
11
# CDA Landing Page Source
22

3-
*The React+Vite project for CDA*
3+
_The React+Vite project for CDA_
44

5+
## Setup
6+
Setup the project by running:
7+
1. `cd cda-gui`
8+
2. `npm install` (With nodejs installed)
9+
10+
## Development
511

612
To run the project in dev:
713
`npm run dev`
814

15+
## Production Files
916
To build the project:
1017
`npm run build`
11-
*NOTE*: Building the project will also deploy it to the required tomcat webapps directory `webapp`
1218

13-
To see the available scripts for this project, including how to run and deploy, look at the `package.json` file.
19+
To see the available scripts for this project, including how to run and deploy, look at the `package.json` file.
20+
21+
22+
## Formatting
23+
24+
Formatting is done with [husky](https://typicode.github.io/husky/) and styled using [prettier](https://prettier.io/docs/). Husky requires a minimum Git version of 2.9
25+
26+
When you commit, after running the install command above, husky will format files for you! But you can also run the formatter with:
27+
`npx prettier --write myfile.html` or `npm run prepare`
28+
29+
Or check files with:
30+
`format:check`

cda-gui/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<!doctype html>
22
<html lang="en">
33
<head>
4-
<meta charset="UTF-8">
5-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
4+
<meta charset="UTF-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>CDA - CWMS Data API</title>
88
<meta name="Description" content="CDA CWMS Data API" />
99
</head>

0 commit comments

Comments
 (0)