feat: expand system and MiSTer launch coverage#1109
Conversation
|
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 (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe change adds numerous system metadata assets and registry entries, expands ES-DE, RetroArch, LaunchBox, and MiSTer mappings, introduces MiSTer launchables and alternate-core fallbacks, and broadens nested RBF discovery and persistence coverage. ChangesSystem definitions and registry
MiSTer core and launcher integration
Platform mappings
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant SystemRegistry
participant MiSTerCoreScanner
participant RBFCache
participant Launcher
participant MGL
SystemRegistry->>MiSTerCoreScanner: Provide registered system IDs
MiSTerCoreScanner->>RBFCache: Discover nested RBF files
RBFCache->>Launcher: Resolve core and fallback MGL
Launcher->>MGL: Launch selected MGL file
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
pkg/platforms/mister/cores/rbfs.go (1)
148-156: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftUse afero consistently for the newly added filesystem operations.
pkg/platforms/mister/cores/rbfs.go#L148-L156: read nested core directories through an injectedafero.Fs.pkg/platforms/mister/cores/rbf_persist.go#L123-L127: snapshot nested manifests through the same filesystem.pkg/platforms/mister/cores/rbf_persist.go#L165-L169: obtain nested-directory metadata through afero.pkg/platforms/mister/launchables.go#L273-L278: make file availability usePlatform.fs.As per coding guidelines, “Use afero for filesystem operations in testable code.”
🤖 Prompt for 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. In `@pkg/platforms/mister/cores/rbfs.go` around lines 148 - 156, Replace the newly added direct filesystem calls with the injected afero filesystem consistently: in pkg/platforms/mister/cores/rbfs.go lines 148-156, use the relevant afero.Fs for nested directory reads; in pkg/platforms/mister/cores/rbf_persist.go lines 123-127 and 165-169, use that same filesystem for nested manifest snapshots and directory metadata; and in pkg/platforms/mister/launchables.go lines 273-278, use Platform.fs for file-availability checks. Preserve the existing behavior while routing all operations through afero.Source: Coding guidelines
pkg/database/systemdefs/systemdefs.go (1)
248-548: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMove the new constants above the file’s functions.
These declarations currently follow
buildLookupMap,LookupSystem, andSystemsWithFallbacks. Relocate the new constants to the top-level declaration section before functions.As per coding guidelines, “Define Go types and consts near the top of the file, before functions and methods.”
🤖 Prompt for 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. In `@pkg/database/systemdefs/systemdefs.go` around lines 248 - 548, Move the newly added system constant declarations, including the groups beginning with System3DO, SystemAcornAtom, and SystemAndroid, above the file’s functions buildLookupMap, LookupSystem, and SystemsWithFallbacks. Keep the existing grouping and values unchanged; only relocate the declarations into the top-level section before any functions or methods.Source: Coding guidelines
🤖 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/platforms/mister/launchers.go`:
- Around line 2326-2331: The Pico-8 launcher filtering pipeline must support
both declared cart formats. In pkg/platforms/mister/launchers.go:2326-2331, add
.png candidates while retaining .p8; in
pkg/platforms/mister/launchers.go:622-624, update pico8PNGCartTest to accept .p8
and valid .p8.png carts while rejecting unrelated PNGs; in
pkg/platforms/mister/launchers_test.go:693-699, add coverage exercising the
complete launcher filtering pipeline for both formats.
In `@pkg/platforms/windows/launchbox_test.go`:
- Around line 141-161: Expand the LaunchBox mapping table test around the
existing system/name/expected entries to cover every newly enabled or changed
mapping in launchbox.go, including all entries from the referenced mapping
ranges. Assert both each system key and its exact platform name so missing keys
or incorrect names are detected, while preserving the existing test structure
and expectations.
---
Nitpick comments:
In `@pkg/database/systemdefs/systemdefs.go`:
- Around line 248-548: Move the newly added system constant declarations,
including the groups beginning with System3DO, SystemAcornAtom, and
SystemAndroid, above the file’s functions buildLookupMap, LookupSystem, and
SystemsWithFallbacks. Keep the existing grouping and values unchanged; only
relocate the declarations into the top-level section before any functions or
methods.
In `@pkg/platforms/mister/cores/rbfs.go`:
- Around line 148-156: Replace the newly added direct filesystem calls with the
injected afero filesystem consistently: in pkg/platforms/mister/cores/rbfs.go
lines 148-156, use the relevant afero.Fs for nested directory reads; in
pkg/platforms/mister/cores/rbf_persist.go lines 123-127 and 165-169, use that
same filesystem for nested manifest snapshots and directory metadata; and in
pkg/platforms/mister/launchables.go lines 273-278, use Platform.fs for
file-availability checks. Preserve the existing behavior while routing all
operations through afero.
🪄 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: 2d50d966-e956-43c7-a49a-5d8301e41acf
📒 Files selected for processing (93)
pkg/assets/systems/1292APVS.jsonpkg/assets/systems/AdvancedPICOBeena.jsonpkg/assets/systems/AirConsole.jsonpkg/assets/systems/AmstradGX4000.jsonpkg/assets/systems/AppleIIGS.jsonpkg/assets/systems/AppleLisa.jsonpkg/assets/systems/ApplePippin.jsonpkg/assets/systems/BlackBerryOS.jsonpkg/assets/systems/BluRayPlayer.jsonpkg/assets/systems/CasioLoopy.jsonpkg/assets/systems/CassetteVision.jsonpkg/assets/systems/CommodoreCDTV.jsonpkg/assets/systems/CommodorePlus4.jsonpkg/assets/systems/DVDPlayer.jsonpkg/assets/systems/Daydream.jsonpkg/assets/systems/DigiBlast.jsonpkg/assets/systems/Dragon32.jsonpkg/assets/systems/ElektorTVGamesComputer.jsonpkg/assets/systems/Evercade.jsonpkg/assets/systems/FireTV.jsonpkg/assets/systems/GearVR.jsonpkg/assets/systems/GoogleStadia.jsonpkg/assets/systems/HandheldElectronicLCD.jsonpkg/assets/systems/HyperNeoGeo64.jsonpkg/assets/systems/HyperScan.jsonpkg/assets/systems/IntellivisionAmico.jsonpkg/assets/systems/LeapTV.jsonpkg/assets/systems/Leapster.jsonpkg/assets/systems/LeapsterExplorer.jsonpkg/assets/systems/LegacyComputer.jsonpkg/assets/systems/LegacyMobileDevice.jsonpkg/assets/systems/Linux.jsonpkg/assets/systems/MZ2200.jsonpkg/assets/systems/MagnavoxOdyssey.jsonpkg/assets/systems/MetaQuest2.jsonpkg/assets/systems/MetaQuest3.jsonpkg/assets/systems/Microvision.jsonpkg/assets/systems/NintendoEReader.jsonpkg/assets/systems/NintendoSwitch2.jsonpkg/assets/systems/Nuon.jsonpkg/assets/systems/OculusGo.jsonpkg/assets/systems/OculusQuest.jsonpkg/assets/systems/OculusRift.jsonpkg/assets/systems/OculusVR.jsonpkg/assets/systems/OpenBOR.jsonpkg/assets/systems/PC50XFamily.jsonpkg/assets/systems/PC6000.jsonpkg/assets/systems/PDP10.jsonpkg/assets/systems/PLATO.jsonpkg/assets/systems/PalmOS.jsonpkg/assets/systems/PanasonicJungle.jsonpkg/assets/systems/PanasonicM2.jsonpkg/assets/systems/Pinball.jsonpkg/assets/systems/PlayStationVR.jsonpkg/assets/systems/PlayStationVR2.jsonpkg/assets/systems/Playdate.jsonpkg/assets/systems/Playdia.jsonpkg/assets/systems/PocketStation.jsonpkg/assets/systems/Polymega.jsonpkg/assets/systems/RZone.jsonpkg/assets/systems/SegaCD32X.jsonpkg/assets/systems/SegaPico.jsonpkg/assets/systems/SteamVR.jsonpkg/assets/systems/SuperCassetteVision.jsonpkg/assets/systems/TapwaveZodiac.jsonpkg/assets/systems/Terebikko.jsonpkg/assets/systems/Uzebox.jsonpkg/assets/systems/VMU.jsonpkg/assets/systems/WebBrowser.jsonpkg/assets/systems/WindowsMixedReality.jsonpkg/assets/systems/WindowsMobile.jsonpkg/assets/systems/WindowsPhone.jsonpkg/assets/systems/Zeebo.jsonpkg/assets/systems/visionOS.jsonpkg/database/systemdefs/systemdefs.gopkg/database/systemdefs/systemdefs_test.gopkg/launchables/ids.gopkg/platforms/mister/cores/cores.gopkg/platforms/mister/cores/cores_test.gopkg/platforms/mister/cores/rbf_persist.gopkg/platforms/mister/cores/rbf_persist_test.gopkg/platforms/mister/cores/rbfs.gopkg/platforms/mister/cores/rbfs_test.gopkg/platforms/mister/launchables.gopkg/platforms/mister/launchables_test.gopkg/platforms/mister/launchers.gopkg/platforms/mister/launchers_test.gopkg/platforms/mister/platform.gopkg/platforms/shared/esde/systemmap.gopkg/platforms/shared/esde/systemmap_test.gopkg/platforms/shared/retroarch/coremap.gopkg/platforms/windows/launchbox.gopkg/platforms/windows/launchbox_test.go
| {systemdefs.SystemAmstradGX4000, "Amstrad GX4000", true}, | ||
| {systemdefs.SystemAppleIIGS, "Apple IIGS", true}, | ||
| {systemdefs.SystemCasioLoopy, "Casio Loopy", true}, | ||
| {systemdefs.SystemCommodoreCDTV, "Commodore CDTV", true}, | ||
| {systemdefs.SystemCommodorePlus4, "Commodore Plus 4", true}, | ||
| {systemdefs.SystemDragon32, "Dragon 32/64", true}, | ||
| {systemdefs.SystemElektorTVGamesComputer, "Elektor TV Games Computer", true}, | ||
| {systemdefs.SystemSuperCassetteVision, "Epoch Super Cassette Vision", true}, | ||
| {systemdefs.SystemLinux, "Linux", true}, | ||
| {systemdefs.SystemMagnavoxOdyssey, "Magnavox Odyssey", true}, | ||
| {systemdefs.SystemHyperScan, "Mattel HyperScan", true}, | ||
| {systemdefs.SystemNintendoSwitch2, "Nintendo Switch 2", true}, | ||
| {systemdefs.SystemNuon, "Nuon", true}, | ||
| {systemdefs.SystemOpenBOR, "OpenBOR", true}, | ||
| {systemdefs.SystemPinball, "Pinball", true}, | ||
| {systemdefs.SystemSegaCD32X, "Sega CD 32X", true}, | ||
| {systemdefs.SystemVMU, "Sega Dreamcast VMU", true}, | ||
| {systemdefs.SystemSegaPico, "Sega Pico", true}, | ||
| {systemdefs.SystemPocketStation, "Sony PocketStation", true}, | ||
| {systemdefs.SystemTapwaveZodiac, "Tapwave Zodiac", true}, | ||
| {systemdefs.SystemUzebox, "Uzebox", true}, |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
Cover every newly enabled LaunchBox mapping.
The table tests only a subset of the mappings added or activated in pkg/platforms/windows/launchbox.go (Lines 140-186, 199-206, 236-261, 271-272, and 296-308). Add assertions for all changed entries, not just the selected systems, so incorrect platform names or missing keys cannot regress unnoticed.
As per coding guidelines, **/*.go: Write tests for all new code — see TESTING.md and pkg/testing/README.md.
🤖 Prompt for 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.
In `@pkg/platforms/windows/launchbox_test.go` around lines 141 - 161, Expand the
LaunchBox mapping table test around the existing system/name/expected entries to
cover every newly enabled or changed mapping in launchbox.go, including all
entries from the referenced mapping ranges. Assert both each system key and its
exact platform name so missing keys or incorrect names are detected, while
preserving the existing test structure and expectations.
Source: Coding guidelines
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
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/platforms/mister/cores/rbf_cache.go`:
- Around line 248-252: Add a test that invokes RBFCache.SetFilesystem with the
supplied memfs before calling Refresh, then verifies filesystem discovery
through the cache. If filesystem replacement is supported, call SetFilesystem
again with a different filesystem and verify the cache is rebuilt accordingly.
🪄 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: e9b1636d-cd9d-44c0-9924-b27584a65742
📒 Files selected for processing (11)
pkg/database/systemdefs/systemdefs.gopkg/platforms/mister/cores/rbf_cache.gopkg/platforms/mister/cores/rbf_persist.gopkg/platforms/mister/cores/rbf_persist_test.gopkg/platforms/mister/cores/rbfs.gopkg/platforms/mister/cores/rbfs_test.gopkg/platforms/mister/launchables.gopkg/platforms/mister/launchables_test.gopkg/platforms/mister/launchers.gopkg/platforms/mister/launchers_test.gopkg/platforms/mister/platform.go
🚧 Files skipped from review as they are similar to previous changes (8)
- pkg/platforms/mister/cores/rbfs_test.go
- pkg/platforms/mister/cores/rbfs.go
- pkg/platforms/mister/launchers.go
- pkg/platforms/mister/launchables.go
- pkg/platforms/mister/cores/rbf_persist_test.go
- pkg/platforms/mister/launchables_test.go
- pkg/database/systemdefs/systemdefs.go
- pkg/platforms/mister/cores/rbf_persist.go
| func (c *RBFCache) SetFilesystem(fs afero.Fs) { | ||
| c.mu.Lock() | ||
| defer c.mu.Unlock() | ||
| c.fs = fs | ||
| } |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
Cover SetFilesystem directly.
The supplied memfs test initializes RBFCache.fs directly, so the new setter’s behavior is not tested. Add coverage that calls SetFilesystem(fs) before Refresh() and verifies discovery; if backend replacement is supported, also verify that replacing the filesystem rebuilds the cache.
As per coding guidelines: **/*.go: Write tests for all new code — see TESTING.md and pkg/testing/README.md.
🤖 Prompt for 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.
In `@pkg/platforms/mister/cores/rbf_cache.go` around lines 248 - 252, Add a test
that invokes RBFCache.SetFilesystem with the supplied memfs before calling
Refresh, then verifies filesystem discovery through the cache. If filesystem
replacement is supported, call SetFilesystem again with a different filesystem
and verify the cache is rebuilt accordingly.
Source: Coding guidelines
Summary
.romindexing and launch support verified against upstream core metadataCloses #1021
Closes #1104
Closes #655
Summary by CodeRabbit