Skip to content

feat(#34972): Nestable Hosts — allow hosts to have parent hosts/folders for path-based URL hierarchies#34973

Draft
wezell wants to merge 8 commits intomainfrom
issue-34972-nested-hosts
Draft

feat(#34972): Nestable Hosts — allow hosts to have parent hosts/folders for path-based URL hierarchies#34973
wezell wants to merge 8 commits intomainfrom
issue-34972-nested-hosts

Conversation

@wezell
Copy link
Copy Markdown
Member

@wezell wezell commented Mar 12, 2026

Closes #34972

Summary

  • No new DB columns — reuses Identifier.host_inode, parent_path, asset_name with extended semantics; top-level hosts anchor to SYSTEM_HOST, nested hosts anchor to parent host/folder
  • NestedHostResolutionFilter intercepts requests, resolves nested host via NestedHostPatternCache (per-top-level-host regex, longest-first, PostgreSQL LISTEN/NOTIFY invalidation), strips host prefix from URI, sets CMS_RESOLVED_HOST on request
  • HostResolver service: (serverName, fullUri) → HostResolutionResult
  • Host lifecycle: delete blocked when descendants exist; cascade archive (cascade=true); unarchive is manual; cycle detection throws before any data is persisted; reparent fires HostReparentPayload
  • Push publish: auto-includes ancestor hosts; import sorts HOST+FOLDER by path length ascending
  • Angular UI: site selector with depth indentation (DotHostDepthPipe), folder tree nested host nodes, showSubHosts param in Browser/ContentDrive APIs, ?hostId= query param for HostFolderField pre-fill; modern syntax (@if, input(), signals)
  • Startup tasks: Task260312 adds parentHost HostFolderField to Host content type; Task260313 syncs Identifier.asset_name = hostname

Test plan

  • 140 unit tests pass
  • HostAPITest: 47/47 integration tests pass (includes 3 new nestable-host tests)
  • HostFactoryImplTest: 10/10
  • Task260312AddHostFolderFieldToHostContentTypeTest: 2/2
  • Task260313SyncHostIdentifierAssetNameTest: 4/4
  • MainSuite3a updated with new startup task tests
  • All 25 acceptance criteria from spec verified (Ouroboros evaluation)

🤖 Generated with Claude Code

…rs for path-based URL hierarchies

Implements the full nestable-hosts feature:

## Data Model
- No new DB columns; reuses Identifier.host_inode, parent_path, asset_name
- Identifier.asset_name = hostname for all host records (synced by startup task)
- Top-level hosts anchor to SYSTEM_HOST; nested hosts anchor to parent host/folder

## URL Resolution
- NestedHostResolutionFilter intercepts requests and resolves nested hosts
- NestedHostPatternCache: per-top-level-host regex cache, longest-first matching,
  PostgreSQL LISTEN/NOTIFY invalidation
- CMS_RESOLVED_HOST request attribute set; HostWebAPIImpl checks it first
- HostResolver: (serverName, fullUri) → HostResolutionResult

## Host Lifecycle
- Deleting host with descendants blocked (HostHasDescendantsException)
- Cascade archive to all descendants; unarchive is manual
- Reparent fires HostReparentPayload (oldTopLevelHostId, newTopLevelHostId)
- Cycle detection in IdentifierAPI.getTopLevelHostId()

## Push Publishing
- Auto-includes ancestor hosts in push bundles
- Import sorts HOST+FOLDER records by path length ascending

## Angular UI
- Site selector shows flat list with depth-based indentation (DotHostDepthPipe)
- Folder tree shows nested host nodes with host icon; click switches context
- BrowserResource/ContentDriveResource support showSubHosts param
- Content editor accepts ?hostId= for HostFolderField pre-fill
- Modern syntax: @if, input(), signals throughout

## Startup Tasks
- Task260312: adds parentHost HostFolderField to Host content type
- Task260313: syncs Identifier.asset_name = hostname for all host records

## Tests
- 140 unit tests pass
- 47 HostAPITest integration tests pass (including 3 new nestable-host tests)
- 10/10 HostFactoryImplTest pass
- 2/2 Task260312 integration tests pass
- 4/4 Task260313 integration tests pass
- MainSuite3a updated to include new startup task tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added Area : Backend PR changes Java/Maven backend code Area : Documentation PR changes documentation files Area : Frontend PR changes Angular/TypeScript frontend code labels Mar 12, 2026
@wezell wezell marked this pull request as draft March 12, 2026 22:45
wezell and others added 7 commits March 13, 2026 11:13
…ements

- Fix Jackson @JsonProperty("isHost") on FolderSearchResultView and FolderView so
  nested-host nodes render their label correctly in the Content Drive folder tree
- Fix ShortyIdAPIImpl.getShorty(null) NPE when legacy browser clicks nested-host node
- Fix HostAPIImpl: capture hostname before checkin() so identifier.asset_name is set
  correctly for new sub-hosts (same pre/post-checkin pattern as parentHostId fix)
- Design change: nested-host nodes in Content Drive open like folders instead of
  switching the global site context; add browseHostname state field to track browsed
  host independently of currentSite
- Fix includeSystemHost: only true at top-level site root (!browseHostname && !path)
  to prevent SYSTEM_HOST content bleeding into nested-host/folder views
- Add BrowserAjax.getChildHostMaps() to show direct child hosts in legacy folder tree
- Fix BrowserAjax.openFolderTree() to resolve host inodes via IdentifierAPI so
  clicking a sub-host node in the legacy browser expands its folder tree correctly
- Update docs/nestable-hosts-requirements.md to reflect folder-like behavior (AC-17)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area : Backend PR changes Java/Maven backend code Area : Documentation PR changes documentation files Area : Frontend PR changes Angular/TypeScript frontend code stale

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

feat: Nestable Hosts — allow hosts to have parent hosts/folders for path-based URL hierarchies

2 participants