Skip to content

List endpoint and web app on start#114

Merged
gtsiolis merged 2 commits intomainfrom
george/des-166
Mar 17, 2026
Merged

List endpoint and web app on start#114
gtsiolis merged 2 commits intomainfrom
george/des-166

Conversation

@gtsiolis
Copy link
Member

BEFORE AFTER
Screenshot 2026-03-13 at 17 45 19 Screenshot 2026-03-13 at 17 41 10

@coderabbitai
Copy link

coderabbitai bot commented Mar 13, 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: e4d6da4a-12cc-4916-be6c-fa3588b32889

📥 Commits

Reviewing files that changed from the base of the PR and between 8364858 and a715248.

📒 Files selected for processing (6)
  • internal/container/start.go
  • internal/container/start_test.go
  • internal/output/events.go
  • internal/output/plain_format.go
  • internal/ui/components/message.go
  • internal/ui/components/message_test.go
🚧 Files skipped from review as they are similar to previous changes (4)
  • internal/ui/components/message_test.go
  • internal/container/start.go
  • internal/container/start_test.go
  • internal/ui/components/message.go

📝 Walkthrough

Walkthrough

This change introduces a new secondary message severity level for terminal output and implements post-start setup enhancements. The post-start flow now outputs endpoint information and optional web app URLs with secondary styling. Supporting infrastructure includes message rendering logic that applies severity-based styling.

Changes

Cohort / File(s) Summary
Post-start output enhancements
internal/container/start.go, internal/container/start_test.go
Added emitPostStartPointers helper function to output endpoint and web app URL after successful post-start setup. Updated runPostStartSetups signature to accept webAppURL parameter. Tests verify output includes endpoint, optional web app URL, and tip message.
Message severity framework
internal/output/events.go, internal/output/plain_format.go
Introduced SeveritySecondary severity level with corresponding EmitSecondary function. Added plain format case for SeveritySecondary to return raw text without prefix formatting.
Message rendering and styling
internal/ui/components/message.go, internal/ui/components/message_test.go
Modified RenderWrappedMessage to select styling based on message severity: uses SecondaryMessage style for SeveritySecondary, otherwise uses default Message style. Tests verify secondary lines (endpoint, web app, tip) render with subdued styling.

Sequence Diagram

sequenceDiagram
    participant Start as Start Function
    participant Setup as runPostStartSetups
    participant Pointers as emitPostStartPointers
    participant Sink as Output Sink
    participant Format as Message Formatter

    Start->>Setup: Call with webAppURL parameter
    Setup->>Setup: Execute container setup
    Setup->>Pointers: Call after successful setup
    Pointers->>Sink: EmitSecondary(endpoint info)
    Sink->>Format: MessageEvent with SeveritySecondary
    Format->>Format: Select SecondaryMessage style
    Format-->>Pointers: Formatted output
    
    alt Web App URL provided
        Pointers->>Sink: EmitSecondary(web app URL)
        Sink->>Format: MessageEvent with SeveritySecondary
        Format-->>Pointers: Formatted with secondary styling
    end
    
    Pointers->>Sink: EmitSecondary(tip message)
    Sink->>Format: MessageEvent with SeveritySecondary
    Format-->>Pointers: Formatted output
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • silv-io
  • anisaoshafi
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: displaying endpoint and web app information on LocalStack startup.
Description check ✅ Passed The description uses before/after screenshots to effectively communicate the enhancement, showing the addition of endpoint and web app information to startup output.

✏️ 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 george/des-166
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

You can disable the changed files summary in the walkthrough.

Disable the reviews.changed_files_summary setting to disable the changed files summary in the walkthrough.

Copy link

@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: 2

🧹 Nitpick comments (1)
internal/container/start.go (1)

144-149: Keep the bullets and Tip: label out of the domain event payload.

These strings are presentation details, and they already leak into internal/ui/components/message.go, which now has to parse prefixes to recover styling semantics. A typed output event or structured payload here would let the plain and TUI renderers own the formatting instead.

