merge: 프로필 DB URL 인코딩 보존을 반영한다
This commit is contained in:
@@ -17,12 +17,13 @@ import { gatewayProfileCapabilities } from '@sammo-ts/common';
|
||||
import {
|
||||
createGamePostgresConnector,
|
||||
createRedisConnector,
|
||||
resolvePostgresConfigFromEnv,
|
||||
resolvePostgresPoolMax,
|
||||
resolveRedisConfigFromEnv,
|
||||
} from '@sammo-ts/infra';
|
||||
import { isRecord } from '@sammo-ts/common';
|
||||
|
||||
import { resolveGatewayPostgresConfigFromEnv } from '../gatewayPostgresConfig.js';
|
||||
|
||||
import {
|
||||
buildTurboReleaseCommand,
|
||||
buildTurboReleaseTaskCommand,
|
||||
@@ -2249,10 +2250,10 @@ export class GatewayOrchestrator implements GatewayOrchestratorHandle {
|
||||
}
|
||||
|
||||
private resolveProfileDatabaseUrl(profile: GatewayProfileRecord): string {
|
||||
return resolvePostgresConfigFromEnv({
|
||||
env: this.processConfig.baseEnv ?? process.env,
|
||||
schema: profile.profile,
|
||||
}).url;
|
||||
return resolveGatewayPostgresConfigFromEnv(
|
||||
this.processConfig.baseEnv ?? process.env,
|
||||
profile.profile
|
||||
).url;
|
||||
}
|
||||
|
||||
private async clearTournamentRuntimeStateFromRedis(profileName: string): Promise<void> {
|
||||
|
||||
@@ -186,7 +186,15 @@ describe('profile DEPLOY operation', () => {
|
||||
frontendServeMode: 'static',
|
||||
frontendArtifactRoot: path.join(workspace, 'artifact-volume'),
|
||||
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,
|
||||
scheduleIntervalMs: 60_000,
|
||||
@@ -214,6 +222,9 @@ describe('profile DEPLOY operation', () => {
|
||||
expect(commandGroups[1]?.map((command) => command.args)).toEqual([
|
||||
['--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(patches.at(-1)).toMatchObject({
|
||||
buildStatus: 'SUCCEEDED',
|
||||
|
||||
Reference in New Issue
Block a user