Skip to content

fix(recording): Ruby 3.2 File.exists? deprecation in BigBlueButton recording sanity worker - #25338

Merged
antobinary merged 3 commits into
bigbluebutton:v3.0.x-developfrom
sanduhrs:patch-1
Jul 6, 2026
Merged

antobinary merged 3 commits into
bigbluebutton:v3.0.x-developfrom
sanduhrs:patch-1

Conversation

@sanduhrs

Copy link
Copy Markdown
Contributor

…ty worker

What does this PR do?

See title.

Closes Issue(s)

Closes #25007

Motivation

Recordings broken on a docker based deployment.

How to test

  • in a docker based deployment
  • record a meeting
  • check if the recording appears on the recordings page or if generation stalls

@github-actions

Copy link
Copy Markdown

Thank you for this contribution!
Could you please confirm if you already sent in the signed Contributor License Agreement?
See https://docs.bigbluebutton.org/support/faq.html#why-do-i-need-to-sign-a-contributor-license-agreement-to-contribute-source-code
Thanks in advance!

@coderabbitai

coderabbitai Bot commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

In sanity.rb, the check_events_xml method's file-existence guard is updated from the deprecated File.exists? to File.exist?. No other logic is changed.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Description check ✅ Passed The description is directly related to the sanity worker fix and its recording-generation impact.
Linked Issues check ✅ Passed The PR implements the linked issue's proposed fix by replacing File.exists? with File.exist? in sanity.rb.
Out of Scope Changes check ✅ Passed The change is narrowly scoped to the Ruby compatibility fix with no unrelated modifications.
Title check ✅ Passed The title accurately summarizes the Ruby 3.2 File.exists? to File.exist? compatibility fix in the recording sanity worker.
✨ 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.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
record-and-playback/core/scripts/sanity/sanity.rb (1)

51-55: 🧹 Nitpick | 🔵 Trivial | 💤 Low value

Consider addressing pre-existing style issues while here.

RuboCop flags several conventions on line 53 that are worth cleaning up since this method is already being touched:

  • Style/Not: Prefer !File.exist?(filepath) over if not File.exist?(filepath).
  • Style/NegatedIf: Prefer unless File.exist?(filepath) over if not.
  • Layout/EmptyLineAfterGuardClause: Add empty line after the guard clause.
  • Lint/RaiseException: Prefer StandardError (or a more specific exception class) over Exception.

These are optional cleanups given this is a targeted compatibility fix.

♻️ Optional style cleanup
 def check_events_xml(raw_dir,meeting_id)
   filepath = "#{raw_dir}/#{meeting_id}/events.xml"
-  raise Exception, "Events file doesn't exists." if not File.exist?(filepath)
+  raise StandardError, "Events file doesn't exist." unless File.exist?(filepath)
+
   bad_doc = Nokogiri::XML(File.open(filepath)) { |config| config.options = Nokogiri::XML::ParseOptions::STRICT }
 end
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@record-and-playback/core/scripts/sanity/sanity.rb` around lines 51 - 55, The
guard clause in check_events_xml should be cleaned up to satisfy RuboCop
conventions while keeping the same behavior: replace the negated File.exist?
check with a more idiomatic form, add the missing blank line after the guard
clause, and raise StandardError or a more specific exception instead of
Exception. Use the existing check_events_xml method and filepath guard as the
only place to update so the compatibility fix stays targeted.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@record-and-playback/core/scripts/sanity/sanity.rb`:
- Line 53: The user-facing error text in sanity.rb has a grammar mistake in the
File.exist? check inside the sanity script. Update the Exception message in the
sanity check branch to use the singular form “doesn’t exist” instead of “doesn’t
exists,” keeping the rest of the message unchanged.

---

Nitpick comments:
In `@record-and-playback/core/scripts/sanity/sanity.rb`:
- Around line 51-55: The guard clause in check_events_xml should be cleaned up
to satisfy RuboCop conventions while keeping the same behavior: replace the
negated File.exist? check with a more idiomatic form, add the missing blank line
after the guard clause, and raise StandardError or a more specific exception
instead of Exception. Use the existing check_events_xml method and filepath
guard as the only place to update so the compatibility fix stays targeted.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ecda9d2c-6325-4454-a85a-a6af112dea9f

📥 Commits

Reviewing files that changed from the base of the PR and between 6f52408 and 29bf6be.

📒 Files selected for processing (1)
  • record-and-playback/core/scripts/sanity/sanity.rb

@sonarqubecloud

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

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.

🧹 Nitpick comments (1)
record-and-playback/core/scripts/sanity/sanity.rb (1)

53-53: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Replace Exception with StandardError.

RuboCop flags this correctly: rescuing or raising Exception catches/raises signals and system exits. StandardError is the appropriate base class for application errors. This is a one-word change on the already-modified line.

✏️ Proposed fix
-  raise Exception, "Events file doesn't exist." unless File.exist?(filepath)
+  raise StandardError, "Events file doesn't exist." unless File.exist?(filepath)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@record-and-playback/core/scripts/sanity/sanity.rb` at line 53, The sanity
check in the Ruby script uses Exception for a normal application error, which
should be narrowed to StandardError. Update the raise in the sanity script’s
file-existence guard so it raises StandardError instead of Exception, keeping
the same message and condition.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@record-and-playback/core/scripts/sanity/sanity.rb`:
- Line 53: The sanity check in the Ruby script uses Exception for a normal
application error, which should be narrowed to StandardError. Update the raise
in the sanity script’s file-existence guard so it raises StandardError instead
of Exception, keeping the same message and condition.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 339a7793-b11f-490d-ad1c-261ab61f803a

📥 Commits

Reviewing files that changed from the base of the PR and between 4933e54 and 9c4582e.

📒 Files selected for processing (1)
  • record-and-playback/core/scripts/sanity/sanity.rb

@antobinary antobinary added this to the Release 3.0 milestone Jul 6, 2026
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

✅ Automated tests have passed!

@antobinary antobinary changed the title Fix Ruby 3.2 File.exists? deprecation in BigBlueButton recording sani… fix(recording): Ruby 3.2 File.exists? deprecation in BigBlueButton recording sanity worker Jul 6, 2026
@antobinary

Copy link
Copy Markdown
Member

Thank you for this contribution!

@antobinary
antobinary merged commit d6bd7fa into bigbluebutton:v3.0.x-develop Jul 6, 2026
32 checks passed
@sanduhrs
sanduhrs deleted the patch-1 branch July 6, 2026 18:47
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.

[3.0][4.0] deprecated method in Ruby 2.6.0 and not compatible with Ruby 3.2.0

2 participants