diff --git a/playground/AspireWithJavaScript/AspireJavaScript.AppHost/AppHost.cs b/playground/AspireWithJavaScript/AspireJavaScript.AppHost/AppHost.cs index 1f4668d1147..3e2a1624b32 100644 --- a/playground/AspireWithJavaScript/AspireJavaScript.AppHost/AppHost.cs +++ b/playground/AspireWithJavaScript/AspireJavaScript.AppHost/AppHost.cs @@ -1,5 +1,3 @@ -#pragma warning disable ASPIREEXTENSION001 // Type is for evaluation purposes only - var builder = DistributedApplication.CreateBuilder(args); var weatherApi = builder.AddProject("weatherapi") @@ -32,22 +30,20 @@ .WithExternalHttpEndpoints() .PublishAsDockerFile(); -#pragma warning disable ASPIREEXTENSION001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. var reactvite = builder.AddViteApp("reactvite", "../AspireJavaScript.Vite") .WithReference(weatherApi) .WithEnvironment("BROWSER", "none") .WithExternalHttpEndpoints(); -#pragma warning restore ASPIREEXTENSION001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. // Demonstrate the new publish methods: // PublishAsStaticWebsite: deploys the Vite app as a static site served by YARP. // With apiPath/apiTarget, YARP reverse-proxies /api/* to the weather API via service discovery — no CORS needed. -#pragma warning disable ASPIREEXTENSION001 +#pragma warning disable ASPIREJAVASCRIPT001 builder.AddViteApp("vite-static", "../AspireJavaScript.Vite") .WithExternalHttpEndpoints() .PublishAsStaticWebsite("/api", weatherApi); -#pragma warning restore ASPIREEXTENSION001 +#pragma warning restore ASPIREJAVASCRIPT001 // PublishAsNodeServer: for frameworks that produce a self-contained Node.js server artifact. // Example: SvelteKit with adapter-node builds to build/index.js, Nuxt/TanStack build to .output/server/index.mjs diff --git a/playground/AspireWithNode/AspireWithNode.AppHost/AppHost.cs b/playground/AspireWithNode/AspireWithNode.AppHost/AppHost.cs index a779602c52f..c27d38d22a0 100644 --- a/playground/AspireWithNode/AspireWithNode.AppHost/AppHost.cs +++ b/playground/AspireWithNode/AspireWithNode.AppHost/AppHost.cs @@ -1,4 +1,3 @@ -#pragma warning disable ASPIREEXTENSION001 #pragma warning disable ASPIRECERTIFICATES001 using Microsoft.Extensions.Hosting; diff --git a/src/Aspire.Hosting.Azure.Kubernetes/AksSkuTier.cs b/src/Aspire.Hosting.Azure.Kubernetes/AksSkuTier.cs deleted file mode 100644 index f2f10865ac4..00000000000 --- a/src/Aspire.Hosting.Azure.Kubernetes/AksSkuTier.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace Aspire.Hosting.Azure.Kubernetes; - -/// -/// Specifies the SKU tier for an AKS cluster. -/// -public enum AksSkuTier -{ - /// - /// Free tier with no SLA. - /// - Free, - - /// - /// Standard tier with financially backed SLA. - /// - Standard, - - /// - /// Premium tier with mission-critical features. - /// - Premium -} diff --git a/src/Aspire.Hosting.Azure.Kubernetes/AzureKubernetesEnvironmentExtensions.cs b/src/Aspire.Hosting.Azure.Kubernetes/AzureKubernetesEnvironmentExtensions.cs index 178c47b99a7..e722d41626a 100644 --- a/src/Aspire.Hosting.Azure.Kubernetes/AzureKubernetesEnvironmentExtensions.cs +++ b/src/Aspire.Hosting.Azure.Kubernetes/AzureKubernetesEnvironmentExtensions.cs @@ -377,14 +377,6 @@ private static void ConfigureAksInfrastructure(AzureResourceInfrastructure infra { var aksResource = (AzureKubernetesEnvironmentResource)infrastructure.AspireResource; - var skuTier = aksResource.SkuTier switch - { - AksSkuTier.Free => ManagedClusterSkuTier.Free, - AksSkuTier.Standard => ManagedClusterSkuTier.Standard, - AksSkuTier.Premium => ManagedClusterSkuTier.Premium, - _ => ManagedClusterSkuTier.Free - }; - // Create the AKS managed cluster var aks = new ContainerServiceManagedCluster(aksResource.GetBicepIdentifier()) { @@ -395,7 +387,7 @@ private static void ConfigureAksInfrastructure(AzureResourceInfrastructure infra Sku = new ManagedClusterSku { Name = ManagedClusterSkuName.Base, - Tier = skuTier + Tier = ManagedClusterSkuTier.Free }, DnsPrefix = $"{aksResource.Name}-dns", Tags = { { "aspire-resource-name", aksResource.Name } } diff --git a/src/Aspire.Hosting.Azure.Kubernetes/AzureKubernetesEnvironmentResource.AksPipeline.cs b/src/Aspire.Hosting.Azure.Kubernetes/AzureKubernetesEnvironmentResource.AksPipeline.cs index 0ada6ba3fd2..335d47b6d4a 100644 --- a/src/Aspire.Hosting.Azure.Kubernetes/AzureKubernetesEnvironmentResource.AksPipeline.cs +++ b/src/Aspire.Hosting.Azure.Kubernetes/AzureKubernetesEnvironmentResource.AksPipeline.cs @@ -8,7 +8,6 @@ using System.Text; using System.Text.RegularExpressions; using Aspire.Hosting.ApplicationModel; -using Aspire.Hosting.Azure.Kubernetes; using Aspire.Hosting.Dcp.Process; using Aspire.Hosting.Kubernetes; using Aspire.Hosting.Kubernetes.Resources; @@ -17,7 +16,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -namespace Aspire.Hosting.Azure; +namespace Aspire.Hosting.Azure.Kubernetes; /// /// AKS-specific pipeline step implementations for . diff --git a/src/Aspire.Hosting.Azure.Kubernetes/AzureKubernetesEnvironmentResource.cs b/src/Aspire.Hosting.Azure.Kubernetes/AzureKubernetesEnvironmentResource.cs index 2cce7bdb839..d43b6cdee3e 100644 --- a/src/Aspire.Hosting.Azure.Kubernetes/AzureKubernetesEnvironmentResource.cs +++ b/src/Aspire.Hosting.Azure.Kubernetes/AzureKubernetesEnvironmentResource.cs @@ -5,11 +5,10 @@ #pragma warning disable ASPIREPIPELINES001 #pragma warning disable ASPIREAZURE001 -using Aspire.Hosting.Azure.Kubernetes; using Aspire.Hosting.Kubernetes; using Aspire.Hosting.Pipelines; -namespace Aspire.Hosting.Azure; +namespace Aspire.Hosting.Azure.Kubernetes; /// /// Represents an Azure Kubernetes Service (AKS) environment resource that provisions @@ -112,11 +111,6 @@ public AzureKubernetesEnvironmentResource( /// internal string? KubernetesVersion { get; set; } - /// - /// Gets or sets the SKU tier for the AKS cluster. - /// - internal AksSkuTier SkuTier { get; set; } = AksSkuTier.Free; - /// /// Gets or sets whether OIDC issuer is enabled on the cluster. /// diff --git a/src/Aspire.Hosting.Azure.Kubernetes/AzureKubernetesIngressExtensions.cs b/src/Aspire.Hosting.Azure.Kubernetes/AzureKubernetesIngressExtensions.cs index abdbcc29c7e..2775956cadd 100644 --- a/src/Aspire.Hosting.Azure.Kubernetes/AzureKubernetesIngressExtensions.cs +++ b/src/Aspire.Hosting.Azure.Kubernetes/AzureKubernetesIngressExtensions.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using Aspire.Hosting.ApplicationModel; -using Aspire.Hosting.Azure; +using Aspire.Hosting.Azure.Kubernetes; using Aspire.Hosting.Kubernetes; namespace Aspire.Hosting; diff --git a/src/Aspire.Hosting.EntityFrameworkCore/EFMigrationResource.cs b/src/Aspire.Hosting.EntityFrameworkCore/EFMigrationResource.cs index c0362204200..4aafb8c3c12 100644 --- a/src/Aspire.Hosting.EntityFrameworkCore/EFMigrationResource.cs +++ b/src/Aspire.Hosting.EntityFrameworkCore/EFMigrationResource.cs @@ -5,22 +5,22 @@ using Aspire.Hosting.ApplicationModel; -namespace Aspire.Hosting; +namespace Aspire.Hosting.EntityFrameworkCore; /// /// Represents an EF Core migration resource associated with a project. /// /// The name of the resource. /// The parent project resource that contains the DbContext. -/// The fully qualified name of the DbContext type, or null to auto-detect. +/// The fully qualified name of the DbContext type, or null to auto-detect. /// /// The resource inherits from so it can be published as a container image /// that runs the migration bundle at deploy time when -/// +/// /// is called with publishContainer: true. /// [AspireExport(ExposeProperties = true)] -public class EFMigrationResource(string name, ProjectResource projectResource, string? contextTypeName) +public class EFMigrationResource(string name, ProjectResource projectResource, string? dbContextTypeName) : ContainerResource(name) { /// @@ -35,7 +35,7 @@ public class EFMigrationResource(string name, ProjectResource projectResource, s /// This property is used to specify which DbContext to use when the project contains multiple DbContext types. /// When null, the EF Core tools will auto-detect the DbContext to use. /// - public string? ContextTypeName { get; } = contextTypeName; + public string? DbContextTypeName { get; } = dbContextTypeName; /// /// Gets or sets whether a migration script should be generated during publishing. diff --git a/src/Aspire.Hosting.EntityFrameworkCore/EFMigrationResourceBuilderExtensions.cs b/src/Aspire.Hosting.EntityFrameworkCore/EFMigrationResourceBuilderExtensions.cs index c219697862b..c8c6d396766 100644 --- a/src/Aspire.Hosting.EntityFrameworkCore/EFMigrationResourceBuilderExtensions.cs +++ b/src/Aspire.Hosting.EntityFrameworkCore/EFMigrationResourceBuilderExtensions.cs @@ -4,6 +4,7 @@ #pragma warning disable ASPIREPIPELINES001 // PipelineStepAnnotation is experimental; used to wire migration-bundle pipeline steps. using Aspire.Hosting.ApplicationModel; +using Aspire.Hosting.EntityFrameworkCore; using Aspire.Hosting.Pipelines; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; diff --git a/src/Aspire.Hosting.EntityFrameworkCore/EFResourceBuilderExtensions.cs b/src/Aspire.Hosting.EntityFrameworkCore/EFResourceBuilderExtensions.cs index 30ba737a0f2..e8e02908d10 100644 --- a/src/Aspire.Hosting.EntityFrameworkCore/EFResourceBuilderExtensions.cs +++ b/src/Aspire.Hosting.EntityFrameworkCore/EFResourceBuilderExtensions.cs @@ -5,6 +5,7 @@ #pragma warning disable ASPIREDOTNETTOOL using Aspire.Hosting.ApplicationModel; +using Aspire.Hosting.EntityFrameworkCore; using Aspire.Hosting.Pipelines; using System.Diagnostics; using System.Text; @@ -33,7 +34,7 @@ private static string GetShortTypeName(string? fullTypeName) /// /// The resource builder for the project. /// The name of the migration resource. - /// The fully qualified name of the DbContext type to manage migrations for. + /// The fully qualified name of the DbContext type to manage migrations for. /// An EF migration resource builder for chaining additional configuration. /// Thrown if migrations for this context type have already been added. /// @@ -50,13 +51,13 @@ private static string GetShortTypeName(string? fullTypeName) public static IResourceBuilder AddEFMigrations( this IResourceBuilder builder, [ResourceName] string name, - string contextTypeName) + string dbContextTypeName) { ArgumentNullException.ThrowIfNull(builder); ArgumentException.ThrowIfNullOrEmpty(name); - ArgumentException.ThrowIfNullOrEmpty(contextTypeName); + ArgumentException.ThrowIfNullOrEmpty(dbContextTypeName); - return AddEFMigrationsCore(builder, name, contextTypeName, configureToolResource: null); + return AddEFMigrationsCore(builder, name, dbContextTypeName, configureToolResource: null); } /// @@ -64,7 +65,7 @@ public static IResourceBuilder AddEFMigrations( /// /// The resource builder for the project. /// The name of the migration resource. - /// The fully qualified name of the DbContext type to manage migrations for. + /// The fully qualified name of the DbContext type to manage migrations for. /// Optional callback to configure the dotnet-ef tool resource used for migrations. /// An EF migration resource builder for chaining additional configuration. /// Thrown if migrations for this context type have already been added. @@ -82,14 +83,14 @@ public static IResourceBuilder AddEFMigrations( public static IResourceBuilder AddEFMigrations( this IResourceBuilder builder, [ResourceName] string name, - string contextTypeName, + string dbContextTypeName, Action>? configureToolResource) { ArgumentNullException.ThrowIfNull(builder); ArgumentException.ThrowIfNullOrEmpty(name); - ArgumentException.ThrowIfNullOrEmpty(contextTypeName); + ArgumentException.ThrowIfNullOrEmpty(dbContextTypeName); - return AddEFMigrationsCore(builder, name, contextTypeName, configureToolResource); + return AddEFMigrationsCore(builder, name, dbContextTypeName, configureToolResource); } /// @@ -106,7 +107,7 @@ public static IResourceBuilder AddEFMigrations( ArgumentNullException.ThrowIfNull(builder); ArgumentException.ThrowIfNullOrEmpty(name); - return AddEFMigrationsCore(builder, name, contextTypeName: null, configureToolResource: null); + return AddEFMigrationsCore(builder, name, dbContextTypeName: null, configureToolResource: null); } /// @@ -125,13 +126,13 @@ public static IResourceBuilder AddEFMigrations( ArgumentNullException.ThrowIfNull(builder); ArgumentException.ThrowIfNullOrEmpty(name); - return AddEFMigrationsCore(builder, name, contextTypeName: null, configureToolResource); + return AddEFMigrationsCore(builder, name, dbContextTypeName: null, configureToolResource); } private static IResourceBuilder AddEFMigrationsCore( IResourceBuilder builder, string name, - string? contextTypeName, + string? dbContextTypeName, Action>? configureToolResource) { // Check for duplicate context types and null/non-null conflicts @@ -140,15 +141,15 @@ private static IResourceBuilder AddEFMigrationsCore( .Where(r => r.ProjectResource == builder.Resource) .ToList(); - if (contextTypeName != null) + if (dbContextTypeName != null) { - if (existingMigrations.Any(r => r.ContextTypeName == contextTypeName)) + if (existingMigrations.Any(r => r.DbContextTypeName == dbContextTypeName)) { throw new InvalidOperationException( - $"The DbContext type '{GetShortTypeName(contextTypeName)}' has already been registered for EF migrations on resource '{builder.Resource.Name}'."); + $"The DbContext type '{GetShortTypeName(dbContextTypeName)}' has already been registered for EF migrations on resource '{builder.Resource.Name}'."); } - if (existingMigrations.Any(r => r.ContextTypeName == null)) + if (existingMigrations.Any(r => r.DbContextTypeName == null)) { throw new InvalidOperationException( $"Cannot add migrations for a specific DbContext type when auto-detected migrations have already been registered on resource '{builder.Resource.Name}'."); @@ -163,7 +164,7 @@ private static IResourceBuilder AddEFMigrationsCore( } } - var migrationResource = new EFMigrationResource(name, builder.Resource, contextTypeName) + var migrationResource = new EFMigrationResource(name, builder.Resource, dbContextTypeName) { ConfigureToolResource = configureToolResource }; @@ -180,7 +181,7 @@ private static IResourceBuilder AddEFMigrationsCore( .WithIconName("Database") .WithPipelineStepFactory(CreateMigrationPipelineStep); - AddEFMigrationCommands(innerBuilder, migrationResource, contextTypeName); + AddEFMigrationCommands(innerBuilder, migrationResource, dbContextTypeName); return innerBuilder; } @@ -270,7 +271,7 @@ private static async Task ExecutePublishPipelineOperationAsync( using var executor = new EFCoreOperationExecutor( migrationResource.ProjectResource, migrationResource.MigrationsProjectPath, - migrationResource.ContextTypeName, + migrationResource.DbContextTypeName, logger, stepContext.CancellationToken, stepContext.Services, @@ -520,9 +521,9 @@ await notificationService.PublishUpdateAsync(toolResource, s => s with private static void AddEFMigrationCommands( IResourceBuilder migrationBuilder, EFMigrationResource migrationResource, - string? contextTypeName) + string? dbContextTypeName) { - var contextShortName = GetShortTypeName(contextTypeName); + var contextShortName = GetShortTypeName(dbContextTypeName); // Create hidden DotnetToolResource for running EF commands var toolName = $"ef-tool-{migrationResource.Name}"; @@ -718,7 +719,7 @@ private static async Task ExecuteWithStateManagementAsync( using var executor = new EFCoreOperationExecutor( migrationResource.ProjectResource, migrationResource.MigrationsProjectPath, - migrationResource.ContextTypeName, + migrationResource.DbContextTypeName, logger, context.CancellationToken, context.ServiceProvider, diff --git a/src/Aspire.Hosting.JavaScript/JavaScriptHostingExtensions.cs b/src/Aspire.Hosting.JavaScript/JavaScriptHostingExtensions.cs index 8bcdfbde18a..2f36f3f8bd2 100644 --- a/src/Aspire.Hosting.JavaScript/JavaScriptHostingExtensions.cs +++ b/src/Aspire.Hosting.JavaScript/JavaScriptHostingExtensions.cs @@ -355,7 +355,7 @@ public static IResourceBuilder AddJavaScriptApp(this IDis /// To add an API reverse-proxy, use the overload that accepts an apiPath and apiTarget. /// /// - [Experimental("ASPIREEXTENSION001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")] + [Experimental("ASPIREJAVASCRIPT001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")] [AspireExportIgnore(Reason = "Use the polyglot-compatible overload instead.")] public static IResourceBuilder PublishAsStaticWebsite( this IResourceBuilder builder, @@ -390,7 +390,7 @@ public static IResourceBuilder PublishAsStaticWebsite( /// work correctly across all deployment targets (Docker Compose, Azure App Service, etc.). /// /// - [Experimental("ASPIREEXTENSION001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")] + [Experimental("ASPIREJAVASCRIPT001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")] [AspireExportIgnore(Reason = "Use the polyglot-compatible overload instead.")] public static IResourceBuilder PublishAsStaticWebsite( this IResourceBuilder builder, @@ -410,6 +410,7 @@ public static IResourceBuilder PublishAsStaticWebsite( /// in a single options object rather than positional args. /// #pragma warning disable ASPIREEXPORT009 // Polyglot entry point — collision is intentional + [Experimental("ASPIREJAVASCRIPT001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")] [AspireExport("publishAsStaticWebsite", Description = "Publishes the JavaScript application as a standalone static website using YARP.")] internal static IResourceBuilder PublishAsStaticWebsitePolyglot( #pragma warning restore ASPIREEXPORT009 @@ -430,6 +431,7 @@ internal static IResourceBuilder PublishAsStaticWebsitePolyglot PublishAsStaticWebsiteCore( IResourceBuilder builder, string? apiPath, @@ -542,6 +544,7 @@ private static IResourceBuilder PublishAsStaticWebsiteCore /// the built output directory is copied into the runtime container, not the full application source. /// /// + [Experimental("ASPIREJAVASCRIPT001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")] [AspireExport(Description = "Publishes the JavaScript application as a standalone Node.js server that runs a built artifact directly.")] public static IResourceBuilder PublishAsNodeServer(this IResourceBuilder builder, string entryPoint, string outputPath = ".") where TResource : JavaScriptAppResource @@ -605,6 +608,7 @@ public static IResourceBuilder PublishAsNodeServer(this IR /// use instead for a smaller runtime image. /// /// + [Experimental("ASPIREJAVASCRIPT001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")] [AspireExport(Description = "Publishes the JavaScript application as a Node.js server that uses a package manager script at runtime.")] public static IResourceBuilder PublishAsNpmScript(this IResourceBuilder builder, string startScriptName = "start", string? runScriptArguments = null) where TResource : JavaScriptAppResource @@ -1084,6 +1088,7 @@ public static IResourceBuilder AddViteApp(this IDistributedAppl /// /// /// + [Experimental("ASPIREJAVASCRIPT001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")] [AspireExport(Description = "Adds a Next.js application resource")] public static IResourceBuilder AddNextJsApp(this IDistributedApplicationBuilder builder, [ResourceName] string name, string appDirectory, string runScriptName = "dev") { @@ -1170,6 +1175,7 @@ public static IResourceBuilder AddNextJsApp(this IDistributed /// to suppress those checks when the configuration is set dynamically or via an external /// mechanism that cannot be detected by static file inspection. /// + [Experimental("ASPIREJAVASCRIPT001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")] [AspireExport(Description = "Disables deploy-time build validation checks for the Next.js application.")] public static IResourceBuilder DisableBuildValidation(this IResourceBuilder builder) { diff --git a/src/Aspire.Hosting.JavaScript/NextJsAppResource.cs b/src/Aspire.Hosting.JavaScript/NextJsAppResource.cs index 60a2b3dc681..3c776a8a018 100644 --- a/src/Aspire.Hosting.JavaScript/NextJsAppResource.cs +++ b/src/Aspire.Hosting.JavaScript/NextJsAppResource.cs @@ -1,6 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; + namespace Aspire.Hosting.JavaScript; /// @@ -10,5 +12,6 @@ namespace Aspire.Hosting.JavaScript; /// The command to execute the application. /// The working directory from which the application command is executed. [AspireExport(ExposeProperties = true)] +[Experimental("ASPIREJAVASCRIPT001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")] public class NextJsAppResource(string name, string command, string workingDirectory) : JavaScriptAppResource(name, command, workingDirectory); diff --git a/src/Aspire.Hosting.JavaScript/PublishAsStaticWebsiteOptions.cs b/src/Aspire.Hosting.JavaScript/PublishAsStaticWebsiteOptions.cs index cf7bc9ded06..ee8c40fbbd0 100644 --- a/src/Aspire.Hosting.JavaScript/PublishAsStaticWebsiteOptions.cs +++ b/src/Aspire.Hosting.JavaScript/PublishAsStaticWebsiteOptions.cs @@ -1,11 +1,14 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; + namespace Aspire.Hosting.JavaScript; /// /// Options for configuring the static website publish mode. /// +[Experimental("ASPIREJAVASCRIPT001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")] public class PublishAsStaticWebsiteOptions { /// diff --git a/src/Aspire.Hosting/Dcp/ContainerCreator.cs b/src/Aspire.Hosting/Dcp/ContainerCreator.cs index fe377d8bef6..a9364dcf69e 100644 --- a/src/Aspire.Hosting/Dcp/ContainerCreator.cs +++ b/src/Aspire.Hosting/Dcp/ContainerCreator.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#pragma warning disable ASPIREEXTENSION001 #pragma warning disable ASPIRECERTIFICATES001 #pragma warning disable ASPIRECONTAINERSHELLEXECUTION001 diff --git a/src/Aspire.Hosting/Dcp/DcpExecutor.cs b/src/Aspire.Hosting/Dcp/DcpExecutor.cs index c9e730c4fcc..49c76b4b9fa 100644 --- a/src/Aspire.Hosting/Dcp/DcpExecutor.cs +++ b/src/Aspire.Hosting/Dcp/DcpExecutor.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#pragma warning disable ASPIREEXTENSION001 #pragma warning disable ASPIRECERTIFICATES001 #pragma warning disable ASPIRECONTAINERSHELLEXECUTION001 diff --git a/src/Aspire.Hosting/Pipelines/WellKnownPipelineSteps.cs b/src/Aspire.Hosting/Pipelines/WellKnownPipelineSteps.cs index dca3b069fcb..4b3f0b97459 100644 --- a/src/Aspire.Hosting/Pipelines/WellKnownPipelineSteps.cs +++ b/src/Aspire.Hosting/Pipelines/WellKnownPipelineSteps.cs @@ -83,12 +83,14 @@ public static class WellKnownPipelineSteps /// /// The step that runs before the application starts. /// + [AspireValue("WellKnownPipelineSteps")] public const string BeforeStart = "before-start"; /// /// The step that checks whether the container runtime (e.g., Docker or Podman) is running. /// Build steps that need a container runtime should depend on this step. /// + [AspireValue("WellKnownPipelineSteps")] public const string CheckContainerRuntime = "check-container-runtime"; /// diff --git a/tests/Aspire.Hosting.Azure.Kubernetes.Tests/AzureKubernetesEnvironmentExtensionsTests.cs b/tests/Aspire.Hosting.Azure.Kubernetes.Tests/AzureKubernetesEnvironmentExtensionsTests.cs index 0332d4c4c6a..4fdfe112cea 100644 --- a/tests/Aspire.Hosting.Azure.Kubernetes.Tests/AzureKubernetesEnvironmentExtensionsTests.cs +++ b/tests/Aspire.Hosting.Azure.Kubernetes.Tests/AzureKubernetesEnvironmentExtensionsTests.cs @@ -76,7 +76,6 @@ public void AddAzureKubernetesEnvironment_DefaultConfiguration() Assert.True(aks.Resource.OidcIssuerEnabled); Assert.True(aks.Resource.WorkloadIdentityEnabled); - Assert.Equal(AksSkuTier.Free, aks.Resource.SkuTier); Assert.Null(aks.Resource.KubernetesVersion); Assert.False(aks.Resource.IsPrivateCluster); Assert.False(aks.Resource.ContainerInsightsEnabled); diff --git a/tests/Aspire.Hosting.CodeGeneration.Go.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.go b/tests/Aspire.Hosting.CodeGeneration.Go.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.go index a65935ed11d..cd14e7465d5 100644 --- a/tests/Aspire.Hosting.CodeGeneration.Go.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.go +++ b/tests/Aspire.Hosting.CodeGeneration.Go.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.go @@ -554,8 +554,10 @@ var TestConfigs = struct { } var WellKnownPipelineSteps = struct { + BeforeStart string Build string BuildPrereq string + CheckContainerRuntime string Deploy string DeployPrereq string Destroy string @@ -568,8 +570,10 @@ var WellKnownPipelineSteps = struct { PushPrereq string ValidateComputeEnvironments string }{ + BeforeStart: "before-start", Build: "build", BuildPrereq: "build-prereq", + CheckContainerRuntime: "check-container-runtime", Deploy: "deploy", DeployPrereq: "deploy-prereq", Destroy: "destroy", diff --git a/tests/Aspire.Hosting.CodeGeneration.Java.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.java b/tests/Aspire.Hosting.CodeGeneration.Java.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.java index 7abe7db08b1..be9e60bed26 100644 --- a/tests/Aspire.Hosting.CodeGeneration.Java.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.java +++ b/tests/Aspire.Hosting.CodeGeneration.Java.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.java @@ -21796,12 +21796,18 @@ public static WaitBehavior fromValue(String value) { public final class WellKnownPipelineSteps { private WellKnownPipelineSteps() { } + /** The step that runs before the application starts. */ + public static final String BeforeStart = "before-start"; + /** The well-known step for building resources. */ public static final String Build = "build"; /** The prerequisite step that runs before any build operations. */ public static final String BuildPrereq = "build-prereq"; + /** The step that checks whether the container runtime (e.g., Docker or Podman) is running. Build steps that need a container runtime should depend on this step. */ + public static final String CheckContainerRuntime = "check-container-runtime"; + /** Aggregation step for all deploy operations. All deploy steps should be required by this step. */ public static final String Deploy = "deploy"; diff --git a/tests/Aspire.Hosting.CodeGeneration.Python.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.py b/tests/Aspire.Hosting.CodeGeneration.Python.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.py index 94ade19a23c..1a8900f2962 100644 --- a/tests/Aspire.Hosting.CodeGeneration.Python.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.py +++ b/tests/Aspire.Hosting.CodeGeneration.Python.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.py @@ -1832,10 +1832,14 @@ class TestNestedDto(typing.TypedDict, total=False): TestConfigs.UnicodeGreeting = "你好こんにちは" WellKnownPipelineSteps = types.SimpleNamespace() +# The step that runs before the application starts. +WellKnownPipelineSteps.BeforeStart = "before-start" # The well-known step for building resources. WellKnownPipelineSteps.Build = "build" # The prerequisite step that runs before any build operations. WellKnownPipelineSteps.BuildPrereq = "build-prereq" +# The step that checks whether the container runtime (e.g., Docker or Podman) is running. Build steps that need a container runtime should depend on this step. +WellKnownPipelineSteps.CheckContainerRuntime = "check-container-runtime" # Aggregation step for all deploy operations. All deploy steps should be required by this step. WellKnownPipelineSteps.Deploy = "deploy" # The prerequisite step that runs before any deploy operations. diff --git a/tests/Aspire.Hosting.CodeGeneration.Rust.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.rs b/tests/Aspire.Hosting.CodeGeneration.Rust.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.rs index bcda4b00ae6..17afdaf74e6 100644 --- a/tests/Aspire.Hosting.CodeGeneration.Rust.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.rs +++ b/tests/Aspire.Hosting.CodeGeneration.Rust.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.rs @@ -941,6 +941,11 @@ pub mod test_configs { pub mod well_known_pipeline_steps { use super::*; + /// The step that runs before the application starts. + pub fn before_start() -> String { + serde_json::from_value::(serde_json::json!("before-start")) + .expect("generated exported value should deserialize") + } /// The well-known step for building resources. pub fn build() -> String { serde_json::from_value::(serde_json::json!("build")) @@ -951,6 +956,11 @@ pub mod well_known_pipeline_steps { serde_json::from_value::(serde_json::json!("build-prereq")) .expect("generated exported value should deserialize") } + /// The step that checks whether the container runtime (e.g., Docker or Podman) is running. Build steps that need a container runtime should depend on this step. + pub fn check_container_runtime() -> String { + serde_json::from_value::(serde_json::json!("check-container-runtime")) + .expect("generated exported value should deserialize") + } /// Aggregation step for all deploy operations. All deploy steps should be required by this step. pub fn deploy() -> String { serde_json::from_value::(serde_json::json!("deploy")) diff --git a/tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.ts b/tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.ts index fade7da509f..68823e3ab33 100644 --- a/tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.ts +++ b/tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.ts @@ -605,12 +605,18 @@ export namespace TestConfigs { } export namespace WellKnownPipelineSteps { + /** The step that runs before the application starts. */ + export const BeforeStart = "before-start"; + /** The well-known step for building resources. */ export const Build = "build"; /** The prerequisite step that runs before any build operations. */ export const BuildPrereq = "build-prereq"; + /** The step that checks whether the container runtime (e.g., Docker or Podman) is running. Build steps that need a container runtime should depend on this step. */ + export const CheckContainerRuntime = "check-container-runtime"; + /** Aggregation step for all deploy operations. All deploy steps should be required by this step. */ export const Deploy = "deploy"; diff --git a/tests/Aspire.Hosting.EntityFrameworkCore.Tests/AddEFMigrationsTests.cs b/tests/Aspire.Hosting.EntityFrameworkCore.Tests/AddEFMigrationsTests.cs index 7831942ebbc..550056c0935 100644 --- a/tests/Aspire.Hosting.EntityFrameworkCore.Tests/AddEFMigrationsTests.cs +++ b/tests/Aspire.Hosting.EntityFrameworkCore.Tests/AddEFMigrationsTests.cs @@ -20,7 +20,7 @@ public void AddEFMigrationsCreatesResource() Assert.IsAssignableFrom>(migrations); Assert.Equal("mymigrations", migrations.Resource.Name); Assert.Equal(project.Resource, migrations.Resource.ProjectResource); - Assert.Equal(typeof(TestDbContext).FullName, migrations.Resource.ContextTypeName); + Assert.Equal(typeof(TestDbContext).FullName, migrations.Resource.DbContextTypeName); } [Fact] @@ -34,7 +34,7 @@ public void AddEFMigrationsWithoutContextTypeCreatesResource() Assert.IsAssignableFrom>(migrations); Assert.Equal("mymigrations", migrations.Resource.Name); Assert.Equal(project.Resource, migrations.Resource.ProjectResource); - Assert.Null(migrations.Resource.ContextTypeName); + Assert.Null(migrations.Resource.DbContextTypeName); } [Fact] @@ -48,7 +48,7 @@ public void AddEFMigrationsWithExplicitContextTypeNameCreatesResource() Assert.IsAssignableFrom>(migrations); Assert.Equal("mymigrations", migrations.Resource.Name); Assert.Equal(project.Resource, migrations.Resource.ProjectResource); - Assert.Equal(typeof(TestDbContext).FullName, migrations.Resource.ContextTypeName); + Assert.Equal(typeof(TestDbContext).FullName, migrations.Resource.DbContextTypeName); } [Fact] @@ -63,7 +63,7 @@ public void AddEFMigrationsWithContextTypeNameStringCreatesResource() Assert.IsAssignableFrom>(migrations); Assert.Equal("mymigrations", migrations.Resource.Name); Assert.Equal(project.Resource, migrations.Resource.ProjectResource); - Assert.Equal(contextTypeName, migrations.Resource.ContextTypeName); + Assert.Equal(contextTypeName, migrations.Resource.DbContextTypeName); } [Fact] @@ -91,8 +91,8 @@ public void AddEFMigrationsForMultipleContextsSucceeds() var migrations2 = project.AddEFMigrations("migrations2", typeof(AnotherDbContext).FullName!); Assert.NotEqual(migrations1.Resource, migrations2.Resource); - Assert.Equal(typeof(TestDbContext).FullName, migrations1.Resource.ContextTypeName); - Assert.Equal(typeof(AnotherDbContext).FullName, migrations2.Resource.ContextTypeName); + Assert.Equal(typeof(TestDbContext).FullName, migrations1.Resource.DbContextTypeName); + Assert.Equal(typeof(AnotherDbContext).FullName, migrations2.Resource.DbContextTypeName); } [Fact] @@ -105,8 +105,8 @@ public void AddEFMigrationsForMultipleContextsWithStringNamesSucceeds() var migrations2 = project.AddEFMigrations("migrations2", "MyApp.Data.LoggingDbContext"); Assert.NotEqual(migrations1.Resource, migrations2.Resource); - Assert.Equal("MyApp.Data.AppDbContext", migrations1.Resource.ContextTypeName); - Assert.Equal("MyApp.Data.LoggingDbContext", migrations2.Resource.ContextTypeName); + Assert.Equal("MyApp.Data.AppDbContext", migrations1.Resource.DbContextTypeName); + Assert.Equal("MyApp.Data.LoggingDbContext", migrations2.Resource.DbContextTypeName); } [Fact] diff --git a/tests/Aspire.Hosting.EntityFrameworkCore.Tests/EFMigrationCommandsTests.cs b/tests/Aspire.Hosting.EntityFrameworkCore.Tests/EFMigrationCommandsTests.cs index f2a4eb33e3a..89ce6ec5ba6 100644 --- a/tests/Aspire.Hosting.EntityFrameworkCore.Tests/EFMigrationCommandsTests.cs +++ b/tests/Aspire.Hosting.EntityFrameworkCore.Tests/EFMigrationCommandsTests.cs @@ -132,7 +132,7 @@ public void AddEFMigrationsWithContextUsesContextTypeName() var migrations = project.AddEFMigrations("mymigrations", typeof(TestDbContext).FullName!); // Verify the context type name is stored on the resource - Assert.Equal(typeof(TestDbContext).FullName, migrations.Resource.ContextTypeName); + Assert.Equal(typeof(TestDbContext).FullName, migrations.Resource.DbContextTypeName); } [Fact] diff --git a/tests/Aspire.Hosting.EntityFrameworkCore.Tests/EFMigrationConfigurationTests.cs b/tests/Aspire.Hosting.EntityFrameworkCore.Tests/EFMigrationConfigurationTests.cs index 486d6a9886d..d59a06233ab 100644 --- a/tests/Aspire.Hosting.EntityFrameworkCore.Tests/EFMigrationConfigurationTests.cs +++ b/tests/Aspire.Hosting.EntityFrameworkCore.Tests/EFMigrationConfigurationTests.cs @@ -126,7 +126,7 @@ public void ConfigurationMethodsPreserveContextTypeName() .PublishAsMigrationBundle(); // The context type name should be preserved through chaining - Assert.Equal(typeof(TestDbContext).FullName, migrations.Resource.ContextTypeName); + Assert.Equal(typeof(TestDbContext).FullName, migrations.Resource.DbContextTypeName); } [Fact] diff --git a/tests/Aspire.Hosting.JavaScript.Tests/AddJavaScriptAppTests.cs b/tests/Aspire.Hosting.JavaScript.Tests/AddJavaScriptAppTests.cs index 5edfb78a38a..2302c6a935f 100644 --- a/tests/Aspire.Hosting.JavaScript.Tests/AddJavaScriptAppTests.cs +++ b/tests/Aspire.Hosting.JavaScript.Tests/AddJavaScriptAppTests.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#pragma warning disable ASPIREEXTENSION001 // Type is for evaluation purposes only +#pragma warning disable ASPIREJAVASCRIPT001 // Type is for evaluation purposes only using System.Diagnostics; using Aspire.Hosting.ApplicationModel; diff --git a/tests/Aspire.Hosting.JavaScript.Tests/AddNodeAppTests.cs b/tests/Aspire.Hosting.JavaScript.Tests/AddNodeAppTests.cs index 8bfe3f07720..7d5c7449d1a 100644 --- a/tests/Aspire.Hosting.JavaScript.Tests/AddNodeAppTests.cs +++ b/tests/Aspire.Hosting.JavaScript.Tests/AddNodeAppTests.cs @@ -429,6 +429,7 @@ private sealed class MyFilesContainer(string name, string command, string workin : ExecutableResource(name, command, workingDirectory), IResourceWithContainerFiles; #pragma warning disable ASPIREEXTENSION001 // Type is for evaluation purposes only +#pragma warning disable ASPIREJAVASCRIPT001 // Type is for evaluation purposes only [Fact] public void NodeApp_WithVSCodeDebugging_AddsSupportsDebuggingAnnotation() @@ -589,4 +590,5 @@ private static IResourceBuilder InvokeWithReference( } #pragma warning restore ASPIREEXTENSION001 // Type is for evaluation purposes only +#pragma warning restore ASPIREJAVASCRIPT001 // Type is for evaluation purposes only } diff --git a/tests/Aspire.Hosting.JavaScript.Tests/AddViteAppTests.cs b/tests/Aspire.Hosting.JavaScript.Tests/AddViteAppTests.cs index d3a35b219b2..f7245991afb 100644 --- a/tests/Aspire.Hosting.JavaScript.Tests/AddViteAppTests.cs +++ b/tests/Aspire.Hosting.JavaScript.Tests/AddViteAppTests.cs @@ -4,7 +4,7 @@ #pragma warning disable ASPIREDOCKERFILEBUILDER001 // Type is for evaluation purposes only #pragma warning disable ASPIRECERTIFICATES001 // Type is for evaluation purposes only #pragma warning disable ASPIREPIPELINES001 // Type is for evaluation purposes only -#pragma warning disable ASPIREEXTENSION001 // Type is for evaluation purposes only +#pragma warning disable ASPIREJAVASCRIPT001 // Type is for evaluation purposes only using Aspire.Hosting.ApplicationModel; using Aspire.Hosting.Pipelines; diff --git a/tests/Aspire.Hosting.JavaScript.Tests/NodeJsPublicApiTests.cs b/tests/Aspire.Hosting.JavaScript.Tests/NodeJsPublicApiTests.cs index b990aaabefe..98d5ca199c1 100644 --- a/tests/Aspire.Hosting.JavaScript.Tests/NodeJsPublicApiTests.cs +++ b/tests/Aspire.Hosting.JavaScript.Tests/NodeJsPublicApiTests.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#pragma warning disable ASPIREEXTENSION001 // Type is for evaluation purposes only +#pragma warning disable ASPIREJAVASCRIPT001 // Type is for evaluation purposes only using Aspire.Hosting.ApplicationModel; using Aspire.Hosting.Utils;