Skip to content

fix(deployments): prevent false-positive redeploy domain warning - #861

Open
chbndrhnns wants to merge 1 commit into
oblien:mainfrom
chbndrhnns:fix/858-redeploy-domain-warning
Open

chbndrhnns wants to merge 1 commit into
oblien:mainfrom
chbndrhnns:fix/858-redeploy-domain-warning

Conversation

@chbndrhnns

Copy link
Copy Markdown
Contributor

Summary

Fixes a false-positive "No public domain is connected" warning modal when redeploying multi-service (compose) projects that already have connected and verified domains.

Motivation

When clicking Redeploy on a multi-service stack, handleRedeploy checks shouldWarnAboutUnreachableServices(services). The previous implementation of hasConnectedDomain only checked the legacy scalar properties service.customDomain and service.domain on the Service record. It ignored:

  1. Active and verified domains in the domain table (domainsData.domains) bound to the service via serviceId or targetPort, as well as project-level domains.
  2. Multi-route endpoints declared in service.publicEndpoints.
  3. Default free domain resolution for exposed services (service.name).

This falsely showed the "No public domain is connected" modal on stacks that are already publicly reachable via the edge proxy. Additionally, the modal button and suggested fix copy directed users to the Services tab ("Open the Services tab. Pick the service that should be public. Enable domain exposure..."), even though domain routing is managed in the Domains tab.

Related issue

Closes #858

Changes

apps/dashboard

  • Deployments.tsx: Pass domainsData.domains to shouldWarnAboutUnreachableServices and accurately count unrouted candidate services. Update the modal primary action button to navigate to the Domains tab (setActiveTab("domains")).
  • redeploy-unreachable-warning.ts: Extract and generalize service reachability logic. A service is considered connected if:
    • Any domain in domains matches by serviceId, targetPort, or project-level assignment.
    • Any endpoint in publicEndpoints defines a valid custom or free domain.
    • Explicit scalar customDomain or domain is set.
    • For exposed free-domain services, a fallback service name exists.
  • redeploy-unreachable-warning.test.ts: Add 13 unit tests covering port matching syntax (container port, host:container, protocol suffixes), domain linking variants, and stack warning conditions.
  • Sidebar.tsx: Update hasConnectedDomain in the deploy wizard to also support service.publicEndpoints.
  • locales/*/projects.json: Add openDomains translation and update fixStep1-3 across all 9 supported locales to point to the Domains tab.

Verification

  • Ran vitest run src/app/(dashboard)/projects/[id]/components/redeploy-unreachable-warning.test.ts (13/13 passed).
  • Ran bun run lint (tsc --noEmit) in apps/dashboard (clean exit, 0 errors).
  • Ran bun test src/i18n/i18n-parity.test.ts (3/3 passed, 0 drift).

Checklist

  • One change per PR — one bug, or one agreed feature, with nothing unrelated bundled in
  • The diff is scoped — no reformatting or lint fixes on lines I wasn't otherwise changing
  • A test fails without this change and passes with it
  • bun run test, bun run --cwd <workspace> lint pass locally
  • I understand every line of this diff and can explain it in review

…ien#858)

- Check project and service domain rows in redeploy unreachable services check
- Support multi-route publicEndpoints on services
- Direct user to Domains tab in warning modal action and suggested fix copy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: False-positive "No public domain is connected" warning on redeploy

1 participant