Skip to content

useLongNames mode includes .local in its allowed TLDs. Also turned on useLongNames - #2474

Open
splidje wants to merge 3 commits into
AcademySoftwareFoundation:masterfrom
splidje:improvement/allow_dot_local_render_hosts
Open

useLongNames mode includes .local in its allowed TLDs. Also turned on useLongNames#2474
splidje wants to merge 3 commits into
AcademySoftwareFoundation:masterfrom
splidje:improvement/allow_dot_local_render_hosts

Conversation

@splidje

@splidje splidje commented Jul 1, 2026

Copy link
Copy Markdown

Summarize your change.

For my setup I've ended up just using mostly bonjour/avahi for name resolution - i.e. .local
I could never get the RQD hosts to properly show up with the .local, it was always stripped off - even using the OVERRIDE_HOSTNAME setting in my rqd.conf.
Turns out not only was cuebot stripping off .local because it's not in its list of valid TLDs, but also useLongNames is hardcoded to false.

I've allowed .local and hardcoded useLongNames to true.

Summary by CodeRabbit

  • Bug Fixes
    • Improved hostname/FQDN parsing for long-form names so trailing .local suffixes are stripped and interpreted correctly.
    • Updated render host creation behavior so host registration uses the correct setup flag when creating new hosts.

@linux-foundation-easycla

linux-foundation-easycla Bot commented Jul 1, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: splidje / name: splidje (5dbca23)

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR updates FQDN domain stripping to recognize .local and changes the render-host insertion boolean from false to true.

Changes

Host FQDN and Render Host Insertion Changes

Layer / File(s) Summary
FQDN domain-matching regex update
cuebot/src/main/java/com/imageworks/spcue/dao/postgres/HostDaoJdbc.java
The getHostNameFromFQDN regex now matches .local as a trailing domain suffix.
Render host insertion flag change
cuebot/src/main/java/com/imageworks/spcue/service/HostManagerService.java
The boolean argument to hostDao.insertRenderHost(...) in createHost changed from false to true.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main changes: .local handling in useLongNames and enabling useLongNames in host creation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
cuebot/src/main/java/com/imageworks/spcue/dao/postgres/HostDaoJdbc.java (1)

667-674: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add regression test for .local domain preservation.

This regex change is the core fix described in the PR objective (preserving .local hostnames), but no test in the provided context exercises getHostNameFromFQDN/insertRenderHost with a .local FQDN under useLongNames=true. Consider adding a case similar to testInsertHostFQDN1 in HostDaoTests.java asserting that a name like myhost.local is preserved as-is.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cuebot/src/main/java/com/imageworks/spcue/dao/postgres/HostDaoJdbc.java`
around lines 667 - 674, Add a regression test covering `.local` hostname
preservation when `useLongNames` is enabled. Update the existing host DAO test
suite around `HostDaoTests` to exercise `insertRenderHost` and/or
`getHostNameFromFQDN` with a `.local` FQDN similar to `myhost.local`, and assert
the stored/resolved host name remains unchanged instead of being stripped. Use
the existing test pattern from `testInsertHostFQDN1` and keep the new assertion
focused on `HostDaoJdbc`’s FQDN parsing behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cuebot/src/main/java/com/imageworks/spcue/service/HostManagerService.java`:
- Line 166: The hardcoded true passed to hostDao.insertRenderHost in
HostManagerService changes hostname derivation for all FQDNs, not just .local.
Update the HostManagerService flow to avoid forcing useLongNames globally;
instead make this behavior configurable or limit it to the Bonjour/Avahi .local
case, and keep the existing short-name behavior for other domains. Verify the
change against HostDaoJdbc.getHostNameFromFQDN and the host insert path so
findDispatchHost and related hostname-based lookups continue to work for
internal domains.

---

Nitpick comments:
In `@cuebot/src/main/java/com/imageworks/spcue/dao/postgres/HostDaoJdbc.java`:
- Around line 667-674: Add a regression test covering `.local` hostname
preservation when `useLongNames` is enabled. Update the existing host DAO test
suite around `HostDaoTests` to exercise `insertRenderHost` and/or
`getHostNameFromFQDN` with a `.local` FQDN similar to `myhost.local`, and assert
the stored/resolved host name remains unchanged instead of being stripped. Use
the existing test pattern from `testInsertHostFQDN1` and keep the new assertion
focused on `HostDaoJdbc`’s FQDN parsing behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 28602e10-5843-4f13-898a-ff3127e31034

📥 Commits

Reviewing files that changed from the base of the PR and between aea9a96 and 5dbca23.

📒 Files selected for processing (2)
  • cuebot/src/main/java/com/imageworks/spcue/dao/postgres/HostDaoJdbc.java
  • cuebot/src/main/java/com/imageworks/spcue/service/HostManagerService.java

public DispatchHost createHost(RenderHost rhost, AllocationEntity alloc) {

hostDao.insertRenderHost(rhost, alloc, false);
hostDao.insertRenderHost(rhost, alloc, true);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Hardcoding useLongNames=true changes hostname derivation for all hosts, not just .local.

Per getHostNameFromFQDN in HostDaoJdbc.java, useLongNames=false unconditionally strips everything after the first ., whereas useLongNames=true only strips the domain suffix if it matches a hardcoded TLD pattern (com|biz|edu|info|net|org|cn|de|eu|nl|local). Any FQDN with a domain suffix outside this list (e.g. internal domains like .corp, .lan, .internal, or other ccTLDs) will now be stored with the full FQDN as the host name instead of the short hostname, since the regex won't match and the fallback keeps hostName = fqdn unchanged.

This affects every deployment on upgrade, not only Bonjour/Avahi .local setups as intended by the PR objective, and could disrupt downstream hostname-based lookups/dispatching (findDispatchHost, tagging, RQD name matching) for installations using unlisted internal domains.

Consider making this configurable (e.g., via a property) rather than hardcoding true, or extending the pattern/logic to explicitly special-case .local while preserving prior stripping behavior for other domains.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cuebot/src/main/java/com/imageworks/spcue/service/HostManagerService.java` at
line 166, The hardcoded true passed to hostDao.insertRenderHost in
HostManagerService changes hostname derivation for all FQDNs, not just .local.
Update the HostManagerService flow to avoid forcing useLongNames globally;
instead make this behavior configurable or limit it to the Bonjour/Avahi .local
case, and keep the existing short-name behavior for other domains. Verify the
change against HostDaoJdbc.getHostNameFromFQDN and the host insert path so
findDispatchHost and related hostname-based lookups continue to work for
internal domains.

@splidje
splidje force-pushed the improvement/allow_dot_local_render_hosts branch from dd23436 to 1e7d8e7 Compare July 9, 2026 10:04
@splidje
splidje force-pushed the improvement/allow_dot_local_render_hosts branch from 35f601a to b42e4f0 Compare July 10, 2026 10:18
Comment on lines -714 to -715
Pattern domainPattern = Pattern
.compile(".*(\\.(.*)\\.(co(m|.[a-z]{2})|biz|edu|info|net|org|cn|de|eu|nl))$");

@lithorus lithorus Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is related to avahi host.local hostnames, but only hostnames like host.domain.local

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.

2 participants