Skip to content

RG-T136 Support for triggering backend rebuilds - #545

Merged
ucswift merged 1 commit into
masterfrom
develop
Oct 8, 2026
Merged

ucswift merged 1 commit into
masterfrom
develop

Conversation

@ucswift

@ucswift ucswift commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features
    • Added a system-operations queue for submitting, tracking, cancelling, and processing administrative tasks.
    • Added support for viewing operation progress and results, detecting cache data loss, checking cache status, and clearing department caches.
    • Added scheduled background processing for queued operations, including recovery of requests abandoned by workers.
    • Added progress reporting for security updates across departments.

@request-info

request-info Bot commented Oct 8, 2026

Copy link
Copy Markdown

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

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: Resgrid/Core/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 3f715969-1d97-46c9-8216-175f0bc1ce00
📥 Commits

Reviewing files that changed from the base of the PR and between a31015f and 3ed0e72.

⛔ Files ignored due to path filters (3)
  • Tests/Resgrid.Tests/Repositories/SystemOperationRequestsDatabaseTests.cs is excluded by !**/Tests/**
  • Tests/Resgrid.Tests/Services/SystemOperationsServiceTests.cs is excluded by !**/Tests/**
  • Tests/Resgrid.Tests/Workers/Console/SystemOperationsTests.cs is excluded by !**/Tests/**
📒 Files selected for processing (21)
  • Core/Resgrid.Model/Repositories/ISystemOperationRequestsRepository.cs
  • Core/Resgrid.Model/Services/ISystemOperationsService.cs
  • Core/Resgrid.Model/SystemOperationCatalog.cs
  • Core/Resgrid.Model/SystemOperationRequest.cs
  • Core/Resgrid.Model/SystemOperationSources.cs
  • Core/Resgrid.Model/SystemOperationStatuses.cs
  • Core/Resgrid.Model/SystemOperationTypes.cs
  • Core/Resgrid.Services/ServicesModule.cs
  • Core/Resgrid.Services/SystemOperationsService.cs
  • Providers/Resgrid.Providers.Migrations/Migrations/M0267_AddSystemOperationRequests.cs
  • Providers/Resgrid.Providers.MigrationsPg/Migrations/M0267_AddSystemOperationRequestsPg.cs
  • Repositories/Resgrid.Repositories.DataRepository/Modules/ApiDataModule.cs
  • Repositories/Resgrid.Repositories.DataRepository/Modules/DataModule.cs
  • Repositories/Resgrid.Repositories.DataRepository/Modules/NonWebDataModule.cs
  • Repositories/Resgrid.Repositories.DataRepository/Modules/TestingDataModule.cs
  • Repositories/Resgrid.Repositories.DataRepository/SystemOperationRequestsRepository.cs
  • Workers/Resgrid.Workers.Console/Commands/SystemOperationsCommand.cs
  • Workers/Resgrid.Workers.Console/Program.cs
  • Workers/Resgrid.Workers.Console/SystemOperations/SystemOperationRunner.cs
  • Workers/Resgrid.Workers.Console/Tasks/SystemOperationsTask.cs
  • Workers/Resgrid.Workers.Framework/Logic/SecurityLogic.cs

Included review availability: This review used your included allowance. 2 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour. Your free on-demand review promotion remains active until October 9, 2026 at 6:00 PM UTC.


📝 Walkthrough

Walkthrough

This change adds durable system-operation requests, database storage for SQL Server and PostgreSQL, service methods for request and cache handling, and a scheduled worker that runs operations and records outcomes.

Changes

System Operations

Layer / File(s) Summary
Request contracts and database schema
Core/Resgrid.Model/SystemOperation*.cs, Core/Resgrid.Model/Repositories/ISystemOperationRequestsRepository.cs, Core/Resgrid.Model/Services/ISystemOperationsService.cs, Providers/Resgrid.Providers.Migrations/Migrations/M0267_AddSystemOperationRequests.cs, Providers/Resgrid.Providers.MigrationsPg/Migrations/M0267_AddSystemOperationRequestsPg.cs
Adds request fields, operation types and catalog, lifecycle statuses, source values, service and repository contracts, and SQL Server and PostgreSQL tables with indexes.
Request persistence and state transitions
Repositories/Resgrid.Repositories.DataRepository/SystemOperationRequestsRepository.cs, Repositories/Resgrid.Repositories.DataRepository/Modules/*DataModule.cs
Adds request queries and conditional state updates, including claiming pending requests and failing abandoned requests. Registers the repository in the data modules.
Request and cache service
Core/Resgrid.Services/SystemOperationsService.cs, Core/Resgrid.Services/ServicesModule.cs
Adds request validation, deduplication, lifecycle delegation, cache-loss detection, cache status, and department cache invalidation. Registers the service.
Operation dispatch and security refresh
Workers/Resgrid.Workers.Console/SystemOperations/SystemOperationRunner.cs, Workers/Resgrid.Workers.Framework/Logic/SecurityLogic.cs
Adds operation dispatch, cache and configuration checks, outcome capture, and department-level security-matrix rebuilding with progress and cancellation support.
Scheduled request processing
Workers/Resgrid.Workers.Console/Commands/SystemOperationsCommand.cs, Workers/Resgrid.Workers.Console/Program.cs, Workers/Resgrid.Workers.Console/Tasks/SystemOperationsTask.cs
Schedules request processing every minute. The task claims and runs requests, checks for cache data loss, reports heartbeats, and records outcomes.

Priority: ⬇️ Low

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant SystemOperationsTask
  participant SystemOperationsService
  participant SystemOperationRequestsRepository
  participant SystemOperationRunner
  SystemOperationsTask->>SystemOperationsService: ClaimNextRequestAsync
  SystemOperationsService->>SystemOperationRequestsRepository: ClaimNextPendingAsync
  SystemOperationRequestsRepository-->>SystemOperationsService: Claimed request
  SystemOperationsService-->>SystemOperationsTask: Request
  SystemOperationsTask->>SystemOperationRunner: RunAsync
  SystemOperationRunner-->>SystemOperationsTask: Outcome
  SystemOperationsTask->>SystemOperationsService: CompleteRequestAsync
  SystemOperationsService->>SystemOperationRequestsRepository: FinishAsync
Loading

Merge Risk: ⚪ Minimal · up to 3ed0e

No confirmed issue remains that should block merging after normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 29.27% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 82 functions across 21 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary capability added by the pull request: triggering backend rebuild operations through the new system-operation infrastructure.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@ucswift

ucswift commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

Approve

@github-actions github-actions 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.

This PR is approved.

@ucswift
ucswift merged commit 65103d9 into master Oct 8, 2026
18 of 19 checks passed
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