Skip to content

Commit 8040604

Browse files
authored
Merge pull request #2904 from hongwei1/chore/remove-retired-lift-standards
refactor: remove retired API standards and superseded Lift stubs
2 parents a3c101e + 9ade982 commit 8040604

377 files changed

Lines changed: 16071 additions & 106615 deletions

File tree

Some content is hidden

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

‎.github/jmx_exporter.config‎

Lines changed: 0 additions & 15 deletions
This file was deleted.

‎.github/logback.xml‎

Lines changed: 0 additions & 13 deletions
This file was deleted.

‎.github/workflows/auto_update_base_image.yml_disabled‎

Lines changed: 0 additions & 44 deletions
This file was deleted.

‎.github/workflows/build_container.yml‎

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,18 @@ jobs:
200200
# discovery excludes this same prefix so no test runs in both shards.
201201
test_filter: >-
202202
code.api.v4_0_0.Dynamic
203+
- shard: 10
204+
name: "PropGatedPublicEndpoint (read_*_requires_role=true)"
205+
# JsonSchemaValidationPublicPropTrueTest / AuthenticationTypeValidationPublicPropTrueTest
206+
# need read_json_schema_validation_requires_role /
207+
# read_authentication_type_validation_requires_role forced true, which is baked into
208+
# Http4s400's ResourceDoc error list at object-init time -- a value only one JVM can
209+
# observe. Every other shard boots with these props unset (false, the default) and
210+
# the pom.xml default tagsToExclude skips this tag there. This shard is the only place
211+
# the true branch is exercised; see the "Run tests" step's shard-10 special case below.
212+
test_filter: >-
213+
code.api.v4_0_0.JsonSchemaValidationPublicPropTrueTest
214+
code.api.v4_0_0.AuthenticationTypeValidationPublicPropTrueTest
203215
204216
services:
205217
redis:
@@ -373,6 +385,18 @@ jobs:
373385
FILTER="${FILTER}${EXTRAS}"
374386
fi
375387
388+
# Shard 10: PropGatedPublicEndpoint tests need read_json_schema_validation_requires_role /
389+
# read_authentication_type_validation_requires_role forced true and the
390+
# PropGatedPublicEndpoint tag included (pom.xml's default tagsToExclude skips it
391+
# everywhere else). These two OBP_* env vars and the tag override apply only to this
392+
# shard's mvn invocation below.
393+
EXTRA_MVN_ARGS=""
394+
if [ "${{ matrix.shard }}" = "10" ]; then
395+
export OBP_READ_JSON_SCHEMA_VALIDATION_REQUIRES_ROLE="true"
396+
export OBP_READ_AUTHENTICATION_TYPE_VALIDATION_REQUIRES_ROLE="true"
397+
EXTRA_MVN_ARGS="-DtagsToInclude=PropGatedPublicEndpoint -Dtest.tagsToExclude="
398+
fi
399+
376400
# `mvn process-resources scalatest:test` — run process-resources (copies the
377401
# dynamically-generated props from src/main/resources onto the classpath at
378402
# target/classes/props) then the scalatest:test goal. This SKIPS the
@@ -391,7 +415,7 @@ jobs:
391415
set +e
392416
MAVEN_OPTS="-Xmx3G -Xss2m -XX:MaxMetaspaceSize=1G" \
393417
timeout 1500 mvn process-resources scalatest:test -pl obp-commons,obp-api -DfailIfNoTests=false \
394-
-DwildcardSuites="$FILTER" \
418+
-DwildcardSuites="$FILTER" $EXTRA_MVN_ARGS \
395419
> maven-build-shard${{ matrix.shard }}.log 2>&1
396420
rc=$?
397421
set -e
@@ -438,6 +462,20 @@ jobs:
438462
echo "No failing tests detected in shard ${{ matrix.shard }}."
439463
fi
440464
465+
# "No failures" is not "it ran". A shard whose filter matches nothing, or
466+
# whose tag override stops taking effect, executes zero tests, matches no
467+
# failure pattern and reports green -- the same false green the
468+
# process-resources note above guards against, from a different direction.
469+
# Shard 10 is the exposed one: its suites only run while
470+
# -DtagsToInclude=PropGatedPublicEndpoint -Dtest.tagsToExclude= holds.
471+
RAN=$(grep -oE "Tests: succeeded [0-9]+" maven-build-shard${{ matrix.shard }}.log \
472+
| awk '{s+=$3} END {print s+0}')
473+
echo "Shard ${{ matrix.shard }} executed ${RAN} tests."
474+
if [ "${RAN}" -eq 0 ]; then
475+
echo "Shard ${{ matrix.shard }} ran no tests at all — treating as failure."
476+
exit 1
477+
fi
478+
441479
- name: Upload Maven build log — shard ${{ matrix.shard }}
442480
if: always()
443481
uses: actions/upload-artifact@v4

