merge: 프로필 DB URL 인코딩 보존을 반영한다

This commit is contained in:
2026-08-22 15:51:55 +00:00
2 changed files with 18 additions and 6 deletions
@@ -17,12 +17,13 @@ import { gatewayProfileCapabilities } from '@sammo-ts/common';
import { import {
createGamePostgresConnector, createGamePostgresConnector,
createRedisConnector, createRedisConnector,
resolvePostgresConfigFromEnv,
resolvePostgresPoolMax, resolvePostgresPoolMax,
resolveRedisConfigFromEnv, resolveRedisConfigFromEnv,
} from '@sammo-ts/infra'; } from '@sammo-ts/infra';
import { isRecord } from '@sammo-ts/common'; import { isRecord } from '@sammo-ts/common';
import { resolveGatewayPostgresConfigFromEnv } from '../gatewayPostgresConfig.js';
import { import {
buildTurboReleaseCommand, buildTurboReleaseCommand,
buildTurboReleaseTaskCommand, buildTurboReleaseTaskCommand,
@@ -2249,10 +2250,10 @@ export class GatewayOrchestrator implements GatewayOrchestratorHandle {
} }
private resolveProfileDatabaseUrl(profile: GatewayProfileRecord): string { private resolveProfileDatabaseUrl(profile: GatewayProfileRecord): string {
return resolvePostgresConfigFromEnv({ return resolveGatewayPostgresConfigFromEnv(
env: this.processConfig.baseEnv ?? process.env, this.processConfig.baseEnv ?? process.env,
schema: profile.profile, profile.profile
}).url; ).url;
} }
private async clearTournamentRuntimeStateFromRedis(profileName: string): Promise<void> { private async clearTournamentRuntimeStateFromRedis(profileName: string): Promise<void> {
@@ -186,7 +186,15 @@ describe('profile DEPLOY operation', () => {
frontendServeMode: 'static', frontendServeMode: 'static',
frontendArtifactRoot: path.join(workspace, 'artifact-volume'), frontendArtifactRoot: path.join(workspace, 'artifact-volume'),
frontendReadinessOrigin: 'http://caddy', frontendReadinessOrigin: 'http://caddy',
baseEnv: { DATABASE_URL: 'postgresql://user:pass@integration.invalid/sammo' }, baseEnv: {
GATEWAY_DATABASE_URL:
'postgresql://user:encoded%23password@integration.invalid/sammo?schema=public',
POSTGRES_USER: 'user',
POSTGRES_PASSWORD: 'raw#password',
POSTGRES_HOST: 'integration.invalid',
POSTGRES_PORT: '5432',
POSTGRES_DB: 'sammo',
},
}, },
reconcileIntervalMs: 60_000, reconcileIntervalMs: 60_000,
scheduleIntervalMs: 60_000, scheduleIntervalMs: 60_000,
@@ -214,6 +222,9 @@ describe('profile DEPLOY operation', () => {
expect(commandGroups[1]?.map((command) => command.args)).toEqual([ expect(commandGroups[1]?.map((command) => command.args)).toEqual([
['--filter', '@sammo-ts/infra', 'prisma:migrate:deploy:game'], ['--filter', '@sammo-ts/infra', 'prisma:migrate:deploy:game'],
]); ]);
expect(commandGroups[1]?.[0]?.env?.DATABASE_URL).toBe(
'postgresql://user:encoded%23password@integration.invalid/sammo?schema=che'
);
expect(commandGroups.flat().some((command) => command.env?.GATEWAY_ROLE === 'profile-seed')).toBe(false); expect(commandGroups.flat().some((command) => command.env?.GATEWAY_ROLE === 'profile-seed')).toBe(false);
expect(patches.at(-1)).toMatchObject({ expect(patches.at(-1)).toMatchObject({
buildStatus: 'SUCCEEDED', buildStatus: 'SUCCEEDED',