Skip to content

Conversation

@ucswift
Copy link
Member

@ucswift ucswift commented Nov 8, 2025

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Improved sound parameter handling for push notifications and messages; notifications now properly specify audio playback.
  • Chores

    • Removed Firebase authentication provider module from the platform.
    • Enhanced CI/CD workflow for improved release notes processing and API integration reliability.

@request-info
Copy link

request-info bot commented Nov 8, 2025

Thanks for opening this, but we'd appreciate a little more information. Could you update it with more details?

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 8, 2025

Walkthrough

This PR removes the Firebase provider module entirely from the solution, including project files, implementations, and all dependency injections across multiple projects. Additionally, it enhances notification sound handling in the push service layer and updates the changerawr-sync workflow to extract and validate release notes with improved logging and error resilience.

Changes

Cohort / File(s) Summary
Firebase Provider Implementation Removal
Providers/Resgrid.Providers.Firebase/FirebaseAuthProvider.cs, FirebaseProviderModule.cs, Resgrid.Providers.Firebase.csproj, app.config, packages.config
Deleted entire Firebase provider module, authentication provider class, and project configuration files. Removes IFirebaseAuthProvider interface implementation and Autofac DI registration.
Firebase Project References Cleanup
Core/Resgrid.Services/Resgrid.Services.csproj, Providers/Resgrid.Providers.Email/Resgrid.Providers.Email.csproj, Resgrid.sln, Tests/Resgrid.Intergration.Tests/Resgrid.Intergration.Tests.csproj, Tests/Resgrid.Tests/Resgrid.Tests.csproj, Tools/Resgrid.Console/Resgrid.Console.csproj, Web/Resgrid.Web.Eventing/Resgrid.Web.Eventing.csproj, Web/Resgrid.Web.Services/Resgrid.Web.Services.csproj, Web/Resgrid.Web/Resgrid.Web.csproj, Workers/Resgrid.Workers.Console/Resgrid.Workers.Console.csproj, Workers/Resgrid.Workers.Framework/Resgrid.Workers.Framework.csproj
Removed Firebase provider project references from all .csproj files and solution configuration.
Firebase DI Registration Removal
Tests/Resgrid.Tests/Bootstrapper.cs, Tools/Resgrid.Console/Program.cs, Web/Resgrid.Web.Eventing/Startup.cs, Web/Resgrid.Web.Services/Startup.cs, Web/Resgrid.Web/Startup.cs, Web/Resgrid.Web/WebBootstrapper.cs, Workers/Resgrid.Workers.Framework/Bootstrapper.cs
Removed Firebase using directives and FirebaseProviderModule Autofac registrations from dependency injection bootstrappers.
Using Directives Cleanup
Web/Resgrid.Web/Areas/User/Controllers/ContactsController.cs, Web/Resgrid.Web/Areas/User/Controllers/TypesController.cs
Removed unused Firebase, Firebase Admin, and other unrelated using directives.
Push Service Sound Parameter Enhancement
Core/Resgrid.Services/PushService.cs
Updated PushMessage and PushNotification paths to pass non-null sound parameters: ((int)PushSoundTypes.Message).ToString() and ((int)PushSoundTypes.Notifiation).ToString() respectively.
Novu Provider Sound Handling Refactor
Providers/Resgrid.Providers.Messaging/NovuProvider.cs
Refactored sound filename resolution by consolidating GetSoundFileNameFromType(platform, type) to GetSoundFileNameFromType(type). Updated SendNotification, SendUnitDispatch, SendUserDispatch, SendUserMessage, and SendUserNotification methods to propagate sound parameter through payload and notification builders.
Release Notes Extraction Workflow Enhancement
.github/workflows/changerawr-sync.yml
Added pull-requests read permission, checkout step, and new release notes extraction logic that strips CodeRabbit-generated sections and extracts content under "Release Notes". Enhanced API submission step with request logging, robust JSON parsing, PR comment posting, and graceful error handling. Validates presence of API credentials before submission.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • NovuProvider.cs: Method signature changes to GetSoundFileNameFromType and SendNotification require careful verification that all call sites properly propagate the sound parameter and that Android/iOS notification builders correctly consume the refactored sound value.
  • Firebase removal across solution: While mostly straightforward project reference and DI registration removal, verify no orphaned Firebase code paths or conditional logic remain in services that consumed Firebase.
  • Workflow changes: The release notes extraction logic involves string parsing and fallback logic; validate edge cases where PR body is missing or malformed.
  • PushService.cs: Verify the hardcoded sound enum conversions are correct and that all notification paths invoke the updated method signatures.

Possibly related PRs

Poem

🐰 Firebase flies away, sound now rings true,
The workflow extracts notes with a graceful debut,
Push messages dance with their sonic delight,
One module removed, notification worlds unite! 🎵

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: complete removal of Firebase provider throughout the codebase and updates to Novu provider for sound parameter handling.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch develop

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.