Based on learnings, "Event payloads should be domain facts (phase/status/progress), not pre-rendered UI strings."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@internal/container/start.go` around lines 144 - 149, emitPostStartPointers is
emitting pre-formatted UI strings via output.EmitInfo (using output.Sink), which
leaks presentation into event payloads; change it to emit a structured domain
event (e.g., a PostStartPointers event/struct with fields Endpoint, WebAppURL,
and Tip or TipKey) instead of the bullet/“Tip:” strings, and update calls to
output.EmitInfo (or add a new output.EmitEvent) to send that structured payload
so presenters (plain/TUI) can render bullets and the “Tip:” label themselves;
update consumers that parse these strings (e.g., message rendering code) to
handle the new typed event.
🤖 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/update/install_method.go`:
- Around line 209-237: The code currently runs exec.Command("npm", "root", "-g")
and treats its output as an install prefix, producing incorrect paths; change
the command to exec.Command("npm", "prefix", "-g") to get the actual global
prefix, then rebuild the candidate paths from that prefix (e.g.
filepath.Join(prefix, "bin", "lstk") for Unix global bin and
filepath.Join(prefix, "lstk.exe") for Windows), and for package locations use
filepath.Join(prefix, "lib", "node_modules", "@localstack", "lstk", "bin",
"lstk") (or the Windows/node_modules variant) instead of joining an already
node_modules path into another node_modules; update the path entries currently
appended where prefix is used (the slice additions around where cmd.Output() is
handled and the subsequent fallbackPrefixes logic) accordingly.
- Around line 143-149: Replace the non-portable inode-based duplicate detection:
remove use of inodeKey and the info.Sys().(*syscall.Stat_t) branch in the
function that processes file info and instead compare file identity with
os.SameFile by keeping the previously-encountered os.FileInfo (or its
os.FileInfo result) and calling os.SameFile(prevInfo, info) to skip duplicates;
update references to seenInodes to store os.FileInfo (or a map of
string->os.FileInfo) keyed by resolved path. Also update collectCandidatePaths
to include Windows executables by probing both "lstk" and "lstk.exe" (and
generally append ".exe" on Windows for candidate names) so Windows installs
aren't missed. Ensure changes touch the symbols seenInodes, inodeKey,
collectCandidatePaths, and any variable named resolved or info.

---

Nitpick comments:
In `@internal/container/start.go`:
- Around line 144-149: emitPostStartPointers is emitting pre-formatted UI
strings via output.EmitInfo (using output.Sink), which leaks presentation into
event payloads; change it to emit a structured domain event (e.g., a
PostStartPointers event/struct with fields Endpoint, WebAppURL, and Tip or
TipKey) instead of the bullet/“Tip:” strings, and update calls to
output.EmitInfo (or add a new output.EmitEvent) to send that structured payload
so presenters (plain/TUI) can render bullets and the “Tip:” label themselves;
update consumers that parse these strings (e.g., message rendering code) to
handle the new typed event.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro

Run ID: 44d5babb-ffe3-4592-8e85-c88ea20b137b

📥 Commits

Reviewing files that changed from the base of the PR and between 2ce11ae and 8364858.

📒 Files selected for processing (5)
  • internal/container/start.go
  • internal/container/start_test.go
  • internal/ui/components/message.go
  • internal/ui/components/message_test.go
  • internal/update/install_method.go

@@ -1,9 +1,12 @@
package update
Copy link
Collaborator

Choose a reason for hiding this comment

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

issue: was this file accidentally committed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops! Good catch! ⚾ Removed.


func isDecorativeMessage(text string) bool {
return strings.HasPrefix(text, "• ") || strings.HasPrefix(text, "> Tip:")
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

issue: we should avoid parsing message content to decide how to style it. This creates a dependency between text content and style that is fragile. Can we use a new message type or a new severity instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

ABSOLUTELY! I should have done this already, thanks for the nudge! 😁

@gtsiolis
Copy link
Member Author

Thanks for taking a look, @carole-lavillonniere! 🏀

@gtsiolis gtsiolis merged commit 02634f1 into main Mar 17, 2026
8 checks passed
@gtsiolis gtsiolis deleted the george/des-166 branch March 17, 2026 08:23
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