Repository navigation
fix(recording): Ruby 3.2 File.exists? deprecation in BigBlueButton recording sanity worker - #25338
Conversation
|
Thank you for this contribution! |
WalkthroughIn Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
record-and-playback/core/scripts/sanity/sanity.rb (1)
51-55: 🧹 Nitpick | 🔵 Trivial | 💤 Low valueConsider 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)overif not File.exist?(filepath).Style/NegatedIf: Preferunless File.exist?(filepath)overif not.Layout/EmptyLineAfterGuardClause: Add empty line after the guard clause.Lint/RaiseException: PreferStandardError(or a more specific exception class) overException.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
📒 Files selected for processing (1)
record-and-playback/core/scripts/sanity/sanity.rb
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
record-and-playback/core/scripts/sanity/sanity.rb (1)
53-53: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winReplace
ExceptionwithStandardError.RuboCop flags this correctly: rescuing or raising
Exceptioncatches/raises signals and system exits.StandardErroris 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
📒 Files selected for processing (1)
record-and-playback/core/scripts/sanity/sanity.rb
✅ Automated tests have passed! |
|
Thank you for this contribution! |



…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