fix: Gateway 기수 표시명을 명예의 전당과 왕조에 전달한다
RESET에서 Gateway의 한국어 표시명을 기수 메타데이터로 저장하고 통일 archive가 내부 profile key 대신 해당 snapshot을 사용하도록 한다. seeder와 Hall/왕조 투영 회귀 테스트를 함께 추가한다.
This commit is contained in:
@@ -23,6 +23,7 @@ import {
|
||||
import { isRecord } from '@sammo-ts/common';
|
||||
|
||||
import { resolveGatewayPostgresConfigFromEnv } from '../gatewayPostgresConfig.js';
|
||||
import { resolveGatewayProfileKoreanName } from '../profileOrder.js';
|
||||
|
||||
import {
|
||||
buildTurboReleaseCommand,
|
||||
@@ -281,6 +282,13 @@ const buildServerId = (profileName: string, now: Date, installOperationId?: stri
|
||||
return `${profileName}_${year}${month}${day}_${suffix}`;
|
||||
};
|
||||
|
||||
export const resolveProfileArchiveServerName = (
|
||||
profile: Pick<GatewayProfileRecord, 'profileName' | 'profile' | 'meta'>
|
||||
): string => {
|
||||
const meta = normalizeMeta(profile.meta);
|
||||
return resolveGatewayProfileKoreanName(profile.profile, meta.korName);
|
||||
};
|
||||
|
||||
const readMetaNumber = (meta: Record<string, unknown>, key: string): number | null => {
|
||||
const raw = meta[key];
|
||||
if (typeof raw === 'number' && Number.isFinite(raw)) {
|
||||
@@ -2010,6 +2018,9 @@ export class GatewayOrchestrator implements GatewayOrchestratorHandle {
|
||||
season,
|
||||
firstGameIdx,
|
||||
serverId,
|
||||
// Snapshot the Gateway display name into this season. Hall and
|
||||
// dynasty archives must not fall back to the runtime instance key.
|
||||
serverName: resolveProfileArchiveServerName(profile),
|
||||
installCommitSha: commitSha,
|
||||
},
|
||||
adminUser,
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
buildSharedProfileFrontendCommands,
|
||||
buildWorkspaceCommands,
|
||||
planProfileReconcile,
|
||||
resolveProfileArchiveServerName,
|
||||
resolveResetLifecycleStatus,
|
||||
} from '../src/orchestrator/gatewayOrchestrator.js';
|
||||
import { GATEWAY_PROFILE_ORDER } from '../src/profileOrder.js';
|
||||
@@ -134,6 +135,30 @@ describe('resolveResetLifecycleStatus', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('resolveProfileArchiveServerName', () => {
|
||||
it('uses the configured Gateway name and never the runtime instance key', () => {
|
||||
expect(
|
||||
resolveProfileArchiveServerName({
|
||||
...buildProfile(),
|
||||
profile: 'hwe',
|
||||
profileName: 'hwe:default',
|
||||
meta: { korName: ' 훼 ' },
|
||||
})
|
||||
).toBe('훼');
|
||||
});
|
||||
|
||||
it('uses the canonical profile label when Gateway has no override', () => {
|
||||
expect(
|
||||
resolveProfileArchiveServerName({
|
||||
...buildProfile(),
|
||||
profile: 'hwe',
|
||||
profileName: 'hwe:default',
|
||||
meta: {},
|
||||
})
|
||||
).toBe('훼');
|
||||
});
|
||||
});
|
||||
|
||||
describe('buildProcessDefinitions', () => {
|
||||
const processConfig = {
|
||||
workspaceRoot: '/srv/sammo/main',
|
||||
|
||||
Reference in New Issue
Block a user