Skip to content

fix(recording): Rap yaml loader followups 40 - #26078

Merged
antobinary merged 3 commits into
bigbluebutton:v4.0.x-developfrom
antobinary:rap-yaml-loader-followups-40
Oct 16, 2026
Merged

antobinary merged 3 commits into
bigbluebutton:v4.0.x-developfrom
antobinary:rap-yaml-loader-followups-40

Conversation

@antobinary

Copy link
Copy Markdown
Member

What does this PR do?

Two small follow-ups to #25952, the 4.0 port of #25820 (recording script cleanup with the shared BigBlueButton.load_yaml loader). Both were noted as non-blocking in the #25820 review and were carried over unchanged by the port.

  1. load_yaml treats a null-only document as absent. The loader passes fallback: through to Psych, but Psych applies it only when the stream has no document at all. An override file under /etc/bigbluebutton/recording/ trimmed down to a bare ---, null or ~ is a document whose value is nil, so read_props and every format script still failed with TypeError: no implicit conversion of nil into Hash from the merge that follows. The loader now returns the fallback for a nil document as well. An explicit false document is still kept, and a required config without a fallback still yields nil, so a broken install keeps failing loudly. test_config_yaml.rb gains a test for the null-document cases and extends the "required config is not masked" test with ---.

  2. presentation/scripts/caption/presentation requires json and fileutils. The script calls JSON.parse and FileUtils.cp but only loads boot.rb, which stops at yaml and date, so the first JSON.parse raised NameError: uninitialized constant JSON. FileUtils happened to be loaded by bundler/setup, which the script should not rely on.

No behaviour change for valid config files.

Closes Issue(s)

Follow-up to #25952 / #25820. No issue filed.

Motivation

Carry the two review notes from #25820 that the 4.0 port did not address, and re-confirm the merged port on the current v4.0.x-develop head.

Testing

Ubuntu 24.04 container (imdt/bigbluebutton:4.0.x-develop), Ruby 3.2.3, Psych 5.0.1, v4.0.x-develop at 35cad46.

Unit tests (record-and-playback/core, rake test):

Tree Result
v4.0.x-develop 35cad46 28 runs, 236 assertions, 1 failure
this branch 29 runs, 241 assertions, 1 failure

The one failure is test_enforce_cut_lengths_short_cut_start, which also fails on v4.0.x-develop and was already recorded as pre-existing in #25952.

Override file probe (BigBlueButton.read_props with /etc/bigbluebutton/recording/recording.yml set to each content):

recording.yml content v4.0.x-develop this branch
empty file PASS PASS
# comment only PASS PASS
--- FAIL TypeError PASS
null FAIL TypeError PASS
~ FAIL TypeError PASS
playback_host: override.example PASS (applied) PASS (applied)

Caption integration script (caption/presentation --record-id <id> against a published recording with a captions index):

Script Result
v4.0.x-develop 35cad46 FAIL, exit 1: NameError: uninitialized constant JSON at the first JSON.parse
this branch PASS, exit 0: the track is copied into the published recording and captions.json gains the en_US entry

