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:
@@ -154,9 +154,10 @@ export async function seedLibrary(orm: FactoryOrm) {
|
||||
export type LibraryFixture = Awaited<ReturnType<typeof seedLibrary>>;
|
||||
|
||||
/**
|
||||
* The keys of `me`'s entries by name. Café Central's two entries tie on the
|
||||
* name and then go by their anchor (`id * 4 + kind`, a trip place's kind 1,
|
||||
* a saved place's 2), so their order follows the ids the seed got.
|
||||
* The keys of `me`'s entries by name. Two entries of the same name go by their
|
||||
* anchor (`id * 4 + kind`, a trip place's kind 1, a saved place's 2; a saved
|
||||
* place grouped with a trip place takes the trip place's), so the order of a
|
||||
* tie follows the ids the seed got.
|
||||
*/
|
||||
export function expectedKeysByName(f: LibraryFixture): string[] {
|
||||
const { places, saved } = f;
|
||||
@@ -167,16 +168,23 @@ export function expectedKeysByName(f: LibraryFixture): string[] {
|
||||
`list:${saved.hiddenCopy.id}`,
|
||||
`trip:${places.hotel.id}`,
|
||||
`list:${saved.lunch.id}`,
|
||||
`list:${saved.namesake.id}`,
|
||||
`trip:${places.museum.id}`,
|
||||
...museumTie(f),
|
||||
`list:${saved.pantheon.id}`,
|
||||
];
|
||||
}
|
||||
|
||||
/** Two entries of one name, in the order their anchors give. */
|
||||
function byAnchor(trip: number, list: number): string[] {
|
||||
const pair = [`list:${list}`, `trip:${trip}`];
|
||||
return list * 4 + 2 < trip * 4 + 1 ? pair : [...pair].reverse();
|
||||
}
|
||||
|
||||
/** The two entries named Café Central, in the order their anchors give. */
|
||||
export function cafeTie(f: LibraryFixture): string[] {
|
||||
const conflicting = f.saved.conflicting.id * 4 + 2;
|
||||
const cafe = f.places.cafe.id * 4 + 1;
|
||||
const pair = [`list:${f.saved.conflicting.id}`, `trip:${f.places.cafe.id}`];
|
||||
return conflicting < cafe ? pair : [...pair].reverse();
|
||||
return byAnchor(f.places.cafe.id, f.saved.conflicting.id);
|
||||
}
|
||||
|
||||
/** The two entries named Museum (the trip place with its saved copy, and the namesake), as their anchors give. */
|
||||
export function museumTie(f: LibraryFixture): string[] {
|
||||
return byAnchor(f.places.museum.id, f.saved.namesake.id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user