Skip to content

feat: host Compose preview plugin builds on the backend (host-compose-preview-plugin) - #124

Merged
raininforest merged 31 commits into
devfrom
docs/select-compose-preview-plugin-by-meta-version
Oct 23, 2026
Merged

raininforest merged 31 commits into
devfrom
docs/select-compose-preview-plugin-by-meta-version

Conversation

@raininforest

@raininforest raininforest commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Что

Change host-compose-preview-plugin: бэкенд DSB принимает и хранит плагин Compose preview, а клиент получает у него адрес актуального билда. Спеки (OpenSpec) и реализация в одном PR; база feature/ds-versions.

  • ds-service: реестр билдов compose_preview_plugin_builds (Flyway V8), POST /api/admin/compose-preview/plugin-builds (архив и нормализованная мета одним запросом): проверки архива и manifest, заливка в S3, импорт меты и активный билд в одной транзакции, идемпотентность, пробная отправка по умолчанию, очистка; GET /api/projects/{projectId}/ds/compose-preview/plugin.
  • identity-gateway, authorization-core, Keycloak: служебная учётка dsbuilder-preview-publisher с ролью compose_preview_publisher, доверенный заголовок X-Compose-Preview-Publisher; роль не открывает импорт меты и проектные маршруты.
  • CLI: dsbuilder preview-plugin publish --platform compose --from <zip> [--apply], вход служебной учёткой из DSBUILDER_CLIENT_ID и DSBUILDER_CLIENT_SECRET (секрет не принимается аргументом); задача packageJvmCli и workflow релиза CLI (cli-vX.Y.Z).
  • Клиент: адрес плагина от бэкенда, VITE_COMPOSE_PREVIEW_PLUGIN_URL остаётся прямым переопределением.
  • Локальный контур и деплой: MinIO с бакетом compose-preview, переменные DS_PLUGIN_*, bootstrap Keycloak, DEPLOY.md.

Принятое ограничение: плагин в бакете клиента, общий origin принят как риск, пока плагин публикует только команда SDDS.

Парный PR в plasma-android (сборка и отправка из CI): salute-developers/plasma-android#955.

Проверено

  • cd backend-kt && ./gradlew build (все сервисы), cd frontend-kt && ./gradlew build (JVM, JS, macOS), cd js/apps/client && npm run build && npm test.
  • Интеграционные тесты публикации на PostgreSQL (Testcontainers): роли, проверки архива и manifest, идемпотентность, откат повторной публикацией, очистка, адрес для проекта.
  • Не проверено сквозь настоящий контур (./setup-local.sh) и на dev-окружении; секреты и инфраструктура (префикс бакета, CORS, ключ записи) не заведены.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3b85c53f-5cbb-406e-8f57-42c1972232bb
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@raininforest raininforest self-assigned this Oct 20, 2026
@raininforest raininforest changed the title docs(openspec): Add select-compose-preview-plugin-by-meta-version change docs(openspec): Add host-compose-preview-plugin change Oct 20, 2026
@raininforest
raininforest force-pushed the docs/select-compose-preview-plugin-by-meta-version branch 2 times, most recently from e98ad92 to b97eff8 Compare October 21, 2026 07:04
@raininforest
raininforest changed the base branch from dev to feature/ds-versions October 21, 2026 07:04
@raininforest raininforest changed the title docs(openspec): Add host-compose-preview-plugin change feat: host Compose preview plugin builds on the backend (host-compose-preview-plugin) Oct 21, 2026
@neretin-trike

Copy link
Copy Markdown
Collaborator

а пока ещё не решили, как сидить компоненты при локальной разработке (и не только) для compose?

@raininforest

Copy link
Copy Markdown
Contributor Author

а пока ещё не решили, как сидить компоненты при локальной разработке (и не только) для compose?

я пока этим не занимался. это лучше отдельно делать, чтобы не задерживать этот ПР

