Skip to content

Proposed fix for #25114 - #25375

Closed
ffdixon wants to merge 1 commit into
bigbluebutton:v3.0.x-developfrom
ffdixon:fix-25114
Closed

ffdixon wants to merge 1 commit into
bigbluebutton:v3.0.x-developfrom
ffdixon:fix-25114

Conversation

@ffdixon

@ffdixon ffdixon commented Jul 6, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Adds an option --format <recording_format_name> to bbb-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.

@sonarqubecloud

sonarqubecloud Bot commented Jul 6, 2026

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

This change adds an optional --format <name> argument to the bbb-record --rebuild command, allowing rebuilding of a single playback format instead of all formats. The mark_for_rebuild function is extended to accept a format parameter, validate it, remove only that format's processed/published markers and output, enqueue process:<format> for the meeting, and return early. CLI parsing, usage text, and the rebuild dispatch call are updated accordingly.

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
Loading

Related issues: #25114 — Requests the ability to rebuild a specific recording format only, which this PR implements via the new --format option.

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,
No more rebuilding all — just what's due.
One flag, one type, cleaned up with care,
The rabbit rebuilds — precise, not everywhere.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is generic and only references the issue number, without describing the actual rebuild-format change. Rename it to mention the new --format option for rebuilding a single recording format.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly matches the feature by explaining the new --format option and its purpose.
Linked Issues check ✅ Passed The changes implement the requested ability to rebuild a single recording format instead of all formats.
Out of Scope Changes check ✅ Passed No unrelated or out-of-scope changes are evident beyond the requested rebuild-format support.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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)
bigbluebutton-config/bin/bbb-record (1)

107-108: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Use a fixed-string match for format validation.

grep -qx "$FMT" treats $FMT as a basic regular expression, so a value like pre.entation could match a legitimate type via the . metacharacter and bypass the whitelist. Use -F for 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

📥 Commits

Reviewing files that changed from the base of the PR and between 9cb82f8 and 42a3b3d.

📒 Files selected for processing (1)
  • bigbluebutton-config/bin/bbb-record

Comment on lines +298 to +305
if [ "$1" = "-format" ] || [ "$1" = "--format" ]; then
if [ -n "${2}" ]; then
FORMAT="${2}"
shift
fi
shift
continue
fi

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.

🎯 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.

Suggested change
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.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

✅ Automated tests have passed!

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

@germanocaumo germanocaumo 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.

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.

@antobinary

Copy link
Copy Markdown
Member

Thank you @germanocaumo !
Could you send a PR superseding this one? Consider cherry-picking if you want.

@antobinary

Copy link
Copy Markdown
Member

Closing in favor of #25773

@antobinary antobinary closed this Oct 8, 2026
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.

Feature request : add bbb-record option to rebuild a specific recording format only

3 participants