Support named environments in lstk config.toml#79
Support named environments in lstk config.toml#79carole-lavillonniere wants to merge 1 commit intomainfrom
Conversation
4e19736 to
24c9955
Compare
📝 WalkthroughWalkthroughIntroduces a named environment resolution system by adding an Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
internal/container/start.go (1)
57-60: Add container context to env-resolution errors.Returning the raw resolver error makes triage harder with multiple container entries.
Proposed diff
- resolvedEnv, err := c.ResolvedEnv(cfg.Env) + resolvedEnv, err := c.ResolvedEnv(cfg.Env) if err != nil { - return err + return fmt.Errorf("failed to resolve env for container %q: %w", c.Name(), err) }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@internal/container/start.go` around lines 57 - 60, When calling c.ResolvedEnv(cfg.Env) and receiving err, wrap and return the error with container context so callers can identify which container failed (e.g., include cfg.Name or cfg.ID). Replace the bare return err with a wrapped error like fmt.Errorf("resolving env for container %s: %w", cfg.Name, err) or errors.Wrapf(err, "resolving env for container %s", cfg.ID) so theResolvedEnv error includes the container identifier; keep using the same symbols resolvedEnv, err, c.ResolvedEnv, and cfg.Env when making this change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@internal/container/start.go`:
- Around line 57-60: When calling c.ResolvedEnv(cfg.Env) and receiving err, wrap
and return the error with container context so callers can identify which
container failed (e.g., include cfg.Name or cfg.ID). Replace the bare return err
with a wrapped error like fmt.Errorf("resolving env for container %s: %w",
cfg.Name, err) or errors.Wrapf(err, "resolving env for container %s", cfg.ID) so
theResolvedEnv error includes the container identifier; keep using the same
symbols resolvedEnv, err, c.ResolvedEnv, and cfg.Env when making this change.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 769f8763-c955-4c47-a671-c8d52708225e
📒 Files selected for processing (4)
internal/config/config.gointernal/config/containers.gointernal/config/containers_test.gointernal/container/start.go
Closes DRG-550.
[env.*]sections to the config, where each named environment defines a set ofKEY=valuevariablesenvfield to[[containers]]to reference which named environments to applyKEY=valuepairs at start time, uppercasing keys to work around Viper's internal key lowercasingExample config:
TODO
Add an integration test once we are able to override the config path through a CLI flag (subsequent PR #80)