Aman-Mittal commented on PR #625:
URL: 
https://github.com/apache/fineract-backoffice-ui/pull/625#issuecomment-5848804247

   CI red again, and this one was a genuine design flaw in the gate rather than 
another defect to fix. Worth writing down.
   
   ### The gate was wrong about deployment branding
   
   All nine `branded-deployment` specs failed with:
   
   ```
   5 translation key(s) rendered as their own name on /dashboard.
     - Members
     - Member Groups
     - Operations
     - Field CRM
     - Reporting Warehouse
   ```
   
   Those are not defects. `DOCS/CUSTOMIZATION.md` documents
   
   ```json
   "overrides": {
     "clients": { "labelKey": "Members", "icon": "person-outline", "order": 10 }
   }
   ```
   
   as the supported way a deployment renames a navigation entry, and it works 
**precisely because** ngx-translate returns an unresolved key verbatim. Every 
branded deployment therefore sends its own labels through the 
missing-translation handler, and the handler called each one a failure. The 
gate was reporting a documented feature as a bug.
   
   **Fix: the shape is the signal.** A dotted identifier arriving at the 
handler is a key that should have resolved; a phrase arriving is a deployment 
exercising a documented feature. Only the first is now reported.
   
   This costs nothing, because phrases in the application's *own* code are 
still a defect — just a statically caught one. `check:nav-ids` rejects a 
`labelKey` that is not a key and `check-translations.mjs` rejects a 
`ColumnDef.label` that is not one, both long before an e2e run. The runtime 
gate goes back to doing only what nothing else can: catching keys assembled at 
runtime.
   
   ### Which it then did
   
   One failure survived the fix, and it is the first defect on this branch that 
**no static check could have found**:
   
   ```
   1 translation key(s) rendered as their own name on /clients/view/123.
     - ACTIONS.UNDOREJECT_CLIENT
   ```
   
   `client-view.component.ts` built its dialog title as `` 
`ACTIONS.${command.toUpperCase()}_CLIENT` ``. That welds the camel hump shut: 
`undoReject` became `UNDOREJECT_CLIENT` while the catalogue defines 
`UNDO_REJECT_CLIENT`. The dialog has been titling itself 
`ACTIONS.UNDOREJECT_CLIENT`.
   
   `undoWithdraw` was broken identically and nothing had noticed — only 
`undoReject` has a spec. Now uses the camel-to-snake transformation 
`savings-account-view` already applies to its confirm keys; all eight client 
commands resolve.
   
   ### Also
   
   - Rebased onto `origin/main` (`a4770751`). All six commits re-signed, no 
conflicts.
   - Replaced the handler's key-shape regex with two linear checks — the 
original tripped `security/detect-unsafe-regex`. It could not actually 
backtrack (`\w` never matches `.`), but a suppression would have been a worse 
trade than an `includes`.
   
   ### Re-verified after rebase
   
   - `npm run lint` — clean, no warnings
   - `npm run format:check`, `npm run typecheck:e2e`, `npm run check:nav-ids` — 
clean
   - `npm run i18n:check` — all four checks pass
   - `npm run test:unit` — **1581 passed**, including 2 new tests pinning the 
deployment-override behaviour
   - `branded-deployment.spec.ts` — 9 passed (was 9 failed)
   - Full `mocked` + `mobile` run in progress; I will report it here.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to