Skip to content

Fix: wire maintenance observer config onto ProductDeployment#365

Merged
Wiesenwischer merged 1 commit intomainfrom
bugfix/maintenance-observer-never-activated
Apr 15, 2026
Merged

Fix: wire maintenance observer config onto ProductDeployment#365
Wiesenwischer merged 1 commit intomainfrom
bugfix/maintenance-observer-never-activated

Conversation

@Wiesenwischer
Copy link
Copy Markdown
Owner

Summary

  • MaintenanceObserverService reads productDeployment.MaintenanceObserverConfig, but ProductDeployment.SetMaintenanceObserverConfig had zero production callers. DeployStackHandler mapped the config correctly but only wrote it to the stack-level Deployment entity, which nothing reads.
  • Result: no observer was ever instantiated for any product. maintenance.observer blocks in stack.yaml were silently ignored regardless of content, so ChangeProductOperationMode via observer never fired.
  • Extract MaintenanceObserverConfigMapper as a shared helper in Application.Services, wire it from DeployProductHandler (initial deploy) and RedeployProductHandler (refresh from catalog so stack.yaml edits take effect on redeploy).

Test plan

  • dotnet build — 0 errors
  • dotnet test — 2877/2877 passing
  • New tests: DeployProductHandler sets observer config on the ProductDeployment when resolvable; leaves it null when placeholders cannot be resolved; leaves it null when no observer defined
  • New tests: RedeployProductHandler re-reads observer config from catalog on redeploy; clears config when observer removed from catalog
  • Manual: deploy ams.project with sqlExtendedProperty observer, flip the extended property, confirm the product transitions into maintenance within the polling interval

MaintenanceObserverService reads productDeployment.MaintenanceObserverConfig,
but ProductDeployment.SetMaintenanceObserverConfig had zero production callers.
DeployStackHandler mapped the config correctly but only wrote it to the
stack-level Deployment entity, which nothing reads. Result: no observer
was ever instantiated for any product, so maintenanceObserver blocks in
stack.yaml were silently ignored regardless of their content.

- Extract MaintenanceObserverConfigMapper as a shared helper in Application.Services
- DeployProductHandler: resolve and attach observer config on InitiateDeployment
- RedeployProductHandler: re-read the product from catalog and refresh observer
  config on redeploy so stack.yaml edits to maintenance.observer take effect
- Tests cover resolvable/unresolvable/missing observer paths for both handlers
@github-actions github-actions Bot added the bug Something isn't working label Apr 15, 2026
@Wiesenwischer Wiesenwischer merged commit 715b3f9 into main Apr 15, 2026
2 checks passed
@Wiesenwischer Wiesenwischer deleted the bugfix/maintenance-observer-never-activated branch April 15, 2026 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant