Fix .cup file parser and update README#116
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 (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughWaypoint uploads now validate supported formats and preserve binary contents. Seeyou waypoint parsing uses CSV headers and resilient coordinate and field extraction. README instructions and ignore patterns were expanded for local container development. ChangesWaypoint and development updates
Estimated code review effort: 3 (Moderate) | ~25 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
lib/xcsoar/mapgen/server/server.py (1)
102-105: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winException is caught but never logged.
except Exception as e:captures the underlying parse error buteis discarded — the user only sees a generic "Unsupported waypoint file" message, and operators have no way to diagnose failures (e.g. the malformed-field crashes noted inseeyou_reader.py).too_many_requestsabove already logs viatraceback.print_exc(); consider doing the same here for consistency and debuggability.♻️ Suggested logging
except Exception as e: + print(("Error parsing waypoint file: {}".format(e))) + traceback.print_exc(file=sys.stdout) return view.render( error="Unsupported waypoint file " + waypoint_file.filename ) | HTMLFormFiller(data=params)🤖 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 `@lib/xcsoar/mapgen/server/server.py` around lines 102 - 105, Update the exception handler around the waypoint file parsing in the server request flow to log the caught exception and traceback before returning the existing generic error response. Use the existing traceback logging approach from the nearby too_many_requests handler, while preserving the current user-facing message and HTMLFormFiller behavior.
🤖 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 @.gitignore:
- Line 18: Update the .gitignore entry for /bin/ so it no longer ignores the
repository-root bin directory; narrow the pattern to the intended
virtual-environment path while preserving ignores for environment-generated
files.
In `@lib/xcsoar/mapgen/waypoints/seeyou_reader.py`:
- Around line 82-92: The raw-line decoding in the SeeYou CUP parsing loop must
not silently discard undecodable bytes. Update the bytes branch before the
filtering logic to try UTF-8 decoding, fall back to Windows-1252 on decode
failure, and preserve the resulting text for stripping and marker checks.
---
Nitpick comments:
In `@lib/xcsoar/mapgen/server/server.py`:
- Around line 102-105: Update the exception handler around the waypoint file
parsing in the server request flow to log the caught exception and traceback
before returning the existing generic error response. Use the existing traceback
logging approach from the nearby too_many_requests handler, while preserving the
current user-facing message and HTMLFormFiller behavior.
🪄 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: a3a92daa-1a6b-4f72-a066-9b4358af04b8
📒 Files selected for processing (4)
.gitignoreREADME.mdlib/xcsoar/mapgen/server/server.pylib/xcsoar/mapgen/waypoints/seeyou_reader.py
dce356c to
44a8f4f
Compare
for more information, see https://pre-commit.ci
Minimum fixes to be able to generate a new map using mapgen and uploading a .cup file.
#115
Summary by CodeRabbit