Skip to content

Warn unsupported multiple containers of the same type#96

Merged
anisaoshafi merged 2 commits intomainfrom
drg-532
Mar 10, 2026
Merged

Warn unsupported multiple containers of the same type#96
anisaoshafi merged 2 commits intomainfrom
drg-532

Conversation

@anisaoshafi
Copy link
Copy Markdown
Contributor

@anisaoshafi anisaoshafi commented Mar 10, 2026

Show a warning to users that have multiple containers of the same type defined in their config to avoid confusion when they start lstk:
image

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 73e2705e-1b0b-4424-8360-9b059a9a8ef0

📥 Commits

Reviewing files that changed from the base of the PR and between 66879be and 65bad3a.

📒 Files selected for processing (1)
  • internal/container/start.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • internal/container/start.go

📝 Walkthrough

Walkthrough

A new helper function detects when multiple emulators of the same container type are configured and emits a runtime warning. The check is invoked during the container startup flow after configuration retrieval and before container preparation.

Changes

Cohort / File(s) Summary
Duplicate Container Detection
internal/container/start.go
Added hasDuplicateContainerTypes() helper function to identify duplicate EmulatorType values in configured containers. Integrated pre-start check in Start() to emit a warning when duplicates are detected.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: adding a runtime warning when multiple containers of the same type are defined.
Description check ✅ Passed The description is related to the changeset, explaining the purpose of warning users about unsupported multiple containers of the same type.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch drg-532

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@internal/container/start.go`:
- Around line 42-44: The warning text emitted when
hasDuplicateContainerTypes(cfg.Containers) is true is misleading; update the
message passed to output.EmitWarning(sink, ...) to refer to "duplicate emulator
definitions in configuration" (or similar) rather than implying multiple
emulators will be run; locate the call to output.EmitWarning in start.go (the
block using hasDuplicateContainerTypes and cfg.Containers) and replace the
message string to clearly state that duplicates were found in the config.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 4a758131-c446-4474-b4c3-ef35ce327e5e

📥 Commits

Reviewing files that changed from the base of the PR and between f746f36 and 66879be.

📒 Files selected for processing (1)
  • internal/container/start.go

Copy link
Copy Markdown
Member

@silv-io silv-io left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Nice and clean change

}

if hasDuplicateContainerTypes(cfg.Containers) {
output.EmitWarning(sink, "multiple emulators of the same type are defined in your config; this setup is not supported yet")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I guess we didn't establish a wording style guide yet, but I think other messages start capitalized. non blocking but something to think about :D

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, changed it. I'll remember that for next time 🙌🏼

@anisaoshafi anisaoshafi merged commit 3dd9206 into main Mar 10, 2026
8 checks passed
@anisaoshafi anisaoshafi deleted the drg-532 branch March 10, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants