Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jul 28, 2025

This PR marks the ParameterResource.Value property as obsolete to prepare for migration to the async GetValueAsync method. This is the first phase of the migration strategy where we identify all usages and suppress the obsolete warnings to maintain a working build state.

Changes Made

Core Change

  • Marked ParameterResource.Value property as [Obsolete] with updated XML documentation recommending migration to GetValueAsync or direct ParameterResource usage
  • Used warning-level obsolete (not error: true) since error-level obsolete attributes cannot be suppressed with pragma directives

Suppressions Added

Added #pragma warning disable CS0618 suppressions in the following files:

  • src/Aspire.Hosting.Docker/DockerComposeServiceExtensions.cs - Parameter default value handling
  • src/Aspire.Hosting.Kubernetes/KubernetesServiceResourceExtensions.cs - Helm value resolution
  • tests/Aspire.Hosting.Tests/AddParameterTests.cs - Multiple test assertions
  • tests/Aspire.Hosting.Tests/Orchestrator/ParameterProcessorTests.cs - Parameter processor validation
  • tests/Aspire.Hosting.Tests/DistributedApplicationTests.cs - Redis connection string tests

Special Case

  • src/Aspire.Hosting.Azure/AzurePublishingContext.cs - Used project-level <NoWarn>CS0618</NoWarn> suppression due to refactored helper method approach

Migration Strategy

This PR represents Phase 1 of the migration:

  1. Mark obsolete and suppress (this PR)
  2. 🔄 Review and migrate appropriate usages (future work)
  3. 🔄 Remove obsolete property (future work)

The suppressions ensure the build continues to work while we plan the migration strategy for each usage. Some usages may be appropriate for GetValueAsync migration, while others might need different approaches.

Testing

All individual projects build successfully with the obsolete warnings properly suppressed. The functionality remains unchanged - this is purely a preparatory step for the async migration.

Fixes #10362
Related to #10354, #10359, #10361

This pull request was created as a result of the following prompt from Copilot chat.

Obsolete the ParameterResource.Value property throughout the codebase. In this first pass:

  • Mark ParameterResource.Value as [Obsolete] with an error flag (causing compile errors).
  • Introduce suppressions (pragma, #nullable, or similar) wherever the compile error is triggered, so the build continues to succeed.
  • Do NOT attempt to change usages to GetValueAsync yet; only suppress the errors for now.
  • Update XML documentation to indicate that Value is obsolete and recommend using GetValueAsync or direct ParameterResource usage instead.
  • Do not change any usage to GetValueAsync in this PR, only suppress errors and mark obsolete.
  • Touch documentation and code comments as needed to provide migration guidance.

This is the first pass for the planned migration. The next step will be to review usages and migrate them where appropriate.

References:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@mitchdenny mitchdenny closed this Jul 28, 2025
Copilot AI changed the title [WIP] Mark ParameterResource.Value as obsolete and suppress resulting errors Obsolete ParameterResource.Value property with suppressions for migration Jul 28, 2025
Copilot AI requested a review from mitchdenny July 28, 2025 13:27
Copilot finished work on behalf of mitchdenny July 28, 2025 13:27
@github-actions github-actions bot locked and limited conversation to collaborators Aug 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Obsolete ParameterResource.Value in favor of GetValueAsync and direct usage

2 participants