@raininforest
raininforest force-pushed the docs/select-compose-preview-plugin-by-meta-version branch from 0701312 to 13b29b6 Compare October 22, 2026 11:03
@malilex
malilex force-pushed the feature/ds-versions branch from 74386d7 to d143d81 Compare October 22, 2026 12:26
@raininforest
raininforest force-pushed the docs/select-compose-preview-plugin-by-meta-version branch from 13b29b6 to 41631c1 Compare October 22, 2026 13:08
@raininforest
raininforest changed the base branch from feature/ds-versions to dev October 22, 2026 13:08
@raininforest
raininforest force-pushed the docs/select-compose-preview-plugin-by-meta-version branch 4 times, most recently from 6f6be97 to 069f879 Compare October 23, 2026 08:14
…ive size

nginx checks the body size of an auth_request subrequest against its own
location, so the 2m server limit rejected the plugin archive with 413 before
the route limit of 64m applied. Give /_auth_user the same limit and cover it
in the route test; mark the end-to-end tasks 6.8 and 7.5 of host-compose-preview-plugin.
…orm-params

The versioned editor model returned platformMappings.compose = null for
every property, so the Compose preview failed with 'has no Compose mapping'.
…archives above the meta limit

Publication, activation and cleanup now run under one advisory lock, so
concurrent publications of one build cannot overwrite accepted files and
cleanup cannot delete a build that a rollback activates. The multipart
parser limit follows the archive limit; the meta size is checked apart.
- minio gets a named volume: the buckets were lost on a Docker restart while the
  registry still listed the plugin builds as published.
- import-compose-components.sh no longer links components with raw SQL: it queried a
  column that does not exist (design_systems.name) and bypassed the revision tables.
  The links are created by 'dsbuilder components push'.
…iew payload

A property whose value is a shape token with an adjustment failed with
'Adjustment ... requires a number'. The protocol cannot carry an adjustment
on a token reference, so the payload gets a derived theme token
<token>@adjust(<n>) with the radii shifted (never below zero).
…e the schema counts after the rebase

feature/ds-versions now owns V7-V11, so the registry migration becomes V12;
migration counts, operation counts and the schema fingerprint follow.
…, a design system and a theme

setup-local.sh now leaves a working Compose preview in the component editor on any machine, without building
anything in other repositories:

- publish-compose-plugin.sh sends a plugin archive (file or URL) through the dsbuilder CLI as the plasma-android CI
  does: the backend stores the files in the local MinIO, imports the API meta from the archive and activates the
  build. The installed CLI may not know the command, so the JVM CLI of this repository is built when needed.
- seed-local-design-system.sh creates a design system and a theme through the API, replaces the Android token values
  with those of a theme-converter theme package (apply_theme_values.py) and loads a component package with
  'components push'.
- local-dev/ bundles the plugin archive, the sdds_serv theme (Android values) and the component package;
  refresh-local-dev-assets.sh updates them (the plugin is built in plasma-android, the theme and components are
  downloaded from theme-converter in the versions that the token module declares).
- Options --plugin-zip, --components-package, --theme-package, --skip-plugin and --skip-design-system override or
  skip the steps.
- The client no longer defaults to the stale http://localhost:8081/ plugin address, so it asks the backend for the
  active build.
…tor model migration

dev took V12 for appearance_editor_model, so the registry migration becomes V13; migration counts, the operation
count and the schema fingerprint of the Flyway tests follow, and the change specs name V13.
The Web/Compose switch was hidden unless both platforms had components, so a design system with Compose
components only showed no switch. Both tabs are shown now and the platform without components is disabled.
dev's test mock answers property-platform-params with an empty list because the lazy editor reads fetch it for Web
only; the Compose mapping test needs the list, so the mock can be switched to the test's own answer.
@raininforest
raininforest force-pushed the docs/select-compose-preview-plugin-by-meta-version branch from 9cdb57d to 37bf808 Compare October 23, 2026 10:36
@raininforest
raininforest merged commit 13f382b into dev Oct 23, 2026
18 checks passed
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.

3 participants