Release v1.16.0-SNAPSHOT: feat: Add unparsed main body tracking to METAR parser#46
Conversation
…TAR parser Changes to NoaaWeatherData: - Add unparsedMainBody field to capture unrecognized tokens - Update equals() and hashCode() to include unparsedMainBody - Add getter/setter methods for unparsedMainBody Changes to NoaaMetarParser: - Capture remaining tokens from parseMainBody() after all patterns processed - Add null safety check before setting unparsedMainBody (prevents NPE on parse failures) - Remove unparsed handler stub method - Remove 'unparsed' case from handlePattern() switch statement Changes to NoaaAviationWeatherPatternRegistry: - Remove UNPARSED_PATTERN from main body handlers (allows tokens to remain for capture) - Keep UNPARSED_PATTERN in remarks handlers (preserves freeText functionality) This enables identification of: - Unknown weather phenomena codes (e.g., regional codes like RETS) - Regional variations not in the standard - Parser gaps requiring investigation - Future enhancement opportunities Resolves tracking of unparsed METAR tokens in main body section.
📝 WalkthroughWalkthroughAdds unparsed main-body token capture for METAR parsing (version 1.16.0-SNAPSHOT): new Changes
Sequence Diagram(s)sequenceDiagram
participant Input as "METAR text"
participant Parser as "NoaaMetarParser"
participant Registry as "NoaaAviationWeatherPatternRegistry"
participant Model as "NoaaWeatherData"
Input->>Parser: parse(METAR)
Parser->>Registry: match main-body patterns
Registry-->>Parser: matched main-body tokens
Parser->>Parser: parseMainBody() -> mainBody (remaining tokens)
alt mainBody non-blank
Parser->>Model: setUnparsedMainBody(mainBody.trim())
end
Parser->>Parser: parseRemarks()
Parser->>Model: populate other fields
Parser-->>Input: return populated NoaaWeatherData
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@CHANGELOG.md`:
- Around line 14-20: The changelog states "8 new test cases" but the code
additions for unparsedMainBody appear to add only 7 tests; please reconcile by
reviewing NoaaWeatherDataTest and ensure the test count matches actual
additions: either add the missing test for NoaaWeatherData (or NoaaMetarParser)
that covers the remaining unparsedMainBody scenario or update the CHANGELOG
entry to "7 new test cases"; specifically verify tests referencing
unparsedMainBody, getUnparsedMainBody()/setUnparsedMainBody(String), and any
parser behavior in NoaaMetarParser to determine which correction is appropriate
and update the CHANGELOG text accordingly.
Changes to NoaaWeatherData:
Changes to NoaaMetarParser:
Changes to NoaaAviationWeatherPatternRegistry:
This enables identification of:
Resolves tracking of unparsed METAR tokens in main body section.
Summary by CodeRabbit
Release Notes - Version 1.16.0-SNAPSHOT
New Features
Tests