Repository navigation
Add Component Registry Pattern and Mock Component - #1648
Conversation
📝 WalkthroughWalkthroughAdds a component plugin model and registry: new Changes
Sequence Diagram(s)sequenceDiagram
participant CLI as Atmos CLI
participant Registry as Component Registry
participant Provider as ComponentProvider
participant Config as AtmosConfiguration
rect rgb(221,235,247)
Note over Registry,Provider: Init / self-registration
CLI->>Registry: Initialize()
Provider-->>Registry: init() self-registers
end
rect rgb(247,247,247)
Note over CLI,Registry: Discovery
CLI->>Registry: ListTypes()
Registry-->>CLI: ["terraform","mock",...]
end
rect rgb(230,244,234)
Note over CLI,Provider: Provider interactions
CLI->>Registry: GetProvider("mock")
Registry-->>CLI: MockComponentProvider
CLI->>Provider: ListComponents(stack, stackConfig)
Provider->>Config: Read component config (Plugins or built-in)
Provider-->>CLI: ["comp-a","comp-b"]
CLI->>Provider: ValidateComponent(componentConfig)
Provider-->>CLI: nil / ErrComponentValidationFailed
CLI->>Provider: Execute(ExecutionContext)
Provider-->>CLI: success / ErrComponentExecutionFailed
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (4)
🧰 Additional context used📓 Path-based instructions (4)go.{mod,sum}📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
Files:
**/*.go📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
Files:
**/!(*_test).go📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
Files:
errors/errors.go📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🧠 Learnings (1)📚 Learning: 2025-10-21T14:49:59.324ZApplied to files:
🪛 LanguageToolCLAUDE.md[typographical] ~945-~945: Consider using a typographic opening quote here. (EN_QUOTES) [typographical] ~945-~945: Consider using a typographic close quote here. (EN_QUOTES) docs/developing-component-plugins.md[typographical] ~768-~768: Consider using a typographic close quote here. (EN_QUOTES) [typographical] ~805-~805: In American English, use a period after an abbreviation. (MISSING_PERIOD_AFTER_ABBREVIATION) [style] ~827-~827: Try moving the adverb to make the sentence clearer. (SPLIT_INFINITIVE) ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
🔇 Additional comments (4)
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 |
|
Warning This PR exceeds the recommended limit of 1,000 lines.Large PRs are difficult to review and may be rejected due to their size. Please verify that this PR does not address multiple issues. |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
pkg/component/mock/config.go (1)
3-26: Consider enhancing the godoc comment.The current comment describes the Config purpose well. For optimal godoc generation, consider starting with "Config represents..." directly before the type declaration.
-// Config represents the configuration structure for mock components. -// This configuration is stored in the Components.Plugins map in atmos.yaml. -// It's designed to test inheritance and merging behavior across global, stack, -// and component configuration levels. +// Config represents the configuration structure for mock components stored in the +// Components.Plugins map in atmos.yaml. It's designed to test inheritance and merging +// behavior across global, stack, and component configuration levels. type Config struct {pkg/component/mock/mock.go (1)
117-139: Consider adding WeaklyTypedInput to decoder config.The parseConfig function creates a mapstructure decoder without
WeaklyTypedInput: true. While the fallback to DefaultConfig() makes this safe, adding WeaklyTypedInput would provide more flexibility in config parsing and match the pattern shown in the documentation.Apply this diff if you want more flexible config parsing:
decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{ - Result: &config, - TagName: "mapstructure", + Result: &config, + WeaklyTypedInput: true, + TagName: "mapstructure", })
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (13)
.gitignore(1 hunks)docs/developing-component-plugins.md(1 hunks)docs/prd/component-registry-pattern.md(1 hunks)errors/errors.go(1 hunks)pkg/component/mock/config.go(1 hunks)pkg/component/mock/mock.go(1 hunks)pkg/component/mock/mock_test.go(1 hunks)pkg/component/provider.go(1 hunks)pkg/component/registry.go(1 hunks)pkg/component/registry_test.go(1 hunks)pkg/datafetcher/schema/config/global/1.0.json(1 hunks)pkg/datafetcher/schema/stacks/stack-config/1.0.json(1 hunks)pkg/schema/schema.go(1 hunks)
🧰 Additional context used
📓 Path-based instructions (8)
pkg/datafetcher/schema/{config/global,atmos/manifest,stacks/stack-config,vendor/package}/1.0.json
📄 CodeRabbit inference engine (CLAUDE.md)
When adding Atmos configuration options, update all schema files for global, manifest, stacks, and vendor package (all four 1.0.json files).
Files:
pkg/datafetcher/schema/config/global/1.0.jsonpkg/datafetcher/schema/stacks/stack-config/1.0.json
pkg/**/*.go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
Place business logic in pkg rather than in cmd
Files:
pkg/component/mock/mock_test.gopkg/schema/schema.gopkg/component/provider.gopkg/component/registry_test.gopkg/component/mock/config.gopkg/component/registry.gopkg/component/mock/mock.go
**/*_test.go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
**/*_test.go: Every new feature must include comprehensive unit tests
Test both happy paths and error conditions
Use table-driven tests for multiple scenarios
**/*_test.go: Use table-driven unit tests for pure functions and focus on behavior; co-locate tests; target >80% coverage for pkg/ and internal/exec/.
Always use t.Skipf() with a clear reason; never use t.Skip() or t.Skipf without a reason.
Files:
pkg/component/mock/mock_test.gopkg/component/registry_test.go
**/*.go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
**/*.go: All code must pass golangci-lint checks
Follow Go error handling idioms and use meaningful error messages
Wrap errors with context using fmt.Errorf("context: %w", err)
Consider custom error types for domain-specific errors
Follow standard Go coding style; run gofmt and goimports
Use snake_case for environment variables
Document complex logic with inline comments
**/*.go: All Go comments must end with periods; applies to single-line, multi-line, inline, and documentation comments (golangci-lint godot).
Group imports into three sections (stdlib, 3rd-party, Atmos), separated by blank lines; sort alphabetically within each group; preserve existing aliases.
Configuration loading must use Viper with precedence CLI → ENV → files → defaults; bind config name atmos and add path, AutomaticEnv, and ATMOS prefix.
All errors must be wrapped using static errors (defined in errors/errors.go); use errors.Join for multiple errors; fmt.Errorf with %w for context; use errors.Is for checks; never compare error strings.
Distinguish structured logging from UI output: UI prompts/status/errors to stderr; data/results to stdout; never use logging for UI.
Most text UI must go to stderr; only data/results to stdout; prefer utils.PrintfMessageToTUI for UI messages.
All new configurations must support Go templating using existing utilities and available template functions.
Prefer SDKs over external binaries for cross-platform support; use filepath/os/runtime for portability.
For non-standard execution paths, capture telemetry via telemetry.CaptureCmd or telemetry.CaptureCmdString without user data.
80% minimum coverage on new/changed lines and include unit tests for new features; add integration tests for CLI using tests/ fixtures.
Always bind environment variables with viper.BindEnv and provide ATMOS_ alternatives for every env var.
Use structured logging with levels (Fatal>Error>Warn>Debug>Trace); avoid string interpolation and ensure logging does not affect execution.
Prefer re...
Files:
pkg/component/mock/mock_test.gopkg/schema/schema.gopkg/component/provider.gopkg/component/registry_test.gopkg/component/mock/config.goerrors/errors.gopkg/component/registry.gopkg/component/mock/mock.go
**/{mock_*.go,mock/*.go}
📄 CodeRabbit inference engine (CLAUDE.md)
Generate and keep mocks alongside the interfaces they mock; mocks are excluded from coverage.
Files:
pkg/component/mock/mock_test.gopkg/component/mock/config.gopkg/component/mock/mock.go
pkg/**/*_test.go
📄 CodeRabbit inference engine (CLAUDE.md)
Unit tests for packages live under pkg/ alongside implementation files.
Files:
pkg/component/mock/mock_test.gopkg/component/registry_test.go
**/!(*_test).go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
Document all exported functions, types, and methods with Go doc comments
Add
defer perf.Track()to all public functions and critical private functions; include a blank line after the call; use package-prefixed names; pass atmosConfig when present, else nil.
Files:
pkg/schema/schema.gopkg/component/provider.gopkg/component/mock/config.goerrors/errors.gopkg/component/registry.gopkg/component/mock/mock.go
errors/errors.go
📄 CodeRabbit inference engine (CLAUDE.md)
Define all static errors centrally in errors/errors.go as package-level vars.
Files:
errors/errors.go
🧠 Learnings (3)
📚 Learning: 2025-09-23T02:30:42.362Z
Learnt from: CR
PR: cloudposse/atmos#0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-09-23T02:30:42.362Z
Learning: Applies to **/*_test.go : Every new feature must include comprehensive unit tests
Applied to files:
pkg/component/mock/mock_test.go
📚 Learning: 2025-10-16T15:18:00.319Z
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-16T15:18:00.319Z
Learning: Applies to internal/exec/*_test.go : Add comprehensive tests for template functions under internal/exec/ with *_test.go files.
Applied to files:
pkg/component/mock/mock_test.go
📚 Learning: 2025-10-16T15:18:00.319Z
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-16T15:18:00.319Z
Learning: Applies to pkg/store/**/*.go : Implement multi-provider interfaces in separate files per provider and register providers in a registry.
Applied to files:
pkg/component/registry.go
🧬 Code graph analysis (5)
pkg/component/mock/mock_test.go (4)
pkg/component/mock/mock.go (1)
MockComponentProvider(20-20)pkg/schema/schema.go (2)
AtmosConfiguration(27-65)Components(357-367)pkg/component/provider.go (1)
ExecutionContext(48-59)pkg/component/mock/config.go (2)
DefaultConfig(29-38)Config(7-26)
pkg/component/provider.go (1)
pkg/schema/schema.go (3)
AtmosConfiguration(27-65)Context(409-424)ConfigAndStacksInfo(488-567)
pkg/component/registry_test.go (4)
pkg/schema/schema.go (2)
AtmosConfiguration(27-65)Context(409-424)pkg/component/provider.go (2)
ExecutionContext(48-59)ComponentProvider(14-45)pkg/component/registry.go (8)
Reset(119-124)Register(29-44)Count(88-93)GetProvider(48-54)ListTypes(74-85)ListProviders(58-70)GetInfo(97-115)MustGetProvider(128-134)errors/errors.go (3)
ErrComponentProviderNil(153-153)ErrComponentTypeEmpty(154-154)ErrComponentProviderNotFound(152-152)
pkg/component/registry.go (2)
pkg/component/provider.go (2)
ComponentProvider(14-45)ComponentInfo(62-67)errors/errors.go (3)
ErrComponentProviderNil(153-153)ErrComponentTypeEmpty(154-154)ErrComponentProviderNotFound(152-152)
pkg/component/mock/mock.go (5)
pkg/component/registry.go (1)
Register(29-44)pkg/schema/schema.go (3)
AtmosConfiguration(27-65)Components(357-367)Context(409-424)pkg/component/mock/config.go (2)
DefaultConfig(29-38)Config(7-26)errors/errors.go (1)
ErrComponentValidationFailed(157-157)pkg/component/provider.go (1)
ExecutionContext(48-59)
🪛 LanguageTool
docs/developing-component-plugins.md
[grammar] ~590-~590: There might be a mistake here.
Context: ...settings for all components of this type 2. Stack Level (stack manifest files): St...
(QB_NEW_EN)
[grammar] ~591-~591: There might be a mistake here.
Context: ...anifest files): Stack-specific overrides 3. Component Level (within stack manifest...
(QB_NEW_EN)
[grammar] ~692-~692: There might be a mistake here.
Context: ...st Coverage Aim for >90% test coverage: - Unit tests for all interface methods - T...
(QB_NEW_EN)
[grammar] ~693-~693: There might be a mistake here.
Context: ...: - Unit tests for all interface methods - Table-driven tests for configuration par...
(QB_NEW_EN)
[grammar] ~694-~694: There might be a mistake here.
Context: ...e-driven tests for configuration parsing - Integration tests for complete workflows...
(QB_NEW_EN)
[grammar] ~695-~695: There might be a mistake here.
Context: ...Integration tests for complete workflows - Error case testing ### 6. Documentation...
(QB_NEW_EN)
[grammar] ~700-~700: There might be a mistake here.
Context: .... Documentation Document your provider: - Package-level documentation - Config str...
(QB_NEW_EN)
[grammar] ~701-~701: There might be a mistake here.
Context: ... provider: - Package-level documentation - Config struct field documentation - Publ...
(QB_NEW_EN)
[grammar] ~702-~702: There might be a mistake here.
Context: ...tion - Config struct field documentation - Public method documentation - Usage exam...
(QB_NEW_EN)
[grammar] ~703-~703: There might be a mistake here.
Context: ...umentation - Public method documentation - Usage examples ## Integration with Atmo...
(QB_NEW_EN)
[grammar] ~730-~730: There might be a mistake here.
Context: ..., dry_run, tags, metadata, dependencies) - Array merging (tags) - Deep object mergi...
(QB_NEW_EN)
[grammar] ~731-~731: There might be a mistake here.
Context: ...ta, dependencies) - Array merging (tags) - Deep object merging (metadata) - Cross-c...
(QB_NEW_EN)
[grammar] ~732-~732: There might be a mistake here.
Context: ... (tags) - Deep object merging (metadata) - Cross-component dependencies (dependenci...
(QB_NEW_EN)
[grammar] ~733-~733: There might be a mistake here.
Context: ...ponent dependencies (dependencies array) - Complete test coverage (>95%) ## Testin...
(QB_NEW_EN)
[grammar] ~758-~758: There might be a mistake here.
Context: ...: Ensure your package is imported (even with blank import _) in a package that's l...
(QB_NEW_EN)
[grammar] ~764-~764: There might be a mistake here.
Context: ...ed, custom config ignored Solution: 1. Verify your config is in the correct loc...
(QB_NEW_EN)
[grammar] ~765-~765: There might be a mistake here.
Context: ... correct location in atmos.yaml under components.yourtype 2. Check mapstructure tags match YAML field...
(QB_NEW_EN)
[typographical] ~766-~766: Consider using a typographic close quote here.
Context: ...ucture tags match YAML field names (use yaml:"field_name") 3. Ensure `GetComponentCon...
(EN_QUOTES)
[grammar] ~766-~766: There might be a mistake here.
Context: ...ML field names (use yaml:"field_name") 3. Ensure GetComponentConfig() is called ...
(QB_NEW_EN)
[typographical] ~803-~803: In American English, use a period after an abbreviation.
Context: ...r) } return nil } ``` ### SDK vs CLI Execution Prefer using Go SDKs ove...
(MISSING_PERIOD_AFTER_ABBREVIATION)
[style] ~825-~825: Try moving the adverb to make the sentence clearer.
Context: ...Path The component registry pattern is designed to eventually migrate all component types to plugins: Phase 1-3 (Current): B...
(SPLIT_INFINITIVE)
[grammar] ~836-~836: There might be a mistake here.
Context: ...view the mock component implementation: pkg/component/mock/ - Check the component registry pattern PRD...
(QB_NEW_EN)
[grammar] ~837-~837: There might be a mistake here.
Context: ...eck the component registry pattern PRD: docs/prd/component-registry-pattern.md - See interface definition: `pkg/component...
(QB_NEW_EN)
[grammar] ~838-~838: There might be a mistake here.
Context: ...pattern.md- See interface definition:pkg/component/provider.go` - Look at existing built-in types for patt...
(QB_NEW_EN)
docs/prd/component-registry-pattern.md
[grammar] ~52-~52: There might be a mistake here.
Context: ...ion (terraform/helmfile/packer commands) 3. Enable future extensibility - Plugin s...
(QB_NEW_EN)
[grammar] ~93-~93: There might be a mistake here.
Context: ...gistry** - Same patterns and conventions 2. Self-registration - Components registe...
(QB_NEW_EN)
[grammar] ~95-~95: There might be a mistake here.
Context: ... Interface-based instead of string-based 4. Backward compatibility - Wraps existin...
(QB_NEW_EN)
[grammar] ~96-~96: There might be a mistake here.
Context: ...bility** - Wraps existing implementation 5. Testability - Mock providers for unit ...
(QB_NEW_EN)
[grammar] ~97-~97: There might be a mistake here.
Context: ...bility** - Mock providers for unit tests 6. Plugin readiness - Foundation for futu...
(QB_NEW_EN)
[grammar] ~98-~98: There might be a mistake here.
Context: ...- Foundation for future external plugins 7. Component-specific schemas - Each comp...
(QB_NEW_EN)
[style] ~99-~99: Since ownership is already implied, this phrasing may be redundant.
Context: ...schemas** - Each component type defines its own configuration structure 8. **Cross-comp...
(PRP_OWN)
[grammar] ~99-~99: There might be a mistake here.
Context: ... defines its own configuration structure 8. Cross-component dependencies - Compone...
(QB_NEW_EN)
[grammar] ~259-~259: There might be a mistake here.
Context: ...rs` - Provider configuration (Terraform) 3. **Each component type validates its own sc...
(QB_NEW_EN)
[style] ~260-~260: Since ownership is already implied, this phrasing may be redundant.
Context: ...orm) 3. Each component type validates its own schema via ValidateComponent() ###...
(PRP_OWN)
[style] ~309-~309: Try replacing ‘care’ with a synonym to elevate your writing.
Context: ...omponent-type agnostic** - the registry doesn't care about internal structure. ### Cross-Componen...
(DONT_CARE)
[style] ~496-~496: Since ownership is already implied, this phrasing may be redundant.
Context: ...lse **Component providers validate their own settings:** go func (t *TerraformCo...
(PRP_OWN)
[grammar] ~563-~563: There might be a mistake here.
Context: ...erraform, helmfile, packer): Access via atmosConfig.Components.Terraform.BasePath 2. Plugin types (mock, pulumi, cdk): Acce...
(QB_NEW_EN)
[grammar] ~564-~564: There might be a mistake here.
Context: ...types** (mock, pulumi, cdk): Access via atmosConfig.Components.Plugins["mock"] 3. Helper method unifies access: `GetComp...
(QB_NEW_EN)
[style] ~569-~569: Since ownership is already implied, this phrasing may be redundant.
Context: ...:** Each component provider can define its own config structure: ```go // pkg/compone...
(PRP_OWN)
[grammar] ~611-~611: There might be a mistake here.
Context: ...` } ``` This gradual migration ensures: - ✅ No breaking changes during transition ...
(QB_NEW_EN)
[grammar] ~612-~612: There might be a mistake here.
Context: ... ✅ No breaking changes during transition - ✅ Terraform/Helmfile/Packer continue to ...
(QB_NEW_EN)
[grammar] ~613-~613: There might be a mistake here.
Context: ...rraform/Helmfile/Packer continue to work - ✅ New plugins use modern pattern - ✅ Bui...
(QB_NEW_EN)
[grammar] ~1089-~1089: There might be a mistake here.
Context: ...try: 1. atmos describe affected ✅ - Iterates through registered component ty...
(QB_NEW_EN)
[grammar] ~1092-~1092: Please add a punctuation mark at the end of paragraph.
Context: ...overy - No changes to affected logic needed 2. atmos list components ✅ - ...
(PUNCTUATION_PARAGRAPH_END)
[grammar] ~1096-~1096: There might be a mistake here.
Context: ... provider.ListComponents() for each type - Maintains current filtering and deduplic...
(QB_NEW_EN)
[grammar] ~1097-~1097: Please add a punctuation mark at the end of paragraph.
Context: ...pe - Maintains current filtering and deduplication 3. atmos describe stacks ✅ - ...
(PUNCTUATION_PARAGRAPH_END)
[grammar] ~1099-~1099: There might be a mistake here.
Context: ...cation 3. atmos describe stacks ✅ - Stack processing remains unchanged - ...
(QB_NEW_EN)
[grammar] ~1110-~1110: There might be a mistake here.
Context: ...ute() instead of type-specific functions - Existing execution logic wrapped by prov...
(QB_NEW_EN)
[grammar] ~1111-~1111: There might be a mistake here.
Context: ...ing execution logic wrapped by providers - No behavior changes ### Backward Compat...
(QB_NEW_EN)
[grammar] ~1112-~1112: Please add a punctuation mark at the end of paragraph.
Context: ...c wrapped by providers - No behavior changes ### Backward Compatibility **No break...
(PUNCTUATION_PARAGRAPH_END)
[grammar] ~1452-~1452: There might be a mistake here.
Context: ...ckage | Minimum Coverage | Focus Areas | |---------|------------------|----------...
(QB_NEW_EN)
[grammar] ~1453-~1453: There might be a mistake here.
Context: ...------|------------------|-------------| | pkg/component/registry.go | 90% ...
(QB_NEW_EN)
[grammar] ~1454-~1454: There might be a mistake here.
Context: ...nctions, concurrent access, edge cases | | pkg/component/mock/mock.go | 90%...
(QB_NEW_EN)
[grammar] ~1455-~1455: There might be a mistake here.
Context: ...terface methods, validation, execution | | pkg/component/provider.go | 100%...
(QB_NEW_EN)
[grammar] ~1473-~1473: There might be a mistake here.
Context: ...Tested:** 1. Registry Core Functions: - ✅ Register() - single and multiple provi...
(QB_NEW_EN)
[grammar] ~1474-~1474: There might be a mistake here.
Context: ...gister() - single and multiple providers - ✅ GetProvider() - found and not found ca...
(QB_NEW_EN)
[grammar] ~1475-~1475: There might be a mistake here.
Context: ...etProvider() - found and not found cases - ✅ ListTypes() - empty, single, multiple ...
(QB_NEW_EN)
[grammar] ~1476-~1476: There might be a mistake here.
Context: ...tTypes() - empty, single, multiple types - ✅ ListProviders() - grouping by category...
(QB_NEW_EN)
[grammar] ~1477-~1477: There might be a mistake here.
Context: ...✅ ListProviders() - grouping by category - ✅ Count() - accurate count tracking -...
(QB_NEW_EN)
[grammar] ~1478-~1478: There might be a mistake here.
Context: ... - ✅ Count() - accurate count tracking - ✅ Reset() - complete cleanup - ✅ Regi...
(QB_NEW_EN)
[grammar] ~1479-~1479: There might be a mistake here.
Context: ...acking - ✅ Reset() - complete cleanup - ✅ RegisterAll() - success and error case...
(QB_NEW_EN)
[grammar] ~1482-~1482: There might be a mistake here.
Context: ...ess and error cases 2. Thread Safety: - ✅ Concurrent registration (100+ goroutin...
(QB_NEW_EN)
[grammar] ~1483-~1483: There might be a mistake here.
Context: ...oncurrent registration (100+ goroutines) - ✅ Concurrent reads (50+ goroutines) -...
(QB_NEW_EN)
[grammar] ~1484-~1484: There might be a mistake here.
Context: ... - ✅ Concurrent reads (50+ goroutines) - ✅ Concurrent read/write mix - ✅ Race ...
(QB_NEW_EN)
[grammar] ~1485-~1485: There might be a mistake here.
Context: ...utines) - ✅ Concurrent read/write mix - ✅ Race detector enabled (go test -race...
(QB_NEW_EN)
[grammar] ~1488-~1488: There might be a mistake here.
Context: ...t -race`) 3. Mock Component Provider: - ✅ GetType() returns "mock" - ✅ GetGro...
(QB_NEW_EN)
[typographical] ~1489-~1489: Consider using typographic quotation marks here.
Context: ...nt Provider:** - ✅ GetType() returns "mock" - ✅ GetGroup() returns "Testing" ...
(EN_QUOTES)
[typographical] ~1490-~1490: Consider using typographic quotation marks here.
Context: ...eturns "mock" - ✅ GetGroup() returns "Testing" - ✅ GetBasePath() with and without c...
(EN_QUOTES)
[grammar] ~1498-~1498: There might be a mistake here.
Context: ...mands() - command list 4. Edge Cases: - ✅ Nil pointer checks - ✅ Empty regist...
(QB_NEW_EN)
[grammar] ~1499-~1499: There might be a mistake here.
Context: ...Edge Cases:* - ✅ Nil pointer checks - ✅ Empty registry operations - ✅ Dupli...
(QB_NEW_EN)
[grammar] ~1500-~1500: There might be a mistake here.
Context: ... checks - ✅ Empty registry operations - ✅ Duplicate registrations (override beha...
(QB_NEW_EN)
[grammar] ~1501-~1501: There might be a mistake here.
Context: ...licate registrations (override behavior) - ✅ Invalid component configurations - ...
(QB_NEW_EN)
[grammar] ~1502-~1502: There might be a mistake here.
Context: ... - ✅ Invalid component configurations - ✅ Missing required fields - ✅ Type mi...
(QB_NEW_EN)
[grammar] ~1503-~1503: There might be a mistake here.
Context: ...gurations - ✅ Missing required fields - ✅ Type mismatches in stack config 5. **...
(QB_NEW_EN)
[grammar] ~1506-~1506: There might be a mistake here.
Context: ...tches in stack config 5. Integration: - ✅ Mock component in stack configuration ...
(QB_NEW_EN)
[grammar] ~1507-~1507: There might be a mistake here.
Context: ... ✅ Mock component in stack configuration - ✅ List components includes mock - ✅ D...
(QB_NEW_EN)
[grammar] ~1508-~1508: There might be a mistake here.
Context: ...ion - ✅ List components includes mock - ✅ Describe component detects mock - ✅...
(QB_NEW_EN)
[grammar] ~1509-~1509: There might be a mistake here.
Context: ...k - ✅ Describe component detects mock - ✅ Cross-component dependencies work -...
(QB_NEW_EN)
[grammar] ~1510-~1510: There might be a mistake here.
Context: ... - ✅ Cross-component dependencies work - ✅ DAG includes mock components ## Migra...
(QB_NEW_EN)
[grammar] ~1519-~1519: There might be a mistake here.
Context: ...ture without changing behavior Tasks: 1. Create pkg/component/provider.go with ...
(QB_NEW_EN)
[grammar] ~1520-~1520: There might be a mistake here.
Context: ...* 1. Create pkg/component/provider.go with ComponentProvider interface 2. Create `...
(QB_NEW_EN)
[grammar] ~1523-~1523: There might be a mistake here.
Context: ...POC) 4. Update pkg/schema/schema.go with hybrid approach: ```go type Com...
(QB_NEW_EN)
[grammar] ~1553-~1553: There might be a mistake here.
Context: ... schemas** in pkg/datafetcher/schema/: - Update config/global/1.0.json to allow...
(QB_NEW_EN)
[grammar] ~1556-~1556: There might be a mistake here.
Context: ...6. Add comprehensive unit test coverage: - 90%+ coverage on `pkg/component/regist...
(QB_NEW_EN)
[grammar] ~1557-~1557: There might be a mistake here.
Context: ...est coverage: - 90%+ coverage on pkg/component/registry.go - 90%+ coverage on `pkg/component/mock/m...
(QB_NEW_EN)
[grammar] ~1558-~1558: There might be a mistake here.
Context: .../registry.go - **90%+ coverage** onpkg/component/mock/mock.go` - Thread safety tests (concurrent registra...
(QB_NEW_EN)
[grammar] ~1559-~1559: There might be a mistake here.
Context: ...y tests (concurrent registration/access) - Edge cases (nil checks, empty registries...
(QB_NEW_EN)
[grammar] ~1560-~1560: There might be a mistake here.
Context: ...mpty registries, duplicate registration) - Integration tests for mock component in ...
(QB_NEW_EN)
[grammar] ~1561-~1561: There might be a mistake here.
Context: ...ation tests for mock component in stacks 7. Document mock component for developers o...
(QB_NEW_EN)
[grammar] ~1564-~1564: There might be a mistake here.
Context: ...rs only (not users) Success Criteria: - ✅ Registry compiles and passes all tests...
(QB_NEW_EN)
[grammar] ~1577-~1577: There might be a mistake here.
Context: ...ting component implementations Tasks: 1. Create `pkg/component/terraform/terrafor...
(QB_NEW_EN)
[grammar] ~1584-~1584: There might be a mistake here.
Context: ...tack configurations Success Criteria: - ✅ All three providers registered success...
(QB_NEW_EN)
[grammar] ~1594-~1594: There might be a mistake here.
Context: ...cribe commands to use registry Tasks: 1. Update pkg/list/list_components.go to ...
(QB_NEW_EN)
[grammar] ~1597-~1597: There might be a mistake here.
Context: ...in internal/exec/describe_affected.go: - Use component.ListTypes() instead of h...
(QB_NEW_EN)
[grammar] ~1601-~1601: There might be a mistake here.
Context: ...enance tracking** to work with registry: - Component type detection - Dependency...
(QB_NEW_EN)
[grammar] ~1602-~1602: There might be a mistake here.
Context: ... registry: - Component type detection - Dependency tracing across types 5. Add i...
(QB_NEW_EN)
[grammar] ~1603-~1603: There might be a mistake here.
Context: ...ion - Dependency tracing across types 5. Add integration tests with mock componen...
(QB_NEW_EN)
[grammar] ~1610-~1610: Please add a punctuation mark at the end of paragraph.
Context: ...ting tests pass 7. Test with real stack configurations Success Criteria: - ✅ `atmos list ...
(PUNCTUATION_PARAGRAPH_END)
[grammar] ~1612-~1612: There might be a mistake here.
Context: ...tack configurations Success Criteria: - ✅ atmos list components includes mock ...
(QB_NEW_EN)
[grammar] ~1626-~1626: There might be a mistake here.
Context: ...pattern for future development Tasks: 1. Create developer guide for adding new co...
(QB_NEW_EN)
[grammar] ~1634-~1634: There might be a mistake here.
Context: ... for built-in types Success Criteria: - ✅ Complete developer documentation - ✅ C...
(QB_NEW_EN)
[grammar] ~1635-~1635: There might be a mistake here.
Context: ...:** - ✅ Complete developer documentation - ✅ Clear examples and guidelines - ✅ Mock...
(QB_NEW_EN)
[grammar] ~1636-~1636: There might be a mistake here.
Context: ...tation - ✅ Clear examples and guidelines - ✅ Mock component documented as POC/testi...
(QB_NEW_EN)
[grammar] ~1637-~1637: There might be a mistake here.
Context: ...component documented as POC/testing tool - ✅ Hybrid approach documented - ✅ Archite...
(QB_NEW_EN)
[grammar] ~1638-~1638: There might be a mistake here.
Context: ...ting tool - ✅ Hybrid approach documented - ✅ Architecture diagrams updated ### Pha...
(QB_NEW_EN)
[grammar] ~1647-~1647: There might be a mistake here.
Context: ...provides a clear path forward. Tasks: 1. Migrate Terraform to plugin model: ...
(QB_NEW_EN)
[grammar] ~1648-~1648: There might be a mistake here.
Context: ... 1. Migrate Terraform to plugin model: - Create `pkg/component/terraform/config.g...
(QB_NEW_EN)
[grammar] ~1654-~1654: There might be a mistake here.
Context: ... 2. Migrate Helmfile to plugin model: - Same pattern as Terraform - Ensure ex...
(QB_NEW_EN)
[grammar] ~1658-~1658: There might be a mistake here.
Context: ...ed 3. Migrate Packer to plugin model: - Same pattern as Terraform - Complete ...
(QB_NEW_EN)
[grammar] ~1707-~1707: There might be a mistake here.
Context: ..., false } ``` Success Criteria: - ✅ All built-in types use plugin model in...
(QB_NEW_EN)
[grammar] ~1715-~1715: There might be a mistake here.
Context: ...major version) Benefits of Migration: - ✅ Consistent pattern for all component t...
(QB_NEW_EN)
[grammar] ~1716-~1716: There might be a mistake here.
Context: ...nsistent pattern for all component types - ✅ No special-casing for built-in vs plug...
(QB_NEW_EN)
[typographical] ~1717-~1717: In American English, use a period after an abbreviation.
Context: ...ypes - ✅ No special-casing for built-in vs plugin types - ✅ Simpler codebase (no s...
(MISSING_PERIOD_AFTER_ABBREVIATION)
[grammar] ~1717-~1717: There might be a mistake here.
Context: ...cial-casing for built-in vs plugin types - ✅ Simpler codebase (no switch statements...
(QB_NEW_EN)
[grammar] ~1718-~1718: There might be a mistake here.
Context: ... Simpler codebase (no switch statements) - ✅ True plugin architecture - ✅ Foundatio...
(QB_NEW_EN)
[grammar] ~1719-~1719: There might be a mistake here.
Context: ...statements) - ✅ True plugin architecture - ✅ Foundation for external plugins (Phase...
(QB_NEW_EN)
[grammar] ~1724-~1724: There might be a mistake here.
Context: ...port (Phase 6+) The component registry provides foundation for external plugins: ### P...
(QB_NEW_EN)
[grammar] ~1765-~1765: There might be a mistake here.
Context: ...} ``` Plugin discovery flow (future): 1. Atmos starts → loads built-in components...
(QB_NEW_EN)
[grammar] ~1767-~1767: There might be a mistake here.
Context: ...ts via registry 2. Discovers plugins in ~/.atmos/plugins/components/ 3. Registers plugins as ComponentProviders ...
(QB_NEW_EN)
[grammar] ~1770-~1770: There might be a mistake here.
Context: ... components 5. Examples of plugin types: - AWS CDK components - Pulumi component...
(QB_NEW_EN)
[grammar] ~1771-~1771: There might be a mistake here.
Context: ...of plugin types: - AWS CDK components - Pulumi components - CloudFormation co...
(QB_NEW_EN)
[grammar] ~1772-~1772: There might be a mistake here.
Context: ...WS CDK components - Pulumi components - CloudFormation components - Ansible p...
(QB_NEW_EN)
[grammar] ~1773-~1773: There might be a mistake here.
Context: ...omponents - CloudFormation components - Ansible playbooks - Custom deployment...
(QB_NEW_EN)
[grammar] ~1774-~1774: There might be a mistake here.
Context: ...mation components - Ansible playbooks - Custom deployment tools ## Benefits ##...
(QB_NEW_EN)
[grammar] ~1781-~1781: There might be a mistake here.
Context: ...face-based instead of string comparisons 2. ✅ Extensibility - Easy to add new co...
(QB_NEW_EN)
[grammar] ~1782-~1782: There might be a mistake here.
Context: ...lity** - Easy to add new component types 3. ✅ Consistency - Parallel with comman...
(QB_NEW_EN)
[grammar] ~1783-~1783: There might be a mistake here.
Context: ...- Parallel with command registry pattern 4. ✅ Testability - Mock components for ...
(QB_NEW_EN)
[grammar] ~1784-~1784: There might be a mistake here.
Context: ...or unit tests without cloud dependencies 5. ✅ Maintainability - Clear contract f...
(QB_NEW_EN)
[grammar] ~1785-~1785: There might be a mistake here.
Context: ...- Clear contract for all component types 6. ✅ Discoverability - Introspection of...
(QB_NEW_EN)
[grammar] ~1790-~1790: There might be a mistake here.
Context: ... Foundation for external component types 8. ✅ Community extensions - Users can s...
(QB_NEW_EN)
[grammar] ~1791-~1791: There might be a mistake here.
Context: ...- Users can share custom component types 9. ✅ Vendor flexibility - Not locked in...
(QB_NEW_EN)
[grammar] ~1792-~1792: There might be a mistake here.
Context: ...ility** - Not locked into specific tools 10. ✅ Innovation - New orchestration pat...
(QB_NEW_EN)
[grammar] ~1797-~1797: There might be a mistake here.
Context: ...sk | Probability | Impact | Mitigation | |------|------------|--------|----------...
(QB_NEW_EN)
[grammar] ~1798-~1798: There might be a mistake here.
Context: ...----|------------|--------|------------| | Breaking existing workflows | Low | Hi...
(QB_NEW_EN)
[grammar] ~1799-~1799: There might be a mistake here.
Context: ...Comprehensive testing, gradual rollout | | Performance overhead | Low | Low | Pro...
(QB_NEW_EN)
[grammar] ~1800-~1800: There might be a mistake here.
Context: ...wrap existing code, no additional work | | Component type conflicts | Low | Mediu...
(QB_NEW_EN)
[grammar] ~1801-~1801: There might be a mistake here.
Context: ...allows explicit override, clear errors | | Template function compatibility | Medi...
(QB_NEW_EN)
[grammar] ~1802-~1802: There might be a mistake here.
Context: ...Providers expose ToMap() for templates | | Testing complexity | Low | Low | Mock ...
(QB_NEW_EN)
[grammar] ~1807-~1807: There might be a mistake here.
Context: ...uccess Criteria ### Phase 1: Foundation - ✅ Registry pattern implemented and teste...
(QB_NEW_EN)
[grammar] ~1808-~1808: There might be a mistake here.
Context: ... Registry pattern implemented and tested - ✅ Mock component provider working - ✅ 10...
(QB_NEW_EN)
[grammar] ~1809-~1809: There might be a mistake here.
Context: ...sted - ✅ Mock component provider working - ✅ 100% test coverage for registry - ✅ No...
(QB_NEW_EN)
[grammar] ~1810-~1810: There might be a mistake here.
Context: ...king - ✅ 100% test coverage for registry - ✅ No behavior changes - ✅ Documentation ...
(QB_NEW_EN)
[grammar] ~1811-~1811: There might be a mistake here.
Context: ...age for registry - ✅ No behavior changes - ✅ Documentation complete ### Phase 2: P...
(QB_NEW_EN)
[grammar] ~1814-~1814: There might be a mistake here.
Context: ...te ### Phase 2: Provider Implementation - ✅ All component types wrapped in provide...
(QB_NEW_EN)
[grammar] ~1815-~1815: There might be a mistake here.
Context: ...All component types wrapped in providers - ✅ Providers delegate to existing logic -...
(QB_NEW_EN)
[grammar] ~1816-~1816: There might be a mistake here.
Context: ...- ✅ Providers delegate to existing logic - ✅ All existing tests pass - ✅ No regress...
(QB_NEW_EN)
[grammar] ~1817-~1817: There might be a mistake here.
Context: ...isting logic - ✅ All existing tests pass - ✅ No regression in functionality ### Ph...
(QB_NEW_EN)
[grammar] ~1820-~1820: There might be a mistake here.
Context: ... functionality ### Phase 3: Integration - ✅ List/describe commands use registry - ...
(QB_NEW_EN)
[grammar] ~1826-~1826: There might be a mistake here.
Context: ...ce unchanged ### Phase 4: Documentation - ✅ Developer guide complete - ✅ Mock comp...
(QB_NEW_EN)
[grammar] ~1827-~1827: There might be a mistake here.
Context: ...cumentation - ✅ Developer guide complete - ✅ Mock component documented - ✅ Examples...
(QB_NEW_EN)
[grammar] ~1828-~1828: There might be a mistake here.
Context: ...e complete - ✅ Mock component documented - ✅ Examples provided - ✅ Architecture doc...
(QB_NEW_EN)
[grammar] ~1829-~1829: There might be a mistake here.
Context: ...mponent documented - ✅ Examples provided - ✅ Architecture documented ## FAQ ### Q...
(QB_NEW_EN)
[grammar] ~1840-~1840: There might be a mistake here.
Context: ...s) or cloud provider access. It enables: - Fast unit testing - CI/CD without cloud ...
(QB_NEW_EN)
[grammar] ~1841-~1841: There might be a mistake here.
Context: ... access. It enables: - Fast unit testing - CI/CD without cloud credentials - Develo...
(QB_NEW_EN)
[grammar] ~1842-~1842: There might be a mistake here.
Context: ...esting - CI/CD without cloud credentials - Development without installing tools - P...
(QB_NEW_EN)
[grammar] ~1843-~1843: There might be a mistake here.
Context: ...s - Development without installing tools - Proof of concept for plugin system ### ...
(QB_NEW_EN)
[grammar] ~1844-~1844: Please add a punctuation mark at the end of paragraph.
Context: ...ing tools - Proof of concept for plugin system ### Q: Is the mock component documente...
(PUNCTUATION_PARAGRAPH_END)
[style] ~1872-~1872: Since ownership is already implied, this phrasing may be redundant.
Context: ...rk? A: Each component type defines its own configuration structure: 1. **Global c...
(PRP_OWN)
[grammar] ~1875-~1875: There might be a mistake here.
Context: .... Stack config: Component instances use flexible map[string]any structure - no ...
(QB_NEW_EN)
[grammar] ~1875-~1875: There might be a mistake here.
Context: ...g]any structure - no schema enforcement at registry level 3. Validation: Each ...
(QB_NEW_EN)
[style] ~1876-~1876: Since ownership is already implied, this phrasing may be redundant.
Context: ...Validation: Each provider validates its own configuration via ValidateComponent()...
(PRP_OWN)
[grammar] ~1889-~1889: Please add a punctuation mark at the end of paragraph.
Context: ...DAG respects dependencies regardless of type Example: `terraform/vpc → terraform/ek...
(PUNCTUATION_PARAGRAPH_END)
[grammar] ~1914-~1914: There might be a mistake here.
Context: ...erences - Command Registry Pattern PRD - [Atmos Component Architecture Research](....
(QB_NEW_EN)
[grammar] ~1915-~1915: There might be a mistake here.
Context: ...- Atmos Component Architecture Research - [Go Plugin Documentation](https://pkg.go....
(QB_NEW_EN)
[grammar] ~1916-~1916: There might be a mistake here.
Context: ...-research.md) - Go Plugin Documentation - [Terraform Plugin Protocol](https://www.t...
(QB_NEW_EN)
[grammar] ~1917-~1917: There might be a mistake here.
Context: ...dev/plugin) - Terraform Plugin Protocol - [kubectl Plugin System](https://kubernete...
(QB_NEW_EN)
[grammar] ~1932-~1932: There might be a mistake here.
Context: ....Pluginsmap instead of static struct | | | | AddedGetComponentConfig()` helpe...
(QB_NEW_EN)
[grammar] ~1933-~1933: There might be a mistake here.
Context: ...tConfig()` helper method to Components | | | | Documented migration path for buil...
(QB_NEW_EN)
[grammar] ~1934-~1934: There might be a mistake here.
Context: ...tion path for built-in types (Phase 5) | | | | Updated migration plan to reflect ...
(QB_NEW_EN)
[grammar] ~1935-~1935: There might be a mistake here.
Context: ...ration plan to reflect hybrid approach | | | | Added Phase 5: Built-in Type Migra...
(QB_NEW_EN)
[grammar] ~1936-~1936: There might be a mistake here.
Context: ...uilt-in Type Migration to plugin model | | | | Clarified that Terraform/Helmfile/...
(QB_NEW_EN)
[grammar] ~1937-~1937: There might be a mistake here.
Context: ...elmfile/Packer will eventually migrate | | | | Updated all code examples to use h...
(QB_NEW_EN)
🪛 markdownlint-cli2 (0.18.1)
docs/developing-component-plugins.md
86-86: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
docs/prd/component-registry-pattern.md
61-61: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Analyze (go)
- GitHub Check: Build (windows-latest, windows)
- GitHub Check: Summary
🔇 Additional comments (38)
.gitignore (1)
84-84: LGTM!The addition aligns with the pattern of excluding research/development documentation from version control.
pkg/datafetcher/schema/stacks/stack-config/1.0.json (1)
167-167: LGTM!Consistent with the global schema change, enabling plugin-based component types in stack configurations.
pkg/component/mock/config.go (1)
28-38: LGTM!DefaultConfig provides sensible defaults for the mock component configuration.
pkg/schema/schema.go (2)
358-366: LGTM!The hybrid approach preserves backward compatibility with built-in types while enabling plugin extensibility through the Plugins map. The mapstructure ",remain" tag correctly captures unmapped fields.
369-389: LGTM!GetComponentConfig provides a clean interface for retrieving both built-in and plugin component configurations. The two-return pattern (config, found) enables safe checking without panics.
pkg/component/registry_test.go (2)
16-53: LGTM!The testProvider is a well-designed minimal implementation for testing registry behavior without unnecessary complexity.
55-366: Excellent test coverage!The test suite comprehensively covers:
- Basic CRUD operations
- Error handling with sentinel errors
- Concurrency safety
- Edge cases (nil, empty, duplicates)
Test isolation via Reset() ensures independence. The concurrency tests properly verify thread-safety guarantees.
pkg/component/mock/mock_test.go (1)
14-446: Excellent test coverage for MockComponentProvider!The test suite thoroughly validates:
- Provider identity and metadata
- Base path resolution with multiple configuration scenarios
- Component listing across various stack structures
- Validation logic including error cases
- Execution and artifact generation flows
- Config parsing with comprehensive test cases
- Integration scenario covering the full lifecycle
The tests align well with the learnings about comprehensive unit test requirements.
Based on learnings
errors/errors.go (1)
151-160: LGTM!The new error sentinels follow established patterns and provide appropriate granularity for component registry operations. Proper grouping and documentation make them easy to locate.
As per coding guidelines
docs/developing-component-plugins.md (7)
1-24: Documentation structure is solid.The overview and key concepts section clearly establishes the purpose and architecture. Self-registration via
init()functions is correctly described and aligns with the implementation in the code.
29-78: Interface documentation matches implementation.The ComponentProvider interface and ExecutionContext struct are accurately represented. Good inclusion of inline documentation from the actual code.
284-523: Test examples demonstrate best practices.The test suite examples cover all interface methods with table-driven tests. Good use of
testify/assertandrequire, and the examples avoid common pitfalls like relying on stringer side effects for comparisons.Based on learnings
537-619: Configuration examples are clear and accurate.The three-level configuration hierarchy (global, stack, component) is well-explained with concrete YAML examples. The inheritance demonstration shows how values merge correctly.
621-705: Error handling and best practices are well-documented.Sentinel error usage is correctly demonstrated with proper wrapping. Best practices align with coding guidelines, including thread safety considerations, mapstructure configuration, and the importance of sensible defaults.
706-774: Integration and troubleshooting guidance is helpful.The integration points with Atmos commands are clearly explained. Troubleshooting section addresses common issues developers might encounter with practical solutions.
776-853: Advanced topics provide valuable depth.The artifact generation example demonstrates proper file handling and error wrapping. The preference for SDKs over CLI execution is good architectural guidance. The summary checklist is a helpful quick reference.
pkg/component/provider.go (1)
1-67: Clean and well-designed interface.The ComponentProvider interface establishes a clear contract for component type implementations. All methods are well-documented with appropriate signatures. ExecutionContext provides comprehensive execution context, and ComponentInfo captures provider metadata effectively.
pkg/component/registry.go (8)
1-21: Thread-safe registry properly initialized.The global registry instance is correctly initialized with a providers map. Use of
sync.RWMutexenables concurrent reads while serializing writes, which is appropriate for a registry pattern where lookups are frequent and registrations are rare.
23-44: Registration logic is solid.Proper validation of provider and type before registration. Thread-safe write operation with deferred unlock. The last-wins behavior for duplicate types is intentional and correctly documented to allow plugin overrides.
46-54: GetProvider follows Go idioms correctly.Proper use of read lock for concurrent access. The (provider, bool) return signature follows the standard Go pattern for optional retrieval.
56-70: ListProviders correctly groups by category.The grouping logic properly organizes providers by their group name. Thread-safe iteration with read lock.
72-85: ListTypes efficiently returns sorted types.Good practice pre-allocating the slice with the correct capacity. Alphabetical sorting provides consistent, predictable output.
87-93: Count is straightforward and thread-safe.Simple, correct implementation with appropriate read lock.
95-115: GetInfo provides consistent metadata.Proper construction of ComponentInfo from provider methods. Sorting by type ensures consistent ordering. Thread-safe with read lock.
117-134: Reset and MustGetProvider are correctly implemented.Reset properly clears the registry for testing with a write lock. MustGetProvider follows Go conventions for panic-on-failure functions and includes helpful error context.
pkg/component/mock/mock.go (7)
1-20: Mock provider clearly documented as POC.The documentation correctly identifies this as a proof-of-concept for testing the registry pattern, not a user-facing feature. Empty struct is appropriate for a stateless provider.
22-27: Self-registration is properly implemented.The init() function correctly registers the mock provider with the global registry. Panic on registration failure is appropriate since this indicates a programming error that should be caught during development.
29-37: Type and group methods are straightforward.Returns appropriate values for type and group.
39-58: GetBasePath implements proper fallback behavior.The method correctly retrieves configuration from the Plugins map, parses it, and falls back to defaults at each error point. This ensures a valid path is always returned.
60-78: ListComponents safely traverses configuration.Proper type assertions with bool checks. Returning an empty slice when mock components aren't present is correct behavior.
80-92: ValidateComponent provides test-friendly validation.The validation logic is intentionally simple for testing purposes. The "invalid" flag mechanism allows test cases to trigger validation failures. Error wrapping with sentinel error is correct.
94-115: Execute and GenerateArtifacts simulate operations.The mock implementations print execution details, which is useful for testing and verification. Returning nil indicates successful mock execution.
docs/prd/component-registry-pattern.md (6)
1-101: PRD provides clear context and solution.The problem statement effectively articulates the limitations of the current hardcoded approach. The solution section clearly explains the registry pattern and its benefits. The architecture diagram provides a helpful visual representation.
102-615: Configuration architecture thoroughly documented.The multi-level configuration approach (global, stack, component) is well-explained with concrete examples. Cross-component dependencies and their type-agnostic nature are clearly described. The hybrid schema approach balancing built-in types and dynamic plugins is well-justified.
617-803: Implementation section aligns with code.The code examples in the PRD match the actual implementation in the repository. The interface definitions, registry implementation, and mock provider examples are accurate representations of the code.
1152-1511: Testing strategy is comprehensive.The 90%+ coverage requirement for registry and mock components is appropriate. Thread safety tests, edge case coverage, and integration tests are all specified. The detailed breakdown of what must be tested provides clear guidance.
1513-1721: Migration plan provides clear phased approach.The five-phase migration plan is well-structured with clear tasks and success criteria for each phase. Phase 5's approach to migrating built-in types to the plugin model maintains backward compatibility while moving toward a unified architecture.
1777-1911: Benefits, risks, and FAQ sections are thorough.The benefits section clearly articulates both immediate and future value. The risks table includes appropriate mitigation strategies. The FAQ addresses likely developer questions with practical answers.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (4)
component-architecture-research.md (4)
1-40: Add language specifications to code blocks throughout the document.Multiple code blocks lack language identifiers (
go,bash, etc.), which helps rendering and syntax highlighting. Additionally, several section titles using**Pattern N**and**Challenge N**should be converted to proper Markdown headings for better document structure.Starting with the code block at line 19, apply language specifications like this:
-``` +```go // pkg/schema/schema.go type Components struct {Also, convert emphasis-based section titles to headings. For example, around line 257:
-**Pattern 1: Simple Command** +#### Pattern 1: Simple CommandApply this pattern to all similar section headers throughout (Pattern 2-4, Challenge 1-4, Phase 1-4, Option A-C, etc.).
195-204: Add blank lines around the command groups table.Markdown linting requires tables to be surrounded by blank lines. Add one before line 195 and after line 204 to comply with formatting standards.
}
Standard Command Groups:
Group Commands Other Commands about, completion, version, support
2.3 Registry Implementation
--- `473-508`: **Clarify the ExecutionContext struct usage expectations.** Section 4.1 (Option C) introduces `ExecutionContext` as part of the recommended hybrid interface. However, the document doesn't clarify: 1. How template context (currently `atmos.Component()`) would map to this interface 2. Whether existing `ConfigAndStacksInfo` would gradually transition or coexist 3. How the `Args` and `Flags` maps would be populated from CLI invocations These details would help implementers understand integration points. Add a subsection after line 508 explaining integration with existing context structures: ```go // Future work: Document mapping between ExecutionContext and ConfigAndStacksInfo // For template functions, consider: ExecutionContext.ToConfigAndStacksInfo() method // to maintain backward compatibility during migration
615-640: Migration phases are well-defined but lack risk mitigation details.The phased approach is sound, but consider adding:
- Rollback strategy - How to safely revert a failed phase
- Testing checkpoints - What integration test scenarios must pass before phase advancement
- Monitoring/observability - How to detect breakage in production (if applicable)
These details would reduce implementation risk for teams executing the plan.
You could add an optional "Phase 0: Preparation" or a separate "Risk Mitigation" section addressing these concerns.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
CLAUDE.md(1 hunks)component-architecture-research.md(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-16T15:18:00.319Z
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-16T15:18:00.319Z
Learning: Applies to **/*.go : 80% minimum coverage on new/changed lines and include unit tests for new features; add integration tests for CLI using tests/ fixtures.
Applied to files:
CLAUDE.md
🪛 LanguageTool
component-architecture-research.md
[grammar] ~13-~13: There might be a mistake here.
Context: ...ng]any`) processed from YAML stack files 2. **Type differentiation by string constants...
(QB_NEW_EN)
[grammar] ~14-~14: There might be a mistake here.
Context: ...ts** (terraform, helmfile, packer) 3. **Processing logic scattered across multip...
(QB_NEW_EN)
[grammar] ~51-~51: There might be a mistake here.
Context: ...t Discovery & Loading File Locations: - Component configs: `components/{terrafor...
(QB_NEW_EN)
[grammar] ~52-~52: There might be a mistake here.
Context: ...File Locations:* - Component configs: components/{terraform|helmfile|packer}/ - Stack configs: stacks/ (YAML files def...
(QB_NEW_EN)
[grammar] ~57-~57: There might be a mistake here.
Context: ... (internal/exec/stack_processor_*.go): - Loads YAML stack manifests from `stacks/...
(QB_NEW_EN)
[grammar] ~127-~127: There might be a mistake here.
Context: ...s helmfile binary ``` Common Pattern: - All component types follow similar execu...
(QB_NEW_EN)
[grammar] ~142-~142: There might be a mistake here.
Context: ... (internal/exec/stack_processor_*.go): - Component inheritance processing - Co...
(QB_NEW_EN)
[grammar] ~143-~143: There might be a mistake here.
Context: ...): - Component inheritance processing - Component configuration merging - Bac...
(QB_NEW_EN)
[grammar] ~144-~144: There might be a mistake here.
Context: ...ing - Component configuration merging - Backend configuration generation - Te...
(QB_NEW_EN)
[grammar] ~145-~145: There might be a mistake here.
Context: ...ng - Backend configuration generation - Template rendering with component contex...
(QB_NEW_EN)
[grammar] ~153-~153: There might be a mistake here.
Context: ... (internal/exec/describe_affected.go): - Git diff analysis - Component depende...
(QB_NEW_EN)
[grammar] ~154-~154: There might be a mistake here.
Context: ...be_affected.go`): - Git diff analysis - Component dependency tracking - Chang...
(QB_NEW_EN)
[grammar] ~155-~155: There might be a mistake here.
Context: ...lysis - Component dependency tracking - Change impact determination 5. **Compon...
(QB_NEW_EN)
[grammar] ~158-~158: There might be a mistake here.
Context: ...sting** (pkg/list/list_components.go): - Filter components by stack - Collect ...
(QB_NEW_EN)
[grammar] ~195-~195: There might be a mistake here.
Context: ...ring } ``` Standard Command Groups: | Group | Commands | |-------|----------...
(QB_NEW_EN)
[grammar] ~196-~196: There might be a mistake here.
Context: ...d Command Groups:** | Group | Commands | |-------|----------| | Core Stack Comman...
(QB_NEW_EN)
[grammar] ~197-~197: There might be a mistake here.
Context: ... Group | Commands | |-------|----------| | Core Stack Commands | terraform, helmf...
(QB_NEW_EN)
[grammar] ~198-~198: There might be a mistake here.
Context: ... terraform, helmfile, workflow, packer | | Stack Introspection | describe, list, ...
(QB_NEW_EN)
[grammar] ~199-~199: There might be a mistake here.
Context: ...trospection | describe, list, validate | | Configuration Management | vendor, doc...
(QB_NEW_EN)
[grammar] ~200-~200: There might be a mistake here.
Context: ...onfiguration Management | vendor, docs | | Cloud Integration | aws, atlantis | | ...
(QB_NEW_EN)
[grammar] ~201-~201: There might be a mistake here.
Context: ... | | Cloud Integration | aws, atlantis | | Pro Features | auth, pro | | Other Com...
(QB_NEW_EN)
[grammar] ~202-~202: There might be a mistake here.
Context: ... atlantis | | Pro Features | auth, pro | | Other Commands | about, completion, ve...
(QB_NEW_EN)
[grammar] ~207-~207: There might be a mistake here.
Context: ...Registry Implementation Key Features: - Thread-safe via sync.RWMutex - Self-re...
(QB_NEW_EN)
[grammar] ~208-~208: There might be a mistake here.
Context: ...on Key Features: - Thread-safe via sync.RWMutex - Self-registration via init() functions...
(QB_NEW_EN)
[grammar] ~209-~209: There might be a mistake here.
Context: ...Self-registration via init() functions - Allows re-registration for testing/plugi...
(QB_NEW_EN)
[grammar] ~210-~210: There might be a mistake here.
Context: ...lows re-registration for testing/plugins - Separate from custom command processing ...
(QB_NEW_EN)
[grammar] ~257-~257: There might be a mistake here.
Context: ...d patterns: Pattern 1: Simple Command - Standalone command with no subcommands -...
(QB_NEW_EN)
[grammar] ~262-~262: There might be a mistake here.
Context: ...out.go` Pattern 2: Static Subcommands - Parent command + predefined subcommands ...
(QB_NEW_EN)
[grammar] ~263-~263: There might be a mistake here.
Context: ... Parent command + predefined subcommands - Example: describe (component, stacks, ...
(QB_NEW_EN)
[grammar] ~264-~264: There might be a mistake here.
Context: ...describe (component, stacks, affected) - Structure: ``` cmd/describe/ ├── d...
(QB_NEW_EN)
[grammar] ~274-~274: There might be a mistake here.
Context: ... ``` Pattern 3: Dynamic Subcommands - Parent + subcommands from arrays - Examp...
(QB_NEW_EN)
[grammar] ~275-~275: There might be a mistake here.
Context: ...nds** - Parent + subcommands from arrays - Example: terraform (plan, apply, destr...
(QB_NEW_EN)
[grammar] ~276-~276: There might be a mistake here.
Context: ...mple: terraform (plan, apply, destroy) - Structure: ``` cmd/terraform/ ├── ...
(QB_NEW_EN)
[grammar] ~288-~288: There might be a mistake here.
Context: ...ile.go ``` Pattern 4: Deeply Nested - Multiple nesting levels - Example: `aws ...
(QB_NEW_EN)
[grammar] ~289-~289: There might be a mistake here.
Context: ...eeply Nested** - Multiple nesting levels - Example: aws eks update-kubeconfig - S...
(QB_NEW_EN)
[grammar] ~290-~290: There might be a mistake here.
Context: ...** - Multiple nesting levels - Example: aws eks update-kubeconfig - Structure: ``` cmd/aws/ ├── aws.go...
(QB_NEW_EN)
[grammar] ~300-~300: There might be a mistake here.
Context: ...ule:** Only top-level commands register with registry. Subcommands are attached via ...
(QB_NEW_EN)
[style] ~425-~425: Since ownership is already implied, this phrasing may be redundant.
Context: ...Key Insight:* Each component type has its own execution function. No shared interface...
(PRP_OWN)
[grammar] ~559-~559: Please add a punctuation mark at the end of paragraph.
Context: ...** Introspection of available component types ### 4.4 Challenges & Considerations *...
(PUNCTUATION_PARAGRAPH_END)
[grammar] ~573-~573: There might be a mistake here.
Context: ... Challenge 3: Component Type Detection - Current try/catch pattern works for YAML...
(QB_NEW_EN)
[grammar] ~617-~617: There might be a mistake here.
Context: ...Phases Phase 1: Foundation (Low Risk) 1. Create ComponentProvider interface in `p...
(QB_NEW_EN)
[grammar] ~618-~618: There might be a mistake here.
Context: .... Create ComponentProvider interface in pkg/component/provider.go 2. Create component registry in `pkg/compon...
(QB_NEW_EN)
[grammar] ~619-~619: There might be a mistake here.
Context: ...der.go2. Create component registry inpkg/component/registry.go` 3. Implement basic providers wrapping exist...
(QB_NEW_EN)
[grammar] ~620-~620: There might be a mistake here.
Context: ...ic providers wrapping existing functions 4. Add 100% unit test coverage 5. No behavi...
(QB_NEW_EN)
[grammar] ~621-~621: There might be a mistake here.
Context: ...functions 4. Add 100% unit test coverage 5. No behavior changes, pure abstraction *...
(QB_NEW_EN)
[grammar] ~624-~624: There might be a mistake here.
Context: ...on Phase 2: Integration (Medium Risk) 1. Update list components to use registry...
(QB_NEW_EN)
[grammar] ~630-~630: There might be a mistake here.
Context: ...ants Phase 3: Execution (Higher Risk) 1. Update terraform/helmfile/packer command...
(QB_NEW_EN)
[grammar] ~636-~636: There might be a mistake here.
Context: ... testing Phase 4: Extensions (Future) 1. Plugin system for external component typ...
(QB_NEW_EN)
[grammar] ~637-~637: There might be a mistake here.
Context: ...ugin system for external component types 2. Dynamic component type loading 3. Commun...
(QB_NEW_EN)
[grammar] ~638-~638: There might be a mistake here.
Context: ... types 2. Dynamic component type loading 3. Community component providers ## 6. Rec...
(QB_NEW_EN)
[grammar] ~647-~647: There might be a mistake here.
Context: ... YES, but incrementally: Pros: ✅ Aligns with command registry pattern (...
(QB_NEW_EN)
[grammar] ~648-~648: There might be a mistake here.
Context: ...h command registry pattern (consistency) ✅ Enables plugin system for new componen...
(QB_NEW_EN)
[grammar] ~649-~649: There might be a mistake here.
Context: ...es plugin system for new component types ✅ Improves type safety and testability ✅...
(QB_NEW_EN)
[grammar] ~650-~650: There might be a mistake here.
Context: ...s ✅ Improves type safety and testability ✅ Makes codebase more maintainable long-...
(QB_NEW_EN)
[grammar] ~651-~651: There might be a mistake here.
Context: ...kes codebase more maintainable long-term ✅ Facilitates future extensibility (CDK,...
(QB_NEW_EN)
[grammar] ~654-~654: There might be a mistake here.
Context: ...nsibility (CDK, Pulumi, etc.) Cons: ❌ Significant refactoring effort (100+ f...
(QB_NEW_EN)
[grammar] ~655-~655: There might be a mistake here.
Context: ... refactoring effort (100+ files touched) ❌ Risk of breaking existing functionalit...
(QB_NEW_EN)
[grammar] ~656-~656: There might be a mistake here.
Context: ... Risk of breaking existing functionality ❌ Current map-based approach works well ...
(QB_NEW_EN)
[grammar] ~657-~657: There might be a mistake here.
Context: ...sed approach works well for YAML configs ❌ Interface overhead may not provide imm...
(QB_NEW_EN)
[grammar] ~673-~673: There might be a mistake here.
Context: ...ror } ``` 2. Gradual Migration: - Phase 1: Create interface and basic prov...
(QB_NEW_EN)
[grammar] ~674-~674: There might be a mistake here.
Context: ...e interface and basic providers (1 week) - Phase 2: Migrate list and describe c...
(QB_NEW_EN)
[grammar] ~675-~675: There might be a mistake here.
Context: ... list and describe commands (1 week) - Phase 3: Migrate execution commands (2 w...
(QB_NEW_EN)
[grammar] ~676-~676: There might be a mistake here.
Context: ... 3: Migrate execution commands (2 weeks) - Phase 4: Plugin system (future) 3. **Ma...
(QB_NEW_EN)
[grammar] ~679-~679: There might be a mistake here.
Context: ...m (future) 3. Maintain Compatibility: - Keep string constants (`TerraformCompone...
(QB_NEW_EN)
[grammar] ~682-~682: There might be a mistake here.
Context: ...ksInfo` struct unchanged - Interface wraps existing implementation 4. **Test-Driv...
(QB_NEW_EN)
[grammar] ~682-~682: Please add a punctuation mark at the end of paragraph.
Context: ...unchanged - Interface wraps existing implementation 4. Test-Driven: - 100% test cov...
(PUNCTUATION_PARAGRAPH_END)
[grammar] ~684-~684: There might be a mistake here.
Context: ...isting implementation 4. Test-Driven: - 100% test coverage for interface impleme...
(QB_NEW_EN)
[grammar] ~685-~685: There might be a mistake here.
Context: ...st coverage for interface implementation - Integration tests for each phase - No...
(QB_NEW_EN)
[grammar] ~686-~686: There might be a mistake here.
Context: ...on - Integration tests for each phase - No behavior changes until Phase 3 ### 6...
(QB_NEW_EN)
[grammar] ~691-~691: There might be a mistake here.
Context: ...If the goal is only code organization: - Current architecture works well for YAML...
(QB_NEW_EN)
[grammar] ~700-~700: There might be a mistake here.
Context: ...em is not a priority - Refactoring risk outweighs benefits ## 7. Conclusion The Atmos c...
(QB_NEW_EN)
[grammar] ~712-~712: There might be a mistake here.
Context: ...or YAML-driven config Recommendation: - **Proceed with component interface extract...
(QB_NEW_EN)
[grammar] ~756-~756: There might be a mistake here.
Context: ...d/helmfile.go` - Helmfile parent command
(QB_NEW_EN)
CLAUDE.md
[grammar] ~823-~823: There might be a mistake here.
Context: ... File Types (They Are Not Deliverables):** - Todo lists or task tracking files you ...
(QB_NEW_EN)
[grammar] ~824-~824: There might be a mistake here.
Context: ...ists** or task tracking files you create - Research documents created to help you...
(QB_NEW_EN)
[grammar] ~825-~825: There might be a mistake here.
Context: ...., component-architecture-research.md) - Scratch files for working through prob...
(QB_NEW_EN)
[grammar] ~826-~826: There might be a mistake here.
Context: ...ms (e.g., scratch-*.md, notes-*.txt) - Investigation outputs that aren't part...
(QB_NEW_EN)
[grammar] ~831-~831: There might be a mistake here.
Context: ...c.) - ✅ Tests for the implementation - ✅ PRDs and design docs the user aske...
(QB_NEW_EN)
[grammar] ~832-~832: There might be a mistake here.
Context: ...sign docs** the user asked you to create - ✅ Developer guides the user requeste...
(QB_NEW_EN)
[grammar] ~833-~833: There might be a mistake here.
Context: ... Developer guides the user requested - ✅ Documentation that's part of the d...
(QB_NEW_EN)
[grammar] ~834-~834: There might be a mistake here.
Context: ...ntation** that's part of the deliverable - ✅ Configuration files needed for the...
(QB_NEW_EN)
[grammar] ~835-~835: There might be a mistake here.
Context: ...on files** needed for the implementation - ✅ Schema updates required for the fe...
(QB_NEW_EN)
[grammar] ~838-~838: There might be a mistake here.
Context: ...uired for the feature When Uncertain: - **If you created a file as part of solving...
(QB_NEW_EN)
[typographical] ~841-~841: Consider using a typographic opening quote here.
Context: ...commit it - If unsure: Ask the user "Should I commit [filename]?" **`.gitign...
(EN_QUOTES)
[typographical] ~841-~841: Consider using a typographic close quote here.
Context: ...sk the user "Should I commit [filename]?" .gitignore Rules: - **DO NOT aut...
(EN_QUOTES)
[grammar] ~843-~843: There might be a mistake here.
Context: ...mmit [filename]?" .gitignore Rules: - **DO NOT automatically add files to `.giti...
(QB_NEW_EN)
[grammar] ~844-~844: There might be a mistake here.
Context: ...tomatically add files to .gitignore** when user asks not to commit them - **Only u...
(QB_NEW_EN)
🪛 markdownlint-cli2 (0.18.1)
component-architecture-research.md
95-95: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
113-113: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
196-196: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
236-236: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
257-257: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
262-262: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
266-266: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
274-274: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
278-278: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
288-288: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
292-292: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
433-433: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
456-456: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
473-473: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
563-563: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
568-568: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
573-573: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
578-578: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
617-617: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
624-624: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
630-630: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
636-636: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Lint (golangci)
- GitHub Check: Analyze (go)
- GitHub Check: Build (macos-latest, macos)
- GitHub Check: Build (windows-latest, windows)
- GitHub Check: Lint (golangci)
- GitHub Check: Analyze (go)
- GitHub Check: Summary
🔇 Additional comments (3)
component-architecture-research.md (2)
1-100: Well-structured research document that effectively establishes context for the registry pattern.The document provides clear analysis of current architecture, discovery mechanisms, and execution flows. The progression from "what exists" → "what could be extracted" → "how to migrate" is logical and actionable. Section 5.2 (Migration Phases) is particularly valuable for implementation planning.
700-720: Recommendation section balances pragmatism with forward-looking design.The conclusion appropriately recommends proceeding incrementally and emphasizes the command registry as a prerequisite learning opportunity. This matches the PR's stated goals (issues #589, #600, #601) by establishing patterns before scaling to components.
CLAUDE.md (1)
821-846: Well-written guidance that fits naturally into the developer workflow.The new "Git and Version Control" section provides practical, actionable direction on what to commit and why. It aligns nicely with the PR's goal of improving maintainability and consistency. The structure is clear, the examples are concrete, and the formatting is consistent with the rest of CLAUDE.md. The static analysis warnings appear to be false positives from markdown parsing.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1648 +/- ##
==========================================
+ Coverage 66.33% 66.45% +0.12%
==========================================
Files 356 357 +1
Lines 41025 41126 +101
==========================================
+ Hits 27213 27331 +118
+ Misses 11775 11759 -16
+ Partials 2037 2036 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
💥 This pull request now has conflicts. Could you fix it Erik Osterman (Cloud Posse) (@osterman)? 🙏 |
82873ad to
616e396
Compare
There was a problem hiding this comment.
Actionable comments posted: 8
♻️ Duplicate comments (1)
CLAUDE.md (1)
821-848: This PR includes a non-deliverable research doc; align with this section.The repo currently adds component-architecture-research.md, which this section classifies as “Do NOT commit.” Please remove it or convert into an approved PRD under docs/prd/. As per coding guidelines.
🧹 Nitpick comments (16)
component-architecture-research.md (2)
559-559: Add terminal punctuation.Sentence lacks a period at the end. Tiny polish for consistency.
682-682: Add terminal punctuation.Sentence lacks a period at the end. Tiny polish for consistency.
docs/developing-component-plugins.md (4)
142-151: Use mapstructure v2 and wrap errors with %w.Switch examples to github.com/go-viper/mapstructure/v2 and use %w for both sentinel and underlying errors (Go 1.20+). Based on learnings.
Apply this diff:
- "github.com/mitchellh/mapstructure" + mapstructure "github.com/go-viper/mapstructure/v2"- decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{ + decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{ Result: &config, WeaklyTypedInput: true, TagName: "mapstructure", }) if err != nil { - return Config{}, fmt.Errorf("%w: failed to create config decoder: %v", errUtils.ErrComponentConfigInvalid, err) + return Config{}, fmt.Errorf("%w: failed to create config decoder: %w", errUtils.ErrComponentConfigInvalid, err) } - if err := decoder.Decode(raw); err != nil { - return Config{}, fmt.Errorf("%w: failed to decode config: %v", errUtils.ErrComponentConfigInvalid, err) + if err := decoder.Decode(raw); err != nil { + return Config{}, fmt.Errorf("%w: failed to decode config: %w", errUtils.ErrComponentConfigInvalid, err) }-import "github.com/mitchellh/mapstructure" +import mapstructure "github.com/go-viper/mapstructure/v2" decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{ Result: &config, WeaklyTypedInput: true, TagName: "mapstructure", })Also applies to: 267-279, 655-662
173-191: Add perf tracking to public methods in examples.Align with mandatory perf.Track guidance by instrumenting exported methods. As per coding guidelines.
Apply this diff:
func (p *YourTypeProvider) GetBasePath(atmosConfig *schema.AtmosConfiguration) string { + defer perf.Track(atmosConfig, "component.yourtype.GetBasePath")() + // Try to get config from Plugins map.func (p *YourTypeProvider) Execute(ctx component.ExecutionContext) error { + defer perf.Track(ctx.AtmosConfig, "component.yourtype.Execute")() + // Implement your execution logic here.And add import:
import ( "context" "fmt" + "github.com/cloudposse/atmos/pkg/perf"Also applies to: 229-239
65-78: Consider carrying context.Context in ExecutionContext.Optional: add a Context field for cancellation/deadline across Execute/GenerateArtifacts.
Would you like a follow-up PR to wire this through providers and call-sites?
766-769: Typographic quote nit.Minor: close quote after yaml:"field_name" renders oddly; keep ASCII quotes or ensure matching typographic quotes.
pkg/component/provider.go (1)
47-59: ExecutionContext lacks a context.Context.Optional: add Context context.Context to support cancellation/timeouts uniformly in provider implementations.
pkg/component/registry.go (3)
62-70: Deterministic grouping order for introspection.ListProviders builds groups but doesn’t sort providers within each group. Sorting improves stability for UIs/tests.
for _, provider := range registry.providers { group := provider.GetGroup() grouped[group] = append(grouped[group], provider) } - return grouped + // Stable order within each group. + for g := range grouped { + sort.Slice(grouped[g], func(i, j int) bool { + return grouped[g][i].GetType() < grouped[g][j].GetType() + }) + } + return grouped
25-27: Doc comment punctuation.End Line 25 comment with a period to satisfy godot.
-// If a provider with the same type already exists, it will be replaced +// If a provider with the same type already exists, it will be replaced.
126-134: Non-panicking alternative (optional).MustGetProvider panics; consider a sibling API that returns an error for library callers to avoid crashes in long‑running processes.
pkg/component/mock/mock.go (3)
3-13: Use go-viper/mapstructure v2 and wrap parse errors.Upgrade to maintained module and add context to errors. Based on learnings.
import ( "context" "fmt" - "github.com/mitchellh/mapstructure" + mapstructure "github.com/go-viper/mapstructure/v2" @@ func parseConfig(raw any) (Config, error) { var config Config decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{ Result: &config, TagName: "mapstructure", }) if err != nil { - return DefaultConfig(), err + return DefaultConfig(), fmt.Errorf("mock.parseConfig: new decoder: %w", err) } if err := decoder.Decode(raw); err != nil { - return DefaultConfig(), err + return DefaultConfig(), fmt.Errorf("mock.parseConfig: decode: %w", err) } return config, nil }Also applies to: 122-139
72-78: Deterministic component listing.Sort names for stable outputs and tests.
for name := range mockComponents { componentNames = append(componentNames, name) } - return componentNames, nil + sort.Strings(componentNames) + return componentNames, nilAlso import sort in the stdlib group.
14-20: Doc comments need trailing periods.End each line in the type doc with a period to satisfy godot.
-// the component registry pattern. It demonstrates the interface implementation +// the component registry pattern. It demonstrates the interface implementation. -// without requiring external tools or cloud providers. +// without requiring external tools or cloud providers. -// +// -// This component type is NOT documented for end users and is intended only +// This component type is NOT documented for end users and is intended only. -// for development and testing purposes. +// for development and testing purposes.docs/prd/component-registry-pattern.md (3)
61-89: Specify language for fenced diagram.Add a language to the ASCII diagram fence to satisfy MD040.
-``` +```text ...--- `1088-1115`: **Minor punctuation cleanups.** A few list items/paragraphs lack terminal punctuation. Add periods for consistency (see lint hints around Lines 1092, 1097, 1112, 1844, 1889). Also applies to: 1840-1848, 1884-1891 --- `806-897`: **Keep GetBasePath example consistent with hybrid config.** Earlier you show GetComponentConfig for plugins; this example uses Components.Mock.BasePath. Consider updating to the helper-based approach for consistency. ```diff -func (m *MockComponentProvider) GetBasePath(atmosConfig *schema.AtmosConfiguration) string { - if atmosConfig.Components.Mock.BasePath != "" { - return atmosConfig.Components.Mock.BasePath - } - return "components/mock" -} +func (m *MockComponentProvider) GetBasePath(atmosConfig *schema.AtmosConfiguration) string { + if raw, ok := atmosConfig.Components.GetComponentConfig("mock"); ok { + cfg := parseComponentConfig[MockComponentConfig](raw) + if cfg.BasePath != "" { + return cfg.BasePath + } + } + return "components/mock" +}
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (16)
CLAUDE.md(1 hunks)component-architecture-research.md(1 hunks)docs/developing-component-plugins.md(1 hunks)docs/prd/component-registry-pattern.md(1 hunks)errors/errors.go(1 hunks)pkg/component/mock/config.go(1 hunks)pkg/component/mock/mock.go(1 hunks)pkg/component/mock/mock_test.go(1 hunks)pkg/component/provider.go(1 hunks)pkg/component/registry.go(1 hunks)pkg/component/registry_test.go(1 hunks)pkg/datafetcher/schema/atmos/manifest/1.0.json(1 hunks)pkg/datafetcher/schema/config/global/1.0.json(1 hunks)pkg/datafetcher/schema/stacks/stack-config/1.0.json(1 hunks)pkg/schema/schema.go(1 hunks)tests/snapshots/TestCLICommands_atmos_describe_config.stdout.golden(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (7)
- pkg/component/mock/config.go
- tests/snapshots/TestCLICommands_atmos_describe_config.stdout.golden
- pkg/datafetcher/schema/stacks/stack-config/1.0.json
- errors/errors.go
- pkg/datafetcher/schema/config/global/1.0.json
- pkg/component/mock/mock_test.go
- pkg/schema/schema.go
🧰 Additional context used
📓 Path-based instructions (7)
pkg/**/*.go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
Place business logic in pkg rather than in cmd
Files:
pkg/component/provider.gopkg/component/registry.gopkg/component/mock/mock.gopkg/component/registry_test.go
**/*.go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
**/*.go: All code must pass golangci-lint checks
Follow Go error handling idioms and use meaningful error messages
Wrap errors with context using fmt.Errorf("context: %w", err)
Consider custom error types for domain-specific errors
Follow standard Go coding style; run gofmt and goimports
Use snake_case for environment variables
Document complex logic with inline comments
**/*.go: All Go comments must end with periods; applies to single-line, multi-line, inline, and documentation comments (golangci-lint godot).
Group imports into three sections (stdlib, 3rd-party, Atmos), separated by blank lines; sort alphabetically within each group; preserve existing aliases.
Configuration loading must use Viper with precedence CLI → ENV → files → defaults; bind config name atmos and add path, AutomaticEnv, and ATMOS prefix.
All errors must be wrapped using static errors (defined in errors/errors.go); use errors.Join for multiple errors; fmt.Errorf with %w for context; use errors.Is for checks; never compare error strings.
Distinguish structured logging from UI output: UI prompts/status/errors to stderr; data/results to stdout; never use logging for UI.
Most text UI must go to stderr; only data/results to stdout; prefer utils.PrintfMessageToTUI for UI messages.
All new configurations must support Go templating using existing utilities and available template functions.
Prefer SDKs over external binaries for cross-platform support; use filepath/os/runtime for portability.
For non-standard execution paths, capture telemetry via telemetry.CaptureCmd or telemetry.CaptureCmdString without user data.
80% minimum coverage on new/changed lines and include unit tests for new features; add integration tests for CLI using tests/ fixtures.
Always bind environment variables with viper.BindEnv and provide ATMOS_ alternatives for every env var.
Use structured logging with levels (Fatal>Error>Warn>Debug>Trace); avoid string interpolation and ensure logging does not affect execution.
Prefer re...
Files:
pkg/component/provider.gopkg/component/registry.gopkg/component/mock/mock.gopkg/component/registry_test.go
**/!(*_test).go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
Document all exported functions, types, and methods with Go doc comments
Add
defer perf.Track()to all public functions and critical private functions; include a blank line after the call; use package-prefixed names; pass atmosConfig when present, else nil.
Files:
pkg/component/provider.gopkg/component/registry.gopkg/component/mock/mock.go
pkg/datafetcher/schema/{config/global,atmos/manifest,stacks/stack-config,vendor/package}/1.0.json
📄 CodeRabbit inference engine (CLAUDE.md)
When adding Atmos configuration options, update all schema files for global, manifest, stacks, and vendor package (all four 1.0.json files).
Files:
pkg/datafetcher/schema/atmos/manifest/1.0.json
**/{mock_*.go,mock/*.go}
📄 CodeRabbit inference engine (CLAUDE.md)
Generate and keep mocks alongside the interfaces they mock; mocks are excluded from coverage.
Files:
pkg/component/mock/mock.go
**/*_test.go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
**/*_test.go: Every new feature must include comprehensive unit tests
Test both happy paths and error conditions
Use table-driven tests for multiple scenarios
**/*_test.go: Use table-driven unit tests for pure functions and focus on behavior; co-locate tests; target >80% coverage for pkg/ and internal/exec/.
Always use t.Skipf() with a clear reason; never use t.Skip() or t.Skipf without a reason.
Files:
pkg/component/registry_test.go
pkg/**/*_test.go
📄 CodeRabbit inference engine (CLAUDE.md)
Unit tests for packages live under pkg/ alongside implementation files.
Files:
pkg/component/registry_test.go
🧠 Learnings (3)
📚 Learning: 2025-10-16T15:18:00.319Z
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-16T15:18:00.319Z
Learning: Applies to pkg/store/**/*.go : Implement multi-provider interfaces in separate files per provider and register providers in a registry.
Applied to files:
pkg/component/registry.go
📚 Learning: 2025-10-16T15:18:00.319Z
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-16T15:18:00.319Z
Learning: Applies to pkg/datafetcher/schema/{config/global,atmos/manifest,stacks/stack-config,vendor/package}/1.0.json : When adding Atmos configuration options, update all schema files for global, manifest, stacks, and vendor package (all four 1.0.json files).
Applied to files:
pkg/datafetcher/schema/atmos/manifest/1.0.json
📚 Learning: 2025-10-16T15:18:00.319Z
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-16T15:18:00.319Z
Learning: Applies to **/*.go : 80% minimum coverage on new/changed lines and include unit tests for new features; add integration tests for CLI using tests/ fixtures.
Applied to files:
CLAUDE.md
🧬 Code graph analysis (4)
pkg/component/provider.go (1)
pkg/schema/schema.go (3)
AtmosConfiguration(27-65)Context(409-424)ConfigAndStacksInfo(488-567)
pkg/component/registry.go (2)
pkg/component/provider.go (2)
ComponentProvider(14-45)ComponentInfo(62-67)errors/errors.go (3)
ErrComponentProviderNil(155-155)ErrComponentTypeEmpty(156-156)ErrComponentProviderNotFound(154-154)
pkg/component/mock/mock.go (5)
pkg/component/registry.go (1)
Register(29-44)pkg/schema/schema.go (3)
AtmosConfiguration(27-65)Components(357-367)Context(409-424)pkg/component/mock/config.go (2)
DefaultConfig(29-38)Config(7-26)errors/errors.go (1)
ErrComponentValidationFailed(159-159)pkg/component/provider.go (1)
ExecutionContext(48-59)
pkg/component/registry_test.go (4)
pkg/schema/schema.go (2)
AtmosConfiguration(27-65)Context(409-424)pkg/component/provider.go (2)
ExecutionContext(48-59)ComponentProvider(14-45)pkg/component/registry.go (8)
Reset(119-124)Register(29-44)Count(88-93)GetProvider(48-54)ListTypes(74-85)ListProviders(58-70)GetInfo(97-115)MustGetProvider(128-134)errors/errors.go (3)
ErrComponentProviderNil(155-155)ErrComponentTypeEmpty(156-156)ErrComponentProviderNotFound(154-154)
🪛 LanguageTool
CLAUDE.md
[typographical] ~841-~841: Consider using a typographic opening quote here.
Context: ...commit it - If unsure: Ask the user "Should I commit [filename]?" **`.gitign...
(EN_QUOTES)
[typographical] ~841-~841: Consider using a typographic close quote here.
Context: ...sk the user "Should I commit [filename]?" .gitignore Rules: - **DO NOT aut...
(EN_QUOTES)
docs/prd/component-registry-pattern.md
[style] ~99-~99: Since ownership is already implied, this phrasing may be redundant.
Context: ...schemas** - Each component type defines its own configuration structure 8. **Cross-comp...
(PRP_OWN)
[style] ~260-~260: Since ownership is already implied, this phrasing may be redundant.
Context: ...orm) 3. Each component type validates its own schema via ValidateComponent() ###...
(PRP_OWN)
[style] ~309-~309: Try replacing ‘care’ with a synonym to elevate your writing.
Context: ...omponent-type agnostic** - the registry doesn't care about internal structure. ### Cross-Componen...
(DONT_CARE)
[style] ~496-~496: Since ownership is already implied, this phrasing may be redundant.
Context: ...lse **Component providers validate their own settings:** go func (t *TerraformCo...
(PRP_OWN)
[style] ~569-~569: Since ownership is already implied, this phrasing may be redundant.
Context: ...:** Each component provider can define its own config structure: ```go // pkg/compone...
(PRP_OWN)
[grammar] ~1092-~1092: Please add a punctuation mark at the end of paragraph.
Context: ...overy - No changes to affected logic needed 2. atmos list components ✅ - ...
(PUNCTUATION_PARAGRAPH_END)
[grammar] ~1097-~1097: Please add a punctuation mark at the end of paragraph.
Context: ...pe - Maintains current filtering and deduplication 3. atmos describe stacks ✅ - ...
(PUNCTUATION_PARAGRAPH_END)
[grammar] ~1112-~1112: Please add a punctuation mark at the end of paragraph.
Context: ...c wrapped by providers - No behavior changes ### Backward Compatibility **No break...
(PUNCTUATION_PARAGRAPH_END)
[typographical] ~1489-~1489: Consider using typographic quotation marks here.
Context: ...nt Provider:** - ✅ GetType() returns "mock" - ✅ GetGroup() returns "Testing" ...
(EN_QUOTES)
[typographical] ~1490-~1490: Consider using typographic quotation marks here.
Context: ...eturns "mock" - ✅ GetGroup() returns "Testing" - ✅ GetBasePath() with and without c...
(EN_QUOTES)
[grammar] ~1610-~1610: Please add a punctuation mark at the end of paragraph.
Context: ...ting tests pass 7. Test with real stack configurations Success Criteria: - ✅ `atmos list ...
(PUNCTUATION_PARAGRAPH_END)
[typographical] ~1717-~1717: In American English, use a period after an abbreviation.
Context: ...ypes - ✅ No special-casing for built-in vs plugin types - ✅ Simpler codebase (no s...
(MISSING_PERIOD_AFTER_ABBREVIATION)
[grammar] ~1844-~1844: Please add a punctuation mark at the end of paragraph.
Context: ...ing tools - Proof of concept for plugin system ### Q: Is the mock component documente...
(PUNCTUATION_PARAGRAPH_END)
[style] ~1872-~1872: Since ownership is already implied, this phrasing may be redundant.
Context: ...rk? A: Each component type defines its own configuration structure: 1. **Global c...
(PRP_OWN)
[style] ~1876-~1876: Since ownership is already implied, this phrasing may be redundant.
Context: ...Validation: Each provider validates its own configuration via ValidateComponent()...
(PRP_OWN)
[grammar] ~1889-~1889: Please add a punctuation mark at the end of paragraph.
Context: ...DAG respects dependencies regardless of type Example: `terraform/vpc → terraform/ek...
(PUNCTUATION_PARAGRAPH_END)
component-architecture-research.md
[style] ~425-~425: Since ownership is already implied, this phrasing may be redundant.
Context: ...Key Insight:* Each component type has its own execution function. No shared interface...
(PRP_OWN)
[grammar] ~559-~559: Please add a punctuation mark at the end of paragraph.
Context: ...** Introspection of available component types ### 4.4 Challenges & Considerations *...
(PUNCTUATION_PARAGRAPH_END)
[grammar] ~682-~682: Please add a punctuation mark at the end of paragraph.
Context: ...unchanged - Interface wraps existing implementation 4. Test-Driven: - 100% test cov...
(PUNCTUATION_PARAGRAPH_END)
docs/developing-component-plugins.md
[typographical] ~766-~766: Consider using a typographic close quote here.
Context: ...ucture tags match YAML field names (use yaml:"field_name") 3. Ensure `GetComponentCon...
(EN_QUOTES)
[typographical] ~803-~803: In American English, use a period after an abbreviation.
Context: ...r) } return nil } ``` ### SDK vs CLI Execution Prefer using Go SDKs ove...
(MISSING_PERIOD_AFTER_ABBREVIATION)
[style] ~825-~825: Try moving the adverb to make the sentence clearer.
Context: ...Path The component registry pattern is designed to eventually migrate all component types to plugins: Phase 1-3 (Current): B...
(SPLIT_INFINITIVE)
🪛 markdownlint-cli2 (0.18.1)
docs/prd/component-registry-pattern.md
61-61: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: Analyze (go)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Lint (golangci)
- GitHub Check: Build (macos-latest, macos)
- GitHub Check: Build (windows-latest, windows)
- GitHub Check: Analyze (go)
- GitHub Check: Lint (golangci)
- GitHub Check: Summary
🔇 Additional comments (5)
pkg/datafetcher/schema/atmos/manifest/1.0.json (1)
167-167: No further action needed—vendor/package schema serves different purpose.The vendor/package/1.0.json schema validates vendoring configuration (vendor.yml files), not stack/component definitions. It has no "components" property, so the
additionalPropertieschange doesn't apply. The three relevant schema files—global, manifest, and stacks—have all been correctly updated withadditionalProperties: trueto support dynamic component types.pkg/component/registry_test.go (1)
275-297: Nice concurrency coverage; keep it.Concurrent registration test is solid and exercises the RWMutex path well.
Consider running with -race in CI to harden coverage.
pkg/component/provider.go (1)
14-45: Interface shape looks solid for v1.Good balance between discovery, validation, execution, and metadata. No blockers.
Ensure provider impls document expected semantics for ListComponents (stack-scoped vs repo-wide).
CLAUDE.md (1)
1041-1046: Go version note in CLAUDE.md is accurate.The documentation correctly states "Go 1.24+" and go.mod specifies "go 1.24.8"—these are aligned. No changes needed.
pkg/component/mock/mock.go (1)
30-33: Add perf instrumentation to provider methods.Add defer perf.Track() to exported methods and critical helper.
func (m *MockComponentProvider) GetType() string { + defer perf.Track() + @@ func (m *MockComponentProvider) GetGroup() string { + defer perf.Track() + @@ func (m *MockComponentProvider) GetBasePath(atmosConfig *schema.AtmosConfiguration) string { + defer perf.Track() + @@ func (m *MockComponentProvider) ListComponents(ctx context.Context, stack string, stackConfig map[string]any) ([]string, error) { + defer perf.Track() + @@ func (m *MockComponentProvider) ValidateComponent(config map[string]any) error { + defer perf.Track() + @@ func (m *MockComponentProvider) Execute(ctx component.ExecutionContext) error { + defer perf.Track() + @@ func (m *MockComponentProvider) GenerateArtifacts(ctx component.ExecutionContext) error { + defer perf.Track() + @@ func (m *MockComponentProvider) GetAvailableCommands() []string { + defer perf.Track() + @@ func parseConfig(raw any) (Config, error) { + defer perf.Track() +Also applies to: 35-37, 40-58, 61-78, 81-92, 95-108, 111-115, 118-120, 123-139
⛔ Skipped due to learnings
Learnt from: CR PR: cloudposse/atmos#0 File: CLAUDE.md:0-0 Timestamp: 2025-10-16T15:18:00.319Z Learning: Applies to **/!(*_test).go : Add `defer perf.Track()` to all public functions and critical private functions; include a blank line after the call; use package-prefixed names; pass atmosConfig when present, else nil.Learnt from: osterman PR: cloudposse/atmos#1599 File: pkg/ui/markdown/renderer.go:247-259 Timestamp: 2025-10-11T19:06:16.131Z Learning: Performance tracking with `defer perf.Track()` should be reserved for functions that perform actual computational work, I/O operations, or have measurable performance impact. Simple wrapper methods that immediately delegate to other functions do not require performance tracking, as it adds unnecessary overhead without providing meaningful insights.Learnt from: osterman PR: cloudposse/atmos#1599 File: pkg/ui/markdown/renderer.go:143-182 Timestamp: 2025-10-11T19:12:23.475Z Learning: High-frequency utility and formatting functions (e.g., markdown renderers, formatters) that are called repeatedly during command execution should not have `defer perf.Track()` even if they are public methods. Performance tracking at these levels introduces unnecessary overhead without meaningful insights, as tracking is already present at higher command-execution levels where it provides actionable data.
- Remove component-architecture-research.md per CLAUDE.md guidelines (non-deliverable process artifact) - Fix YAML example in developing-component-plugins.md to match hybrid schema - Plugin types must be nested under components.plugins, not directly under components 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
docs/developing-component-plugins.md (1)
767-827: Address minor typographic and grammar polish issues.Three quick fixes to tighten the prose:
- Line 767: Inconsistent quote style in code block—use straight single/double quotes consistently for field names.
- Line 804: Add period after "SDK" abbreviation → "...Prefer using Go SDKs over..."
- Line 826: Rephrase split infinitive for clarity → "The component registry pattern is designed to help migrate..." or "...will eventually migrate all component types to plugins".
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
docs/developing-component-plugins.md(1 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/developing-component-plugins.md
[typographical] ~767-~767: Consider using a typographic close quote here.
Context: ...ucture tags match YAML field names (use yaml:"field_name") 3. Ensure `GetComponentCon...
(EN_QUOTES)
[typographical] ~804-~804: In American English, use a period after an abbreviation.
Context: ...r) } return nil } ``` ### SDK vs CLI Execution Prefer using Go SDKs ove...
(MISSING_PERIOD_AFTER_ABBREVIATION)
[style] ~826-~826: Try moving the adverb to make the sentence clearer.
Context: ...Path The component registry pattern is designed to eventually migrate all component types to plugins: Phase 1-3 (Current): B...
(SPLIT_INFINITIVE)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Build (macos-latest, macos)
- GitHub Check: Build (windows-latest, windows)
- GitHub Check: Analyze (go)
- GitHub Check: Lint (golangci)
- GitHub Check: Summary
🔇 Additional comments (2)
docs/developing-component-plugins.md (2)
1-282: Early sections look solid.Interface definitions, package structure, config templates, and implementation examples are well-organized and comprehensive. The code block language identifier is now in place. Moving on to configuration examples.
622-802: Error handling, best practices, and advanced sections are well-written.Clear guidance on sentinel errors, thread safety, config parsing, defaults, and troubleshooting. SDK vs. CLI execution guidance is practical.
- Fix PRD Register() signature to match implementation with error return - Add nil check for atmosConfig in mock GetBasePath() - Change UI output to use PrintfMessageToTUI() instead of fmt.Printf() - Fix concurrent test to avoid testing.T calls in goroutines - Wrap sentinel errors with context using fmt.Errorf() - Add perf.Track() to all exported registry functions - Change ExecutionContext parameter to pointer to avoid hugeParam warning - Fix godot linting issue (missing period) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 11
♻️ Duplicate comments (1)
docs/prd/component-registry-pattern.md (1)
713-736: Register semantics mismatch (override vs error).Code overwrites on duplicate (last wins); PRD says “return error on already registered.” Update PRD to match code or change code. If keeping override, adjust snippet:
-// Returns an error if the provider is nil, has an empty type, or is already registered. +// Returns an error if the provider is nil or has an empty type. +// If a provider with the same type exists, the last registration wins (override).
🧹 Nitpick comments (10)
pkg/component/registry_test.go (1)
55-72: Optionally mark non-concurrent tests t.Parallel.Many tests are independent; consider t.Parallel() at test starts to speed CI (skip for the two concurrent tests).
Also applies to: 117-137, 139-153, 155-170, 172-185, 187-213, 214-227, 229-239, 241-254, 256-273, 275-297, 299-341, 343-354, 356-372
pkg/component/mock/mock_test.go (1)
24-84: Good breadth of coverage.Covers all interface methods and config parsing paths. Consider t.Parallel() inside the for _, tt := range tests loops to speed up suites.
Also applies to: 86-148, 150-219, 221-268, 270-281, 282-293, 294-303, 305-381, 383-446
pkg/component/provider.go (1)
9-15: Doc comment punctuation nit.A couple lines in the multi-line doc comment don’t end with periods; add periods for godot compliance. Example tweak:
-// ComponentProvider is the interface that component type implementations -// must satisfy to register with the Atmos component registry. +// ComponentProvider is the interface that component type implementations must satisfy. +// Providers register with the Atmos component registry via init() functions.docs/prd/component-registry-pattern.md (3)
849-856: Mock GetBasePath config source mismatch.Docs use Components.Mock.BasePath; implementation/tests read from Plugins["mock"]. Switch example:
-func (m *MockComponentProvider) GetBasePath(atmosConfig *schema.AtmosConfiguration) string { - if atmosConfig.Components.Mock.BasePath != "" { - return atmosConfig.Components.Mock.BasePath - } - return "components/mock" -} +func (m *MockComponentProvider) GetBasePath(cfg *schema.AtmosConfiguration) string { + raw, ok := cfg.Components.GetComponentConfig("mock") + if !ok { + return "components/mock" + } + c, _ := parseConfig(raw) // or typed parse + if c.BasePath != "" { + return c.BasePath + } + return "components/mock" +}Also applies to: 581-592
1277-1332: Avoid testing.T in goroutines in examples.Update PRD concurrency example to avoid calling assert inside goroutines:
- go func() { - defer wg.Done() - _, ok := GetProvider("mock") - assert.True(t, ok) - }() + go func() { + defer wg.Done() + if _, ok := GetProvider("mock"); !ok { + errCh <- fmt.Errorf("provider 'mock' not found") + } + }() ... + close(errCh) + for err := range errCh { + t.Error(err) + }
61-90: Add fenced code language for diagram blocks.Markdownlint MD040: specify a language. Use “text” for ASCII diagrams:
-``` +```text ... -``` +```pkg/component/registry.go (2)
69-77: Optional: stable ordering in ListProviders.For deterministic output, sort providers within each group by type before returning:
func ListProviders() map[string][]ComponentProvider { @@ - for _, provider := range registry.providers { + for _, provider := range registry.providers { group := provider.GetGroup() grouped[group] = append(grouped[group], provider) } + for g := range grouped { + sort.SliceStable(grouped[g], func(i, j int) bool { + return grouped[g][i].GetType() < grouped[g][j].GetType() + }) + } return grouped }
37-41: Optional: normalize componentType.Trim whitespace to avoid accidental duplicates:
- componentType := provider.GetType() + componentType := strings.TrimSpace(provider.GetType()) if componentType == "" {Add import:
import ( "fmt" "sort" "sync" + "strings"pkg/component/mock/mock.go (2)
15-21: Tighten type doc comment (lint-friendly, no empty // lines).Consolidate and end sentences with periods to satisfy godoc/godot.
As per coding guidelines.
-// MockComponentProvider is a proof-of-concept component type for testing -// -// the component registry pattern. It demonstrates the interface implementation -// -// without requiring external tools or cloud providers. -// -// -// This component type is NOT documented for end users and is intended only -// -// for development and testing purposes. +// MockComponentProvider is a proof-of-concept component provider for testing the component registry pattern. +// It demonstrates the interface implementation without requiring external tools or cloud providers. +// This component type is not documented for end users and is intended only for development and testing purposes.
127-144: Wrap decode errors with context in parseConfig.Gives clearer failure provenance; pairs well with logs/telemetry. Safe even when caller falls back to defaults.
As per coding guidelines.
func parseConfig(raw any) (Config, error) { var config Config - decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{ + decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{ Result: &config, TagName: "mapstructure", }) if err != nil { - return DefaultConfig(), err + return DefaultConfig(), fmt.Errorf("mock: new decoder: %w", err) } - if err := decoder.Decode(raw); err != nil { - return DefaultConfig(), err + if err := decoder.Decode(raw); err != nil { + return DefaultConfig(), fmt.Errorf("mock: decode config: %w", err) } return config, nil }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (6)
docs/prd/component-registry-pattern.md(1 hunks)pkg/component/mock/mock.go(1 hunks)pkg/component/mock/mock_test.go(1 hunks)pkg/component/provider.go(1 hunks)pkg/component/registry.go(1 hunks)pkg/component/registry_test.go(1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
pkg/**/*.go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
Place business logic in pkg rather than in cmd
Files:
pkg/component/provider.gopkg/component/registry_test.gopkg/component/mock/mock.gopkg/component/registry.gopkg/component/mock/mock_test.go
**/*.go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
**/*.go: All code must pass golangci-lint checks
Follow Go error handling idioms and use meaningful error messages
Wrap errors with context using fmt.Errorf("context: %w", err)
Consider custom error types for domain-specific errors
Follow standard Go coding style; run gofmt and goimports
Use snake_case for environment variables
Document complex logic with inline comments
**/*.go: All Go comments must end with periods; applies to single-line, multi-line, inline, and documentation comments (golangci-lint godot).
Group imports into three sections (stdlib, 3rd-party, Atmos), separated by blank lines; sort alphabetically within each group; preserve existing aliases.
Configuration loading must use Viper with precedence CLI → ENV → files → defaults; bind config name atmos and add path, AutomaticEnv, and ATMOS prefix.
All errors must be wrapped using static errors (defined in errors/errors.go); use errors.Join for multiple errors; fmt.Errorf with %w for context; use errors.Is for checks; never compare error strings.
Distinguish structured logging from UI output: UI prompts/status/errors to stderr; data/results to stdout; never use logging for UI.
Most text UI must go to stderr; only data/results to stdout; prefer utils.PrintfMessageToTUI for UI messages.
All new configurations must support Go templating using existing utilities and available template functions.
Prefer SDKs over external binaries for cross-platform support; use filepath/os/runtime for portability.
For non-standard execution paths, capture telemetry via telemetry.CaptureCmd or telemetry.CaptureCmdString without user data.
80% minimum coverage on new/changed lines and include unit tests for new features; add integration tests for CLI using tests/ fixtures.
Always bind environment variables with viper.BindEnv and provide ATMOS_ alternatives for every env var.
Use structured logging with levels (Fatal>Error>Warn>Debug>Trace); avoid string interpolation and ensure logging does not affect execution.
Prefer re...
Files:
pkg/component/provider.gopkg/component/registry_test.gopkg/component/mock/mock.gopkg/component/registry.gopkg/component/mock/mock_test.go
**/!(*_test).go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
Document all exported functions, types, and methods with Go doc comments
Add
defer perf.Track()to all public functions and critical private functions; include a blank line after the call; use package-prefixed names; pass atmosConfig when present, else nil.
Files:
pkg/component/provider.gopkg/component/mock/mock.gopkg/component/registry.go
**/*_test.go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
**/*_test.go: Every new feature must include comprehensive unit tests
Test both happy paths and error conditions
Use table-driven tests for multiple scenarios
**/*_test.go: Use table-driven unit tests for pure functions and focus on behavior; co-locate tests; target >80% coverage for pkg/ and internal/exec/.
Always use t.Skipf() with a clear reason; never use t.Skip() or t.Skipf without a reason.
Files:
pkg/component/registry_test.gopkg/component/mock/mock_test.go
pkg/**/*_test.go
📄 CodeRabbit inference engine (CLAUDE.md)
Unit tests for packages live under pkg/ alongside implementation files.
Files:
pkg/component/registry_test.gopkg/component/mock/mock_test.go
**/{mock_*.go,mock/*.go}
📄 CodeRabbit inference engine (CLAUDE.md)
Generate and keep mocks alongside the interfaces they mock; mocks are excluded from coverage.
Files:
pkg/component/mock/mock.gopkg/component/mock/mock_test.go
🧠 Learnings (7)
📚 Learning: 2025-10-16T15:18:00.319Z
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-16T15:18:00.319Z
Learning: Applies to pkg/store/**/*.go : Implement multi-provider interfaces in separate files per provider and register providers in a registry.
Applied to files:
pkg/component/registry_test.gopkg/component/registry.go
📚 Learning: 2025-10-16T15:18:00.319Z
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-16T15:18:00.319Z
Learning: Applies to pkg/**/*_test.go : Unit tests for packages live under pkg/ alongside implementation files.
Applied to files:
pkg/component/registry_test.go
📚 Learning: 2025-09-13T18:06:07.674Z
Learnt from: samtholiya
PR: cloudposse/atmos#1466
File: toolchain/list.go:39-42
Timestamp: 2025-09-13T18:06:07.674Z
Learning: In the cloudposse/atmos repository, for UI messages in the toolchain package, use utils.PrintfMessageToTUI instead of log.Error or fmt.Fprintln(os.Stderr, ...). Import pkg/utils with alias "u" to follow the established pattern.
Applied to files:
pkg/component/mock/mock.go
📚 Learning: 2025-10-16T15:18:00.319Z
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-16T15:18:00.319Z
Learning: Applies to **/*.go : Most text UI must go to stderr; only data/results to stdout; prefer utils.PrintfMessageToTUI for UI messages.
Applied to files:
pkg/component/mock/mock.go
📚 Learning: 2025-10-16T15:18:00.319Z
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-16T15:18:00.319Z
Learning: Applies to **/!(*_test).go : Add `defer perf.Track()` to all public functions and critical private functions; include a blank line after the call; use package-prefixed names; pass atmosConfig when present, else nil.
Applied to files:
pkg/component/registry.go
📚 Learning: 2025-10-11T19:06:16.131Z
Learnt from: osterman
PR: cloudposse/atmos#1599
File: pkg/ui/markdown/renderer.go:247-259
Timestamp: 2025-10-11T19:06:16.131Z
Learning: Performance tracking with `defer perf.Track()` should be reserved for functions that perform actual computational work, I/O operations, or have measurable performance impact. Simple wrapper methods that immediately delegate to other functions do not require performance tracking, as it adds unnecessary overhead without providing meaningful insights.
Applied to files:
pkg/component/registry.go
📚 Learning: 2025-10-11T19:12:23.475Z
Learnt from: osterman
PR: cloudposse/atmos#1599
File: pkg/ui/markdown/renderer.go:143-182
Timestamp: 2025-10-11T19:12:23.475Z
Learning: High-frequency utility and formatting functions (e.g., markdown renderers, formatters) that are called repeatedly during command execution should not have `defer perf.Track()` even if they are public methods. Performance tracking at these levels introduces unnecessary overhead without meaningful insights, as tracking is already present at higher command-execution levels where it provides actionable data.
Applied to files:
pkg/component/registry.go
🧬 Code graph analysis (5)
pkg/component/provider.go (1)
pkg/schema/schema.go (3)
AtmosConfiguration(27-65)Context(409-424)ConfigAndStacksInfo(488-567)
pkg/component/registry_test.go (4)
pkg/schema/schema.go (2)
AtmosConfiguration(27-65)Context(409-424)pkg/component/provider.go (2)
ExecutionContext(48-59)ComponentProvider(14-45)pkg/component/registry.go (8)
Reset(132-139)Register(30-47)Count(97-104)GetProvider(51-59)ListTypes(81-94)ListProviders(63-77)GetInfo(108-128)MustGetProvider(143-151)errors/errors.go (3)
ErrComponentProviderNil(155-155)ErrComponentTypeEmpty(156-156)ErrComponentProviderNotFound(154-154)
pkg/component/mock/mock.go (6)
pkg/component/registry.go (1)
Register(30-47)pkg/schema/schema.go (3)
AtmosConfiguration(27-65)Components(357-367)Context(409-424)pkg/component/mock/config.go (2)
DefaultConfig(29-38)Config(7-26)errors/errors.go (1)
ErrComponentValidationFailed(159-159)pkg/component/provider.go (1)
ExecutionContext(48-59)pkg/utils/log_utils.go (1)
PrintfMessageToTUI(33-35)
pkg/component/registry.go (3)
pkg/component/provider.go (2)
ComponentProvider(14-45)ComponentInfo(62-67)pkg/perf/perf.go (1)
Track(121-138)errors/errors.go (3)
ErrComponentProviderNil(155-155)ErrComponentTypeEmpty(156-156)ErrComponentProviderNotFound(154-154)
pkg/component/mock/mock_test.go (4)
pkg/component/mock/mock.go (1)
MockComponentProvider(21-21)pkg/schema/schema.go (2)
AtmosConfiguration(27-65)Components(357-367)pkg/component/provider.go (1)
ExecutionContext(48-59)pkg/component/mock/config.go (2)
DefaultConfig(29-38)Config(7-26)
🪛 LanguageTool
docs/prd/component-registry-pattern.md
[style] ~99-~99: Since ownership is already implied, this phrasing may be redundant.
Context: ...schemas** - Each component type defines its own configuration structure 8. **Cross-comp...
(PRP_OWN)
[style] ~260-~260: Since ownership is already implied, this phrasing may be redundant.
Context: ...orm) 3. Each component type validates its own schema via ValidateComponent() ###...
(PRP_OWN)
[style] ~309-~309: Try replacing ‘care’ with a synonym to elevate your writing.
Context: ...omponent-type agnostic** - the registry doesn't care about internal structure. ### Cross-Componen...
(DONT_CARE)
[style] ~496-~496: Since ownership is already implied, this phrasing may be redundant.
Context: ...lse **Component providers validate their own settings:** go func (t *TerraformCo...
(PRP_OWN)
[style] ~569-~569: Since ownership is already implied, this phrasing may be redundant.
Context: ...:** Each component provider can define its own config structure: ```go // pkg/compone...
(PRP_OWN)
[grammar] ~1102-~1102: Please add a punctuation mark at the end of paragraph.
Context: ...overy - No changes to affected logic needed 2. atmos list components ✅ - ...
(PUNCTUATION_PARAGRAPH_END)
[grammar] ~1107-~1107: Please add a punctuation mark at the end of paragraph.
Context: ...pe - Maintains current filtering and deduplication 3. atmos describe stacks ✅ - ...
(PUNCTUATION_PARAGRAPH_END)
[grammar] ~1122-~1122: Please add a punctuation mark at the end of paragraph.
Context: ...c wrapped by providers - No behavior changes ### Backward Compatibility **No break...
(PUNCTUATION_PARAGRAPH_END)
[typographical] ~1499-~1499: Consider using typographic quotation marks here.
Context: ...nt Provider:** - ✅ GetType() returns "mock" - ✅ GetGroup() returns "Testing" ...
(EN_QUOTES)
[typographical] ~1500-~1500: Consider using typographic quotation marks here.
Context: ...eturns "mock" - ✅ GetGroup() returns "Testing" - ✅ GetBasePath() with and without c...
(EN_QUOTES)
[grammar] ~1620-~1620: Please add a punctuation mark at the end of paragraph.
Context: ...ting tests pass 7. Test with real stack configurations Success Criteria: - ✅ `atmos list ...
(PUNCTUATION_PARAGRAPH_END)
[typographical] ~1727-~1727: In American English, use a period after an abbreviation.
Context: ...ypes - ✅ No special-casing for built-in vs plugin types - ✅ Simpler codebase (no s...
(MISSING_PERIOD_AFTER_ABBREVIATION)
[grammar] ~1854-~1854: Please add a punctuation mark at the end of paragraph.
Context: ...ing tools - Proof of concept for plugin system ### Q: Is the mock component documente...
(PUNCTUATION_PARAGRAPH_END)
[style] ~1882-~1882: Since ownership is already implied, this phrasing may be redundant.
Context: ...rk? A: Each component type defines its own configuration structure: 1. **Global c...
(PRP_OWN)
[style] ~1886-~1886: Since ownership is already implied, this phrasing may be redundant.
Context: ...Validation: Each provider validates its own configuration via ValidateComponent()...
(PRP_OWN)
[grammar] ~1899-~1899: Please add a punctuation mark at the end of paragraph.
Context: ...DAG respects dependencies regardless of type Example: `terraform/vpc → terraform/ek...
(PUNCTUATION_PARAGRAPH_END)
🪛 markdownlint-cli2 (0.18.1)
docs/prd/component-registry-pattern.md
61-61: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Build (windows-latest, windows)
- GitHub Check: Analyze (go)
- GitHub Check: Lint (golangci)
- GitHub Check: Run pre-commit hooks
- GitHub Check: Summary
🔇 Additional comments (6)
pkg/component/registry_test.go (1)
309-341: Nice concurrency hygiene.Good use of errCh to avoid calling testing.T in goroutines; races avoided and logic is clear.
pkg/component/provider.go (1)
34-45: Confirm pointer usage is intentional.Interface uses pointers for Execute/GenerateArtifacts (ctx *ExecutionContext). Tests follow this. Ensure docs reflect pointer form to avoid confusion.
Also applies to: 47-60
pkg/component/registry.go (1)
24-47: Register path looks good.Error wrapping and perf instrumentation are on point; lock usage is correct.
pkg/component/mock/mock.go (3)
99-120: Nice: UI routed to TUI/stderr.The switch to utils.PrintfMessageToTUI aligns with repo guidance. No changes requested.
99-113: Add perf.Track to Execute; skip nil guard (no sentinel exists, pattern not used elsewhere).The review correctly identifies that
perf.Track()is required per coding guidelines for all public functions. However, the nil guard suggestion doesn't align with your codebase:
- No
ErrExecutionContextNilsentinel exists inerrors/errors.go- Other
Executeimplementations (testProvider in registry_test.go, docs examples) don't guard against nil ctx- Current code already dereferences ctx fields directly (lines 103-107), so a nil check is inconsistent with existing assumptions
Simply add the performance tracking with the blank line as shown in the diff, and keep the TUI output intact:
func (m *MockComponentProvider) Execute(ctx *component.ExecutionContext) error { // Mock execution - simulates command execution without external dependencies. + defer perf.Track(ctx.AtmosConfig, "mock.Execute")() + u.PrintfMessageToTUI("Mock component execution:\n")Likely an incorrect or invalid review comment.
115-120: Revert the suggested changes—mocks shouldn't have perf.Track.The review selectively flags only
GenerateArtifactswhen the mock has eight equivalent public methods. If the perf tracking guideline truly applied to this file, all eight methods would require it consistently. The current codebase has zero perf.Track calls across all mock implementations, andperfisn't even imported inmock.go, indicating mocks are intentionally excluded from performance tracking—they're test fixtures, not production code.Likely an incorrect or invalid review comment.
- Add perf.Track() instrumentation to all MockComponentProvider methods - Add sort.Strings() to ListComponents for deterministic ordering - Fix PRD ExecutionContext to use pointer types in interface examples - Remove TestNilCommand and RegisterAll() references from PRD - Fix developing-component-plugins.md to show plugin types under components.plugins 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 8
♻️ Duplicate comments (2)
docs/prd/component-registry-pattern.md (1)
883-896: Use pointer ExecutionContext in provider examples.Keep PRD consistent with code.
-func (m *MockComponentProvider) Execute(ctx component.ExecutionContext) error { +func (m *MockComponentProvider) Execute(ctx *component.ExecutionContext) error { @@ -func (m *MockComponentProvider) GenerateArtifacts(ctx component.ExecutionContext) error { +func (m *MockComponentProvider) GenerateArtifacts(ctx *component.ExecutionContext) error {-func (t *TerraformComponentProvider) Execute(ctx component.ExecutionContext) error { +func (t *TerraformComponentProvider) Execute(ctx *component.ExecutionContext) error { @@ -func (t *TerraformComponentProvider) GenerateArtifacts(ctx component.ExecutionContext) error { +func (t *TerraformComponentProvider) GenerateArtifacts(ctx *component.ExecutionContext) error {Also applies to: 898-902, 969-977
docs/developing-component-plugins.md (1)
766-770: Fix config path in Troubleshooting.Plugins live under components.plugins.
-1. Verify your config is in the correct location in `atmos.yaml` under `components.yourtype` +1. Verify your config is in the correct location in `atmos.yaml` under `components.plugins.yourtype`
🧹 Nitpick comments (4)
docs/developing-component-plugins.md (1)
146-146: Optional: use mapstructure v2 in examples.Modern API and hooks; update when the repo migrates.
-import "github.com/mitchellh/mapstructure" +import "github.com/go-viper/mapstructure/v2"Also applies to: 657-657
docs/prd/component-registry-pattern.md (2)
713-736: Align duplicate registration semantics.Docs show Register() errors on duplicates, but current code overrides silently. Choose and document one behavior.
Option A (document override): remove duplicate check from snippet and adjust commentary.
-// Returns an error if the provider is nil, has an empty type, or is already registered. -// Callers should handle the returned error appropriately. +// Returns an error if the provider is nil or has an empty type. +// Re-registration overrides the existing provider. @@ - if _, exists := registry.providers[componentType]; exists { - return fmt.Errorf("component %s already registered", componentType) - } - registry.providers[componentType] = provider return nilOption B (enforce error): implement duplicate check in code and fix tests. Confirm preferred behavior.
Also applies to: 1358-1366
516-559: Update hybrid config example to use plugins.Keep examples consistent across the doc.
- # Plugin types (dynamic map) - Mock uses this pattern - # Demonstrates inheritance, array/object merging, and dependency tracking - mock: - base_path: "components/mock" - enabled: true - dry_run: false - tags: - - test - - development - metadata: - owner: "platform-team" - version: "1.0.0" - dependencies: [] + # Plugin types (dynamic map) - Mock uses this pattern + # Demonstrates inheritance, array/object merging, and dependency tracking + plugins: + mock: + base_path: "components/mock" + enabled: true + dry_run: false + tags: + - test + - development + metadata: + owner: "platform-team" + version: "1.0.0" + dependencies: []pkg/component/mock/mock.go (1)
8-8: Align mapstructure imports repo-wide to prevent maintenance debt.The original maintainer archived the mitchellh/mapstructure project; go-viper/mapstructure achieved "blessed fork" status. The codebase currently has split imports: 15 files using v1 (mitchellh) and pkg/auth/hooks.go already on v2 (go-viper). V2 replaces interface{} with the modern
anykeyword and adds new hooks. Migration requires only changing import paths; the API is the same. Unify imports across the repo—either complete the migration or revert pkg/auth/hooks.go.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
docs/developing-component-plugins.md(1 hunks)docs/prd/component-registry-pattern.md(1 hunks)pkg/component/mock/mock.go(1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
pkg/**/*.go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
Place business logic in pkg rather than in cmd
Files:
pkg/component/mock/mock.go
**/*.go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
**/*.go: All code must pass golangci-lint checks
Follow Go error handling idioms and use meaningful error messages
Wrap errors with context using fmt.Errorf("context: %w", err)
Consider custom error types for domain-specific errors
Follow standard Go coding style; run gofmt and goimports
Use snake_case for environment variables
Document complex logic with inline comments
**/*.go: All Go comments must end with periods; applies to single-line, multi-line, inline, and documentation comments (golangci-lint godot).
Group imports into three sections (stdlib, 3rd-party, Atmos), separated by blank lines; sort alphabetically within each group; preserve existing aliases.
Configuration loading must use Viper with precedence CLI → ENV → files → defaults; bind config name atmos and add path, AutomaticEnv, and ATMOS prefix.
All errors must be wrapped using static errors (defined in errors/errors.go); use errors.Join for multiple errors; fmt.Errorf with %w for context; use errors.Is for checks; never compare error strings.
Distinguish structured logging from UI output: UI prompts/status/errors to stderr; data/results to stdout; never use logging for UI.
Most text UI must go to stderr; only data/results to stdout; prefer utils.PrintfMessageToTUI for UI messages.
All new configurations must support Go templating using existing utilities and available template functions.
Prefer SDKs over external binaries for cross-platform support; use filepath/os/runtime for portability.
For non-standard execution paths, capture telemetry via telemetry.CaptureCmd or telemetry.CaptureCmdString without user data.
80% minimum coverage on new/changed lines and include unit tests for new features; add integration tests for CLI using tests/ fixtures.
Always bind environment variables with viper.BindEnv and provide ATMOS_ alternatives for every env var.
Use structured logging with levels (Fatal>Error>Warn>Debug>Trace); avoid string interpolation and ensure logging does not affect execution.
Prefer re...
Files:
pkg/component/mock/mock.go
**/!(*_test).go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
Document all exported functions, types, and methods with Go doc comments
Add
defer perf.Track()to all public functions and critical private functions; include a blank line after the call; use package-prefixed names; pass atmosConfig when present, else nil.
Files:
pkg/component/mock/mock.go
**/{mock_*.go,mock/*.go}
📄 CodeRabbit inference engine (CLAUDE.md)
Generate and keep mocks alongside the interfaces they mock; mocks are excluded from coverage.
Files:
pkg/component/mock/mock.go
🧠 Learnings (5)
📚 Learning: 2025-09-13T18:06:07.674Z
Learnt from: samtholiya
PR: cloudposse/atmos#1466
File: toolchain/list.go:39-42
Timestamp: 2025-09-13T18:06:07.674Z
Learning: In the cloudposse/atmos repository, for UI messages in the toolchain package, use utils.PrintfMessageToTUI instead of log.Error or fmt.Fprintln(os.Stderr, ...). Import pkg/utils with alias "u" to follow the established pattern.
Applied to files:
pkg/component/mock/mock.go
📚 Learning: 2025-10-16T15:18:00.319Z
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-16T15:18:00.319Z
Learning: Applies to **/*.go : Most text UI must go to stderr; only data/results to stdout; prefer utils.PrintfMessageToTUI for UI messages.
Applied to files:
pkg/component/mock/mock.go
📚 Learning: 2025-10-16T15:18:00.319Z
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-16T15:18:00.319Z
Learning: Applies to **/!(*_test).go : Add `defer perf.Track()` to all public functions and critical private functions; include a blank line after the call; use package-prefixed names; pass atmosConfig when present, else nil.
Applied to files:
pkg/component/mock/mock.go
📚 Learning: 2025-10-16T15:18:00.319Z
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-16T15:18:00.319Z
Learning: Applies to **/*.go : Group imports into three sections (stdlib, 3rd-party, Atmos), separated by blank lines; sort alphabetically within each group; preserve existing aliases.
Applied to files:
pkg/component/mock/mock.go
📚 Learning: 2025-10-11T19:12:23.475Z
Learnt from: osterman
PR: cloudposse/atmos#1599
File: pkg/ui/markdown/renderer.go:143-182
Timestamp: 2025-10-11T19:12:23.475Z
Learning: High-frequency utility and formatting functions (e.g., markdown renderers, formatters) that are called repeatedly during command execution should not have `defer perf.Track()` even if they are public methods. Performance tracking at these levels introduces unnecessary overhead without meaningful insights, as tracking is already present at higher command-execution levels where it provides actionable data.
Applied to files:
pkg/component/mock/mock.go
🧬 Code graph analysis (1)
pkg/component/mock/mock.go (7)
pkg/perf/perf.go (1)
Track(121-138)pkg/component/registry.go (1)
Register(30-47)pkg/schema/schema.go (3)
AtmosConfiguration(27-65)Components(357-367)Context(409-424)pkg/component/mock/config.go (2)
DefaultConfig(29-38)Config(7-26)errors/errors.go (1)
ErrComponentValidationFailed(159-159)pkg/component/provider.go (1)
ExecutionContext(48-59)pkg/utils/log_utils.go (1)
PrintfMessageToTUI(33-35)
🪛 LanguageTool
docs/prd/component-registry-pattern.md
[style] ~99-~99: Since ownership is already implied, this phrasing may be redundant.
Context: ...schemas** - Each component type defines its own configuration structure 8. **Cross-comp...
(PRP_OWN)
[style] ~260-~260: Since ownership is already implied, this phrasing may be redundant.
Context: ...orm) 3. Each component type validates its own schema via ValidateComponent() ###...
(PRP_OWN)
[style] ~309-~309: Try replacing ‘care’ with a synonym to elevate your writing.
Context: ...omponent-type agnostic** - the registry doesn't care about internal structure. ### Cross-Componen...
(DONT_CARE)
[style] ~496-~496: Since ownership is already implied, this phrasing may be redundant.
Context: ...lse **Component providers validate their own settings:** go func (t *TerraformCo...
(PRP_OWN)
[style] ~569-~569: Since ownership is already implied, this phrasing may be redundant.
Context: ...:** Each component provider can define its own config structure: ```go // pkg/compone...
(PRP_OWN)
[grammar] ~1102-~1102: Please add a punctuation mark at the end of paragraph.
Context: ...overy - No changes to affected logic needed 2. atmos list components ✅ - ...
(PUNCTUATION_PARAGRAPH_END)
[grammar] ~1107-~1107: Please add a punctuation mark at the end of paragraph.
Context: ...pe - Maintains current filtering and deduplication 3. atmos describe stacks ✅ - ...
(PUNCTUATION_PARAGRAPH_END)
[grammar] ~1122-~1122: Please add a punctuation mark at the end of paragraph.
Context: ...c wrapped by providers - No behavior changes ### Backward Compatibility **No break...
(PUNCTUATION_PARAGRAPH_END)
[typographical] ~1483-~1483: Consider using typographic quotation marks here.
Context: ...nt Provider:** - ✅ GetType() returns "mock" - ✅ GetGroup() returns "Testing" ...
(EN_QUOTES)
[typographical] ~1484-~1484: Consider using typographic quotation marks here.
Context: ...eturns "mock" - ✅ GetGroup() returns "Testing" - ✅ GetBasePath() with and without c...
(EN_QUOTES)
[grammar] ~1604-~1604: Please add a punctuation mark at the end of paragraph.
Context: ...ting tests pass 7. Test with real stack configurations Success Criteria: - ✅ `atmos list ...
(PUNCTUATION_PARAGRAPH_END)
[typographical] ~1711-~1711: In American English, use a period after an abbreviation.
Context: ...ypes - ✅ No special-casing for built-in vs plugin types - ✅ Simpler codebase (no s...
(MISSING_PERIOD_AFTER_ABBREVIATION)
[grammar] ~1838-~1838: Please add a punctuation mark at the end of paragraph.
Context: ...ing tools - Proof of concept for plugin system ### Q: Is the mock component documente...
(PUNCTUATION_PARAGRAPH_END)
[style] ~1866-~1866: Since ownership is already implied, this phrasing may be redundant.
Context: ...rk? A: Each component type defines its own configuration structure: 1. **Global c...
(PRP_OWN)
[style] ~1870-~1870: Since ownership is already implied, this phrasing may be redundant.
Context: ...Validation: Each provider validates its own configuration via ValidateComponent()...
(PRP_OWN)
[grammar] ~1883-~1883: Please add a punctuation mark at the end of paragraph.
Context: ...DAG respects dependencies regardless of type Example: `terraform/vpc → terraform/ek...
(PUNCTUATION_PARAGRAPH_END)
docs/developing-component-plugins.md
[typographical] ~768-~768: Consider using a typographic close quote here.
Context: ...ucture tags match YAML field names (use yaml:"field_name") 3. Ensure `GetComponentCon...
(EN_QUOTES)
[typographical] ~805-~805: In American English, use a period after an abbreviation.
Context: ...r) } return nil } ``` ### SDK vs CLI Execution Prefer using Go SDKs ove...
(MISSING_PERIOD_AFTER_ABBREVIATION)
[style] ~827-~827: Try moving the adverb to make the sentence clearer.
Context: ...Path The component registry pattern is designed to eventually migrate all component types to plugins: Phase 1-3 (Current): B...
(SPLIT_INFINITIVE)
🪛 markdownlint-cli2 (0.18.1)
docs/prd/component-registry-pattern.md
61-61: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Build (macos-latest, macos)
- GitHub Check: Build (windows-latest, windows)
- GitHub Check: Analyze (go)
- GitHub Check: Lint (golangci)
- GitHub Check: Summary
Code fixes: - Fix doc comment punctuation in mock.go (godot compliance) - Wrap parseConfig errors with sentinel ErrComponentConfigInvalid - Add context to error messages for better debugging Documentation fixes: - Fix ExecutionContext to use pointer type in interface and examples - Add language identifier to fenced code block (MD040 compliance) - Move mock config under components.plugins in PRD - Handle Register error in init() example - Update GetBasePath to use GetComponentConfig pattern 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (5)
CLAUDE.md(1 hunks)docs/developing-component-plugins.md(1 hunks)docs/prd/component-registry-pattern.md(1 hunks)errors/errors.go(1 hunks)pkg/component/mock/mock.go(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- pkg/component/mock/mock.go
🧰 Additional context used
📓 Path-based instructions (4)
**/*
📄 CodeRabbit inference engine (CLAUDE.md)
Target minimum 80% coverage on new/changed lines; exclude mock files from coverage: **/mock_.go, mock_.go, **/mock/*.go.
Files:
CLAUDE.mderrors/errors.godocs/prd/component-registry-pattern.mddocs/developing-component-plugins.md
**/*.go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
**/*.go: All code must pass golangci-lint checks
Follow Go error handling idioms and use meaningful error messages
Wrap errors with context using fmt.Errorf("context: %w", err)
Consider custom error types for domain-specific errors
Follow standard Go coding style; run gofmt and goimports
Use snake_case for environment variables
Document complex logic with inline comments
**/*.go: All comments must end with periods; enforced by golangci-lint godot across all Go comments.
Organize imports into three groups (stdlib, third-party, Atmos) separated by blank lines and sorted alphabetically within each group; keep existing aliases.
All errors must be wrapped using static errors defined in errors/errors.go; prefer errors.Join for multiple, fmt.Errorf with %w for context, and errors.Is for checks; never rely on string comparisons.
Prefer cross-platform implementations: use SDKs over external binaries; use filepath/os facilities; gate OS-specific logic with runtime.GOOS or build tags.
Files:
errors/errors.go
**/!(*_test).go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
Document all exported functions, types, and methods with Go doc comments
Files:
errors/errors.go
errors/errors.go
📄 CodeRabbit inference engine (CLAUDE.md)
Define static error variables in errors/errors.go (e.g., ErrInvalidComponent, ErrInvalidStack).
Files:
errors/errors.go
🧠 Learnings (1)
📚 Learning: 2025-10-19T22:59:32.304Z
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-19T22:59:32.304Z
Learning: Applies to errors/errors.go : Define static error variables in errors/errors.go (e.g., ErrInvalidComponent, ErrInvalidStack).
Applied to files:
errors/errors.go
🪛 LanguageTool
CLAUDE.md
[typographical] ~934-~934: Consider using a typographic opening quote here.
Context: ...commit it - If unsure: Ask the user "Should I commit [filename]?" **`.gitign...
(EN_QUOTES)
[typographical] ~934-~934: Consider using a typographic close quote here.
Context: ...sk the user "Should I commit [filename]?" .gitignore Rules: - **DO NOT aut...
(EN_QUOTES)
docs/prd/component-registry-pattern.md
[style] ~99-~99: Since ownership is already implied, this phrasing may be redundant.
Context: ...schemas** - Each component type defines its own configuration structure 8. **Cross-comp...
(PRP_OWN)
[style] ~260-~260: Since ownership is already implied, this phrasing may be redundant.
Context: ...orm) 3. Each component type validates its own schema via ValidateComponent() ###...
(PRP_OWN)
[style] ~309-~309: Try replacing ‘care’ with a synonym to elevate your writing.
Context: ...omponent-type agnostic** - the registry doesn't care about internal structure. ### Cross-Componen...
(DONT_CARE)
[style] ~496-~496: Since ownership is already implied, this phrasing may be redundant.
Context: ...lse **Component providers validate their own settings:** go func (t *TerraformCo...
(PRP_OWN)
[style] ~569-~569: Since ownership is already implied, this phrasing may be redundant.
Context: ...:** Each component provider can define its own config structure: ```go // pkg/compone...
(PRP_OWN)
[grammar] ~1121-~1121: Please add a punctuation mark at the end of paragraph.
Context: ...overy - No changes to affected logic needed 2. atmos list components ✅ - ...
(PUNCTUATION_PARAGRAPH_END)
[grammar] ~1126-~1126: Please add a punctuation mark at the end of paragraph.
Context: ...pe - Maintains current filtering and deduplication 3. atmos describe stacks ✅ - ...
(PUNCTUATION_PARAGRAPH_END)
[grammar] ~1141-~1141: Please add a punctuation mark at the end of paragraph.
Context: ...c wrapped by providers - No behavior changes ### Backward Compatibility **No break...
(PUNCTUATION_PARAGRAPH_END)
[typographical] ~1502-~1502: Consider using typographic quotation marks here.
Context: ...nt Provider:** - ✅ GetType() returns "mock" - ✅ GetGroup() returns "Testing" ...
(EN_QUOTES)
[typographical] ~1503-~1503: Consider using typographic quotation marks here.
Context: ...eturns "mock" - ✅ GetGroup() returns "Testing" - ✅ GetBasePath() with and without c...
(EN_QUOTES)
[grammar] ~1623-~1623: Please add a punctuation mark at the end of paragraph.
Context: ...ting tests pass 7. Test with real stack configurations Success Criteria: - ✅ `atmos list ...
(PUNCTUATION_PARAGRAPH_END)
[typographical] ~1730-~1730: In American English, use a period after an abbreviation.
Context: ...ypes - ✅ No special-casing for built-in vs plugin types - ✅ Simpler codebase (no s...
(MISSING_PERIOD_AFTER_ABBREVIATION)
[grammar] ~1857-~1857: Please add a punctuation mark at the end of paragraph.
Context: ...ing tools - Proof of concept for plugin system ### Q: Is the mock component documente...
(PUNCTUATION_PARAGRAPH_END)
[style] ~1885-~1885: Since ownership is already implied, this phrasing may be redundant.
Context: ...rk? A: Each component type defines its own configuration structure: 1. **Global c...
(PRP_OWN)
[style] ~1889-~1889: Since ownership is already implied, this phrasing may be redundant.
Context: ...Validation: Each provider validates its own configuration via ValidateComponent()...
(PRP_OWN)
[grammar] ~1902-~1902: Please add a punctuation mark at the end of paragraph.
Context: ...DAG respects dependencies regardless of type Example: `terraform/vpc → terraform/ek...
(PUNCTUATION_PARAGRAPH_END)
docs/developing-component-plugins.md
[typographical] ~768-~768: Consider using a typographic close quote here.
Context: ...ucture tags match YAML field names (use yaml:"field_name") 3. Ensure `GetComponentCon...
(EN_QUOTES)
[typographical] ~805-~805: In American English, use a period after an abbreviation.
Context: ...r) } return nil } ``` ### SDK vs CLI Execution Prefer using Go SDKs ove...
(MISSING_PERIOD_AFTER_ABBREVIATION)
[style] ~827-~827: Try moving the adverb to make the sentence clearer.
Context: ...Path The component registry pattern is designed to eventually migrate all component types to plugins: Phase 1-3 (Current): B...
(SPLIT_INFINITIVE)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Build (macos-latest, macos)
- GitHub Check: Build (windows-latest, windows)
- GitHub Check: Analyze (go)
- GitHub Check: Lint (golangci)
- GitHub Check: Summary
🔇 Additional comments (4)
CLAUDE.md (1)
914-1163: LGTM! Comprehensive development guidelines established.The new mandatory sections provide clear, actionable guidance across Git workflows, testing, environment variables, logging, output conventions, schemas, cross-platform compatibility, multi-provider interfaces, and telemetry. These align well with the component registry pattern being introduced in this PR.
The distinction between deliverable files (code, tests, docs) and process artifacts (research notes, todo lists) is particularly helpful for maintaining repository hygiene.
errors/errors.go (1)
164-176: LGTM! Well-structured component registry error sentinels.The nine new error variables provide clear, specific sentinel errors for the component registry pattern:
- Provider lifecycle errors (not found, nil, empty type, registration)
- Operation errors (list, validation, execution, artifact generation)
- Configuration errors (invalid config)
All follow the established naming convention and provide actionable error messages. Based on learnings.
docs/prd/component-registry-pattern.md (1)
1-1950: Excellent PRD! Comprehensive component registry pattern documentation.This PRD provides thorough coverage of:
- Clear problem statement showing current hardcoded limitations
- Well-designed registry architecture with ComponentProvider interface
- Hybrid configuration approach supporting both built-in and plugin types
- Cross-component dependencies working across all registered types
- Realistic migration plan (Phases 1-5) preserving backward compatibility
- Extensive testing requirements (90%+ coverage) with thread safety and edge cases
- Mock component as POC for validation without external dependencies
The FAQ section effectively addresses concerns about backward compatibility, configuration inheritance, and cross-type dependencies. The changelog shows iterative refinement to the hybrid approach.
All past review comments were addressed in previous commits (ExecutionContext pointers, Register error handling, GetComponentConfig usage, plugins configuration structure).
docs/developing-component-plugins.md (1)
1-787: Excellent developer guide! Practical and comprehensive.This guide provides clear, actionable instructions for creating component plugins:
- Step-by-step implementation from package structure to testing
- Correct usage of pointer *ExecutionContext throughout main examples
- Configuration properly shown under components.plugins
- Error handling with sentinel errors from errors/errors.go
- Comprehensive test examples targeting 90%+ coverage
- Best practices for thread safety, defaults, and error messages
- Integration details for how plugins work with Atmos commands
- Mock component reference as working example
The guide complements the PRD perfectly by focusing on practical "how-to" rather than architectural "what/why."
All past review corrections were applied (language identifiers, plugins structure, pointer types, inheritance).
Also applies to: 803-855
- Fix ExecutionContext pointer in developing-component-plugins.md example (line 788) - Add nil check for atmosConfig.Components in GetBasePath to prevent NPE - Verified all perf.Track() calls are present in registry.go (8 functions) - Verified all perf.Track() calls are present in mock.go (8 methods) - Verified RegisterAll() references already removed from PRD 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Remove invalid nil check for atmosConfig.Components since Components is defined as a value type (not pointer) in schema.AtmosConfiguration. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
The mock component provider directly imports mapstructure, so it should be listed as a direct dependency rather than indirect. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
* Changes auto-committed by Conductor * [autofix.ci] apply automated fixes * Changes auto-committed by Conductor * Changes auto-committed by Conductor * Remove non-deliverable research file and fix plugin schema example - Remove component-architecture-research.md per CLAUDE.md guidelines (non-deliverable process artifact) - Fix YAML example in developing-component-plugins.md to match hybrid schema - Plugin types must be nested under components.plugins, not directly under components 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Changes auto-committed by Conductor * Fix code review issues and add performance tracking - Fix PRD Register() signature to match implementation with error return - Add nil check for atmosConfig in mock GetBasePath() - Change UI output to use PrintfMessageToTUI() instead of fmt.Printf() - Fix concurrent test to avoid testing.T calls in goroutines - Wrap sentinel errors with context using fmt.Errorf() - Add perf.Track() to all exported registry functions - Change ExecutionContext parameter to pointer to avoid hugeParam warning - Fix godot linting issue (missing period) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Address CodeRabbit review comments - Add perf.Track() instrumentation to all MockComponentProvider methods - Add sort.Strings() to ListComponents for deterministic ordering - Fix PRD ExecutionContext to use pointer types in interface examples - Remove TestNilCommand and RegisterAll() references from PRD - Fix developing-component-plugins.md to show plugin types under components.plugins 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Address remaining CodeRabbit review comments Code fixes: - Fix doc comment punctuation in mock.go (godot compliance) - Wrap parseConfig errors with sentinel ErrComponentConfigInvalid - Add context to error messages for better debugging Documentation fixes: - Fix ExecutionContext to use pointer type in interface and examples - Add language identifier to fenced code block (MD040 compliance) - Move mock config under components.plugins in PRD - Handle Register error in init() example - Update GetBasePath to use GetComponentConfig pattern 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Address final CodeRabbit review comments - Fix ExecutionContext pointer in developing-component-plugins.md example (line 788) - Add nil check for atmosConfig.Components in GetBasePath to prevent NPE - Verified all perf.Track() calls are present in registry.go (8 functions) - Verified all perf.Track() calls are present in mock.go (8 methods) - Verified RegisterAll() references already removed from PRD 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Fix compilation error: Components is a struct value, not a pointer Remove invalid nil check for atmosConfig.Components since Components is defined as a value type (not pointer) in schema.AtmosConfiguration. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Move mapstructure to direct dependency The mock component provider directly imports mapstructure, so it should be listed as a direct dependency rather than indirect. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Claude <[email protected]> Co-authored-by: Andriy Knysh <[email protected]>
|
These changes were released in v1.196.0-rc.0. |
what
This Pull Request introduces the Component Registry Pattern to Atmos, enabling extensible support for various component types. It lays the foundation for adding new infrastructure tools as plugins in the future.
Key changes include:
pkg/schema/schema.gois updated to support both statically defined built-in component types (Terraform, Helmfile, Packer) and dynamically registered plugin types via thePluginsmap.errors/errors.go.pkg/datafetcher/schema/are modified to allow additional properties for component types, accommodating the hybrid configuration.docs/developing-component-plugins.mdis added, detailing how to create new component plugins.why
The existing hardcoded approach for component types (Terraform, Helmfile, Packer) limits extensibility and maintainability. This PR introduces a more robust and flexible pattern:
references
closes #589
closes #600
closes #601
Summary by CodeRabbit
New Features
Documentation
Tests