Skip to content

Commit 2b3ef7d

Browse files
committed
feat(deploy): show DNS records on the resume verification path
1 parent 5f2ceba commit 2b3ef7d

2 files changed

Lines changed: 45 additions & 0 deletions

File tree

packages/cli-core/src/commands/deploy/index.test.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,37 @@ describe("deploy", () => {
906906
expect(String(firstInput?.message)).not.toContain("Production domain");
907907
});
908908

909+
test("resume DNS verification prints CNAME records before the verification prompt", async () => {
910+
await linkedProject({
911+
instances: { development: "ins_dev_123", production: "ins_prod_123" },
912+
});
913+
mockIsAgent.mockReturnValue(false);
914+
mockLiveProduction({
915+
instanceId: "ins_prod_123",
916+
productionConfig: {},
917+
});
918+
mockGetDeployStatus.mockResolvedValue({
919+
status: "incomplete",
920+
dns_ok: false,
921+
ssl_ok: false,
922+
mail_ok: false,
923+
});
924+
mockConfirm.mockResolvedValueOnce(false); // BIND export prompt placeholder (wired in Task 5)
925+
mockSelect.mockResolvedValueOnce("skip").mockResolvedValueOnce("have-credentials");
926+
mockInput.mockResolvedValueOnce("google-client-id.apps.googleusercontent.com");
927+
mockPassword.mockResolvedValueOnce("google-secret");
928+
mockPatchInstanceConfig.mockResolvedValueOnce({});
929+
930+
await runDeploy({});
931+
const err = stripAnsi(captured.err);
932+
933+
const recordsIdx = err.indexOf("Add the following records at your DNS provider");
934+
const promptIdx = err.indexOf("DNS verification");
935+
expect(recordsIdx).toBeGreaterThan(-1);
936+
expect(promptIdx).toBeGreaterThan(-1);
937+
expect(recordsIdx).toBeLessThan(promptIdx);
938+
});
939+
909940
test("DNS verification timeout names the specific pending components from deploy_status", async () => {
910941
await linkedProject({
911942
instances: { development: "ins_dev_123", production: "ins_prod_123" },

packages/cli-core/src/commands/deploy/index.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,20 @@ async function runExistingDomainDnsVerification(
563563
ctx: DeployContext,
564564
state: DeployOperationState,
565565
): Promise<DnsVerificationResult | false> {
566+
for (const line of dnsIntro(state.domain)) log.info(line);
567+
log.blank();
568+
if (state.cnameTargets && state.cnameTargets.length > 0) {
569+
for (const line of dnsRecords(state.cnameTargets)) log.info(line);
570+
log.blank();
571+
}
572+
const connectUrl = domainConnectUrl(state.domain);
573+
if (connectUrl) {
574+
log.info(`Domain Connect: ${connectUrl}`);
575+
log.blank();
576+
}
577+
for (const line of dnsDashboardHandoff(state.domain)) log.info(line);
578+
log.blank();
579+
566580
try {
567581
const action = await chooseDnsVerificationAction();
568582
if (action === "skip") {

0 commit comments

Comments
 (0)