‎.github/workflows/build_pull_request.yml‎

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,18 @@ jobs:
194194
# discovery excludes this same prefix so no test runs in both shards.
195195
test_filter: >-
196196
code.api.v4_0_0.Dynamic
197+
- shard: 10
198+
name: "PropGatedPublicEndpoint (read_*_requires_role=true)"
199+
# JsonSchemaValidationPublicPropTrueTest / AuthenticationTypeValidationPublicPropTrueTest
200+
# need read_json_schema_validation_requires_role /
201+
# read_authentication_type_validation_requires_role forced true, which is baked into
202+
# Http4s400's ResourceDoc error list at object-init time -- a value only one JVM can
203+
# observe. Every other shard boots with these props unset (false, the default) and
204+
# the pom.xml default tagsToExclude skips this tag there. This shard is the only place
205+
# the true branch is exercised; see the "Run tests" step's shard-10 special case below.
206+
test_filter: >-
207+
code.api.v4_0_0.JsonSchemaValidationPublicPropTrueTest
208+
code.api.v4_0_0.AuthenticationTypeValidationPublicPropTrueTest
197209
198210
services:
199211
redis:
@@ -377,6 +389,18 @@ jobs:
377389
FILTER="${FILTER}${EXTRAS}"
378390
fi
379391
392+
# Shard 10: PropGatedPublicEndpoint tests need read_json_schema_validation_requires_role /
393+
# read_authentication_type_validation_requires_role forced true and the
394+
# PropGatedPublicEndpoint tag included (pom.xml's default tagsToExclude skips it
395+
# everywhere else). These two OBP_* env vars and the tag override apply only to this
396+
# shard's mvn invocation below.
397+
EXTRA_MVN_ARGS=""
398+
if [ "${{ matrix.shard }}" = "10" ]; then
399+
export OBP_READ_JSON_SCHEMA_VALIDATION_REQUIRES_ROLE="true"
400+
export OBP_READ_AUTHENTICATION_TYPE_VALIDATION_REQUIRES_ROLE="true"
401+
EXTRA_MVN_ARGS="-DtagsToInclude=PropGatedPublicEndpoint -Dtest.tagsToExclude="
402+
fi
403+
380404
# `mvn process-resources scalatest:test` — run process-resources (copies the
381405
# dynamically-generated props from src/main/resources onto the classpath at
382406
# target/classes/props) then the scalatest:test goal. This SKIPS the
@@ -395,7 +419,7 @@ jobs:
395419
set +e
396420
MAVEN_OPTS="-Xmx3G -Xss2m -XX:MaxMetaspaceSize=1G" \
397421
timeout 1500 mvn process-resources scalatest:test -pl obp-commons,obp-api -DfailIfNoTests=false \
398-
-DwildcardSuites="$FILTER" \
422+
-DwildcardSuites="$FILTER" $EXTRA_MVN_ARGS \
399423
> maven-build-shard${{ matrix.shard }}.log 2>&1
400424
rc=$?
401425
set -e
@@ -442,6 +466,20 @@ jobs:
442466
echo "No failing tests detected in shard ${{ matrix.shard }}."
443467
fi
444468
469+
# "No failures" is not "it ran". A shard whose filter matches nothing, or
470+
# whose tag override stops taking effect, executes zero tests, matches no
471+
# failure pattern and reports green -- the same false green the
472+
# process-resources note above guards against, from a different direction.
473+
# Shard 10 is the exposed one: its suites only run while
474+
# -DtagsToInclude=PropGatedPublicEndpoint -Dtest.tagsToExclude= holds.
475+
RAN=$(grep -oE "Tests: succeeded [0-9]+" maven-build-shard${{ matrix.shard }}.log \
476+
| awk '{s+=$3} END {print s+0}')
477+
echo "Shard ${{ matrix.shard }} executed ${RAN} tests."
478+
if [ "${RAN}" -eq 0 ]; then
479+
echo "Shard ${{ matrix.shard }} ran no tests at all — treating as failure."
480+
exit 1
481+
fi
482+
445483
- name: Upload Maven build log — shard ${{ matrix.shard }}
446484
if: always()
447485
uses: actions/upload-artifact@v4

