Repository navigation
Proposed fix for #25114 - #25375
Proposed fix for #25114#25375ffdixon wants to merge 1 commit into
Conversation
|
WalkthroughThis change adds an optional Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant bbb-record CLI
participant mark_for_rebuild
participant Filesystem/Queue
User->>bbb-record CLI: --rebuild meetingID --format formatName
bbb-record CLI->>mark_for_rebuild: mark_for_rebuild(meetingID, formatName)
mark_for_rebuild->>mark_for_rebuild: validate format against known types
alt format valid
mark_for_rebuild->>Filesystem/Queue: remove processed/published markers for format
mark_for_rebuild->>Filesystem/Queue: remove format-specific output dirs/files
mark_for_rebuild->>Filesystem/Queue: enqueue process:<format> for meeting
mark_for_rebuild-->>bbb-record CLI: return early
else format invalid
mark_for_rebuild-->>bbb-record CLI: error/no-op
end
Related issues: Suggested labels: enhancement, recordings, bbb-record Suggested reviewers: (repository maintainers familiar with the bbb-record script and recording pipeline) 🐰 A hop, a script, a format anew, 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ 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)
bigbluebutton-config/bin/bbb-record (1)
107-108: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winUse a fixed-string match for format validation.
grep -qx "$FMT"treats$FMTas a basic regular expression, so a value likepre.entationcould match a legitimate type via the.metacharacter and bypass the whitelist. Use-Ffor an exact literal match.♻️ Proposed change
- if ! printf '%s\n' $TYPES | grep -qx "$FMT"; then + if ! printf '%s\n' $TYPES | grep -qxF "$FMT"; then🤖 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 `@bigbluebutton-config/bin/bbb-record` around lines 107 - 108, The format validation in bbb-record currently uses grep -qx on $FMT, which treats the input as a regex and can let metacharacters bypass the whitelist. Update the validation in the format-checking block to use a fixed-string exact match instead, keeping the existing logic around TYPES, FMT, and the unknown-format error message intact.
🤖 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 `@bigbluebutton-config/bin/bbb-record`:
- Around line 298-305: The --format option handling in bbb-record accepts a
missing value and silently leaves FORMAT unset, which later triggers a full
rebuild. Update the argument parsing block that checks for -format/--format to
validate that a next value exists and is not another flag before assigning
FORMAT, and fail fast with an error if it is missing. Keep the fix localized to
the FORMAT parsing logic so the script never continues with an unintended
default rebuild when --format is provided incorrectly.
---
Nitpick comments:
In `@bigbluebutton-config/bin/bbb-record`:
- Around line 107-108: The format validation in bbb-record currently uses grep
-qx on $FMT, which treats the input as a regex and can let metacharacters bypass
the whitelist. Update the validation in the format-checking block to use a
fixed-string exact match instead, keeping the existing logic around TYPES, FMT,
and the unknown-format error message intact.
🪄 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: 22c29377-0809-4994-a589-d69c4c3382b8
📒 Files selected for processing (1)
bigbluebutton-config/bin/bbb-record
| if [ "$1" = "-format" ] || [ "$1" = "--format" ]; then | ||
| if [ -n "${2}" ]; then | ||
| FORMAT="${2}" | ||
| shift | ||
| fi | ||
| shift | ||
| continue | ||
| fi |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
--format with no following value silently falls back to a full rebuild.
If a user passes --format as the last argument (or immediately followed by another flag), ${2} is empty, FORMAT stays unset, and the run degrades to a full rebuild of all formats without any warning — the opposite of the user's intent, and potentially a long/expensive operation. Consider erroring when --format is given without a value.
🛠️ Proposed change
if [ "$1" = "-format" ] || [ "$1" = "--format" ]; then
- if [ -n "${2}" ]; then
- FORMAT="${2}"
- shift
- fi
+ if [ -z "${2}" ] || [[ "${2}" == -* ]]; then
+ echo "--format requires a format name"
+ exit 1
+ fi
+ FORMAT="${2}"
+ shift
shift
continue
fi📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if [ "$1" = "-format" ] || [ "$1" = "--format" ]; then | |
| if [ -n "${2}" ]; then | |
| FORMAT="${2}" | |
| shift | |
| fi | |
| shift | |
| continue | |
| fi | |
| if [ "$1" = "-format" ] || [ "$1" = "--format" ]; then | |
| if [ -z "${2}" ] || [[ "${2}" == -* ]]; then | |
| echo "--format requires a format name" | |
| exit 1 | |
| fi | |
| FORMAT="${2}" | |
| shift | |
| shift | |
| continue | |
| fi |
🤖 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 `@bigbluebutton-config/bin/bbb-record` around lines 298 - 305, The --format
option handling in bbb-record accepts a missing value and silently leaves FORMAT
unset, which later triggers a full rebuild. Update the argument parsing block
that checks for -format/--format to validate that a next value exists and is not
another flag before assigning FORMAT, and fail fast with an error if it is
missing. Keep the fix localized to the FORMAT parsing logic so the script never
continues with an unintended default rebuild when --format is provided
incorrectly.
✅ Automated tests have passed! |
germanocaumo
left a comment
There was a problem hiding this comment.
Just a few things I think would be good to fix before merge:
The new path bypasses the per-meeting format opt-out.
Only schedule_next_step consults the bbb-disable-recording-formats metadata;
rap-enqueue.rb does not. Starting directly at process: therefore rebuilds and
republishes a format the meeting explicitly disabled. The full rebuild starts at
sanity and honors it.
A missing value silently escalates to a full rebuild.
--rebuild --format (no value) leaves FORMAT unset and falls through to
the all-formats branch that deletes every format's output. Worth failing fast.
--format is silently ignored by --rebuildall/--republish, which a user
might reasonably expect it to apply to.
|
Thank you @germanocaumo ! |
|
Closing in favor of #25773 |



What does this PR do?
Adds an option
--format <recording_format_name>tobbb-record --rebuild <recordID>to enable rebuilding of a single recording format.Closes Issue(s)
Closes #25114
Motivation
Previously,
bbb-record --rebuild <recordID>would rebuild all recording formats, which was unnecessary if just testing a specific format.How to test
Run on a BigBlueButton server with a recording that has multiple formats.