Skip to content

Implement caching rollout for portal-repo 4.2.21 - #52

Merged
frasermolyneux merged 1 commit into
mainfrom
agents/portal-repo-4221-caching-rollout
Aug 2, 2026
Merged

Implement caching rollout for portal-repo 4.2.21#52
frasermolyneux merged 1 commit into
mainfrom
agents/portal-repo-4221-caching-rollout

Conversation

@frasermolyneux

Copy link
Copy Markdown
Owner

This pull request implements the consumer caching rollout for the portal-repo version 4.2.21 in the portal-server-events application. The following changes were made:

  • Updated Dependencies:

    • Bumped XtremeIdiots.Portal.Repository.Api.Client.V1 from 4.2.16 to 4.2.21 and MX.Api.Client from 2.3.75 to 2.3.76 in the project file.
  • Enabled Caching:

    • Added .WithCaching(c => c.UseLibraryDefaults()) to the AddRepositoryApiClient(...) method in Program.cs to enable caching with the specified defaults.
  • Test Adjustments:

    • Updated the ChatMessageProcessorTests to accommodate changes in the IConnectedPlayersApi.GetConnectedPlayers method signature while preserving existing behavioral expectations.
  • Audit and Validation:

    • Conducted a thorough audit of read sites to ensure compliance with caching rules, confirming that no unnecessary caching was introduced and that existing player-context caching mechanisms remain intact.
  • Validation:

    • All tests passed successfully, confirming that the changes did not introduce any regressions.

This rollout aligns with the specified requirements and preserves the necessary caching behaviors while implementing the new version of the repository client.

Copilot AI review requested due to automatic review settings August 2, 2026 19:58
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 2 package(s) with unknown licenses.
See the Details below.

License Issues

src/XtremeIdiots.Portal.Server.Events.Processor.App/XtremeIdiots.Portal.Server.Events.Processor.App.csproj

PackageVersionLicenseIssue Type
MX.Api.Client2.3.76NullUnknown License
XtremeIdiots.Portal.Repository.Api.Client.V14.2.21NullUnknown License

OpenSSF Scorecard

PackageVersionScoreDetails
nuget/MX.Api.Client 2.3.76 UnknownUnknown
nuget/XtremeIdiots.Portal.Repository.Api.Client.V1 4.2.21 UnknownUnknown

Scanned Files

  • src/XtremeIdiots.Portal.Server.Events.Processor.App/XtremeIdiots.Portal.Server.Events.Processor.App.csproj

Copilot AI 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.

Pull request overview

This pull request rolls the processor app forward to portal-repo client 4.2.21 and enables the repository client’s built-in caching using the library default configuration, while updating unit tests to match an updated GetConnectedPlayers method signature.

Changes:

  • Bumped XtremeIdiots.Portal.Repository.Api.Client.V1 to 4.2.21 and MX.Api.Client to 2.3.76.
  • Enabled repository API client caching via .WithCaching(c => c.UseLibraryDefaults()) in the processor app startup.
  • Updated ChatMessageProcessorTests mock setup to include the new GetConnectedPlayers parameters.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/XtremeIdiots.Portal.Server.Events.Processor.App/XtremeIdiots.Portal.Server.Events.Processor.App.csproj Updates package references to pick up portal-repo 4.2.21 and related client changes.
src/XtremeIdiots.Portal.Server.Events.Processor.App/Program.cs Enables repository client caching using library defaults during DI setup.
src/XtremeIdiots.Portal.Server.Events.Processor.App.Tests/Functions/ChatMessageProcessorTests.cs Adjusts Moq setup to match updated GetConnectedPlayers signature.

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown

🏗️ Terraform Plan

🌍 Environment: dev

✅ Validate — Passed

✅ Plan

