feat(build): add --dynamic flag and infobase.unlock_code config#8
feat(build): add --dynamic flag and infobase.unlock_code config#8steel-code-agent wants to merge 3 commits into
Conversation
- CLI flag `--dynamic` for `build` enables /UpdateDBCfg -Dynamic+ - New config field `build.dynamicUpdate` (default false), CLI overrides config - New config field `infobase.unlock_code` propagates /UC <value> to DESIGNER - Mask unlock_code in command-render logs like password (/UC ***) - Propagate dynamic flag through BuildRequest, McpBuildProjectRequest and the execute_source_set_step pipeline; `load` and tool-extension flows keep the historical static update - Bump version 0.4.2 -> 0.5.0 - Regenerate JSON schemas for v8project.yaml / v8project.local.yaml
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughДобавлены опциональный infobase.unlock_code и конфигурация build.dynamicUpdate, CLI-флаг ChangesПоддержка динамического обновления и кода разблокировки
Sequence Diagram(s)sequenceDiagram
participant CLI as "CLI (--dynamic)"
participant MCP as "MCP build_project"
participant BuildReq as "BuildRequest"
participant Config as "AppConfig"
participant Resolver as "resolve_dynamic_update"
participant Coordinator as "run_build_designer/run_build_edt"
participant Designer as "DesignerDsl::update_db_cfg"
participant V8Conn as "V8Connection (args)"
participant Renderer as "Process::render_command"
CLI->>BuildReq: sets dynamic=true
MCP->>BuildReq: dynamicUpdate=Some(true)
BuildReq->>Resolver: provide per-invocation override
Config->>Resolver: provide build.dynamic_update default
Resolver->>Coordinator: effective dynamic flag
Coordinator->>Designer: call update_db_cfg(extension, dynamic)
V8Conn->>Designer: args() includes /UC <code> (if set)
Designer->>Renderer: command includes /UpdateDBCfg -Dynamic+ (if dynamic)
Renderer->>Renderer: mask /UC and -UC in rendered output
🎯 3 (Умеренная) | ⏱️ ~25 minutes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/mcp/service.rs (1)
806-843: ⚡ Quick winДобавьте проверку поля
dynamic_updateв тесте.Тест
build_project_maps_success_request_and_responseпроверяет маппинг полейfull_rebuildиsource_set(строки 841-842), но не проверяет, чтоdynamic_updateкорректно передаётся вBuildRequest. Добавление этой проверки повысит надёжность теста для критического пути передачи запросов.✅ Предлагаемое дополнение теста
assert_eq!(requests[0].1.full_rebuild, true); assert_eq!(requests[0].1.source_set.as_deref(), Some("main")); +assert_eq!(requests[0].1.dynamic_update, None);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/mcp/service.rs` around lines 806 - 843, The test build_project_maps_success_request_and_response currently asserts full_rebuild and source_set but omits dynamic_update; add an assertion that the BuildRequest received by the port carries the expected dynamic_update value (referencing McpBuildProjectRequest and the captured BuildRequest at service.port.build_requests -> requests[0].1). If you intend to verify the current call with no dynamic update, assert requests[0].1.dynamic_update == None; if you want to test a true value, set dynamic_update: Some(true) on the McpBuildProjectRequest and assert requests[0].1.dynamic_update == Some(true).src/use_cases/build_project.rs (1)
2610-2718: ⚡ Quick winНе хватает регрессии для EDT→Designer ветки.
Новые кейсы проверяют только сборку из Designer-исходников. При этом
resolve_dynamic_update(...)теперь ещё проброшен в EDT-пайплайн, а теста наSourceFormat::Edtс проверкой-Dynamic+/static-поведения здесь нет, поэтому именно эта изменённая ветка останется без защиты от регрессии.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/use_cases/build_project.rs` around lines 2610 - 2718, Add regression tests covering the EDT→Designer branch by duplicating the existing Designer tests but using SourceFormat::Edt and the EDT backend (e.g., BuilderBackend::Edt) where build_config is called; create EDT variants of dynamic_cli_flag_emits_dynamic_marker_in_update_db_cfg, build_dynamic_update_config_default_emits_dynamic_marker, and build_without_dynamic_flag_emits_static_update_db_cfg that mirror their assertions (check for "/UpdateDBCfg" and presence/absence of "-Dynamic+" as appropriate) so the resolve_dynamic_update behavior in the EDT pipeline is exercised.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/use_cases/run_tests/coordinator.rs`:
- Around line 76-81: The prerequisite build is not forcing dynamic_update off
because BuildArgs currently sets dynamic_update: None and
resolve_dynamic_update() falls back to config.build.dynamic_update; change the
BuildArgs construction used for the prerequisite build in coordinator.rs so
dynamic_update is explicitly Some(false) (instead of None) to ensure the test
use case always performs a static update; update the BuildArgs instance where
full_rebuild is false and source_set is None so it passes Some(false) to
dynamic_update and keep resolve_dynamic_update() semantics unchanged.
---
Nitpick comments:
In `@src/mcp/service.rs`:
- Around line 806-843: The test build_project_maps_success_request_and_response
currently asserts full_rebuild and source_set but omits dynamic_update; add an
assertion that the BuildRequest received by the port carries the expected
dynamic_update value (referencing McpBuildProjectRequest and the captured
BuildRequest at service.port.build_requests -> requests[0].1). If you intend to
verify the current call with no dynamic update, assert
requests[0].1.dynamic_update == None; if you want to test a true value, set
dynamic_update: Some(true) on the McpBuildProjectRequest and assert
requests[0].1.dynamic_update == Some(true).
In `@src/use_cases/build_project.rs`:
- Around line 2610-2718: Add regression tests covering the EDT→Designer branch
by duplicating the existing Designer tests but using SourceFormat::Edt and the
EDT backend (e.g., BuilderBackend::Edt) where build_config is called; create EDT
variants of dynamic_cli_flag_emits_dynamic_marker_in_update_db_cfg,
build_dynamic_update_config_default_emits_dynamic_marker, and
build_without_dynamic_flag_emits_static_update_db_cfg that mirror their
assertions (check for "/UpdateDBCfg" and presence/absence of "-Dynamic+" as
appropriate) so the resolve_dynamic_update behavior in the EDT pipeline is
exercised.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 402afecb-3cc5-4ff5-a1fd-9eb38068dcf4
📒 Files selected for processing (22)
SKILL/references/config-and-backends.mdSKILL/references/project-workflows.mddocs/CAPABILITIES.mddocs/CONFIGURATION.mdsrc/cli/args.rssrc/cli/execute.rssrc/config/loader.rssrc/config/model.rssrc/config/schema.rssrc/config/validate.rssrc/mcp/port.rssrc/mcp/request.rssrc/mcp/service.rssrc/platform/connection.rssrc/platform/designer.rssrc/platform/process.rssrc/use_cases/build_project.rssrc/use_cases/build_project/coordinator.rssrc/use_cases/load_artifact.rssrc/use_cases/request.rssrc/use_cases/run_tests/coordinator.rssrc/use_cases/tool_extension.rs
- force static update for test prerequisite builds - cover dynamic update mapping for MCP and EDT Designer builds - refresh config schemas and docs for dynamic update behavior
There was a problem hiding this comment.
🧹 Nitpick comments (1)
docs/schemas/v8project.local.schema.json (1)
246-246: ⚡ Quick winУточните описание
unlock_codeдля случая пустой строки.Сейчас текст выглядит как безусловная передача
/UC <value>, но по поведению PR пустая строка должна означать «не передавать/UC». Лучше зафиксировать это прямо в description, чтобы документация и runtime-семантика не расходились.Предлагаемое изменение
- "description": "Optional local infobase unlock code propagated as `/UC <value>`. Masked in command logs.", + "description": "Optional local infobase unlock code. Non-empty value is propagated as `/UC <value>`; empty string means no unlock code and `/UC` is not passed. Masked in command logs.",🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/schemas/v8project.local.schema.json` at line 246, Update the JSON schema description for the unlock_code property to explicitly state that an empty string means the `/UC` segment is omitted (i.e., do not send `/UC`) and that non-empty values are propagated as `/UC <value>` and masked in logs; modify the "description" text for the unlock_code field to include this explicit behavior so documentation matches runtime semantics.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@docs/schemas/v8project.local.schema.json`:
- Line 246: Update the JSON schema description for the unlock_code property to
explicitly state that an empty string means the `/UC` segment is omitted (i.e.,
do not send `/UC`) and that non-empty values are propagated as `/UC <value>` and
masked in logs; modify the "description" text for the unlock_code field to
include this explicit behavior so documentation matches runtime semantics.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 32ba5b78-0731-408d-8229-a2933ca325a0
📒 Files selected for processing (9)
SKILL/SKILL.mddocs/CAPABILITIES.mddocs/DEEP_DIVE.mddocs/schemas/v8project.local.schema.jsondocs/schemas/v8project.schema.jsonsrc/config/loader.rssrc/mcp/service.rssrc/use_cases/build_project.rssrc/use_cases/run_tests/coordinator.rs
✅ Files skipped from review due to trivial changes (3)
- docs/DEEP_DIVE.md
- SKILL/SKILL.md
- docs/schemas/v8project.schema.json
🚧 Files skipped from review as they are similar to previous changes (3)
- docs/CAPABILITIES.md
- src/config/loader.rs
- src/use_cases/build_project.rs
- document that empty unlock_code omits /UC - refresh generated config schemas
Summary
Adds two related capabilities required when the configuration database is protected by an
exclusive lock or by an admin-set password:
--dynamicflag forbuild— emits/UpdateDBCfg -Dynamic+so the build can runwhile the infobase has live HTTP services or background jobs holding the exclusive lock.
infobase.unlock_codeconfig field — propagates/UC <value>to every DESIGNERinvocation. Without it any administrative operation against a locked infobase is rejected
by the platform.
Behavior
v8-runner build --dynamic. Equivalent project-wide default:build.dynamicUpdate: trueinv8project.yaml. CLI overrides config for one invocation.infobase.unlock_code: '<code>'. Empty value is treated as "no unlockcode" so
unlock_code: ''overlays do not accidentally push/UCwithout a value./UC <value>is masked in command-render logs the same way the password is masked(
/UC ***), so it never ends up in build logs / agent traces.dynamicflag is threaded throughBuildRequest,McpBuildProjectRequestand theexecute_source_set_steppipeline. Theloadand tool-extension flows keep the historicalstatic
/UpdateDBCfg(no-Dynamic+), matching the upstream conservative default.Failure modes
surfaces that error verbatim and does NOT fall back to a static update — the operator
decides whether to retry without
--dynamic(and gain exclusive access first).unlock_codeproduces the platform's own "code mismatch" error fromDESIGNER; no v8-runner-side guessing.
Why both at once
Locked infobases in production typically combine both safeguards (password-protected DBCfg
and active sessions). Splitting these into two PRs would force one to land first without
a usable end-to-end path. They share the same plumbing (BuildRequest, designer.rs render,
schema regen, version bump 0.4.2 → 0.5.0).
Files
src/cli/args.rs,src/cli/execute.rs—--dynamicflag wiring.src/config/{loader,model,schema,validate}.rs—build.dynamicUpdateandinfobase.unlock_codeparsing/validation.src/use_cases/request.rs,src/use_cases/build_project*.rs,src/use_cases/run_tests/coordinator.rs,src/use_cases/load_artifact.rs,src/use_cases/tool_extension.rs.src/platform/connection.rs(/UCargv),src/platform/designer.rs(
-Dynamic+),src/platform/process.rs(log masking).src/mcp/{port,request,service}.rs— propagatedynamicover MCP.docs/CAPABILITIES.md,docs/CONFIGURATION.md,SKILL/references/{config-and-backends,project-workflows}.md.docs/schemas/v8project*.schema.jsonregenerated.Testing
cargo build --releasepasses on Linux (gcc).gbig_pam_ai(8.3.27.2074) —/UCreaches DESIGNER in argv,/UpdateDBCfg -Dynamic+is emitted when--dynamicis set, masked properly in logs.Note
Rebased on top of latest
upstream/master(postchore(release): bump version to 0.5.0).Cargo.lock auto-merged. Conflicts were limited to the schema
$idURL (resolved by keepingthe upstream
masterURL) and a doc path moved fromv8-runner/references/toSKILL/references/in upstream (content reapplied in the new location).Summary by CodeRabbit
Новые функции
Документация