‎CLAUDE.md‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
- Commit messages, code comments, and PR titles/descriptions: no AI/tool names (Claude, GPT, Copilot, etc.), no AI-typical filler phrasing ("Certainly!", "I'll help you with..."), no emoji, no "AI-generated"/"LLM" labels. Use plain Conventional Commits style (`fix:`, `feat:`, `refactor:`, ...) and set commit author/committer to the actual person directing the work.
77
- **Goal is full http4s migration** — eliminate Lift Web and all deprecated libraries entirely. Treat Lift code as temporary scaffolding to be removed, not maintained. When fixing bugs or adding features, always prefer the http4s path.
88
- **Versioning is tech-agnostic** — API version numbers reflect API signature changes (new/changed fields, new behaviour), never the underlying framework. A framework migration (Lift → http4s) happens in-place at the existing version; it does not justify a version bump.
9-
- **`APIMethodsXYZ.scala` (Lift) files are the source of truth for migration.** The commented-out Lift ResourceDocs and endpoints inside each `APIMethodsXYZ.scala` are the canonical reference for what the http4s version should match: URL templates, verb casing, summaries, descriptions, example bodies, error lists, tags. **Do NOT edit these files to make the parity audit pass.** The audit compares http4s against the Lift source-of-truth — when it flags a diff, the fix is to either (a) update http4s to match Lift, or (b) document the difference at the http4s site as a known intentional drift (e.g. a placeholder rename for `ResourceDocMatcher` middleware, or an upstream-driven case-class shape change). Rewriting the Lift comments to match http4s runs the comparison backwards and destroys the historical record. See `scripts/check_lift_http4s_resource_doc_parity.py` for the audit, and `scripts/rehydrate_resource_docs.py` / `scripts/restore_resource_doc_bodies.py` for the canonical Lift → http4s restoration tools.
9+
- **`scripts/resource_doc_baseline/lift_resource_docs_vX_Y_Z.json` is the source of truth for migration.** The 12 `APIMethodsXYZ.scala` files that used to hold this as commented-out Lift `ResourceDoc` text have been deleted (they had shrunk to thin runtime shims plus ~60,000 lines of dead comments — see git history for their last content, or `scripts/resource_doc_baseline/README.md` for the full story). The JSON baseline is the canonical reference for what the http4s version should match: URL templates, verb casing, summaries, descriptions, example bodies, error lists, tags — each field stored as the literal, unevaluated Scala source snippet it always was. **Do NOT hand-edit this JSON to make the parity audit pass**, for the same reason you never edited the old Lift comments for that purpose: it's the historical record the audit compares http4s against. When the audit flags a diff, the fix is to either (a) update http4s to match the baseline, or (b) if it's a reviewed, intentional difference, add a digest-bound entry to `scripts/resource_doc_baseline/parity_allowlist.json` (see that directory's README for the exact workflow — use `allowlist_helper.py`, don't hand-compute digests). See `scripts/check_lift_http4s_resource_doc_parity.py` for the audit (now reads the JSON baseline on the Lift side, live `.scala` on the http4s side), and `scripts/rehydrate_resource_docs.py` / `scripts/restore_resource_doc_bodies.py` for the canonical baseline → http4s restoration tools (also JSON-sourced now).
1010

