Skip to content

Greenlight 2/3 Import: Preparations for import of recordings#3034

Open
pizkaz wants to merge 2 commits intoTHM-Health:developfrom
pizkaz:feat/import-greenlight-recordings
Open

Greenlight 2/3 Import: Preparations for import of recordings#3034
pizkaz wants to merge 2 commits intoTHM-Health:developfrom
pizkaz:feat/import-greenlight-recordings

Conversation

@pizkaz
Copy link
Copy Markdown
Contributor

@pizkaz pizkaz commented Apr 9, 2026

Fixes #

Type

  • Bugfix
  • Feature
  • Documentation
  • Refactoring (e.g. Style updates, Test implementation, etc.)
  • Other (please describe):

Checklist

  • Code updated to current develop branch head
  • Passes CI checks
  • Is a part of an issue
  • Tests added for the bugfix or newly implemented feature, describe below why if not
  • Changelog is updated
  • Documentation of code and features exists

Changes

  • When running a Greenlight 2 / Greenlight 3 import command, a meeting (without timestamps) is created for every imported room so that recordings can be associated later on.

Summary by CodeRabbit

  • Improvements
    • Room imports from Greenlight v2 and v3 now create corresponding Meeting records, ensuring imported rooms have linked meetings.
    • Recording imports now resolve recordings via their Meeting and associate recordings with the meeting’s room for more reliable linkage.
  • Tests
    • Updated import tests and fixtures to validate meeting creation and simplified/asserted CLI import output accordingly.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d1f4be9a-8226-4663-be9f-33b8e30e75b3

📥 Commits

Reviewing files that changed from the base of the PR and between 9372868 and 6b8df6e.

📒 Files selected for processing (7)
  • app/Console/Commands/ImportGreenlight2Command.php
  • app/Console/Commands/ImportGreenlight3Command.php
  • app/Models/RecordingFormat.php
  • tests/Backend/Unit/Console/ImportGreenlight2Test.php
  • tests/Backend/Unit/Console/ImportGreenlight3Test.php
  • tests/Backend/Unit/Console/helper/Greenlight2Room.php
  • tests/Backend/Unit/Console/helper/Greenlight3Room.php
🚧 Files skipped from review as they are similar to previous changes (4)
  • tests/Backend/Unit/Console/ImportGreenlight3Test.php
  • app/Models/RecordingFormat.php
  • tests/Backend/Unit/Console/ImportGreenlight2Test.php
  • tests/Backend/Unit/Console/helper/Greenlight3Room.php

Walkthrough

Adds reading of external meeting IDs from Greenlight v2/v3 room imports (bbb_id / meeting_id) and creates corresponding Meeting records when new Rooms are created; changes recording import to resolve Meeting via Meeting::findOrFail() and link recordings through the meeting's room. Tests and test helpers updated.

Changes

