Skip to content

Conversation

@makrsmark
Copy link
Collaborator

@makrsmark makrsmark commented Jan 23, 2026

Summary by CodeRabbit

  • New Features

    • Added support for decoding a "44" Runway Flight Briefing variant (parses flight number, position, arrival airport, ETA, runway, fuel and related fields).
  • Tests

    • Added unit tests covering multiple valid Flight Briefing variants and invalid cases.
  • Refactor

    • Centralized flight‑procedure handling to improve consistency in processing and display of procedure data.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 23, 2026

Warning

Rate limit exceeded

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

⌛ 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.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Adds a new Label_44_Slash decoder plugin with tests, registers and re-exports it, and refactors flight_plan_utils to move addProcedure into the FlightPlanUtils class with updated call sites.

Changes

Cohort / File(s) Summary
Plugin Registration & Export
lib/MessageDecoder.ts, lib/plugins/official.ts
Register Label_44_Slash in MessageDecoder; add export * from './Label_44_Slash'.
Label_44_Slash Plugin Implementation
lib/plugins/Label_44_Slash.ts
New Label_44_Slash class (name: "label-44-slash") parsing /FB-prefixed label 44 runway reports; validates field counts, extracts position, flight number, arrival airport, ETA, optional fuel/runway/procedure fields, sets decodeLevel and decoded flags.
Label_44_Slash Tests
lib/plugins/Label_44_Slash.test.ts
New unit tests for metadata/qualifiers, two valid message variants, and an invalid-message rejection.
Utility Refactor
lib/utils/flight_plan_utils.ts
Move addProcedure into FlightPlanUtils as public static addProcedure(...); update call sites to FlightPlanUtils.addProcedure(...); removed standalone function.
Manifest
package.json
Indirect: manifest included in diff (unchanged functional content).

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Plugin as Label_44_Slash
    participant DateTime as DateTimeUtils
    participant FlightPlan as FlightPlanUtils
    participant Result as DecodeResult

    Client->>Plugin: decode(message, options)
    Plugin->>Plugin: split message text on '/'
    Plugin->>Plugin: validate 4 segments
    alt valid segments
        Plugin->>Plugin: parse fields (position, flight_number, arrival_airport)
        Plugin->>DateTime: convert ETA timestamp
        DateTime-->>Plugin: eta_time
        alt extended 18-field variant
            Plugin->>FlightPlan: FlightPlanUtils.addProcedure(decodeResult, route, type)
            FlightPlan-->>Plugin: procedure added (raw + formatted)
        end
        Plugin->>Result: set fields, decoded=true, decodeLevel='partial'
    else invalid
        Plugin->>Result: decoded=false, decodeLevel='none'
    end
    Plugin-->>Client: return DecodeResult
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested reviewers

  • kevinelliott
  • fredclausen

Poem

🐇 I hopped through slashes, "/FB" in sight,
I parsed the fields from day to night.
ETA, fuel, runway in a dash,
Tests gave thumbs up—what a splash!
CodeRabbit twitches, plugin takes flight. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change: adding a new Label 44 /FB parsing plugin with supporting infrastructure.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for parsing Label 44 Flight Briefing (/FB) messages, which provide flight status information including position, ETA, fuel, and arrival procedures.

Changes:

  • Refactored addProcedure from a private function to a public static method in FlightPlanUtils class
  • Added new Label_44_Slash decoder plugin to parse Flight Briefing messages
  • Registered the new plugin in the MessageDecoder

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
lib/utils/flight_plan_utils.ts Converted addProcedure from private function to public static method to support external usage
lib/plugins/official.ts Added export for new Label_44_Slash plugin
lib/plugins/Label_44_Slash.ts New decoder plugin for parsing Label 44 Flight Briefing (/FB) messages
lib/plugins/Label_44_Slash.test.ts Test coverage for the new Flight Briefing decoder
lib/MessageDecoder.ts Registered Label_44_Slash plugin in the decoder

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@lib/plugins/Label_44_Slash.ts`:
- Around line 8-9: Update the mismatched inline comment so it reflects the
actual message type used in the class: change the comment that currently reads
"On Runway Report" above the class Label_44_Slash to match the
formatted.description value "Flight Briefing" (or vice‑versa if you prefer the
comment to drive the description) by editing the comment near the class
declaration and ensuring formatted.description in the Label_44_Slash
implementation remains consistent with that comment.
🧹 Nitpick comments (2)
lib/utils/flight_plan_utils.ts (1)

97-115: Indentation inconsistency with class methods.

The addProcedure method appears to have inconsistent indentation compared to other methods in the class (processFlightPlan, parseHeader). Consider aligning the indentation for consistency.

🔧 Suggested formatting fix
-public static addProcedure(decodeResult: DecodeResult, value: string, type: string) {
-  if (decodeResult.raw.procedures === undefined) {
-    decodeResult.raw.procedures = [];
-  }
-  const data = value.split('.');
-  let waypoints;
-  if (data.length > 1) {
-    waypoints = data.slice(1).map((leg) => RouteUtils.getWaypoint(leg));
-  }
-  const route = { name: data[0], waypoints: waypoints };
-  decodeResult.raw.procedures.push({ type: type, route: route });
-  const procedureName = type.substring(0, 1).toUpperCase() + type.slice(1);
-  decodeResult.formatted.items.push({
-    type: `procedure`,
-    code: 'proc',
-    label: `${procedureName} Procedure`,
-    value: RouteUtils.routeToString(route),
-  });
-};
+  public static addProcedure(decodeResult: DecodeResult, value: string, type: string) {
+    if (decodeResult.raw.procedures === undefined) {
+      decodeResult.raw.procedures = [];
+    }
+    const data = value.split('.');
+    let waypoints;
+    if (data.length > 1) {
+      waypoints = data.slice(1).map((leg) => RouteUtils.getWaypoint(leg));
+    }
+    const route = { name: data[0], waypoints: waypoints };
+    decodeResult.raw.procedures.push({ type: type, route: route });
+    const procedureName = type.substring(0, 1).toUpperCase() + type.slice(1);
+    decodeResult.formatted.items.push({
+      type: `procedure`,
+      code: 'proc',
+      label: `${procedureName} Procedure`,
+      value: RouteUtils.routeToString(route),
+    });
+  }
lib/plugins/Label_44_Slash.ts (1)

46-60: Consider adding validation for parsed numeric values.

The parseFloat calls on lines 49, 52, and 59 could return NaN if the input data is malformed. This could propagate invalid data into the decode result. Consider adding validation or defensive checks.

💡 Example defensive check
const latitude = (data[0].charAt(0) === "S" ? -1 : 1) * parseFloat(data[0].slice(1).trim());
const longitude = (data[1].charAt(0) === "W" ? -1 : 1) * parseFloat(data[1].slice(1).trim());

if (isNaN(latitude) || isNaN(longitude)) {
  // Handle invalid position data
  ResultFormatter.unknown(decodeResult, `${data[0]},${data[1]}`);
} else {
  ResultFormatter.position(decodeResult, { latitude, longitude });
}

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.

1 participant