Skip to content

fix(dotAI): use request host config for bulk embeddings; fix site filter dropdown#36130

Open
ihoffmann-dot wants to merge 6 commits into
mainfrom
fix/embeddings-request-host-config
Open

fix(dotAI): use request host config for bulk embeddings; fix site filter dropdown#36130
ihoffmann-dot wants to merge 6 commits into
mainfrom
fix/embeddings-request-host-config

Conversation

@ihoffmann-dot

@ihoffmann-dot ihoffmann-dot commented Jun 12, 2026

Copy link
Copy Markdown
Member

Summary

  • BulkEmbeddingsRunner: replaced per-contentlet config lookup with a single EmbeddingsAPI instance resolved from the request host at construction time. Fixes silent embedding failures when a Lucene query returns content from sites with no dotAI config.
  • EmbeddingsForm: added requestHostId field; query made optional to support programmatic use.
  • EmbeddingsResource: captures request host from HTTP context and injects requestHostId into the form before dispatching.
  • render.jsp / dotai.js: replaced the broken free-text "Site" input in Advanced Search with a dropdown populated from GET /api/v1/site at load time. Options carry the site identifier as value, fixing the exact-match filter against dot_embeddings.host.

Test plan

  • Integration tests: BulkEmbeddingsRunnerTest — covers request-host config used for cross-site contentlets, and no-config fallback
  • Manual: create an embedding index from a site with dotAI configured; verify embeddings are generated for content belonging to other sites
  • Manual: open Advanced Search, select a site from the dropdown, verify results are filtered correctly
  • Manual: leave "All sites" selected, verify no site filter is applied

Fixes: #36129

@github-actions github-actions Bot added Area : Backend PR changes Java/Maven backend code Area : Frontend PR changes Angular/TypeScript frontend code labels Jun 12, 2026
@claude

claude Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Claude finished @ihoffmann-dot's task in 1m 21s —— View job


Rollback Safety Analysis

  • Gather context (read ROLLBACK_UNSAFE_CATEGORIES.md and PR diff)
  • Analyze diff against every unsafe category
  • Apply label and post findings

Verdict: ✅ Safe to Roll Back

The label AI: Safe To Rollback has been applied.

Analysis against all unsafe categories:

Category Verdict
C-1 Structural Data Model Change ✅ No DB schema change of any kind
C-2 Elasticsearch Mapping Change ✅ No ES mapping touched
C-3 Content JSON Model Version Bump ✅ No ImmutableContentlet or CURRENT_MODEL_VERSION change
C-4 DROP TABLE / DROP COLUMN ✅ No DDL present
H-1 One-Way Data Migration ✅ No data transformation tasks
H-2 RENAME TABLE / COLUMN ✅ None
H-3 PK / Unique Constraint Restructure ✅ None
H-4 New ContentType Field Type ✅ None
H-5 Storage Provider Change ✅ None
H-6 DROP PROCEDURE / FUNCTION ✅ None
H-7 NOT NULL Column Without Default ✅ None
H-8 VTL Viewtool Contract Change ✅ None — the JSP/JS changes are UI-only (Admin portlet), not VTL viewtools
M-1 Non-Broadening Column Type Change ✅ None
M-2 Push Publishing Bundle Format ✅ None
M-3 REST/GraphQL API Contract Change requestHostId is added as a new optional field to EmbeddingsForm / openapi.yaml. Additive-only changes to request bodies are backward-compatible; N-1 simply ignores the new field.
M-4 OSGi Plugin API Breakage ✅ No public interface signatures changed

Summary of what changed:

  • EmbeddingsForm — new optional requestHostId field added; query made nullable (previously threw IllegalArgumentException, now returns null). The null check was moved to the resource layer. This is additive and backward-safe.
  • EmbeddingsResource — injects requestHostId from the HTTP request before dispatching. Old clients not sending this field get an empty string → falls back to systemHost().
  • BulkEmbeddingsRunner — constructs a single EmbeddingsAPI instance from the request host instead of per-contentlet. Pure runtime behavior change, no storage impact.
  • render.jsp / dotai.js — Admin-only UI: free-text site field replaced with a populated dropdown. No data stored differently.
  • openapi.yaml — auto-generated; adds requestHostId: string to the schema. Additive only.
  • BulkEmbeddingsRunnerTest — test-only changes.

No database migrations, no Elasticsearch mapping changes, no stored procedure drops, no VTL viewtool contract changes, no data transformations. A rollback to N-1 will work correctly.

@dotCMS dotCMS deleted a comment from github-actions Bot Jun 12, 2026
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

❌ Codex Review failed — openai.gpt-5.5

The review job failed before producing output. See the run for details.

Run: #27393711404

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI: Safe To Rollback Area : Backend PR changes Java/Maven backend code Area : Frontend PR changes Angular/TypeScript frontend code

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

fix(dotAI): embedding index generation fails for cross-site content; site filter in Advanced Search broken

1 participant