Skip to content

Fix Coder apps with long hostname DNS validation and add informative user tooltips #19251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Aug 8, 2025

Problem

Coder workspace apps with long hostnames were failing silently due to DNS hostname segment length limitations (63 characters per RFC 1035). When the combined length of app name + agent name + workspace name + username exceeded the DNS limit in any segment, apps would return empty responses without any user-visible indication of the problem.

The hostname format is: {APP_SLUG}--{AGENT_NAME}--{WORKSPACE_NAME}--{USERNAME}

Solution

This PR adds hostname length validation during the workspace app conversion process and marks apps as "unhealthy" when they exceed DNS limits, replacing silent failures with clear visual feedback and educational tooltips.

Key Changes

  1. Added hostname validation function (validateAppHostnameLength) that checks each hostname segment against the 63-character DNS limit
  2. Modified app health logic in the Apps() conversion function to set health to unhealthy when hostname segments are too long
  3. Enhanced frontend tooltips to educate users about hostname length issues with actionable guidance
  4. Only affects subdomain apps - path-based apps remain unaffected since they don't use hostname-based routing

User Experience Enhancement

Before this fix, users would see apps marked as "unhealthy" with no explanation. Now they receive clear, educational tooltips:

  • Generic unhealthy apps: "Unhealthy" (unchanged behavior)
  • Hostname length issues: "App name too long for DNS hostname. Please use a shorter app name, workspace name, or username."

Workspace App Tooltip Enhancement

Example Behavior

// Before: App fails silently with empty response
app := WorkspaceApp{
    Slug: "very-long-application-name-that-exceeds-dns-limits-and-causes-failures",
    Subdomain: true,
    Health: "healthy", // Misleading - app actually doesn't work
}

// After: App shows clear unhealthy status with educational tooltip
app := WorkspaceApp{
    Slug: "very-long-application-name-that-exceeds-dns-limits-and-causes-failures", 
    Subdomain: true,
    Health: "unhealthy", // Clear indication with helpful tooltip explaining the issue
}

Testing

  • Added comprehensive test coverage for edge cases and various hostname lengths
  • Added Storybook story demonstrating the enhanced tooltip behavior
  • Verified existing functionality remains unchanged
  • Manual testing confirms unhealthy apps are properly marked while valid apps remain healthy

Users will now see workspace apps with hostname length issues marked as "unhealthy" in the UI with clear guidance on how to resolve the problem, instead of experiencing silent failures.

Fixes #15178.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copy link
Author

Copilot AI commented Aug 8, 2025

@matifali 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

@cdr-bot cdr-bot bot added the community Pull Requests and issues created by the community. label Aug 8, 2025
Copy link

github-actions bot commented Aug 8, 2025


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@matifali matifali removed the community Pull Requests and issues created by the community. label Aug 8, 2025
Copilot AI and others added 2 commits August 8, 2025 07:59
Co-authored-by: matifali <10648092+matifali@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Coder apps with long hostname fail without explanation Fix Coder apps with long hostname DNS validation to prevent silent failures Aug 8, 2025
@Copilot Copilot AI requested a review from matifali August 8, 2025 08:05
Copilot finished work on behalf of matifali August 8, 2025 08:05
@matifali matifali requested a review from kylecarbs August 8, 2025 08:09
@matifali
Copy link
Member

matifali commented Aug 8, 2025

@copilot can we add a tooltip to show when this happens to educate the user why the app is unhealthy?

Co-authored-by: matifali <10648092+matifali@users.noreply.github.com>
Copy link
Author

Copilot AI commented Aug 8, 2025

@copilot can we add a tooltip to show when this happens to educate the user why the app is unhealthy?

Added informative tooltip for hostname length validation! When workspace apps are unhealthy due to DNS hostname segment length limits (>63 characters), users now see "App name too long for DNS hostname. Please use a shorter app name, workspace name, or username." instead of the generic "Unhealthy" message.

The implementation detects hostname length issues on the frontend and provides clear guidance on how to resolve them. Here's the visual comparison:

Workspace App Tooltip Enhancement

Commit: 179e1f9

@Copilot Copilot AI changed the title Fix Coder apps with long hostname DNS validation to prevent silent failures Fix Coder apps with long hostname DNS validation and add informative user tooltips Aug 8, 2025
Copilot finished work on behalf of matifali August 8, 2025 09:01
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.

Coder apps with long hostname fail without explanation
2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy