Skip to content

Add Label 5U Weather Information Request decoder plugin#404

Open
thepacket wants to merge 1 commit intoairframesio:masterfrom
thepacket:plugin/label-5u
Open

Add Label 5U Weather Information Request decoder plugin#404
thepacket wants to merge 1 commit intoairframesio:masterfrom
thepacket:plugin/label-5u

Conversation

@thepacket
Copy link
Copy Markdown

Adds a decoder for label 5U autonomous weather information requests (WXRQ). Handles two observed variants:

Form A — subtype + ICAO + /WXR+ICAO:

OS KHRL/WXRKHRL,

Form B — count + slash-separated ICAO list:

3LFRB/EINN/BIKF

npm run build passes.

New plugin registered in official.ts and MessageDecoder.ts.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 22, 2026

Warning

Rate limit exceeded

@thepacket has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 55 minutes and 37 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 086c59a6-baf3-465f-8cfb-11b08647f4a3

📥 Commits

Reviewing files that changed from the base of the PR and between 10f9f69 and cfc06ed.

📒 Files selected for processing (3)
  • lib/MessageDecoder.ts
  • lib/plugins/Label_5U_WXR.ts
  • lib/plugins/official.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@kevinelliott kevinelliott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 companion Label_*.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 the unshift ordering 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 pollutes raw.departure_icao / raw.arrival_icao and the ORG/DST formatted slots with values that are not flight endpoints. Consider exposing them only via a neutral WXRREQ row plus a typed raw.weather_request_icaos: string[].

Should Fix

  • Form B count regex 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 matches icaos.length.
  • Non-standard raw keys. raw.count, raw.icaos, raw.subtype, raw.wxr_request_icao are bespoke. Prefer documented forms or namespace them (e.g. wxr_request: { icaos: [], count: n }).
  • count is stored as a string (raw.count = count). Other plugins store numeric counts as numbers; consider Number(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 on remaining.text rather 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 only OS is 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 pluginClasses in MessageDecoder.ts and exported from official.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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants