feat: Add user-configurable MiSTer _Other launchables#1063
Conversation
Lets users register additional MiSTer _Other launchables via a new config.toml [[other_launchables]] section instead of requiring a Core code change per new core.
Two-task plan: pkg/config validation section, then merging user entries into the mister platform's launchable list.
Lets users declare additional MiSTer _Other launchable cores in config.toml. Entries are validated at load time (required fields, core_path must be a bare filename with no path separators, category must be a known value or omitted). Invalid entries are dropped with a warning; nothing here is wired into the mister platform yet.
Turns the hardcoded _Other launchable list into a data-driven slice and overlays config.toml's [[other_launchables]] entries onto it. A user id matching a built-in overrides its display fields while keeping the built-in's fixed UUID; a new id gets a UUID deterministically derived from the id string (uuid.NewSHA1), so users can now register cores like Arduboy, Chip8, OpenBOR, PICO-8, Solarus, Sonic Mania, and Tamagotchi themselves without a Core code change.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds validated custom launcher configuration and external TOML loading, deterministic UUIDs for user-defined launchables, command-backed virtual-system synthesis, and configurable MiSTer “Other” launchables with override and append behavior. ChangesCustom launcher configuration
Launcher and platform integration
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Config as config.Instance
participant Platform as MiSTer Platform
participant Merge as mergeOtherLaunchableDefinitions
participant Launchables as launchables.Launchables
Platform->>Config: CustomLaunchers()
Platform->>Merge: merge built-in and custom Other definitions
Merge-->>Platform: merged definitions
Platform->>Platform: create VirtualSystem launch and test functions
Launchables->>Platform: Launchables(cfg)
Platform-->>Launchables: MiSTer launchables
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
I have kept this idea but moved it to a multi-platform setup. You can define launchables in custom launchers now [[launchers.custom]]
id = "Tools"
kind = "virtual_system"
backend = "command"
name = "Tools"
category = "Computer"
execute = "echo tools" |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/config/configcustomlaunchers_test.go`:
- Around line 164-235: Replace hardcoded path literals and string concatenation
in TestLoadCustomLaunchers_StrictAndAtomic,
TestLoadCustomLaunchers_RetainsSnapshotWhenAllFilesFail, and
TestLoadCustomLaunchers_InlineEntryWinsDuplicateID with filepath.Join, including
launchersDir initialization and launcher file paths; add the required filepath
import.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 9c030ced-6414-49c7-a081-c3150e8e88e7
📒 Files selected for processing (11)
pkg/config/config.gopkg/config/configcustomlaunchers.gopkg/config/configcustomlaunchers_test.gopkg/config/configlaunchers.gopkg/helpers/launchers.gopkg/helpers/launchers_test.gopkg/launchables/launchables.gopkg/launchables/launchables_test.gopkg/platforms/mister/launchables.gopkg/platforms/mister/launchables_test.gopkg/platforms/mister/platform.go
✅ Files skipped from review due to trivial changes (1)
- pkg/platforms/mister/platform.go
🚧 Files skipped from review as they are similar to previous changes (1)
- pkg/platforms/mister/launchables_test.go
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Adds a new [[other_launchables]] section to config.toml so users can register additional MiSTer _Other launchable cores (e.g. Sonic Mania, OpenBOR, PICO-8)
Entries are validated at config-load time: required fields, core_path must be a bare filename (no path separators/traversal), category defaults to "Other" or must be a known value.
The MiSTer platform's previously-hardcoded _Other launchable list is now data-driven and merges user entries on top: a matching id overrides an existing built-in's display fields while freezing its original UUID (so any existing frontend hidden/renamed/cover-art state isn't lost); a new id gets a UUID deterministically derived from the id string.
Test plan
go test -race ./pkg/config/... — passing
go test -race ./pkg/launchables/... — passing
go test -race ./pkg/platforms/mister/... — passing (run via Linux, since this package requires GOOS=linux)
golangci-lint run on changed packages — clean
Summary by CodeRabbit