Repository navigation
feat: support composed CLI render registries - #671
Conversation
|
| pub fn register_cloudformation_registry_extension(extension: CloudFormationRegistryExtension) { | ||
| CLOUDFORMATION_REGISTRY_EXTENSION | ||
| .set(extension) | ||
| .expect("CloudFormation registry extension already registered"); | ||
| } |
There was a problem hiding this comment.
Registry composition lacks tests
The new process-global hooks are not covered by a test that registers an extension and confirms a fresh registry contains both built-in and extension emitters. The only existing render unit test covers Azure preflight mutation, so incorrect callback wiring, skipped callbacks, or lost built-ins could reach downstream composed CLIs without being caught here. Please add isolated integration coverage for both generator hooks; using a separate test binary would avoid leaking the OnceLock state into other tests.
Knowledge Base Used: Deployment and packaging
Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/alien-cli/src/commands/render.rs
Line: 24-28
Comment:
**Registry composition lacks tests**
The new process-global hooks are not covered by a test that registers an extension and confirms a fresh registry contains both built-in and extension emitters. The only existing render unit test covers Azure preflight mutation, so incorrect callback wiring, skipped callbacks, or lost built-ins could reach downstream composed CLIs without being caught here. Please add isolated integration coverage for both generator hooks; using a separate test binary would avoid leaking the `OnceLock` state into other tests.
**Knowledge Base Used:** [Deployment and packaging](https://app.greptile.com/alien/-/custom-context/knowledge-base/alienplatform/alien/-/docs/deployment-and-packaging.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Background
The official Alien developer CLI is composed in the Platform repository so it can include Platform-owned cloud controllers. Terraform and CloudFormation have the same OSS/private split: OSS owns the generator and registry, while Platform owns additional emitters in
alien-terraformxandalien-cloudformationx.The registries are already intentionally extensible, but
alien renderalways constructedbuilt_in()internally. A composed binary therefore could register runtime controllers but could not make its Platform emitters visible to the shared render command.Root cause
render_cloudformationandrender_terraformcreated their registries inside private command functions with no composition hook. The only alternatives were duplicating the render command in Platform or moving Platform emitters into OSS; neither matches the existing ownership boundary.Change
Add one process-startup registration hook per generator:
Each render invocation starts with the normal OSS
built_in()registry and then applies the registered extension. The ordinary OSSalienbinary registers nothing and behaves exactly as before. Duplicate registration fails immediately, matching the existing controller-extension contract.End-to-end use
The Platform
alien-clixcomposition root will register:alien_terraformx::register_platform_extensionsalien_cloudformationx::register_platform_extensionsbefore delegating to the shared
alien_cli::run_cli. Commands, parsing, output, and generators remain implemented in OSS Alien.Verification
cargo fmt -p alien-cli