Cohort / File(s) Summary
Greenlight v2 import
app/Console/Commands/ImportGreenlight2Command.php, tests/Backend/Unit/Console/ImportGreenlight2Test.php, tests/Backend/Unit/Console/helper/Greenlight2Room.php
Query now requests bbb_id; when creating a new Room, code also creates a Meeting with id = bbb_id. Tests and fixture helper gain bbb_id; assertions extended to verify created Meeting IDs and consolidated CLI output assertions.
Greenlight v3 import
app/Console/Commands/ImportGreenlight3Command.php, tests/Backend/Unit/Console/ImportGreenlight3Test.php, tests/Backend/Unit/Console/helper/Greenlight3Room.php
Query now requests meeting_id; when creating a new Room, code also creates a Meeting with id = meeting_id. Test fixtures and assertions updated to include and verify meeting_id / created Meeting records.
Recording import / association
app/Models/RecordingFormat.php
createFromRecordingXML() now resolves the Meeting via Meeting::findOrFail($meetingId) (catches ModelNotFoundException) and associates recordings using $meeting->room instead of separate Room lookup.
Test helpers
tests/Backend/Unit/Console/helper/Greenlight2Room.php, tests/Backend/Unit/Console/helper/Greenlight3Room.php
Constructor signatures changed and new public properties added (bbb_id, meeting_id) to match updated room payload shapes used in tests.
Tests (CLI behavior)
tests/Backend/Unit/Console/ImportGreenlight2Test.php, tests/Backend/Unit/Console/ImportGreenlight3Test.php
Updated mocked query projections and fake room constructions to include meeting IDs; assertions expanded to check created Meeting records and their IDs. CLI output expectations consolidated to table assertions where applicable.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 64.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: preparing for recording imports by creating meetings for imported Greenlight 2/3 rooms.
Description check ✅ Passed The description includes the required template sections with type (Feature) and checklist items indicated, though several checklist items remain unchecked and some non-critical sections lack detail.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.73%. Comparing base (e086f05) to head (6b8df6e).
⚠️ Report is 2 commits behind head on develop.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #3034      +/-   ##
=============================================
- Coverage      96.75%   96.73%   -0.02%     
+ Complexity      1924     1923       -1     
=============================================
  Files            457      457              
  Lines          12988    12993       +5     
  Branches        2079     2079              
=============================================
+ Hits           12566    12569       +3     
- Misses           422      424       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pizkaz pizkaz force-pushed the feat/import-greenlight-recordings branch from 7289bae to 9372868 Compare April 15, 2026 14:39
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/Console/Commands/ImportGreenlight2Command.php`:
- Around line 391-395: Before creating a Meeting record, check that
$room->bbb_id is not null; if it is null, do not set $dbMeeting->id or call
$dbMeeting->save()—instead skip creating the Meeting (and optionally log a
warning) to avoid violating the non-null primary key constraint; update the
block that creates the Meeting (where $dbMeeting = new Meeting, $dbMeeting->id =
$room->bbb_id, $dbMeeting->room()->associate($dbRoom), $dbMeeting->save()) to
guard on $room->bbb_id and only run those lines when it is non-null.

In `@app/Console/Commands/ImportGreenlight3Command.php`:
- Around line 305-309: Add a defensive null/empty check for $room->meeting_id
before instantiating Meeting: in ImportGreenlight3Command (around the block
creating $dbMeeting) verify that $room->meeting_id is not null/empty (and
optionally numeric) and only then create new Meeting, set $dbMeeting->id and
associate room()->associate($dbRoom); if it is null/empty, skip creation and
optionally log or record the missing meeting_id for later; mirror the same
validation used in the GL2 importer for consistency.
🪄 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: e1e4a130-cba1-474f-8d04-10d34acb2b47

📥 Commits

Reviewing files that changed from the base of the PR and between 7289bae and 9372868.

📒 Files selected for processing (7)
  • app/Console/Commands/ImportGreenlight2Command.php
  • app/Console/Commands/ImportGreenlight3Command.php
  • app/Models/RecordingFormat.php
  • tests/Backend/Unit/Console/ImportGreenlight2Test.php
  • tests/Backend/Unit/Console/ImportGreenlight3Test.php
  • tests/Backend/Unit/Console/helper/Greenlight2Room.php
  • tests/Backend/Unit/Console/helper/Greenlight3Room.php
🚧 Files skipped from review as they are similar to previous changes (4)
  • tests/Backend/Unit/Console/ImportGreenlight3Test.php
  • app/Models/RecordingFormat.php
  • tests/Backend/Unit/Console/helper/Greenlight2Room.php
  • tests/Backend/Unit/Console/helper/Greenlight3Room.php

Comment thread app/Console/Commands/ImportGreenlight2Command.php
Comment thread app/Console/Commands/ImportGreenlight3Command.php
@samuelwei samuelwei added the backend Pull requests that update Php code label Apr 15, 2026
@pizkaz pizkaz force-pushed the feat/import-greenlight-recordings branch from 9372868 to 6b8df6e Compare April 16, 2026 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants