Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,6 @@ protected void AddContainerRegistryParameters(Action<BicepList<ContainerAppRegis
]);
}

#pragma warning disable ASPIREPROBES001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
protected void AddProbes(ContainerAppContainer containerAppContainer)
{
if (!Resource.TryGetAnnotationsOfType<ProbeAnnotation>(out var probeAnnotations))
Expand Down Expand Up @@ -603,7 +602,6 @@ protected void AddProbes(ContainerAppContainer containerAppContainer)
}
}
}
#pragma warning restore ASPIREPROBES001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.

protected enum SecretType
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,6 @@ static FunctionCallExpression Join(BicepExpression args, string delimeter) =>
}

// Probes
#pragma warning disable ASPIREPROBES001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
if (resource.TryGetAnnotationsOfType<ProbeAnnotation>(out var probeAnnotations))
{
// AppService allow only one "health check" with only path, so prioritize "liveness" and/or take the first one
Expand All @@ -693,7 +692,6 @@ static FunctionCallExpression Join(BicepExpression args, string delimeter) =>
}
}
}
#pragma warning restore ASPIREPROBES001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.

RoleAssignment? webSiteRa = null;
if (environmentContext.Environment.EnableDashboard)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#pragma warning disable AZPROVISION001 // Type is for evaluation purposes only and is subject to change or removal in future updates.
#pragma warning disable ASPIREAZURE003 // Type is for evaluation purposes only and is subject to change or removal in future updates.
#pragma warning disable ASPIRECOMPUTE002 // IComputeEnvironmentResource.GetHostAddressExpression is experimental
#pragma warning disable ASPIREPROBES001 // EndpointProbeAnnotation is experimental

using Aspire.Hosting.ApplicationModel;
using Aspire.Hosting.Azure;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,6 @@ private static ContainerV1 WithContainerSecrets(this ContainerV1 container, Kube
return container;
}

#pragma warning disable ASPIREPROBES001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
private static ContainerV1 WithContainerProbes(this ContainerV1 container, KubernetesResource context)
{
if (context.Probes.Count == 0)
Expand Down Expand Up @@ -459,7 +458,6 @@ private static ContainerV1 WithContainerProbes(this ContainerV1 container, Kuber

return container;
}
#pragma warning restore ASPIREPROBES001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.

private static PersistentVolumeClaim CreatePersistentVolumeClaim(KubernetesResource context, VolumeMountV1 volume)
{
Expand Down
4 changes: 0 additions & 4 deletions src/Aspire.Hosting.Kubernetes/KubernetesResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ internal record EndpointMapping(string Scheme, string Protocol, string Host, Hel
internal List<string> Commands { get; } = [];
internal List<VolumeMountV1> Volumes { get; } = [];
internal List<PersistentVolumeClaim> PersistentVolumeClaims { get; } = [];
#pragma warning disable ASPIREPROBES001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
internal List<(ProbeType Type, ProbeV1 Probe)> Probes { get; } = [];
#pragma warning restore ASPIREPROBES001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.

/// <summary>
/// </summary>
Expand Down Expand Up @@ -322,7 +320,6 @@ private void ProcessVolumes()
}
}

#pragma warning disable ASPIREPROBES001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
private void ProcessProbes()
{
if (!resource.TryGetAnnotationsOfType<ProbeAnnotation>(out var probeAnnotations))
Expand Down Expand Up @@ -359,7 +356,6 @@ private void ProcessProbes()
}
}
}
#pragma warning restore ASPIREPROBES001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.

private async Task ProcessArgumentsAsync(KubernetesEnvironmentContext environmentContext, DistributedApplicationExecutionContext executionContext, CancellationToken cancellationToken)
{
Expand Down
2 changes: 0 additions & 2 deletions src/Aspire.Hosting/ApplicationModel/ContainerResource.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#pragma warning disable ASPIREPROBES001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.

// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

Expand Down
2 changes: 0 additions & 2 deletions src/Aspire.Hosting/ApplicationModel/ExecutableResource.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#pragma warning disable ASPIREPROBES001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.

// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

Expand Down
3 changes: 0 additions & 3 deletions src/Aspire.Hosting/ApplicationModel/IResourceWithProbes.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
// 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.ApplicationModel;

/// <summary>
/// Represents a resource that has probes associated with it.
/// </summary>
[Experimental("ASPIREPROBES001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")]
public interface IResourceWithProbes : IResource
{
}
5 changes: 0 additions & 5 deletions src/Aspire.Hosting/ApplicationModel/ProbeAnnotation.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
// 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.ApplicationModel;

/// <summary>
/// Enum representing the type of probe.
/// </summary>
[Experimental("ASPIREPROBES001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")]
public enum ProbeType
{
/// <summary>
Expand All @@ -30,7 +27,6 @@ public enum ProbeType
/// <summary>
/// Represents an annotation that specifies the probes (health, readiness, liveness, etc.) of a resource.
/// </summary>
[Experimental("ASPIREPROBES001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")]
public abstract class ProbeAnnotation : IResourceAnnotation
{
/// <summary>
Expand Down Expand Up @@ -67,7 +63,6 @@ public abstract class ProbeAnnotation : IResourceAnnotation
/// <summary>
/// Represents an annotation that specifies the HTTP probes (health, readiness, liveness, etc.) of a resource.
/// </summary>
[Experimental("ASPIREPROBES001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")]
public sealed class EndpointProbeAnnotation : ProbeAnnotation
{
/// <summary>
Expand Down
1 change: 0 additions & 1 deletion src/Aspire.Hosting/ApplicationModel/ProjectResource.cs
Original file line number Diff line number Diff line change
@@ -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 ASPIREPROBES001
#pragma warning disable ASPIREPROJECTS001

using System.Diagnostics;
Expand Down
4 changes: 0 additions & 4 deletions src/Aspire.Hosting/ResourceBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5171,7 +5171,6 @@ public static IResourceBuilder<T> WithDebugSupport<T, TLaunchConfiguration>(
/// </example>
/// <para>This method is not available in polyglot app hosts. The parameter name 'type' is a reserved keyword in Go and Rust.</para>
/// </remarks>
[Experimental("ASPIREPROBES001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")]
[AspireExportIgnore(Reason = "Use the ATS export stub with renamed probeType parameter instead.")]
public static IResourceBuilder<T> WithHttpProbe<T>(this IResourceBuilder<T> builder, ProbeType type, string? path = null, int? initialDelaySeconds = null, int? periodSeconds = null, int? timeoutSeconds = null, int? failureThreshold = null, int? successThreshold = null, string? endpointName = null)
Comment thread
mitchdenny marked this conversation as resolved.
Resolved
where T : IResourceWithEndpoints, IResourceWithProbes
Expand All @@ -5190,7 +5189,6 @@ public static IResourceBuilder<T> WithHttpProbe<T>(this IResourceBuilder<T> buil
/// with renamed parameter to avoid reserved keyword conflicts in Go and Rust.
/// </summary>
/// <ats-summary>Adds an HTTP health probe to the resource</ats-summary>
[Experimental("ASPIREPROBES001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")]
[AspireExport("withHttpProbe")]
Comment thread
mitchdenny marked this conversation as resolved.
Resolved
internal static IResourceBuilder<T> WithHttpProbeExport<T>(this IResourceBuilder<T> builder, ProbeType probeType, string? path = null, int? initialDelaySeconds = null, int? periodSeconds = null, int? timeoutSeconds = null, int? failureThreshold = null, int? successThreshold = null, string? endpointName = null)
where T : IResourceWithEndpoints, IResourceWithProbes
Expand Down Expand Up @@ -5231,7 +5229,6 @@ internal static IResourceBuilder<T> WithHttpProbeExport<T>(this IResourceBuilder
/// </example>
/// <para>This method is not available in polyglot app hosts. Use the endpointName-based overload instead.</para>
/// </remarks>
[Experimental("ASPIREPROBES001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")]
[AspireExportIgnore(Reason = "Func<EndpointReference> delegate — not ATS-compatible.")]
public static IResourceBuilder<T> WithHttpProbe<T>(this IResourceBuilder<T> builder, ProbeType type, Func<EndpointReference>? endpointSelector, string? path = null, int? initialDelaySeconds = null, int? periodSeconds = null, int? timeoutSeconds = null, int? failureThreshold = null, int? successThreshold = null)
where T : IResourceWithEndpoints, IResourceWithProbes
Expand Down Expand Up @@ -5263,7 +5260,6 @@ public static IResourceBuilder<T> WithHttpProbe<T>(this IResourceBuilder<T> buil
/// <param name="builder">Resource builder.</param>
/// <param name="probeAnnotation">Probe annotation to add to resource.</param>
/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
[Experimental("ASPIREPROBES001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")]
private static IResourceBuilder<T> WithProbe<T>(this IResourceBuilder<T> builder, ProbeAnnotation probeAnnotation) where T : IResourceWithProbes
{
// Replace existing annotation with the same type
Expand Down
2 changes: 0 additions & 2 deletions tests/Aspire.Hosting.Azure.Tests/AzureAppServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -819,14 +819,12 @@ public async Task ResourceWithProbes()

var env1 = builder.AddAzureAppServiceEnvironment("env");

#pragma warning disable ASPIREPROBES001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
builder
.AddProject<Project>("project1", launchProfileName: null)
.WithHttpsEndpoint()
.WithExternalHttpEndpoints()
.WithHttpProbe(ProbeType.Readiness, "/ready", initialDelaySeconds: 60) // This will be ignored
.WithHttpProbe(ProbeType.Liveness, "/health");
#pragma warning restore ASPIREPROBES001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.

using var app = builder.Build();

Expand Down
6 changes: 0 additions & 6 deletions tests/Aspire.Hosting.Azure.Tests/AzureContainerAppsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2609,7 +2609,6 @@ public async Task ResourceWithProbes_HttpEndpoint()

builder.AddAzureContainerAppEnvironment("env");

#pragma warning disable ASPIREPROBES001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
builder
.AddContainer("api", "myimage")
.WithHttpEndpoint()
Expand All @@ -2621,7 +2620,6 @@ public async Task ResourceWithProbes_HttpEndpoint()
.WithHttpEndpoint()
.WithHttpProbe(ProbeType.Readiness, "/ready", initialDelaySeconds: 60)
.WithHttpProbe(ProbeType.Liveness, "/health");
#pragma warning restore ASPIREPROBES001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.

using var app = builder.Build();

Expand Down Expand Up @@ -2651,7 +2649,6 @@ public async Task ResourceWithProbes_HttpEndpoint_TargetPort()

builder.AddAzureContainerAppEnvironment("env");

#pragma warning disable ASPIREPROBES001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
builder
.AddContainer("api", "myimage")
.WithHttpEndpoint(targetPort: 1111)
Expand All @@ -2661,7 +2658,6 @@ public async Task ResourceWithProbes_HttpEndpoint_TargetPort()
.AddProject<Project>("project1", launchProfileName: null)
.WithHttpEndpoint(targetPort: 1111)
.WithHttpProbe(ProbeType.Liveness, "/health");
#pragma warning restore ASPIREPROBES001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.

using var app = builder.Build();

Expand Down Expand Up @@ -2691,7 +2687,6 @@ public async Task ResourceWithProbes_HttpsEndpoint_TargetPort_MatchIngress()

builder.AddAzureContainerAppEnvironment("env");

#pragma warning disable ASPIREPROBES001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
builder
.AddContainer("api", "myimage")
.WithHttpsEndpoint(targetPort: 1111)
Expand All @@ -2701,7 +2696,6 @@ public async Task ResourceWithProbes_HttpsEndpoint_TargetPort_MatchIngress()
.AddProject<Project>("project1", launchProfileName: null)
.WithHttpsEndpoint(targetPort: 1111)
.WithHttpProbe(ProbeType.Liveness, "/health");
#pragma warning restore ASPIREPROBES001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.

using var app = builder.Build();

Expand Down
1 change: 0 additions & 1 deletion tests/Aspire.Hosting.Azure.Tests/AzureFrontDoorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.

#pragma warning disable ASPIRECOMPUTE002
#pragma warning disable ASPIREPROBES001

using Aspire.Hosting.ApplicationModel;
using Aspire.Hosting.Utils;
Expand Down
Loading
Loading