mirror of
https://github.com/google/nomulus
synced 2026-07-08 17:16:54 +00:00
2ce91e3477
During our implementation of Expiry Access Period (XAP), adding a field to the Registrar entity altered database heap scan order when loadAllOf() was called without an explicit ORDER BY clause. This caused non-deterministic row shifting in the Angular console registrar table (/console/registrars), breaking golden image comparisons in ConsoleScreenshotTest. To permanently fix this root cause and guarantee deterministic UI rendering and test stability across schema evolutions, this commit introduces sorted database loading across our persistence layer. Specifically, this commit: - Adds loadAllOfSorted and loadAllOfSortedStream to TransactionManager, JpaTransactionManagerImpl, and DelegatingReplicaJpaTransactionManager. - Enforces strict allowlist regex validation (^[a-zA-Z0-9_.]+$) on property names in JpaTransactionManagerImpl before appending dynamic ORDER BY clauses, preventing JPQL/SQL injection since bind parameters cannot be used for schema identifiers. - Adds Registrar.loadAllSorted and updates RegistrarsAction to explicitly sort registrars alphabetically by registrarName and registrarId. - Updates golden screenshot ConsoleScreenshotTest_globalRole_registrars_registrarsPage.png to reflect the newly enforced deterministic alphabetical registrar ordering. - Adds comprehensive unit test coverage in JpaTransactionManagerImplTest verifying exact sorted entity retrieval across multiple fields and regex rejection of invalid field names. TAG=agy CONV=f2488c74-8b4a-43f1-9c22-d1dddbdbb4e0 BUG=http://b/531889856