chore(mister): add AmigaVision launch diagnostics#869
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds AmigaVision boot-image discovery with fallback install-path selection and structured logging; adds load_core path validation and command logging in the MiSTer interface, plus unit tests for the new validation. ChangesAmigaVision boot and launch improvements
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
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/mgls/mgls.go`:
- Around line 169-170: The code builds a line-delimited command ("load_core
"+path) and writes it with fmt.Fprintln(cmd, command) without sanitizing path;
update the function that sends the load_core command to validate/reject any path
containing newline or other control characters (e.g., '\n', '\r', or
unicode.IsControl) before constructing command, returning an error if invalid,
so injection via path is prevented; ensure validation is performed on the path
variable referenced where command is built and before the fmt.Fprintln call.
🪄 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
Run ID: 6031d1b5-db6d-4888-ab13-9edc8e54dbdf
📒 Files selected for processing (2)
pkg/platforms/mister/cores/hooks.gopkg/platforms/mister/mgls/mgls.go
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/mgls/mgls_test.go`:
- Around line 161-164: The test cases in mgls_test.go currently use hardcoded
POSIX-style path literals; replace those with filepath.Join-based construction:
create a base path using filepath.Join with components ("media", "fat",
".LASTLAUNCH.mgl") and use that base for the "valid path" case, and for the
negative cases ("newline rejected", "carriage return rejected", "tab rejected")
append the respective control character to the base string rather than embedding
a POSIX path literal; update the table entries (the rows with name: "valid
path", "newline rejected", etc.) to use the filepath.Join-built base and
concatenated control characters.
- Around line 153-179: Add tests that exercise the actual call sites launchFile
and LaunchCore (not just validateLoadCorePath) by invoking them with paths
containing control characters (e.g., newline, CR, tab) and asserting they return
an error and do not proceed to write the launch file; specifically, add subtests
that call launchFile(...) and LaunchCore(...) with the malicious paths used in
TestValidateLoadCorePath and use require.Error to ensure validation is enforced
at the call sites (and optionally check no file was created) so future refactors
can't bypass the guards in launchFile and LaunchCore.
🪄 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
Run ID: e55def2f-48f4-490d-8f36-33bd0e881b1a
📒 Files selected for processing (2)
pkg/platforms/mister/mgls/mgls.gopkg/platforms/mister/mgls/mgls_test.go
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/mgls/mgls_test.go`:
- Around line 195-217: The test TestLaunchCoreRejectsControlCharacters currently
only checks for any error but can get unrelated errors because LaunchCore calls
cores.GlobalRBFCache.Resolve before validateLoadCorePath; change the assertion
to require the specific validation error from validateLoadCorePath by asserting
that err.Error() equals fmt.Sprintf("load_core path contains control character:
%q", path) (use the loop variable path) so the test fails only when the
control-character check does not trigger; apply the same exact-message assertion
to TestLaunchFileRejectsControlCharacters as well.
🪄 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
Run ID: 01bd2be3-e16d-4b45-a4ee-e471c41b39ac
📒 Files selected for processing (2)
pkg/platforms/mister/mgls/mgls.gopkg/platforms/mister/mgls/mgls_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
- pkg/platforms/mister/mgls/mgls.go
Summary
ags_bootwrite path and failuresVerification
Summary by CodeRabbit
Bug Fixes
Chores
Tests