Copy link
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: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Providers/Resgrid.Providers.Messaging/NovuProvider.cs (1)

324-353: Restore .caf filenames for iOS custom sounds

GetSoundFileNameFromType now always returns a .wav filename. CreateAppleNotification (Line 459) forwards that value straight into the APNS payload, so every iOS push will reference a .wav we don't ship—our iOS builds only include the .caf variants (see Providers/Resgrid.Providers.Bus/NotificationProvider.cs Lines 370-423 for the existing mapping). iOS will silently fall back to the default alert, breaking all custom tones for calls/messages. Please keep platform-specific extensions (e.g., .caf for Apple) or compute a dedicated Apple sound string before constructing the APNS payload. One way to fix it is to restore the platform-aware mapping:

-		private string GetSoundFileNameFromType(string type)
+		private string GetSoundFileNameFromType(string type, Platforms platform)
 		{
 			if (type == ((int)PushSoundTypes.CallEmergency).ToString())
 			{
-				return "callemergency.wav";
+				return platform == Platforms.iOS ? "callemergency.caf" : "callemergency.wav";
 			}
 			else if (type == ((int)PushSoundTypes.CallHigh).ToString())
 			{
-				return "callhigh.wav";
+				return platform == Platforms.iOS ? "callhigh.caf" : "callhigh.wav";
 			}
 			…

Make sure the APNS path calls GetSoundFileNameFromType(type, Platforms.iOS) while the Android/default paths use Platforms.Android.

🧹 Nitpick comments (2)
.github/workflows/changerawr-sync.yml (2)

71-71: Minor: Simplify redundant empty string check.

The condition [ -z "$NOTES" ] || [ "$NOTES" = "" ] is redundant—-z already tests for empty strings.

-        if [ -z "$NOTES" ] || [ "$NOTES" = "" ]; then
+        if [ -z "$NOTES" ]; then

90-171: Excellent error resilience and security posture in API submission.

The updated step validates credentials before proceeding, handles both JSON and non-JSON responses robustly, logs extensively for observability, and gracefully tolerates API or comment posting failures without failing the workflow. This prevents broken API integrations from blocking releases.

Consider adding a metric or alert in your observability system to track when Changerawr submissions fail silently, since the workflow won't fail. This ensures issues with the changelog system don't go unnoticed.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0f606fe and 4ffe97b.

📒 Files selected for processing (28)
  • .github/workflows/changerawr-sync.yml (3 hunks)
  • Core/Resgrid.Services/PushService.cs (3 hunks)
  • Core/Resgrid.Services/Resgrid.Services.csproj (0 hunks)
  • Providers/Resgrid.Providers.Email/Resgrid.Providers.Email.csproj (0 hunks)
  • Providers/Resgrid.Providers.Firebase/FirebaseAuthProvider.cs (0 hunks)
  • Providers/Resgrid.Providers.Firebase/FirebaseProviderModule.cs (0 hunks)
  • Providers/Resgrid.Providers.Firebase/Resgrid.Providers.Firebase.csproj (0 hunks)
  • Providers/Resgrid.Providers.Firebase/app.config (0 hunks)
  • Providers/Resgrid.Providers.Firebase/packages.config (0 hunks)
  • Providers/Resgrid.Providers.Messaging/NovuProvider.cs (7 hunks)
  • Resgrid.sln (1 hunks)
  • Tests/Resgrid.Intergration.Tests/Resgrid.Intergration.Tests.csproj (0 hunks)
  • Tests/Resgrid.Tests/Bootstrapper.cs (0 hunks)
  • Tests/Resgrid.Tests/Resgrid.Tests.csproj (0 hunks)
  • Tools/Resgrid.Console/Program.cs (0 hunks)
  • Tools/Resgrid.Console/Resgrid.Console.csproj (0 hunks)
  • Web/Resgrid.Web.Eventing/Resgrid.Web.Eventing.csproj (0 hunks)
  • Web/Resgrid.Web.Eventing/Startup.cs (0 hunks)
  • Web/Resgrid.Web.Services/Resgrid.Web.Services.csproj (0 hunks)
  • Web/Resgrid.Web.Services/Startup.cs (0 hunks)
  • Web/Resgrid.Web/Areas/User/Controllers/ContactsController.cs (0 hunks)
  • Web/Resgrid.Web/Areas/User/Controllers/TypesController.cs (0 hunks)
  • Web/Resgrid.Web/Resgrid.Web.csproj (0 hunks)
  • Web/Resgrid.Web/Startup.cs (0 hunks)
  • Web/Resgrid.Web/WebBootstrapper.cs (0 hunks)
  • Workers/Resgrid.Workers.Console/Resgrid.Workers.Console.csproj (0 hunks)
  • Workers/Resgrid.Workers.Framework/Bootstrapper.cs (0 hunks)
  • Workers/Resgrid.Workers.Framework/Resgrid.Workers.Framework.csproj (0 hunks)
💤 Files with no reviewable changes (24)
  • Tests/Resgrid.Tests/Bootstrapper.cs
  • Workers/Resgrid.Workers.Framework/Resgrid.Workers.Framework.csproj
  • Tools/Resgrid.Console/Resgrid.Console.csproj
  • Providers/Resgrid.Providers.Email/Resgrid.Providers.Email.csproj
  • Providers/Resgrid.Providers.Firebase/packages.config
  • Web/Resgrid.Web.Services/Startup.cs
  • Web/Resgrid.Web.Services/Resgrid.Web.Services.csproj
  • Web/Resgrid.Web.Eventing/Resgrid.Web.Eventing.csproj
  • Providers/Resgrid.Providers.Firebase/FirebaseAuthProvider.cs
  • Core/Resgrid.Services/Resgrid.Services.csproj
  • Web/Resgrid.Web/WebBootstrapper.cs
  • Web/Resgrid.Web.Eventing/Startup.cs
  • Web/Resgrid.Web/Startup.cs
  • Web/Resgrid.Web/Areas/User/Controllers/TypesController.cs
  • Workers/Resgrid.Workers.Framework/Bootstrapper.cs
  • Tests/Resgrid.Intergration.Tests/Resgrid.Intergration.Tests.csproj
  • Tests/Resgrid.Tests/Resgrid.Tests.csproj
  • Web/Resgrid.Web/Areas/User/Controllers/ContactsController.cs
  • Tools/Resgrid.Console/Program.cs
  • Workers/Resgrid.Workers.Console/Resgrid.Workers.Console.csproj
  • Providers/Resgrid.Providers.Firebase/Resgrid.Providers.Firebase.csproj
  • Web/Resgrid.Web/Resgrid.Web.csproj
  • Providers/Resgrid.Providers.Firebase/FirebaseProviderModule.cs
  • Providers/Resgrid.Providers.Firebase/app.config
🧰 Additional context used
📓 Path-based instructions (1)
**/*.cs

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.cs: Prefer functional patterns and immutable data where appropriate in C#
Use modern C# features appropriately
Use meaningful, descriptive names for types, methods, and parameters; avoid unclear abbreviations
Separate state from behavior (e.g., use records for state and place operations in separate static classes)
Prefer pure methods over methods with side effects
Use extension methods appropriately for domain-specific operations
Design for testability; avoid hidden dependencies inside methods and prefer explicit, pure functions
Minimize constructor injection; keep the number of injected dependencies small
Prefer composition with interfaces to extend behavior

Files:

  • Core/Resgrid.Services/PushService.cs
  • Providers/Resgrid.Providers.Messaging/NovuProvider.cs
🧬 Code graph analysis (1)
Providers/Resgrid.Providers.Messaging/NovuProvider.cs (2)
Providers/Resgrid.Providers.Bus/NotificationProvider.cs (2)
  • GetSoundFileNameFromType (371-424)
  • FormatForAndroidNativePush (426-432)
Providers/Resgrid.Providers.Bus/UnitNotificationProvider.cs (2)
  • GetSoundFileNameFromType (400-460)
  • FormatForAndroidNativePush (462-468)
🪛 actionlint (1.7.8)
.github/workflows/changerawr-sync.yml

30-30: "github.event.pull_request.title" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/reference/security/secure-use#good-practices-for-mitigating-script-injection-attacks for more details

(expression)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: build
  • GitHub Check: Analyze (csharp)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
.github/workflows/changerawr-sync.yml (3)

5-5: Appropriate permissions and checkout configuration.

The addition of pull-requests: read permission is correct for the workflow's needs, and the checkout step with fetch-depth: 10 properly enables access to recent commit history for the fallback logic.

Also applies to: 21-24


26-88: Robust release notes extraction with good fallback logic.

The extraction logic correctly strips CodeRabbit-generated sections, attempts to isolate a "Release Notes" section, and gracefully falls back to the PR title plus recent commits when necessary. The multiline output handling via EOF delimiter is properly implemented.


73-73: Mitigate potential script injection from untrusted PR metadata.

Per static analysis, the template expression ${{ github.event.pull_request.title }} is used directly in the shell script. Although this is common in GitHub Actions, PR titles containing special characters (e.g., backticks, $(...)) could potentially be executed. Pass the value through an environment variable for defense in depth.

-    - name: Extract and prepare release notes
+    - name: Extract and prepare release notes
       id: prepare_notes
       env:
         GH_TOKEN: ${{ github.token }}
+        PR_TITLE: ${{ github.event.pull_request.title }}
       run: |
         set -eo pipefail
         ...
-          NOTES="## ${{ github.event.pull_request.title }}"
+          NOTES="## $PR_TITLE"

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.

2 participants