Add Label 5U Weather Information Request decoder plugin#404
Add Label 5U Weather Information Request decoder plugin#404thepacket wants to merge 1 commit intoairframesio:masterfrom
Conversation
New plugin registered in official.ts and MessageDecoder.ts.
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 55 minutes and 37 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ 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 |
kevinelliott
left a comment
There was a problem hiding this comment.
Summary
Adds a Label_5U_WXR plugin handling two observed Weather Information Request shapes (Form A: OS KHRL/WXRKHRL, and Form B: 3LFRB/EINN/BIKF). Registered in MessageDecoder.ts and official.ts.
Verdict
Changes requested — no tests, and Form B mis-uses departureAirport. Otherwise small surface, easy fixes.
Must Fix
- No tests. Every other plugin in
lib/plugins/has a companionLabel_*.test.ts. Please add coverage for at least: Form A canonical (OS KHRL/WXRKHRL,), Form B canonical (3LFRB/EINN/BIKF), empty body, malformed body, and theunshiftordering of items. - Form B mis-uses
ResultFormatter.departureAirport()/arrivalAirport()for the first two ICAOs (lines 59–60). In a WXRQ list there is no semantic departure or arrival airport — these are weather request targets. This pollutesraw.departure_icao/raw.arrival_icaoand the ORG/DST formatted slots with values that are not flight endpoints. Consider exposing them only via a neutralWXRREQrow plus a typedraw.weather_request_icaos: string[].
Should Fix
- Form B
countregex is greedy and unbounded.^(?<count>\d+)(?<icaos>...)will happily consume any leading digit run. ARINC count fields here are typically a single digit. Anchor with\d{1,2}and validate the count matchesicaos.length. - Non-standard raw keys.
raw.count,raw.icaos,raw.subtype,raw.wxr_request_icaoare bespoke. Prefer documented forms or namespace them (e.g.wxr_request: { icaos: [], count: n }). countis stored as a string (raw.count = count). Other plugins store numeric counts as numbers; considerNumber(count).- Form A regex is not anchored at the end (
/^...\/WXR(?<wxrIcao>[A-Z]{3,4})/). If trailing content carries additional comma-separated entries (per the file’s own header comment), capture them or leave them onremaining.textrather than silently discarding.
Nits
- The pretty box-drawing comment is great, but please normalise the unicode dashes (── / └──) — some editors render them inconsistently in diffs.
decodeResult.formatted.items.unshift(...)after several pushes makes the final ordering hard to reason about. Build the items in order (or use a small helper) instead of mixing unshift + push.- The Form A subtype is captured as
[A-Z]{1,4}but onlyOSis documented. A small inline comment listing observed subtypes (OS, …) would help future maintainers.
Tests
Missing entirely. See Must Fix.
Notes
- Registration LGTM — plugin added at the end of
pluginClassesinMessageDecoder.tsand exported fromofficial.ts. No conflicts with existing 5U handlers (none exist). - CodeRabbit hit a rate limit and did not actually review this PR; the warning comment can be ignored.
Thanks @thepacket!
Adds a decoder for label 5U autonomous weather information requests (WXRQ). Handles two observed variants:
Form A — subtype + ICAO +
/WXR+ICAO:Form B — count + slash-separated ICAO list:
npm run buildpasses.