Skip to content

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

Open
splidje wants to merge 1 commit 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 1 commit 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 parsing for long-form names so FQDNs ending in .local are handled correctly.
    • Updated render host registration behavior during host creation to align with expected setup handling.

@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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 988832d2-4117-46e3-bc69-d0d6159ae3f9

📥 Commits

Reviewing files that changed from the base of the PR and between dd23436 and 1e7d8e7.

📒 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
✅ Files skipped from review due to trivial changes (1)
  • cuebot/src/main/java/com/imageworks/spcue/dao/postgres/HostDaoJdbc.java
🚧 Files skipped from review as they are similar to previous changes (1)
  • cuebot/src/main/java/com/imageworks/spcue/service/HostManagerService.java

📝 Walkthrough

Walkthrough

This PR makes two isolated one-line changes: extending the domain-stripping regex in HostDaoJdbc to recognize the .local top-level domain, and switching a boolean argument from false to true in HostManagerService's insertRenderHost call.

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 regex used in getHostNameFromFQDN to strip recognized domain suffixes now also matches .local.
Render host insertion flag change
cuebot/src/main/java/com/imageworks/spcue/service/HostManagerService.java
The boolean argument to hostDao.insertRenderHost(...) in createHost was 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 accurately reflects both the .local suffix handling and the switch to always enabling useLongNames.
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.

…ts allowed TLDs. Also turned on useLongNames.
@splidje splidje force-pushed the improvement/allow_dot_local_render_hosts branch from dd23436 to 1e7d8e7 Compare July 9, 2026 10:04
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.

1 participant