Skip to content

fix(llmo): echo detectedCdn from the site-only onboarding endpoint - #2976

Open
andreeastroe96 wants to merge 2 commits into
mainfrom
feature/onboarding-detected-cdn-response
Open

fix(llmo): echo detectedCdn from the site-only onboarding endpoint#2976
andreeastroe96 wants to merge 2 commits into
mainfrom
feature/onboarding-detected-cdn-response

Conversation

@andreeastroe96

Copy link
Copy Markdown
Contributor

Summary

  • onboardSiteOnly (POST /v2/orgs/:orgId/llmo/onboard-site) already runs CDN detection via performLlmoOnboarding (the same orchestrator the legacy /llmo/onboard handler uses) and persists it to the site's LLMO config, but never included detectedCdn in its own response — unlike the legacy handler one line above it.
  • This silently dropped CDN auto-select pre-fill for every client using the site-only endpoint. Currently that's project-elmo-ui's self-serve domain-onboarding wizard step; a companion elmo-ui PR (reusing that same wizard for first-run org onboarding) depends on this fix to avoid regressing CDN pre-fill for that new surface too.
  • Also documents the field on LlmoOnboardSiteResponse in the OpenAPI spec, reusing the existing CDN-provider enum already defined for the sibling /llmo/onboard endpoint.

Test plan

  • Updated the existing happy-path test (test/controllers/llmo/onboard-site-only.test.js) which previously asserted the exact response body and would have failed once detectedCdn appeared
  • Added a new test asserting a non-null detectedCdn is echoed through
  • Full unit suite passes (npm test)
  • redocly lint validates the updated OpenAPI spec

🤖 Generated with Claude Code

onboardSiteOnly already runs CDN detection via performLlmoOnboarding (same
orchestrator the legacy /llmo/onboard handler uses) and persists it to the
site's LLMO config, but never included it in its own response -- unlike the
legacy handler one line above it. This silently dropped CDN auto-select
pre-fill for every client using the site-only endpoint (project-elmo-ui's
self-serve domain-onboarding wizard step).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

This PR will trigger a patch release when merged.

@MysticatBot MysticatBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey @andreeastroe96,

Verdict: Request changes - test fixture uses a CDN value that contradicts the OpenAPI enum documented in this same PR.
Complexity: MEDIUM - small diff; API surface signal.
Changes: Adds the missing detectedCdn field to the site-only LLMO onboarding endpoint response and documents it in the OpenAPI spec (3 files).

Must fix before merge

  1. [Important] Test uses non-canonical CDN value 'cloudflare' which is not in the CDN_TYPES vocabulary - test/controllers/llmo/onboard-site-only.test.js:183 (details inline)
Non-blocking (1): minor issues and suggestions
  • suggestion: OpenAPI nullable enum should include null in the enum list for strict JSON Schema 2020-12 compliance (without it, strict validators will reject {"detectedCdn": null}) - docs/openapi/schemas.yaml:4676

Skill: pr-review | Model: us.anthropic.claude-opus-4-6-v1[1m] | Duration: 3m 24s | Cost: $4.35 | Commit: fa95b872bf757c49430b5f6750eb774000e97a74
If this code review was useful, please react with 👍. Otherwise, react with 👎.

});

it('echoes a non-null detectedCdn from performLlmoOnboarding (LLMO client CDN pre-fill)', async () => {
performLlmoOnboardingStub.resolves({

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue (blocking): The test uses 'cloudflare' as the detectedCdn value, but the canonical CDN_TYPES vocabulary (defined in src/controllers/llmo/llmo-utils.js) and the OpenAPI enum you are documenting in this same PR list only prefixed compound values (byocdn-cloudflare, aem-cs-fastly, etc.). 'cloudflare' is not among them and would never be returned by performLlmoOnboarding in production.

The pass-through logic is still exercised correctly, but the fixture is misleading: a reader will assume 'cloudflare' is a real production value, and it contradicts the contract formalized one file away in this same commit.

Fix: Replace 'cloudflare' with a real enum member, e.g. 'byocdn-cloudflare'.

@MysticatBot MysticatBot added ai-reviewed Reviewed by AI complexity:medium AI-assessed PR complexity: MEDIUM labels Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-reviewed Reviewed by AI complexity:medium AI-assessed PR complexity: MEDIUM

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants