Skip to content

Feature/config updates#771

Merged
frasermolyneux merged 1 commit intomainfrom
feature/config-updates
Feb 23, 2026
Merged

Feature/config updates#771
frasermolyneux merged 1 commit intomainfrom
feature/config-updates

Conversation

@frasermolyneux
Copy link
Copy Markdown
Owner

This pull request introduces several improvements to the configuration and resilience of the API, making key operational parameters configurable via Azure App Configuration and environment variables. The changes enhance flexibility for deployment and maintenance, and improve testability by injecting configuration dependencies. Below are the most important changes grouped by theme:

Configuration Management and Azure App Configuration:

  • Refactored both Program.cs files (V1 and V2) to use a more robust pattern for loading configuration from Azure App Configuration, including support for environment labels and additional key selection (such as GameTracker and SqlResilience). This also includes improved credential handling for managed identities. [1] [2]
  • Made operational parameters for SQL resilience (RetryCount, RetryDelaySeconds, CommandTimeoutSeconds) and Application Insights sampling percentages configurable via environment variables or Azure App Configuration, with sensible defaults. [1] [2] [3] [4]

Controller and Test Refactoring:

  • Updated DataMaintenanceController and its tests to accept an IConfiguration dependency, enabling the controller to use configuration values for data retention logic instead of hardcoded values. [1] [2] [3] [4]
  • Changed the logic in PruneRecentPlayers and ResetSystemAssignedPlayerTags methods to use configurable retention periods from the DataRetention section in configuration, defaulting to previous hardcoded values if not set. [1] [2]

Other Configuration-Driven Improvements:

  • Updated the logic for building the GameTracker banner image URL in GameTrackerBannerController to use a configurable base URL, allowing for easier changes to external dependencies.

…MaintenanceController and GameTrackerBannerController
Copilot AI review requested due to automatic review settings February 23, 2026 22:33
@github-actions
Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the API’s operational configurability by sourcing more settings from Azure App Configuration and environment variables, and by injecting configuration into controllers so retention behavior can be tuned without code changes.

Changes:

  • Refactors V1/V2 startup to load additional configuration sets from Azure App Configuration using managed identity credentials.
  • Makes Application Insights adaptive sampling and SQL retry/timeout resilience parameters configurable with defaults.
  • Updates maintenance and banner controllers to use configurable retention periods and a configurable GameTracker banner base URL.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
src/XtremeIdiots.Portal.Repository.Api.V2/Program.cs Adds Azure App Configuration selection and makes AI sampling + SQL resilience configurable
src/XtremeIdiots.Portal.Repository.Api.V1/Program.cs Same as V2, plus loads GameTracker:* keys
src/XtremeIdiots.Portal.Repository.Api.V1/Controllers/V1/GameTrackerBannerController.cs Builds GameTracker image URL from a configurable base URL
src/XtremeIdiots.Portal.Repository.Api.V1/Controllers/V1/DataMaintenanceController.cs Injects IConfiguration and uses config-driven retention windows
src/XtremeIdiots.Portal.Repository.Api.Tests.V1/Controllers/V1/DataMaintenanceControllerTests.cs Updates tests for the new controller constructor signature

Comment thread src/XtremeIdiots.Portal.Repository.Api.V2/Program.cs
Comment thread src/XtremeIdiots.Portal.Repository.Api.V2/Program.cs
Comment thread src/XtremeIdiots.Portal.Repository.Api.V1/Program.cs
Comment thread src/XtremeIdiots.Portal.Repository.Api.V1/Program.cs
Comment thread src/XtremeIdiots.Portal.Repository.Api.V2/Program.cs
Comment thread src/XtremeIdiots.Portal.Repository.Api.V1/Program.cs
@github-actions
Copy link
Copy Markdown
Contributor

🏗️ Terraform Plan

🌍 Environment: dev

✅ Validate — Passed

✅ Plan

No changes. Your infrastructure matches the configuration.

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
66.7% Duplication on New Code (required ≤ 30%)

See analysis details on SonarQube Cloud

@frasermolyneux frasermolyneux merged commit 67c162e into main Feb 23, 2026
27 of 29 checks passed
@frasermolyneux frasermolyneux deleted the feature/config-updates branch February 23, 2026 23:10
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