Commit fffec38
committed
Merge Hongwei's PR OpenBankProject#2815 — adopt his dynamic-entity + resource-docs Lift cleanup
Adopts upstream PR OpenBankProject#2815 (Hongwei) into the local fork's develop. His PR
was opened against `aa21d891d` on upstream — before all of my recent work
landed on `origin/develop` — so we did the dynamic-entity Phase 2 work in
parallel. His implementation supersedes mine because:
1. **Transaction atomicity.** He extracted `withBusinessDBTransaction`
from `ResourceDocMiddleware` into `RequestScopeConnection`, and his
`Http4sDynamicEntity` wraps POST/PUT/DELETE in it. My Phase 2 missed
this — every DB op auto-committed, no request-scoped atomicity. Real
bug, undetected by tests because each handler does a single DB op.
2. **Cleaner Lift unregistration.** `OBPAPIDynamicEntity.routes = Nil`
+ `LiftRules.statelessDispatch.append` commented out + the Lift
OBPEndpoint handlers in `APIMethodsDynamicEntity` commented (with a
`/* DISABLED … */` block per the repo's convention). My version
kept the Lift registration as a dormant fallback, which is safer
during migration but messier as an end state.
3. **Characterization tests.** `DynamicEntityFilterAndBankAccessTest`
(275 lines) locks in GET-all `req.params` filtering (PARAM_LOCALE
exclusion) + bank-level public/community access — both edge cases I
hadn't covered. Written *before* his migration as a regression gate.
4. **Resource-docs cleanup.** Three follow-up commits (aabebc0,
35988b0, ca461f6) comment out the `ResourceDocs140..600` Lift
dispatch handlers and restore minimal stubs for the entries
`Http4sResourceDocs` still references. Independent of dynamic-entity
but on the same Lift-removal track.
Conflict resolution (3 files, all "take theirs" with one Phase-3a exception):
- `Http4sDynamicEntity.scala` (add/add) — accepted his 358-line file
verbatim (vs my 488-line version).
- `ErrorResponseConverter.scala` — accepted his `JsonResponseException`
case (extracts `(message, code)` → `OBPErrorResponse` envelope). My
`1e1047da1` `liftResponseToHttp4s` pass-through approach is superseded;
his envelope-extraction works for every test that asserts on
`(code, message)` (which is all of them today). Worth a follow-up to
swap to `liftResponseToHttp4s` if a future test asserts on Lift-side
response headers, but not blocking.
- `Http4sApp.scala` — kept his `dynamicEntityRoutes` declaration
(`Http4sDynamicEntity.wrappedRoutesDynamicEntity` — his entry-point
name) **and** my `dynamicEndpointRoutes` declaration (Phase-3a
dynamic-endpoint adapter, unrelated to his PR). De-duplicated the
`.orElse(dynamicEntityRoutes.run(req))` wire-in that auto-merge
inserted twice — kept it once at his position (right after v121).
Surviving from my fork (not affected by his PR):
- `8dfdae9ae` — DirectLogin cleanup (dead `dlServe` block removal).
- `ca4237e73` — MakerChecker TTL race resolution + stress regression
guard.
- `97c74e09e` — dynamic-endpoint Phase 3a (scoped Lift-Req shim).
- `4c262e420` — migration-doc update for dynamic-entity (still accurate
— the doc says Phase 2 is done; the *implementation* is now his).
Effectively superseded by his (no functional loss):
- `ee05e701a` — my Phase 2 Http4sDynamicEntity (his version replaces it).
- `1e1047da1` — my JsonResponseException case in ErrorResponseConverter
(his version replaces it).
Verified: 23 suites / 151 tests green —
ForceErrorValidationTest (the 5-fail regression — now green),
JsonSchemaValidationTest (the 1-fail regression — now green),
AuthenticationTypeValidationTest (same interceptor mechanism),
v6 DynamicEntityFilterAndBankAccessTest (Hongwei's new tests),
v6 DynamicEntityAccessFlagsTest, v4 DynamicendPointsTest,
DynamicIntegrationTest, DynamicResourceDocTest, DynamicEndpointHelperTest,
DynamicMessageDocTest, code.util.DynamicUtilTest,
v4 MakerCheckerTransactionRequestTest (incl. my stress regression guard).
Once Hongwei's PR is also merged into upstream and origin/develop pulls
that in, the resulting state matches this merge exactly — this lets the
fork stay green while the upstream PR completes its review.15 files changed
Lines changed: 1365 additions & 1161 deletions
File tree
- obp-api/src
- main/scala
- bootstrap/liftweb
- code/api
- ResourceDocs1_4_0
- dynamic/entity
- util
- http4s
- test/scala/code/api
- ResourceDocs1_4_0
- v4_0_0
- v6_0_0
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
Lines changed: 159 additions & 124 deletions
Large diffs are not rendered by default.
Lines changed: 592 additions & 591 deletions
Large diffs are not rendered by default.
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
73 | 78 | | |
74 | 79 | | |
75 | 80 | | |
| |||
513 | 518 | | |
514 | 519 | | |
515 | 520 | | |
| 521 | + | |
| 522 | + | |
516 | 523 | | |
517 | 524 | | |
518 | 525 | | |
| |||
Lines changed: 216 additions & 346 deletions
Large diffs are not rendered by default.
Lines changed: 23 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
54 | 61 | | |
55 | | - | |
56 | | - | |
57 | 62 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
75 | 78 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2875 | 2875 | | |
2876 | 2876 | | |
2877 | 2877 | | |
2878 | | - | |
| 2878 | + | |
| 2879 | + | |
| 2880 | + | |
| 2881 | + | |
2879 | 2882 | | |
2880 | 2883 | | |
2881 | 2884 | | |
| |||
Lines changed: 25 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
73 | 75 | | |
74 | 76 | | |
75 | 77 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | 78 | | |
89 | 79 | | |
90 | 80 | | |
91 | 81 | | |
92 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
93 | 92 | | |
94 | 93 | | |
95 | 94 | | |
96 | 95 | | |
97 | 96 | | |
98 | 97 | | |
99 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
100 | 112 | | |
101 | 113 | | |
102 | 114 | | |
| |||
Lines changed: 4 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
81 | 80 | | |
82 | 81 | | |
83 | 82 | | |
| |||
135 | 134 | | |
136 | 135 | | |
137 | 136 | | |
| 137 | + | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
141 | 140 | | |
142 | 141 | | |
143 | 142 | | |
| |||
Lines changed: 48 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
173 | 175 | | |
174 | 176 | | |
175 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
176 | 223 | | |
177 | 224 | | |
178 | 225 | | |
| |||
0 commit comments