Re-test of the merged port on the current head. One recording with microphone, webcam, non-ASCII user names and chat, a published poll, BlockNote shared notes, a screenshare, slide changes, meetingKeepEvents=true and an analytics callback URL. It was processed in all five formats (presentation, video, screenshare, podcast, notes) once on the pre-merge tree (f8d9ebb, parent of the #25952 merge) and once on the current head, then the published trees were compared.

pre-merge tree f8d9ebb current head 35cad46
formats published 5 of 5 5 of 5
resque:failed 0 0
files in the published trees 161 161
media durations identical identical
text outputs 3 differ, all in published/presentation/ (see below)

The three differing files are metadata.xml (only processing_time and the resulting size), and panzooms.xml / cursor.xml, which on the head gain one event each at the screenshare start and stop timestamps. Those two come from #25991 (panzoom and screenshare boundaries), which landed after the port: 1ec02fc94b marks the panzoom as changed on screenshare start and stop. They are not from the YAML loader. Every other text output is byte-identical and no log contains a Psych, TypeError or NameError line.

The keep-events worker and post_events_analytics_callback.rb (both touched by the port) ran on the head tree: events/events.xml and data.json were written and the callback POST arrived with the Authorization header and the non-ASCII meeting name and metadata intact.

Note for anyone reproducing on Ubuntu 24.04: the presentation publish fails on both trees with nil can't be coerced into Float unless the ImageMagick policy allows the XC coder. That is issue #25926 and is unrelated to this change; the A/B above was run with rights="read | write" on the {XC} module line.

BigBlueButton.load_yaml passes fallback: through to Psych, but Psych only
applies it when the stream has no document at all. An override file under
/etc/bigbluebutton/recording/ that was trimmed down to a bare "---" or an
explicit "null" is a document whose value is nil, so read_props and every
format script still raised "no implicit conversion of nil into Hash" from
the merge that follows -- the same crash the fallback was added to avoid
for empty and comment-only files.

Return the fallback for a nil document as well. A document that parses to
false is still a value and is kept, and a required config without a
fallback still yields nil, so a broken install keeps failing loudly.

Seen on Ubuntu 24.04 with Psych 5.0.1. Noted as a non-blocking item in the
review of bigbluebutton#25820 and carried over unchanged by the 4.0 port in bigbluebutton#25952.
… script

presentation/scripts/caption/presentation parses captions.json with
JSON.parse and copies tracks with FileUtils.cp, but requires neither
library. It only loads boot.rb, which stops at yaml and date, so the first
JSON.parse raises NameError: uninitialized constant JSON. FileUtils happens
to be loaded by bundler/setup today, which the script should not rely on.

Noted as a non-blocking item in the review of bigbluebutton#25820; the 4.0 port in
bigbluebutton#25952 carried the gap over unchanged.
@antobinary antobinary added this to the Release 4.0 milestone Oct 15, 2026
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2330399f-cf27-4cd2-be27-a4ec299f4a90
📥 Commits

Reviewing files that changed from the base of the PR and between bca02b6 and 4ade391.

📒 Files selected for processing: 1
  • record-and-playback/core/lib/boot.rb

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

Walkthrough

load_yaml now returns the supplied fallback when YAML parsing returns nil. Tests cover bare document markers, explicit null values, and comment-only documents. The caption presentation script also adds requirements for fileutils and json.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: germanocaumo

Merge Risk: ⚪ Minimal · up to 4ade3

The YAML fallback behavior and caption script imports are consistent with their intended use. No actionable merge risk remains.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title identifies the recording changes and the YAML loader follow-ups, which are the primary changes in the pull request.
Description check Passed The description clearly explains both changes, their motivation, testing results, and known unrelated failures.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Comment thread record-and-playback/core/lib/boot.rb Outdated
# silently yielding empty settings.
def self.load_yaml(path, fallback: nil)
YAML.safe_load_file(path, permitted_classes: YAML_PERMITTED_CLASSES, aliases: true, fallback: fallback)
loaded = YAML.safe_load_file(path, permitted_classes: YAML_PERMITTED_CLASSES, aliases: true, fallback: fallback)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Possible code simplification: the nil? check already covers the empty-file case, so fallback: fallback can be dropped from the Psych call.

@antobinary
antobinary marked this pull request as ready for review October 16, 2026 19:42
@antobinary

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Since ef86493 load_yaml returns the fallback itself whenever the
loaded document is nil, and Psych yields nil for a stream with no
document just as it does for a null-only one. Passing fallback: through
to safe_load_file only duplicated that branch for the empty-file case.
Keep the single nil check; behaviour is unchanged on Psych 3.3 and 5.0.

Suggested in the review of bigbluebutton#26078.
@germanocaumo
germanocaumo self-requested a review October 16, 2026 21:00
@github-actions

Copy link
Copy Markdown

✅ Automated tests have passed!

@antobinary
antobinary merged commit 3b24349 into bigbluebutton:v4.0.x-develop Oct 16, 2026
33 checks passed
@antobinary
antobinary deleted the rap-yaml-loader-followups-40 branch October 16, 2026 21:32
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