mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-29 16:10:07 +00:00
fix(ci): repair server and shared gates after the place identities change
Push run 46275645144 on dev (f69a4c1a2) was red in these jobs:
- Server types: UserPlacesRepository.create, UserPlaceMergesRepository.create
and UserPlaceLinksRepository.insert shadowed MikroORM's EntityRepository
methods with other signatures (TS2416), which also broke defineEntity on the
three entities (TS2769). They are createOwn, record and insertUses now.
- Server lint: collections.service.ts had grown to 1411 lines against 1410.
The trip tag lookup of a copy moved into collections.helpers.ts
(tripTagIdsOf, tagKeyOf); the size baseline is lowered to the 1398 it holds.
- ASTCAP-001/002/005b: the trip chat core had taken in PlacesLibraryMcp,
PlaceIdentitiesMcp and TripCollectionsMcp, so core and the tours group
offered 132 tools against 128. They load with the collections group now.
- PLIB-001, PLIB-MCP-001 and the places library e2e: the two entries named
Museum tie on the name and go by their anchor, which the expected order
hard coded the other way. The fixture orders every tie by its anchors.
- ENT-003 and CLASSFIELD-002: the five new entities and their 18 NOT NULL
columns without a default are counted.
- Shared tests: collections.ratingBadge was missing in 26 locales; each has
its translation now.
This commit is contained in:
@@ -60,14 +60,17 @@ describe('ALL_ENTITIES', () => {
|
||||
* + assistant_attachments, the files attached in the trip chat, kept with their conversation
|
||||
* + mail_ingest_addresses, _prefs, _cursor, _messages and _candidates, the forwarded
|
||||
* booking mails, the bookings read from them and the switches and addresses behind them
|
||||
* + trip_addon_overrides, the owner's per-trip on or off for a trip addon)
|
||||
* + trip_addon_overrides, the owner's per-trip on or off for a trip addon
|
||||
* + user_places, user_place_links, user_place_merges and user_place_merge_dismissals,
|
||||
* a user's own place identities, the uses they group, the merges and the dismissed pairs
|
||||
* + trip_collection_links, the lists a trip links)
|
||||
* is registered, and no two share a class name (a silent duplicate would
|
||||
* shadow one of them in `orm.getMetadata()`, exactly the kind of drift
|
||||
* `entity-schema-parity.test.ts` can't see — it iterates the metadata map,
|
||||
* which de-duplicates by class name).
|
||||
*/
|
||||
it('ENT-003: exactly 174 entities, every class name unique', () => {
|
||||
expect(ALL_ENTITIES.length).toBe(174);
|
||||
it('ENT-003: exactly 179 entities, every class name unique', () => {
|
||||
expect(ALL_ENTITIES.length).toBe(179);
|
||||
const names = ALL_ENTITIES.map((s) => s.meta.className);
|
||||
expect(new Set(names).size).toBe(names.length);
|
||||
});
|
||||
|
||||
@@ -67,7 +67,10 @@ import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest';
|
||||
// id, transport, mailbox; mail_ingest_messages: id, transport, dedupe_hash, user_id, size; mail_ingest_candidates:
|
||||
// id, message_id, user_id (each row is written whole by the mail import, which always knows all of them).
|
||||
// + trip_addon_overrides: trip_id, addon_id, enabled (an override is only ever written whole, by the trip owner).
|
||||
const KNOWN_UNINITIALISED_NOT_NULL_SCALARS = 635;
|
||||
// + user_places: id, user_id, name; user_place_links: id, user_place_id, user_id; user_place_merges: id, user_id,
|
||||
// leading_id, merged_id, moved_link_ids; user_place_merge_dismissals: id, user_id, key_a, key_b;
|
||||
// trip_collection_links: id, trip_id, collection_id (each row is written whole by the places library or the trip).
|
||||
const KNOWN_UNINITIALISED_NOT_NULL_SCALARS = 653;
|
||||
|
||||
describe('entity class fields never carry a NaN initialiser (task-4-review-shape.md, Important 1)', () => {
|
||||
it('CLASSFIELD-001: new X() has no own property whose value is NaN, across all 133 entities', () => {
|
||||
|
||||
@@ -13,7 +13,13 @@ import { PlacesLibraryService, type LibraryUser } from '../../../../src/nest/pla
|
||||
import { createSnapshotTestDb } from '../../../helpers/db-mock';
|
||||
import { updateRows } from '../../../helpers/factories/rows';
|
||||
import { oneByOne } from '../../../helpers/one-by-one';
|
||||
import { cafeTie, expectedKeysByName, seedLibrary, type LibraryFixture } from '../../../helpers/places-library-fixture';
|
||||
import {
|
||||
cafeTie,
|
||||
expectedKeysByName,
|
||||
museumTie,
|
||||
seedLibrary,
|
||||
type LibraryFixture,
|
||||
} from '../../../helpers/places-library-fixture';
|
||||
import { resetTestDb } from '../../../helpers/test-db';
|
||||
import { createTestModule, type TestModule } from '../../../helpers/test-module';
|
||||
import { createTestOrm, type TestOrm } from '../../../helpers/test-orm';
|
||||
@@ -148,8 +154,7 @@ describe('PlacesLibraryService.list', () => {
|
||||
...cafeTie(f),
|
||||
`list:${f.saved.hiddenCopy.id}`,
|
||||
`list:${f.saved.lunch.id}`,
|
||||
`list:${f.saved.namesake.id}`,
|
||||
`trip:${f.places.museum.id}`,
|
||||
...museumTie(f),
|
||||
]);
|
||||
expect(await by({ trip_id: f.rome.id })).toEqual([`trip:${f.places.forum.id}`]);
|
||||
expect(await by({ status: 'visited' })).toEqual([`list:${f.saved.pantheon.id}`]);
|
||||
|
||||
Reference in New Issue
Block a user