1111
## Architecture (Onboarding)
1212

@@ -115,7 +115,7 @@ But: if the inline check uses the **same** role as the doc (e.g. v5 `createAccou
115115

116116
**`StoredProcedureUtils` in tests**: `StoredProcedureUtils` has a constructor block that requires `stored_procedure_connector.*` props. In the test environment these aren't set, so the first access to the object (inside `Future { StoredProcedureUtils.getHealth() }`) throws and returns 500. Only test the 401/403 scenarios for `getStoredProcedureConnectorHealth` — skip the 200 scenario.
117117

118-
**`resource-docs` version dispatch**: `GET /obp/v7.0.0/resource-docs/API_VERSION/obp` accepts any valid API version string. Delegates to `ResourceDocs140.ImplementationsResourceDocs.getResourceDocsList(requestedApiVersion)` which dispatches per version (v7.0.0 → `Http4s700.resourceDocs`, v6.0.0 → `OBPAPI6_0_0.allResourceDocs`, etc.). An invalid/unknown version string returns 400.
118+
**`resource-docs` version dispatch**: `GET /obp/v7.0.0/resource-docs/API_VERSION/obp` accepts any valid API version string. Delegates to `ResourceDocs140.ImplementationsResourceDocs.getResourceDocsList(requestedApiVersion)` which dispatches per version (v7.0.0 → `Http4s700.resourceDocs`, v6.0.0 → `Http4sResourceDocAggregation.v600`, etc.). An invalid/unknown version string returns 400.
119119

120120
**System owner view** (`"owner"`) has `CAN_GET_COUNTERPARTY` and is granted to `resourceUser1` on all test accounts — safe to use as VIEW_ID in tests.
121121

@@ -274,7 +274,7 @@ Perf note: integration tests are DB/HTTP-bound (~0.4 s/test) on both frameworks;
274274

275275
### Shard assignment
276276

277-
Shards are defined per-matrix-entry in `.github/workflows/build_pull_request.yml` and `.github/workflows/build_container.yml` (both files carry an identical 9-shard matrix — update both when reshaping). Shard 8 runs a **catch-all**: any `.scala` test file whose package is not covered by shards 1–7 and 9 is appended automatically at runtime — new packages are never silently skipped. Extras are printed in the step log under `"Catch-all extras added to shard 8"`. Shard 1 (`code.api.v4_0_0` non-Dynamic) is itself discovered at runtime rather than hand-listed — see the "Run tests" step's `matrix.shard = 1` branch — specifically so a newly added class in that package can never fall through both shard 1 and the catch-all.
277+
Shards are defined per-matrix-entry in `.github/workflows/build_pull_request.yml` and `.github/workflows/build_container.yml` (both files carry an identical 10-shard matrix — update both when reshaping). Shard 8 runs a **catch-all**: any `.scala` test file whose package is not covered by shards 1–7, 9, and 10 is appended automatically at runtime — new packages are never silently skipped. Extras are printed in the step log under `"Catch-all extras added to shard 8"`. Shard 1 (`code.api.v4_0_0` non-Dynamic) is itself discovered at runtime rather than hand-listed — see the "Run tests" step's `matrix.shard = 1` branch — specifically so a newly added class in that package can never fall through both shard 1 and the catch-all.
278278

279279
| Package prefix | Shard |
280280
|---|---|
@@ -288,6 +288,9 @@ Shards are defined per-matrix-entry in `.github/workflows/build_pull_request.yml
288288
| `code.connector`, `code.util`, `code.api.Authentication*`, `code.api.dauthTest`, `code.api.DirectLoginTest`, `code.api.gateWayloginTest`, `code.api.OBPRestHelperTest`, `code.entitlement`, `code.bankaccountcreation`, `code.bankconnectors`, `code.container`, `code.management`, `code.metrics`, `code.concurrency` | 8 |
289289
| anything else | **8** (catch-all) |
290290
| `code.api.v4_0_0.Dynamic*` | 9 |
291+
| `code.api.v4_0_0.JsonSchemaValidationPublicPropTrueTest`, `code.api.v4_0_0.AuthenticationTypeValidationPublicPropTrueTest` (tagged `PropGatedPublicEndpoint`) | 10 |
292+
293+
Shard 10 is a special case: it's the only shard that overrides pom.xml's default `tagsToExclude` (which otherwise skips `PropGatedPublicEndpoint` everywhere) and sets `OBP_READ_JSON_SCHEMA_VALIDATION_REQUIRES_ROLE`/`OBP_READ_AUTHENTICATION_TYPE_VALIDATION_REQUIRES_ROLE=true`, because those two props are baked into `Http4s400`'s `ResourceDoc` error lists at object-init time — a single JVM can only ever observe one value of each, so the `true` branch needs its own shard while every other shard (which boots with the props unset, i.e. `false`) exercises the default branch. `run_tests_parallel.sh` (local runner) mirrors this with a dedicated sequential step after its 4 main shards — see that script's own comment near `PropGatedPublicEndpoint`.
291294

292295
To explicitly move a package to a different shard, add it to that shard's `test_filter` block — it will be excluded from the catch-all automatically. `run_tests_parallel.sh` (local runner) uses a coarser 4-shard layout that folds all 9 CI shards' coverage into 4 wildcardSuites groups — see its own header comment for the mapping.
293296

‎CONTRIBUTING.md‎

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -172,39 +172,6 @@ class FundsAvailableTest extends V310ServerSetup {
172172
}
173173
```
174174

175-
## Code Generation
176-
177-
We support to generate the OBP-API code from the following three types of json. You can choose one of them as your own requirements.
178-
179-
1 Choose one of the following types: type1 or type2 or type3
180-
2 Modify the json file your selected, for now, we only support these three types: String, Double, Int. other types may throw the exceptions
181-
3 Run the Main method according to your json file
182-
4 Run/Restart OBP-API project.
183-
5 Run API_Exploer project to test your new APIs. (click the Tag `APIBuilder B1)
184-
185-
Here are the three types:
186-
187-
Type1: If you use `modelSource.json`, please run `APIBuilderModel.scala` main method
188-
189-
```
190-
/OBP-API/obp-api/src/main/resources/apiBuilder/APIModelSource.json
191-
/OBP-API/obp-api/src/main/scala/code/api/APIBuilder/APIBuilderModel.scala
192-
```
193-
194-
Type2: If you use `apisResource.json`, please run `APIBuilder.scala` main method
195-
196-
```
197-
/OBP-API/obp-api/src/main/resources/apiBuilder/apisResource.json
198-
OBP-API/src/main/scala/code/api/APIBuilder/APIBuilder.scala
199-
```
200-
201-
Type3: If you use `swaggerResource.json`, please run `APIBuilderSwagger.scala` main method
202-
203-
```
204-
/OBP-API/obp-api/src/main/resources/apiBuilder/swaggerResource.json
205-
OBP-API/src/main/scala/code/api/APIBuilder/APIBuilderSwagger.scala
206-
```
207-
208175
## Issues
209176

210177
If would like to report an issue or suggest any kind of improvement please use Github Issues.

0 commit comments

Comments
 (0)