Skip to content

fix(presentations): resolve summit_id via owning presentation for PresentationMaterial lifecycle events - #579

Open
romanetar wants to merge 2 commits into
mainfrom
fix/presentation-material-summit-id
Open

fix(presentations): resolve summit_id via owning presentation for PresentationMaterial lifecycle events#579
romanetar wants to merge 2 commits into
mainfrom
fix/presentation-material-summit-id

Conversation

@romanetar

@romanetar romanetar commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

ref https://app.clickup.com/t/9014802374/86bb90npj

Summary by CodeRabbit

  • Bug Fixes

    • Presentation media upload events now include the correct summit identifier.
    • Events remain reliable when presentation associations are removed.
  • Tests

    • Added coverage for media upload insert, update, and delete event handling.
    • Added end-to-end validation that published media upload messages contain valid summit and entity identifiers.

…sentationMaterial lifecycle events

Signed-off-by: romanetar <roman_ag@hotmail.com>
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@romanetar, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 22 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 787bbdc0-61a6-4ffd-88c9-c2d78187fe02

📥 Commits

Reviewing files that changed from the base of the PR and between f3ca991 and af30e55.

📒 Files selected for processing (3)
  • .github/workflows/push.yml
  • tests/Feature/ExampleTest.php
  • tests/Feature/PresentationMaterialRabbitMQIntegrationTest.php
📝 Walkthrough

Walkthrough

The change adds summit ID retrieval to PresentationMaterial and verifies summit ID propagation across presentation media upload lifecycle events, queued jobs, and RabbitMQ messages.

Changes

Presentation material event propagation

Layer / File(s) Summary
Summit ID accessor
app/Models/Foundation/Summit/Events/Presentations/Materials/PresentationMaterial.php
PresentationMaterial now returns its presentation summit ID and uses 0 when the association raises an exception.
Lifecycle dispatch coverage
tests/Unit/Services/PresentationMaterialEventDispatchTest.php
Tests verify summit IDs for update and insert events. The delete test verifies dispatch with a summit ID of 0.
RabbitMQ delivery coverage
tests/Feature/PresentationMaterialRabbitMQIntegrationTest.php
The integration test configures a temporary RabbitMQ queue, runs the lifecycle flow, and verifies the published entity and summit IDs.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested reviewers: smarcet

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes resolving summit_id from the owning presentation for PresentationMaterial lifecycle events.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/presentation-material-summit-id

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

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 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 `@tests/Feature/PresentationMaterialRabbitMQIntegrationTest.php`:
- Around line 138-151: Update the message polling loop around
consumer_channel->basic_get to decode each received payload and continue
consuming until entity_type is PresentationMediaUpload and entity_id matches
$entity_id, or the timeout expires. Only assert and validate summit_id after the
matching message is found, while preserving the existing not-null failure when
no match arrives.
- Around line 59-71: Update the test setup around the RabbitMQ Config::set calls
to capture the original rabbitmq configuration before mutation, then restore
that configuration and call
app()->forgetInstance(IProcessScheduleEntityLifeCycleEventService::class) during
teardown before fixture cleanup. Ensure shared configuration and the singleton
are reset even when the test completes or fails.
- Around line 63-73: Update the RabbitMQ setup in
PresentationMaterialRabbitMQIntegrationTest to read the broker user and password
from the test environment instead of hardcoding them. Reuse those configured
values in both the rabbitmq.user/rabbitmq.password settings and the
AMQPStreamConnection construction, while preserving the existing host, port,
vhost, and lifecycle reset behavior.
🪄 Autofix

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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b3dace2a-47db-4d6f-8033-e9d6ea32ccf2

📥 Commits

Reviewing files that changed from the base of the PR and between 28ae095 and f3ca991.

📒 Files selected for processing (3)
  • app/Models/Foundation/Summit/Events/Presentations/Materials/PresentationMaterial.php
  • tests/Feature/PresentationMaterialRabbitMQIntegrationTest.php
  • tests/Unit/Services/PresentationMaterialEventDispatchTest.php

Comment thread tests/Feature/PresentationMaterialRabbitMQIntegrationTest.php
Comment thread tests/Feature/PresentationMaterialRabbitMQIntegrationTest.php Outdated
Comment thread tests/Feature/PresentationMaterialRabbitMQIntegrationTest.php Outdated
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

📘 OpenAPI / Swagger preview

➡️ https://OpenStackweb.github.io/summit-api/openapi/pr-579/

This page is automatically updated on each push to this PR.

1 similar comment
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

📘 OpenAPI / Swagger preview

➡️ https://OpenStackweb.github.io/summit-api/openapi/pr-579/

This page is automatically updated on each push to this PR.

Restores the original rabbitmq config and forgets the
IProcessScheduleEntityLifeCycleEventService singleton in tearDown() so the
real-broker override doesn't leak to later tests in the same process; sources
broker credentials from existing DOMAIN_EVENTS_RABBITMQ_* / RABBITMQ_* env vars
instead of hardcoding them in a tracked file; and makes the message-polling
loop skip unrelated messages on the shared fanout exchange instead of
asserting on the first one received.

Signed-off-by: romanetar <roman_ag@hotmail.com>
@romanetar
romanetar force-pushed the fix/presentation-material-summit-id branch from 3d8c06f to af30e55 Compare August 6, 2026 17:57
@romanetar
romanetar requested a review from smarcet August 6, 2026 17:58
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.

1 participant