Skip to content

feat(serenity): expose semrush provisioning status on brand reads (LLMO-7352/LLMO-7418) - #3250

Open
IrisAlexandrescu wants to merge 1 commit into
feat/LLMO-7418-phase4-skip-mode-asyncfrom
feat/LLMO-7418-expose-provisioning-status
Open

feat(serenity): expose semrush provisioning status on brand reads (LLMO-7352/LLMO-7418)#3250
IrisAlexandrescu wants to merge 1 commit into
feat/LLMO-7418-phase4-skip-mode-asyncfrom
feat/LLMO-7418-expose-provisioning-status

Conversation

@IrisAlexandrescu

Copy link
Copy Markdown
Contributor

Summary

Fifth PR in the LLMO-7352/LLMO-7418 stack (after #3223, #3233, #3246, #3249). Small, focused prerequisite for the frontend UI-states work (LLMO-7419): surfaces brands.semrush_provisioning_status/semrush_provisioning_error as read-only semrushProvisioningStatus/semrushProvisioningError fields on the V2 Brand DTO.

Why this PR exists: these two columns previously existed only for the async provisioning worker's own internal CAS bookkeeping (getBrandProvisioningState's narrow PROVISIONING_SELECT) — no GET response exposed them. The frontend has no way to show a persistent "Setting up / Ready / Setup failed" indicator on the brand list or detail view without this — it would otherwise have to rely on the one-shot jobId an async: true create/activate response carries, which is useless on any later page load.

Changes

  • mapDbBrandToV2 (src/support/brands-storage.js) — the single mapping point for all 3 GET paths (listBrandsForOrg/getBrandForOrg/getBrandForOrgSite) and the create/update write-response paths (all route through withSerenityState, which just spreads whatever the mapper produced) — now copies the two columns onto the DTO. No SELECT/query changes needed: PostgREST's '*' already returns every brands column.
  • docs/openapi/schemas.yaml's V2Brand schema — both fields added as readOnly, nullable, not in required.

Test plan

  • npm run lint, npm run type-check, npm run docs:lint — all clean
  • New unit test in brands-storage.test.js asserting the mapping (both the failed-with-error case and the null/never-provisioned case)
  • Full targeted regression suite (brands, serenity, serenity-prompt-classification, routes) — 4513 passing, 0 regressions

🤖 Generated with Claude Code

@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@IrisAlexandrescu
IrisAlexandrescu force-pushed the feat/LLMO-7418-expose-provisioning-status branch from a048d64 to c7c0239 Compare September 9, 2026 14:47
@IrisAlexandrescu

Copy link
Copy Markdown
Contributor Author

Rebased onto Phase 4's (#3249) fix commit — no changes needed in this PR itself, the fixed activate-brand-workspace-job.js behavior now carries through automatically.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

This PR will trigger a minor release when merged.

@IrisAlexandrescu
IrisAlexandrescu force-pushed the feat/LLMO-7418-phase4-skip-mode-async branch from 4d3123e to a964882 Compare September 9, 2026 16:20
@IrisAlexandrescu
IrisAlexandrescu force-pushed the feat/LLMO-7418-expose-provisioning-status branch from c7c0239 to 2be9230 Compare September 9, 2026 16:36
@IrisAlexandrescu
IrisAlexandrescu force-pushed the feat/LLMO-7418-phase4-skip-mode-async branch 2 times, most recently from 135eec6 to e888c2a Compare September 9, 2026 17:29
@IrisAlexandrescu
IrisAlexandrescu force-pushed the feat/LLMO-7418-expose-provisioning-status branch from 2be9230 to 581d363 Compare September 9, 2026 17:33
@IrisAlexandrescu
IrisAlexandrescu force-pushed the feat/LLMO-7418-phase4-skip-mode-async branch from e888c2a to f822111 Compare September 9, 2026 18:42
@IrisAlexandrescu
IrisAlexandrescu force-pushed the feat/LLMO-7418-expose-provisioning-status branch from 581d363 to feb52c7 Compare September 9, 2026 18:47
@IrisAlexandrescu
IrisAlexandrescu force-pushed the feat/LLMO-7418-phase4-skip-mode-async branch from f822111 to a587be3 Compare September 10, 2026 08:17
@IrisAlexandrescu
IrisAlexandrescu force-pushed the feat/LLMO-7418-expose-provisioning-status branch from feb52c7 to 60e70ad Compare September 10, 2026 08:21
@IrisAlexandrescu
IrisAlexandrescu force-pushed the feat/LLMO-7418-expose-provisioning-status branch from 60e70ad to 24911fc Compare September 10, 2026 08:46
@IrisAlexandrescu
IrisAlexandrescu force-pushed the feat/LLMO-7418-expose-provisioning-status branch from 24911fc to d8befb8 Compare September 10, 2026 09:10
@IrisAlexandrescu
IrisAlexandrescu force-pushed the feat/LLMO-7418-phase4-skip-mode-async branch from b0a89f6 to 90986fd Compare September 10, 2026 10:23
@IrisAlexandrescu
IrisAlexandrescu force-pushed the feat/LLMO-7418-expose-provisioning-status branch from d8befb8 to d4706fd Compare September 10, 2026 10:23
@IrisAlexandrescu
IrisAlexandrescu force-pushed the feat/LLMO-7418-phase4-skip-mode-async branch from 90986fd to f77926a Compare September 10, 2026 11:17
@IrisAlexandrescu
IrisAlexandrescu force-pushed the feat/LLMO-7418-expose-provisioning-status branch from d4706fd to fdc0a01 Compare September 10, 2026 11:17
@IrisAlexandrescu
IrisAlexandrescu force-pushed the feat/LLMO-7418-expose-provisioning-status branch from fdc0a01 to 8473538 Compare September 10, 2026 16:08
@IrisAlexandrescu
IrisAlexandrescu force-pushed the feat/LLMO-7418-phase4-skip-mode-async branch from af1cbe8 to fe80d7d Compare September 10, 2026 17:54
@IrisAlexandrescu
IrisAlexandrescu force-pushed the feat/LLMO-7418-expose-provisioning-status branch from 8473538 to 3925628 Compare September 10, 2026 17:54
…MO-7352/LLMO-7418)

Surfaces brands.semrush_provisioning_status/semrush_provisioning_error as
read-only fields (semrushProvisioningStatus/semrushProvisioningError) on the
V2 Brand DTO. These columns previously existed only for the async
provisioning worker's own internal CAS bookkeeping (getBrandProvisioningState's
narrow PROVISIONING_SELECT) -- no GET response exposed them, so a client had
no way to show a persistent provisioning-status indicator without relying on
an `async: true` create/activate response's one-shot jobId.

mapDbBrandToV2 is the single mapping point for all 3 GET paths
(listBrandsForOrg/getBrandForOrg/getBrandForOrgSite) and the create/update
write-response paths (all route through withSerenityState, which just spreads
whatever the mapper produced) -- fixing it there propagates everywhere for
free, no SELECT/query changes needed since PostgREST's `'*'` already returns
every brands column.

Prerequisite for the frontend UI-states work (LLMO-7419): a persistent
Setting-up/Ready/Setup-failed indicator on the brand list/detail views can't
exist without a backend field to read it from.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@IrisAlexandrescu
IrisAlexandrescu force-pushed the feat/LLMO-7418-expose-provisioning-status branch from 3925628 to 7fc9a1f Compare September 10, 2026 18:35
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