Count
➕ Add 29
📋 Resource Details
Action Resource
➕ Create azurerm_api_management_api.cod4x_ingest[0]
➕ Create azurerm_api_management_api_operation.cod4x_ingest_active_bans_get[0]
➕ Create azurerm_api_management_api_operation.cod4x_ingest_events_post["ban_file_changed"]
➕ Create azurerm_api_management_api_operation.cod4x_ingest_events_post["chat_message"]
➕ Create azurerm_api_management_api_operation.cod4x_ingest_events_post["map_change"]
➕ Create azurerm_api_management_api_operation.cod4x_ingest_events_post["player_connected"]
➕ Create azurerm_api_management_api_operation.cod4x_ingest_events_post["player_disconnected"]
➕ Create azurerm_api_management_api_operation.cod4x_ingest_events_post["player_ip_resolved"]
➕ Create azurerm_api_management_api_operation.cod4x_ingest_events_post["server_connected"]
➕ Create azurerm_api_management_api_operation.cod4x_ingest_events_post["server_status"]
➕ Create azurerm_api_management_api_operation.cod4x_ingest_vpn_protection_evaluate_post[0]
➕ Create azurerm_api_management_api_operation_policy.cod4x_ingest_active_bans_get[0]
➕ Create azurerm_api_management_api_operation_policy.cod4x_ingest_events_post["ban_file_changed"]
➕ Create azurerm_api_management_api_operation_policy.cod4x_ingest_events_post["chat_message"]
➕ Create azurerm_api_management_api_operation_policy.cod4x_ingest_events_post["map_change"]
➕ Create azurerm_api_management_api_operation_policy.cod4x_ingest_events_post["player_connected"]
➕ Create azurerm_api_management_api_operation_policy.cod4x_ingest_events_post["player_disconnected"]
➕ Create azurerm_api_management_api_operation_policy.cod4x_ingest_events_post["player_ip_resolved"]
➕ Create azurerm_api_management_api_operation_policy.cod4x_ingest_events_post["server_connected"]
➕ Create azurerm_api_management_api_operation_policy.cod4x_ingest_events_post["server_status"]
➕ Create azurerm_api_management_api_operation_policy.cod4x_ingest_vpn_protection_evaluate_post[0]
➕ Create azurerm_api_management_product_api.cod4x_ingest[0]
➕ Create azurerm_linux_function_app.function_app
➕ Create azurerm_monitor_activity_log_alert.rg_resource_health
➕ Create azurerm_monitor_metric_alert.dead_letter_messages
➕ Create azurerm_monitor_metric_alert.queue_backlog
➕ Create azurerm_role_assignment.app_to_storage
➕ Create azurerm_storage_account.function_app_storage
➕ Create random_id.environment_id

@sonarqubecloud

sonarqubecloud Bot commented Aug 2, 2026

Copy link
Copy Markdown

@frasermolyneux
frasermolyneux merged commit 28ab5f4 into main Aug 2, 2026
19 checks passed
@frasermolyneux
frasermolyneux deleted the agents/portal-repo-4221-caching-rollout branch August 2, 2026 20:30
frasermolyneux added a commit that referenced this pull request Aug 2, 2026
…artup crash (#53)

Repository 4.2.21 client-side caching policy composition throws
ArgumentException: expression must invoke a method declared by IAdminActionsApi
at DI build time. portal-sync and portal-repository-func are already crashing
in production with this signature. portal-server-events main (PR #52) has the
same registration and is subject to the same deterministic failure on restart.

Removes only `.WithCaching(c => c.UseLibraryDefaults())` from Program.cs.
BaseUrl + Entra ID authentication preserved. Repository server-side caching
remains active. Player-context IMemoryCache, LiveStatus writes, moderation,
VPN protection, welcome messages, and all event handling behaviour unchanged.
Repository 4.2.21 / MX.Api 2.3.76 versions unchanged.

Adds Startup/RepositoryApiClientRegistrationTests that build the production
DI registration and resolve IRepositoryApiClient, IVersionedAdminActionsApi
and every sub-client the processor calls at runtime (.V1 access forces the
typed-client graph to materialise) so any regression in the AddRepositoryApiClient
composition is caught before it reaches production.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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