Skip to content

Remove redundant id in AspireExportAttribute usages#15769

Merged
AndriySvyryd merged 10 commits intomainfrom
copilot/remove-id-parameter-where-unnecessary
Apr 3, 2026
Merged

Remove redundant id in AspireExportAttribute usages#15769
AndriySvyryd merged 10 commits intomainfrom
copilot/remove-id-parameter-where-unnecessary

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

Fixes #15767

Description

[AspireExport("id")] usages were inconsistent — most explicitly repeated the camelCase method name as the id, which is redundant. The id should only appear when disambiguation is needed (e.g., multiple overloads mapped to different capability names).

Changes

  • AtsCapabilityScanner: Auto-derives capability ID from ToCamelCase(method.Name) when no explicit id is provided (static methods only). When id is explicitly set to an empty/whitespace string, emits a warning and skips the method (restoring original behavior).
  • AspireExportAnalyzer: Adds GetDerivedExportId to compute the effective export ID for ASPIREEXPORT007 duplicate detection, so [AspireExport] on AddThing correctly collides with [AspireExport("addThing")] on another overload. Empty/invalid exportId values are normalized to null before applying the fallback. Caches the s_exportIdPattern.IsMatch(exportId) result in a local isExportIdFormatValid variable to avoid evaluating the regex twice. GetDerivedExportId is now called only once per method analysis, with the result stored in derivedExportId and reused for both the ASPIREEXPORT011 redundancy check and the effectiveExportId computation. GetDerivedExportId accounts for the containing type name: for instance methods the derived ID is TypeName.camelCaseMethod (matching the scanner's TypeName.methodName pattern), and for static methods it remains camelCaseMethod. Rule 7 (ASPIREEXPORT009 — export name uniqueness) now correctly uses effectiveExportId instead of the raw exportId, so the uniqueness check is no longer silently skipped for methods without an explicit id.
  • ASPIREEXPORT011 (new diagnostic): Warns when an explicit id argument matches the convention-derived name, flagging it as redundant. For static extension methods, the convention is camelCase(methodName) (e.g., [AspireExport("addRedis")] on AddRedis). For instance methods on types, the convention is TypeName.camelCase(methodName), so a short explicit id like "getValueAsync" on EndpointReference.GetValueAsync is not flagged. ASPIREEXPORT011 is suppressed when ASPIREEXPORT009 also fires for the same method — the two diagnostics give contradictory advice ("remove the id" vs. "make the id more specific"), so only the actionable ASPIREEXPORT009 is shown. A HasConcreteResourceBuilderTargetParameter helper detects this condition.
  • AspireExportAttribute: Updated XML docs — id constructor overload now documents it's only needed for disambiguation; parameterless constructor documents it works for both methods and types.
  • ~550 src and test files: Removed all redundant id arguments where id == camelCase(methodName) for static extension methods. All disambiguation cases (where id differs) are preserved.

Before / After (static extension methods):

// Before - redundant id
[AspireExport("addMongoDB", Description = "Adds a MongoDB container resource")]
public static IResourceBuilder<MongoDBServerResource> AddMongoDB(...)

// After - id omitted, scanner derives "addMongoDB" from method name
[AspireExport(Description = "Adds a MongoDB container resource")]
public static IResourceBuilder<MongoDBServerResource> AddMongoDB(...)

// Disambiguation cases unchanged (with MethodName to preserve ATS-visible name)
[AspireExport("addEFMigrationsWithContextType", MethodName = "addEFMigrations", Description = "...")]
public static IResourceBuilder<EFMigrationResource> AddEFMigrations(..., string contextTypeName) { }

Instance methods retain explicit ids (ATS capability ID must stay unchanged):

// Explicit id preserved — omitting it would change capability ID to "EndpointReference.getValueAsync"
[AspireExport("getValueAsync", Description = "Gets the URL of the endpoint asynchronously")]
public ValueTask<string?> GetValueAsync(CancellationToken cancellationToken = default) ...

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

Copilot AI linked an issue Apr 1, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix inconsistent id parameter usage in AspireExportAttribute Be consistent with id parameter in AspireExportAttribute usages Apr 1, 2026
Copilot AI requested a review from AndriySvyryd April 1, 2026 19:24
@AndriySvyryd AndriySvyryd requested a review from Copilot April 1, 2026 19:27
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15769

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15769"

Copy link
Copy Markdown
Contributor

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 standardizes [AspireExport] usage by removing redundant id arguments (when they simply restated the camel-cased method name) and updating the runtime scanner/analyzer to derive the effective export ID when id is omitted.

Changes:

  • Update ATS runtime capability scanning to derive the capability id from the method name when not explicitly provided.
  • Update the AspireExportAnalyzer to use the effective/derived export ID for duplicate detection, aligning [AspireExport] with [AspireExport("addThing")].
  • Remove redundant id arguments across many Aspire exports and adjust tests/docs accordingly.

Reviewed changes

Copilot reviewed 109 out of 109 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/Aspire.Hosting.RemoteHost.Tests/CapabilityDispatcherTests.cs Removes redundant id arguments in test capability exports to validate derived IDs.
tests/Aspire.Hosting.RemoteHost.Tests/AttributeDataReaderTests.cs Switches a test export to [AspireExport] (no explicit id).
tests/Aspire.Hosting.RemoteHost.Tests/AtsCapabilityScannerTests.cs Removes redundant id arguments in scanner tests to validate derived IDs.
tests/Aspire.Cli.EndToEnd.Tests/ProjectReferenceTests.cs Updates an E2E test integration export to omit redundant id.
src/Aspire.Hosting/RequiredCommandResourceExtensions.cs Removes redundant id for an exported builder extension.
src/Aspire.Hosting/ProjectResourceBuilderExtensions.cs Removes redundant id arguments from multiple exported builder extensions.
src/Aspire.Hosting/Pipelines/PipelineStepFactoryExtensions.cs Removes redundant id arguments from pipeline-related exports.
src/Aspire.Hosting/ParameterResourceBuilderExtensions.cs Removes redundant id arguments from parameter/connection-string related exports.
src/Aspire.Hosting/OtlpConfigurationExtensions.cs Removes redundant id from OTLP exporter export.
src/Aspire.Hosting/McpServerResourceBuilderExtensions.cs Removes redundant id from MCP server export.
src/Aspire.Hosting/ExternalServiceBuilderExtensions.cs Removes redundant id from external service export.
src/Aspire.Hosting/ExecutableResourceBuilderExtensions.cs Removes redundant id arguments from executable-related exports.
src/Aspire.Hosting/DotnetToolResourceExtensions.cs Removes redundant id arguments from dotnet-tool exports.
src/Aspire.Hosting/DistributedApplication.cs Removes redundant id from CreateBuilder export.
src/Aspire.Hosting/ContainerResourceBuilderExtensions.cs Removes redundant id arguments from container-related exports.
src/Aspire.Hosting/ContainerRegistryResourceBuilderExtensions.cs Removes redundant id arguments from container-registry exports.
src/Aspire.Hosting/Ats/UserSecretsExports.cs Removes redundant id arguments from ATS user-secrets exports.
src/Aspire.Hosting/Ats/PipelineExports.cs Removes redundant id arguments from ATS pipeline exports.
src/Aspire.Hosting/Ats/NotificationExports.cs Removes redundant id arguments from ATS notification exports.
src/Aspire.Hosting/Ats/ModelExports.cs Removes redundant id arguments from ATS model exports.
src/Aspire.Hosting/Ats/LoggingExports.cs Removes redundant id arguments from ATS logging exports.
src/Aspire.Hosting/Ats/CoreExports.cs Removes redundant id arguments from ATS core exports.
src/Aspire.Hosting/Ats/BuilderExports.cs Removes redundant id arguments from ATS builder/config exports.
src/Aspire.Hosting/Ats/AspireExportAttribute.cs Updates XML docs to reflect derived IDs and when explicit id is needed.
src/Aspire.Hosting.Yarp/YarpResourceExtensions.cs Removes redundant id arguments from YARP exports.
src/Aspire.Hosting.Yarp/ConfigurationBuilder/YarpRoute.cs Removes redundant id arguments from YARP route exports.
src/Aspire.Hosting.Yarp/ConfigurationBuilder/YarpCluster.cs Removes redundant id from YARP cluster export.
src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/ResponseTransformExtensions.cs Removes redundant id arguments from YARP response transform exports.
src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/RequestHeadersTransformExtensions.cs Removes redundant id arguments from YARP request header transform exports.
src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/QueryTransformExtensions.cs Removes redundant id arguments from YARP query transform exports.
src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/HttpMethodTransformExtensions.cs Removes redundant id from YARP HTTP method transform export.
src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/ForwardedTransformExtensions.cs Removes redundant id arguments from YARP forwarded-header transform exports.
src/Aspire.Hosting.Valkey/ValkeyBuilderExtensions.cs Removes redundant id arguments from Valkey exports.
src/Aspire.Hosting.Testing/DistributedApplicationHostingTestingExtensions.cs Removes redundant id from testing helper export.
src/Aspire.Hosting.SqlServer/SqlServerBuilderExtensions.cs Removes redundant id arguments from SQL Server exports.
src/Aspire.Hosting.Seq/SeqBuilderExtensions.cs Removes redundant id arguments from Seq exports.
src/Aspire.Hosting.RemoteHost/AtsCapabilityScanner.cs Changes scanner behavior to derive export IDs when id is omitted.
src/Aspire.Hosting.Redis/RedisBuilderExtensions.cs Removes redundant id arguments from Redis exports.
src/Aspire.Hosting.RabbitMQ/RabbitMQBuilderExtensions.cs Removes redundant id arguments from RabbitMQ exports.
src/Aspire.Hosting.Qdrant/QdrantBuilderExtensions.cs Removes redundant id arguments from Qdrant exports.
src/Aspire.Hosting.Python/PythonAppResourceBuilderExtensions.cs Removes redundant id arguments from Python app exports.
src/Aspire.Hosting.PostgreSQL/PostgresBuilderExtensions.cs Removes redundant id arguments from PostgreSQL exports.
src/Aspire.Hosting.Orleans/OrleansServiceExtensions.cs Removes redundant id arguments from Orleans exports.
src/Aspire.Hosting.Oracle/OracleDatabaseBuilderExtensions.cs Removes redundant id arguments from Oracle exports.
src/Aspire.Hosting.OpenAI/OpenAIExtensions.cs Removes redundant id arguments from OpenAI exports.
src/Aspire.Hosting.Nats/NatsBuilderExtensions.cs Removes redundant id arguments from NATS exports.
src/Aspire.Hosting.MySql/MySqlBuilderExtensions.cs Removes redundant id arguments from MySQL exports.
src/Aspire.Hosting.MongoDB/MongoDBBuilderExtensions.cs Removes redundant id arguments from MongoDB exports.
src/Aspire.Hosting.Milvus/MilvusBuilderExtensions.cs Removes redundant id arguments from Milvus exports.
src/Aspire.Hosting.Maui/MauiWindowsExtensions.cs Removes redundant id from MAUI Windows export.
src/Aspire.Hosting.Maui/MauiProjectResourceExtensions.cs Removes redundant id from MAUI project export.
src/Aspire.Hosting.Maui/MauiOtlpExtensions.cs Removes redundant id from MAUI OTLP export.
src/Aspire.Hosting.Maui/MauiMacCatalystExtensions.cs Removes redundant id from MAUI Mac Catalyst export.
src/Aspire.Hosting.Maui/MauiiOSExtensions.cs Removes redundant id arguments from MAUI iOS exports.
src/Aspire.Hosting.Maui/MauiAndroidExtensions.cs Removes redundant id arguments from MAUI Android exports.
src/Aspire.Hosting.Kubernetes/KubernetesServiceExtensions.cs Removes redundant id from Kubernetes service export.
src/Aspire.Hosting.Kubernetes/KubernetesEnvironmentExtensions.cs Removes redundant id arguments from Kubernetes environment exports.
src/Aspire.Hosting.Keycloak/KeycloakResourceBuilderExtensions.cs Removes redundant id arguments from Keycloak exports.
src/Aspire.Hosting.Kafka/KafkaBuilderExtensions.cs Removes redundant id arguments from Kafka exports.
src/Aspire.Hosting.JavaScript/JavaScriptHostingExtensions.cs Removes redundant id arguments from JavaScript/Node exports.
src/Aspire.Hosting.Integration.Analyzers/AspireExportAnalyzer.cs Uses derived IDs for duplicate detection when id is omitted.
src/Aspire.Hosting.GitHub.Models/GitHubModelsExtensions.cs Removes redundant id from GitHub Models export.
src/Aspire.Hosting.Garnet/GarnetBuilderExtensions.cs Removes redundant id arguments from Garnet exports.
src/Aspire.Hosting.Foundry/Project/ProjectBuilderExtension.cs Removes redundant id arguments from Foundry project exports.
src/Aspire.Hosting.Foundry/HostedAgent/HostedAgentBuilderExtension.cs Removes redundant id from Foundry hosted agent export.
src/Aspire.Hosting.Foundry/FoundryExtensions.cs Removes redundant id arguments from Foundry exports.
src/Aspire.Hosting.Docker/DockerComposeServiceExtensions.cs Removes redundant id from Docker Compose service export.
src/Aspire.Hosting.Docker/DockerComposeEnvironmentExtensions.cs Removes redundant id arguments from Docker Compose environment exports.
src/Aspire.Hosting.Docker/DockerComposeAspireDashboardResourceBuilderExtensions.cs Removes redundant id arguments from Docker Compose dashboard exports.
src/Aspire.Hosting.DevTunnels/DevTunnelResourceBuilderExtensions.cs Removes redundant id from dev tunnel export.
src/Aspire.Hosting.Azure/Provisioning/AzureProvisionerExtensions.cs Removes redundant id from Azure provisioning export.
src/Aspire.Hosting.Azure/ExistingAzureResourceExtensions.cs Removes redundant id arguments from Azure existing-resource exports.
src/Aspire.Hosting.Azure/AzureUserAssignedIdentityExtensions.cs Removes redundant id from Azure identity export.
src/Aspire.Hosting.Azure/AzureResourceExtensions.cs Removes redundant id arguments from Azure resource exports.
src/Aspire.Hosting.Azure/AzureProvisioningResourceExtensions.cs Removes redundant id arguments from Azure provisioning-resource exports.
src/Aspire.Hosting.Azure/AzureEnvironmentResourceExtensions.cs Removes redundant id arguments from Azure environment exports.
src/Aspire.Hosting.Azure/AzureBicepResourceExtensions.cs Removes redundant id arguments from Azure Bicep exports.
src/Aspire.Hosting.Azure.WebPubSub/AzureWebPubSubExtensions.cs Removes redundant id arguments from Web PubSub exports.
src/Aspire.Hosting.Azure.Storage/AzureStorageExtensions.cs Removes redundant id arguments from Azure Storage exports.
src/Aspire.Hosting.Azure.Sql/AzureSqlExtensions.cs Removes redundant id arguments from Azure SQL exports.
src/Aspire.Hosting.Azure.SignalR/AzureSignalRExtensions.cs Removes redundant id from Azure SignalR emulator export.
src/Aspire.Hosting.Azure.ServiceBus/AzureServiceBusExtensions.cs Removes redundant id arguments from Azure Service Bus exports.
src/Aspire.Hosting.Azure.Search/AzureSearchExtensions.cs Removes redundant id from Azure Search export.
src/Aspire.Hosting.Azure.Redis/AzureManagedRedisExtensions.cs Removes redundant id arguments from Azure Managed Redis exports.
src/Aspire.Hosting.Azure.PostgreSQL/AzurePostgresExtensions.cs Removes redundant id arguments from Azure Postgres exports.
src/Aspire.Hosting.Azure.OperationalInsights/AzureLogAnalyticsWorkspaceExtensions.cs Removes redundant id from Log Analytics Workspace export.
src/Aspire.Hosting.Azure.Network/AzureVirtualNetworkExtensions.cs Removes redundant id arguments from Azure VNet/subnet/NSG rule exports.
src/Aspire.Hosting.Azure.Network/AzurePublicIPAddressExtensions.cs Removes redundant id from Azure public IP export.
src/Aspire.Hosting.Azure.Network/AzurePrivateEndpointExtensions.cs Removes redundant id from Azure private endpoint export.
src/Aspire.Hosting.Azure.Network/AzureNetworkSecurityGroupExtensions.cs Removes redundant id arguments from Azure NSG exports.
src/Aspire.Hosting.Azure.Network/AzureNatGatewayExtensions.cs Removes redundant id arguments from Azure NAT gateway exports.
src/Aspire.Hosting.Azure.Kusto/AzureKustoReadWriteDatabaseResourceExtensions.cs Removes redundant id from Kusto script export.
src/Aspire.Hosting.Azure.Kusto/AzureKustoBuilderExtensions.cs Removes redundant id arguments from Kusto exports.
src/Aspire.Hosting.Azure.KeyVault/AzureKeyVaultResourceExtensions.cs Removes redundant id arguments from Key Vault exports.
src/Aspire.Hosting.Azure.Functions/DurableTask/DurableTaskResourceExtensions.cs Removes redundant id arguments from Durable Task exports.
src/Aspire.Hosting.Azure.Functions/AzureFunctionsProjectResourceExtensions.cs Removes redundant id arguments from Azure Functions exports.
src/Aspire.Hosting.Azure.EventHubs/AzureEventHubsExtensions.cs Removes redundant id arguments from Event Hubs exports.
src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBExtensions.cs Removes redundant id arguments from Cosmos DB exports.
src/Aspire.Hosting.Azure.ContainerRegistry/AzureContainerRegistryExtensions.cs Removes redundant id arguments from ACR exports.
src/Aspire.Hosting.Azure.CognitiveServices/AzureOpenAIExtensions.cs Removes redundant id arguments from Azure OpenAI exports.
src/Aspire.Hosting.Azure.AppService/AzureAppServiceEnvironmentExtensions.cs Removes redundant id arguments from App Service environment exports.
src/Aspire.Hosting.Azure.AppService/AzureAppServiceComputeResourceExtensions.cs Removes redundant id arguments from App Service compute exports.
src/Aspire.Hosting.Azure.ApplicationInsights/AzureApplicationInsightsExtensions.cs Removes redundant id arguments from Application Insights exports.
src/Aspire.Hosting.Azure.AppContainers/ContainerAppExtensions.cs Removes redundant id from Container App Job publish export.
src/Aspire.Hosting.Azure.AppContainers/AzureContainerAppExtensions.cs Removes redundant id arguments from Container Apps environment exports.
src/Aspire.Hosting.Azure.AppConfiguration/AzureAppConfigurationExtensions.cs Removes redundant id arguments from App Configuration exports.

Comment thread src/Aspire.Hosting.RemoteHost/AtsCapabilityScanner.cs
Comment thread src/Aspire.Hosting.Integration.Analyzers/AspireExportAnalyzer.cs Outdated
Comment thread src/Aspire.Hosting.RemoteHost/AtsCapabilityScanner.cs
Comment thread src/Aspire.Hosting.Integration.Analyzers/AspireExportAnalyzer.cs
Comment thread src/Aspire.Hosting/Ats/AspireExportAttribute.cs
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 1, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dnceng.pkgs.visualstudio.com
    • Triggering command: /usr/share/dotnet/dotnet dotnet build src/Aspire.Hosting.EntityFrameworkCore/Aspire.Hosting.EntityFrameworkCore.csproj /p:TreatWarningsAsErrors=false (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Comment thread src/Aspire.Hosting.EntityFrameworkCore/EFMigrationResourceBuilderExtensions.cs Outdated
Comment thread src/Aspire.Hosting.EntityFrameworkCore/EFResourceBuilderExtensions.cs Outdated
Comment thread src/Aspire.Hosting.Integration.Analyzers/AspireExportAnalyzer.cs Outdated
Comment thread src/Aspire.Hosting.Azure.EventHubs/AzureEventHubsExtensions.cs
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 1, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dnceng.pkgs.visualstudio.com
    • Triggering command: /usr/share/dotnet/dotnet dotnet build src/Aspire.Hosting.EntityFrameworkCore/Aspire.Hosting.EntityFrameworkCore.csproj (dns block)
    • Triggering command: /usr/share/dotnet/dotnet dotnet build src/Aspire.Hosting/Aspire.Hosting.csproj (dns block)
    • Triggering command: /usr/share/dotnet/dotnet dotnet build src/Aspire.Hosting/Aspire.Hosting.csproj /p:TreatWarningsAsErrors=false (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 1, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dnceng.pkgs.visualstudio.com
    • Triggering command: /usr/share/dotnet/dotnet dotnet build src/Aspire.Hosting/Aspire.Hosting.csproj --no-incremental (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@AndriySvyryd AndriySvyryd changed the title Be consistent with id parameter in AspireExportAttribute usages Remove redundant id in AspireExportAttribute usages Apr 1, 2026
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
@AndriySvyryd AndriySvyryd force-pushed the copilot/remove-id-parameter-where-unnecessary branch from adce063 to 26ad309 Compare April 1, 2026 21:52
@JamesNK JamesNK self-requested a review April 2, 2026 01:28
Comment thread src/Aspire.Hosting.Integration.Analyzers/AspireExportAnalyzer.cs Outdated
…T011 and effectiveExportId

Agent-Logs-Url: https://github.com/microsoft/aspire/sessions/d7430cb3-5ccf-44a2-8d5d-d607612c47f7

Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 2, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dnceng.pkgs.visualstudio.com
    • Triggering command: /usr/share/dotnet/dotnet dotnet test tests/Aspire.Hosting.Analyzers.Tests/Aspire.Hosting.Analyzers.Tests.csproj -- --filter-not-trait quarantined=true --filter-not-trait outerloop=true (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copy link
Copy Markdown
Member

@JamesNK JamesNK left a comment

Choose a reason for hiding this comment

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

Two minor findings (contradictory dual-diagnostic scenario and missing instance-method test coverage for ASPIREEXPORT011). Otherwise LGTM — the analyzer/scanner ID derivation logic is consistent, bulk removals are correct, and disambiguation cases are properly handled.

@sebastienros please also approve before merge.

Comment thread tests/Aspire.Hosting.Analyzers.Tests/AspireExportAnalyzerTests.cs
Comment thread src/Aspire.Hosting.Integration.Analyzers/AspireExportAnalyzer.cs
@davidfowl
Copy link
Copy Markdown
Contributor

@AndriySvyryd wait on @sebastienros to merge this.

@davidfowl davidfowl closed this Apr 2, 2026
@davidfowl davidfowl reopened this Apr 2, 2026
@davidfowl
Copy link
Copy Markdown
Contributor

woops

…hod ExposeMethods=true tests

Agent-Logs-Url: https://github.com/microsoft/aspire/sessions/52cb7aa6-8962-4b6e-9695-b3cdad28c19f

Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 2, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dnceng.pkgs.visualstudio.com
    • Triggering command: /usr/share/dotnet/dotnet dotnet test tests/Aspire.Hosting.Analyzers.Tests/Aspire.Hosting.Analyzers.Tests.csproj -- --filter-not-trait quarantined=true --filter-not-trait outerloop=true (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@sebastienros
Copy link
Copy Markdown
Contributor

Right now no snapshots or polyglot test apphost are touched, which is a good sign that this isn't breaking anything. When the tests run (currently blocked on conflict) we'll see if anything is impacted.

@AndriySvyryd
Copy link
Copy Markdown
Member

When the tests run (currently blocked on conflict) we'll see if anything is impacted.

Auto-merge should be enabled, otherwise this will constantly be blocked by a conflict

@AndriySvyryd AndriySvyryd enabled auto-merge (squash) April 3, 2026 00:02
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

Re-running the failed jobs in the CI workflow for this pull request because 1 job was identified as retry-safe transient failures in the CI run attempt.
GitHub was asked to rerun all failed jobs for that attempt, and the rerun is being tracked in the rerun attempt.
The job links below point to the failed attempt jobs that matched the retry-safe transient failure rules.

@AndriySvyryd AndriySvyryd merged commit 535fad9 into main Apr 3, 2026
521 of 524 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

🎬 CLI E2E Test Recordings — 55 recordings uploaded (commit 7cdb9eb)

View recordings
Test Recording
AddPackageInteractiveWhileAppHostRunningDetached ▶️ View Recording
AddPackageWhileAppHostRunningDetached ▶️ View Recording
AgentCommands_AllHelpOutputs_AreCorrect ▶️ View Recording
AgentInitCommand_DefaultSelection_InstallsSkillOnly ▶️ View Recording
AgentInitCommand_MigratesDeprecatedConfig ▶️ View Recording
AspireAddPackageVersionToDirectoryPackagesProps ▶️ View Recording
AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps ▶️ View Recording
Banner_DisplayedOnFirstRun ▶️ View Recording
Banner_DisplayedWithExplicitFlag ▶️ View Recording
Banner_NotDisplayedWithNoLogoFlag ▶️ View Recording
CertificatesClean_RemovesCertificates ▶️ View Recording
CertificatesTrust_WithNoCert_CreatesAndTrustsCertificate ▶️ View Recording
CertificatesTrust_WithUntrustedCert_TrustsCertificate ▶️ View Recording
ConfigSetGet_CreatesNestedJsonFormat ▶️ View Recording
CreateAndRunAspireStarterProject ▶️ View Recording
CreateAndRunAspireStarterProjectWithBundle ▶️ View Recording
CreateAndRunEmptyAppHostProject ▶️ View Recording
CreateAndRunJavaEmptyAppHostProject ▶️ View Recording
CreateAndRunJsReactProject ▶️ View Recording
CreateAndRunPythonReactProject ▶️ View Recording
CreateAndRunTypeScriptEmptyAppHostProject ▶️ View Recording
CreateAndRunTypeScriptStarterProject ▶️ View Recording
CreateJavaAppHostWithViteApp ▶️ View Recording
CreateStartAndStopAspireProject ▶️ View Recording
CreateTypeScriptAppHostWithViteApp ▶️ View Recording
DescribeCommandResolvesReplicaNames ▶️ View Recording
DescribeCommandShowsRunningResources ▶️ View Recording
DetachFormatJsonProducesValidJson ▶️ View Recording
DoctorCommand_DetectsDeprecatedAgentConfig ▶️ View Recording
DoctorCommand_WithSslCertDir_ShowsTrusted ▶️ View Recording
DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted ▶️ View Recording
GlobalMigration_HandlesCommentsAndTrailingCommas ▶️ View Recording
GlobalMigration_HandlesMalformedLegacyJson ▶️ View Recording
GlobalMigration_PreservesAllValueTypes ▶️ View Recording
GlobalMigration_SkipsWhenNewConfigExists ▶️ View Recording
GlobalSettings_MigratedFromLegacyFormat ▶️ View Recording
InvalidAppHostPathWithComments_IsHealedOnRun ▶️ View Recording
LegacySettingsMigration_AdjustsRelativeAppHostPath ▶️ View Recording
LogsCommandShowsResourceLogs ▶️ View Recording
PsCommandListsRunningAppHost ▶️ View Recording
PsFormatJsonOutputsOnlyJsonToStdout ▶️ View Recording
PublishWithDockerComposeServiceCallbackSucceeds ▶️ View Recording
RestoreGeneratesSdkFiles ▶️ View Recording
RestoreSupportsConfigOnlyHelperPackageAndCrossPackageTypes ▶️ View Recording
RunFromParentDirectory_UsesExistingConfigNearAppHost ▶️ View Recording
RunWithMissingAwaitShowsHelpfulError ▶️ View Recording
SecretCrudOnDotNetAppHost ▶️ View Recording
SecretCrudOnTypeScriptAppHost ▶️ View Recording
StagingChannel_ConfigureAndVerifySettings_ThenSwitchChannels ▶️ View Recording
StopAllAppHostsFromAppHostDirectory ▶️ View Recording
StopAllAppHostsFromUnrelatedDirectory ▶️ View Recording
StopNonInteractiveMultipleAppHostsShowsError ▶️ View Recording
StopNonInteractiveSingleAppHost ▶️ View Recording
StopWithNoRunningAppHostExitsSuccessfully ▶️ View Recording
TypeScriptAppHostWithProjectReferenceIntegration ▶️ View Recording

📹 Recordings uploaded automatically from CI run #23926834693

@joperezr joperezr added this to the 13.3 milestone Apr 14, 2026
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.

Be consistent with id parameter in AspireExportAttribute usages

8 participants