Skip to content

lua: fix return value documentation for record and code 2#2366

Merged
eschabell merged 1 commit intofluent:masterfrom
bplessis-swi:fix/lua-return-values
Jan 31, 2026
Merged

lua: fix return value documentation for record and code 2#2366
eschabell merged 1 commit intofluent:masterfrom
bplessis-swi:fix/lua-return-values

Conversation

@bplessis-swi
Copy link
Contributor

@bplessis-swi bplessis-swi commented Jan 30, 2026

Lua documentation state that the record field is only used when the code is equal to 1 but it's also used with 2 when we only change the record content if i am not mistaken

Summary by CodeRabbit

  • Documentation
    • Clarified Lua callback docs: when returned codes indicate replacement (now applies to two specific codes) the original record is replaced; clarified timestamp handling and that a callback may emit multiple records if the returned value is an array.

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

@bplessis-swi bplessis-swi requested review from a team and eschabell as code owners January 30, 2026 15:18
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 30, 2026

📝 Walkthrough

Walkthrough

Documentation update to Lua filter clarifies that the original record is replaced when callback return codes are 1 or 2, not just code 1 as previously stated.

Changes

Cohort / File(s) Summary
Lua Filter Documentation
pipeline/filters/lua.md
Clarified record replacement behavior in return values to indicate codes 1 and 2 result in record replacement, expanding the previously documented code 1 condition.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A doc update, clear and bright,
When code is one or two takes flight,
The record hops and changes hue,
I nibbled notes and made them true,
Joy in words — a tiny rabbit's delight! 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main documentation change: clarifying that the record field is used for both code 1 and code 2 in Lua callbacks.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Signed-off-by: Benoit Plessis <bplessis@sierrawireless.com>
@bplessis-swi bplessis-swi force-pushed the fix/lua-return-values branch from cf9eebe to 80c6877 Compare January 30, 2026 15:21
@eschabell eschabell self-assigned this Jan 31, 2026
@eschabell eschabell added 5.0 waiting-on-review Waiting on a review from mainteners labels Jan 31, 2026
Copy link
Collaborator

@eschabell eschabell left a comment

Choose a reason for hiding this comment

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

@bplessis-swi this is a good catch, thanks for the PR fix!

@eschabell eschabell removed the waiting-on-review Waiting on a review from mainteners label Jan 31, 2026
@eschabell eschabell merged commit 2e6bf01 into fluent:master Jan 31, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants