Skip to content

Commit 94f40b5

Browse files
authored
Remove [Experimental] from IInteractionService and related types (#18032)
1 parent 582ba4c commit 94f40b5

69 files changed

Lines changed: 25 additions & 197 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

extension/scripts/run-e2e.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -817,8 +817,7 @@ function writeAppHostProject(projectName, resolvedAppHostSdkVersion) {
817817
</Project>
818818
`);
819819

820-
fs.writeFileSync(path.join(projectDirectory, 'AppHost.cs'), `${csharpFileHeader}#pragma warning disable ASPIREINTERACTION001
821-
820+
fs.writeFileSync(path.join(projectDirectory, 'AppHost.cs'), `${csharpFileHeader}
822821
var builder = DistributedApplication.CreateBuilder(args);
823822
824823
builder.AddProject<Projects.AspireE2E_Worker>("e2e-worker")

playground/ExternalServices/ExternalServices.AppHost/AppHost.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
var builder = DistributedApplication.CreateBuilder(args);
77

8-
#pragma warning disable ASPIREINTERACTION001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
98
var externalServiceUrl = builder.AddParameter("external-service-url")
109
.WithDescription("The URL of the external service.")
1110
.WithCustomInput(p => new()
@@ -17,7 +16,6 @@
1716
Placeholder = $"Enter value for {p.Name}",
1817
Description = p.Description
1918
});
20-
#pragma warning restore ASPIREINTERACTION001
2119
var externalService = builder.AddExternalService("external-service", externalServiceUrl);
2220

2321
var nuget = builder.AddExternalService("nuget", "https://api.nuget.org/")

playground/ParameterEndToEnd/ParameterEndToEnd.AppHost/AppHost.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ And has another paragraph.
4242
- Item 3
4343
""", enableMarkdown: true);
4444

45-
#pragma warning disable ASPIREINTERACTION001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
4645
var parameterWithCustomInput = builder.AddParameter("customInput")
4746
.WithDescription("This parameter only accepts a number.")
4847
.WithCustomInput(p => new()
@@ -53,7 +52,6 @@ And has another paragraph.
5352
Placeholder = "Enter a number",
5453
Description = p.Description,
5554
});
56-
#pragma warning restore ASPIREINTERACTION001
5755

5856
builder.AddProject<Projects.ParameterEndToEnd_ApiService>("api")
5957
.WithExternalHttpEndpoints()

playground/Stress/Stress.AppHost/CommandResources.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using System.Text.Json;
55
using Microsoft.Extensions.DependencyInjection;
66

7-
#pragma warning disable ASPIREINTERACTION001 // InteractionInput is used to exercise resource command arguments.
87
#pragma warning disable ASPIREPROCESSCOMMAND001 // Process command APIs are experimental.
98

109
internal static class CommandResources
@@ -877,7 +876,7 @@ private static void AddTelemetryCommands(IDistributedApplicationBuilder builder,
877876
displayName: "Stop all resources",
878877
executeCommand: async (c) =>
879878
{
880-
await ExecuteCommandForAllResourcesAsync(c.ServiceProvider, KnownResourceCommands.StopCommand, c.CancellationToken);
879+
await ExecuteCommandForAllResourcesAsync(c.Services, KnownResourceCommands.StopCommand, c.CancellationToken);
881880
return CommandResults.Success();
882881
},
883882
commandOptions: new() { IconName = "Stop", IconVariant = IconVariant.Filled })
@@ -886,7 +885,7 @@ private static void AddTelemetryCommands(IDistributedApplicationBuilder builder,
886885
displayName: "Start all resources",
887886
executeCommand: async (c) =>
888887
{
889-
await ExecuteCommandForAllResourcesAsync(c.ServiceProvider, KnownResourceCommands.StartCommand, c.CancellationToken);
888+
await ExecuteCommandForAllResourcesAsync(c.Services, KnownResourceCommands.StartCommand, c.CancellationToken);
890889
return CommandResults.Success();
891890
},
892891
commandOptions: new() { IconName = "Play", IconVariant = IconVariant.Filled });
@@ -1173,4 +1172,4 @@ private sealed class ValidateCommandArguments
11731172
}
11741173

11751174
#pragma warning restore ASPIREPROCESSCOMMAND001
1176-
#pragma warning restore ASPIREINTERACTION001
1175+

playground/Stress/Stress.AppHost/InteractionCommands.cs

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
using Microsoft.Extensions.DependencyInjection;
66
using Microsoft.Extensions.Logging;
77

8-
#pragma warning disable ASPIREINTERACTION001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
9-
108
internal static class InteractionCommands
119
{
1210
[AspireExportIgnore(Reason = "Uses interaction service callbacks and command handlers that are not ATS-compatible.")]
@@ -15,7 +13,7 @@ public static IResourceBuilder<T> AddInteractionCommands<T>(this IResourceBuilde
1513
resource
1614
.WithCommand("confirmation-interaction", "Confirmation interactions", executeCommand: async commandContext =>
1715
{
18-
var interactionService = commandContext.ServiceProvider.GetRequiredService<IInteractionService>();
16+
var interactionService = commandContext.Services.GetRequiredService<IInteractionService>();
1917
var resultTask1 = interactionService.PromptConfirmationAsync("Command confirmation", "Are you sure?", cancellationToken: commandContext.CancellationToken);
2018
var resultTask2 = interactionService.PromptMessageBoxAsync("Command confirmation", "Are you really sure?", new MessageBoxInteractionOptions { Intent = MessageIntent.Warning, ShowSecondaryButton = true }, cancellationToken: commandContext.CancellationToken);
2119

@@ -33,7 +31,7 @@ public static IResourceBuilder<T> AddInteractionCommands<T>(this IResourceBuilde
3331
{
3432
await Task.Yield();
3533

36-
var interactionService = commandContext.ServiceProvider.GetRequiredService<IInteractionService>();
34+
var interactionService = commandContext.Services.GetRequiredService<IInteractionService>();
3735
_ = interactionService.PromptNotificationAsync("Success bar", "The command successfully executed.", new NotificationInteractionOptions { Intent = MessageIntent.Success });
3836
_ = interactionService.PromptNotificationAsync("Information bar", "The command successfully executed.", new NotificationInteractionOptions { Intent = MessageIntent.Information });
3937
_ = interactionService.PromptNotificationAsync("Warning bar", "The command successfully executed.", new NotificationInteractionOptions { Intent = MessageIntent.Warning });
@@ -45,7 +43,7 @@ public static IResourceBuilder<T> AddInteractionCommands<T>(this IResourceBuilde
4543
})
4644
.WithCommand("html-interaction", "HTML interactions", executeCommand: async commandContext =>
4745
{
48-
var interactionService = commandContext.ServiceProvider.GetRequiredService<IInteractionService>();
46+
var interactionService = commandContext.Services.GetRequiredService<IInteractionService>();
4947

5048
_ = interactionService.PromptNotificationAsync("Success <strong>bar</strong>", "The **command** successfully executed.", new NotificationInteractionOptions { Intent = MessageIntent.Success });
5149
_ = interactionService.PromptNotificationAsync("Success <strong>bar</strong>", "The **command** successfully executed.", new NotificationInteractionOptions { Intent = MessageIntent.Success, EnableMessageMarkdown = true });
@@ -66,7 +64,7 @@ public static IResourceBuilder<T> AddInteractionCommands<T>(this IResourceBuilde
6664
})
6765
.WithCommand("long-content-interaction", "Long content interactions", executeCommand: async commandContext =>
6866
{
69-
var interactionService = commandContext.ServiceProvider.GetRequiredService<IInteractionService>();
67+
var interactionService = commandContext.Services.GetRequiredService<IInteractionService>();
7068

7169
var inputHasMarkdown = new InteractionInput { Name = "Name", Label = "<strong>Name</strong>", InputType = InputType.Text, Placeholder = "Enter <strong>your</strong> name.", Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce id massa arcu. Morbi ac risus eget augue venenatis hendrerit. Morbi posuere, **neque id** efficitur ultrices, velit augue suscipit ante, vitae lacinia elit risus nec dui.", EnableDescriptionMarkdown = true };
7270
var choiceWithLongContent = new InteractionInput
@@ -103,7 +101,7 @@ public static IResourceBuilder<T> AddInteractionCommands<T>(this IResourceBuilde
103101
})
104102
.WithCommand("value-interaction", "Value interactions", executeCommand: async commandContext =>
105103
{
106-
var interactionService = commandContext.ServiceProvider.GetRequiredService<IInteractionService>();
104+
var interactionService = commandContext.Services.GetRequiredService<IInteractionService>();
107105
var result = await interactionService.PromptInputAsync(
108106
title: "Text request",
109107
message: "Provide your name",
@@ -128,7 +126,7 @@ public static IResourceBuilder<T> AddInteractionCommands<T>(this IResourceBuilde
128126
return CommandResults.Failure("Canceled");
129127
}
130128

131-
var resourceLoggerService = commandContext.ServiceProvider.GetRequiredService<ResourceLoggerService>();
129+
var resourceLoggerService = commandContext.Services.GetRequiredService<ResourceLoggerService>();
132130
var logger = resourceLoggerService.GetLogger(commandContext.ResourceName);
133131

134132
var input = result.Data;
@@ -138,7 +136,7 @@ public static IResourceBuilder<T> AddInteractionCommands<T>(this IResourceBuilde
138136
})
139137
.WithCommand("choice-no-placeholder", "Choice with no placeholder", executeCommand: async commandContext =>
140138
{
141-
var interactionService = commandContext.ServiceProvider.GetRequiredService<IInteractionService>();
139+
var interactionService = commandContext.Services.GetRequiredService<IInteractionService>();
142140
var dinnerInput = new InteractionInput
143141
{
144142
Name = "Dinner",
@@ -178,7 +176,7 @@ public static IResourceBuilder<T> AddInteractionCommands<T>(this IResourceBuilde
178176
return CommandResults.Failure("Canceled");
179177
}
180178

181-
var resourceLoggerService = commandContext.ServiceProvider.GetRequiredService<ResourceLoggerService>();
179+
var resourceLoggerService = commandContext.Services.GetRequiredService<ResourceLoggerService>();
182180
var logger = resourceLoggerService.GetLogger(commandContext.ResourceName);
183181

184182
foreach (var updatedInput in result.Data)
@@ -190,7 +188,7 @@ public static IResourceBuilder<T> AddInteractionCommands<T>(this IResourceBuilde
190188
})
191189
.WithCommand("input-interaction", "Input interactions", executeCommand: async commandContext =>
192190
{
193-
var interactionService = commandContext.ServiceProvider.GetRequiredService<IInteractionService>();
191+
var interactionService = commandContext.Services.GetRequiredService<IInteractionService>();
194192
var dinnerInput = new InteractionInput
195193
{
196194
Name = "Dinner",
@@ -264,7 +262,7 @@ public static IResourceBuilder<T> AddInteractionCommands<T>(this IResourceBuilde
264262
return CommandResults.Failure("Canceled");
265263
}
266264

267-
var resourceLoggerService = commandContext.ServiceProvider.GetRequiredService<ResourceLoggerService>();
265+
var resourceLoggerService = commandContext.Services.GetRequiredService<ResourceLoggerService>();
268266
var logger = resourceLoggerService.GetLogger(commandContext.ResourceName);
269267

270268
foreach (var updatedInput in result.Data)
@@ -276,7 +274,7 @@ public static IResourceBuilder<T> AddInteractionCommands<T>(this IResourceBuilde
276274
})
277275
.WithCommand("choice-interaction", "Choice interactions", executeCommand: async commandContext =>
278276
{
279-
var interactionService = commandContext.ServiceProvider.GetRequiredService<IInteractionService>();
277+
var interactionService = commandContext.Services.GetRequiredService<IInteractionService>();
280278
var predefinedOptionsInput = new InteractionInput
281279
{
282280
Name = "PredefinedOptions",
@@ -403,7 +401,7 @@ public static IResourceBuilder<T> AddInteractionCommands<T>(this IResourceBuilde
403401
return CommandResults.Failure("Canceled");
404402
}
405403

406-
var resourceLoggerService = commandContext.ServiceProvider.GetRequiredService<ResourceLoggerService>();
404+
var resourceLoggerService = commandContext.Services.GetRequiredService<ResourceLoggerService>();
407405
var logger = resourceLoggerService.GetLogger(commandContext.ResourceName);
408406

409407
foreach (var updatedInput in result.Data)
@@ -415,7 +413,7 @@ public static IResourceBuilder<T> AddInteractionCommands<T>(this IResourceBuilde
415413
})
416414
.WithCommand("dynamic-error", "Dynamic error", executeCommand: async commandContext =>
417415
{
418-
var interactionService = commandContext.ServiceProvider.GetRequiredService<IInteractionService>();
416+
var interactionService = commandContext.Services.GetRequiredService<IInteractionService>();
419417
var predefinedOptionsInput = new InteractionInput
420418
{
421419
Name = "PredefinedOptions",
@@ -502,7 +500,7 @@ public static IResourceBuilder<T> AddInteractionCommands<T>(this IResourceBuilde
502500
return CommandResults.Failure("Canceled");
503501
}
504502

505-
var resourceLoggerService = commandContext.ServiceProvider.GetRequiredService<ResourceLoggerService>();
503+
var resourceLoggerService = commandContext.Services.GetRequiredService<ResourceLoggerService>();
506504
var logger = resourceLoggerService.GetLogger(commandContext.ResourceName);
507505

508506
foreach (var updatedInput in result.Data)
@@ -514,7 +512,7 @@ public static IResourceBuilder<T> AddInteractionCommands<T>(this IResourceBuilde
514512
})
515513
.WithCommand("dismiss-interaction", "Dismiss interaction tests", executeCommand: commandContext =>
516514
{
517-
var interactionService = commandContext.ServiceProvider.GetRequiredService<IInteractionService>();
515+
var interactionService = commandContext.Services.GetRequiredService<IInteractionService>();
518516

519517
RunInteractionWithDismissValues(nameof(IInteractionService.PromptNotificationAsync), (showDismiss, title) =>
520518
{
@@ -555,7 +553,7 @@ public static IResourceBuilder<T> AddInteractionCommands<T>(this IResourceBuilde
555553
})
556554
.WithCommand("many-values", "Many values", executeCommand: async commandContext =>
557555
{
558-
var interactionService = commandContext.ServiceProvider.GetRequiredService<IInteractionService>();
556+
var interactionService = commandContext.Services.GetRequiredService<IInteractionService>();
559557
var inputs = new List<InteractionInput>();
560558
for (var i = 0; i < 50; i++)
561559
{
@@ -578,7 +576,7 @@ public static IResourceBuilder<T> AddInteractionCommands<T>(this IResourceBuilde
578576
return CommandResults.Failure("Canceled");
579577
}
580578

581-
var resourceLoggerService = commandContext.ServiceProvider.GetRequiredService<ResourceLoggerService>();
579+
var resourceLoggerService = commandContext.Services.GetRequiredService<ResourceLoggerService>();
582580
var logger = resourceLoggerService.GetLogger(commandContext.ResourceName);
583581

584582
foreach (var input in result.Data)
@@ -590,7 +588,7 @@ public static IResourceBuilder<T> AddInteractionCommands<T>(this IResourceBuilde
590588
})
591589
.WithCommand("azure-provisioning-simulation", "Azure provisioning simulation", executeCommand: async commandContext =>
592590
{
593-
var interactionService = commandContext.ServiceProvider.GetRequiredService<IInteractionService>();
591+
var interactionService = commandContext.Services.GetRequiredService<IInteractionService>();
594592

595593
var tenantInput = new InteractionInput
596594
{
@@ -769,7 +767,7 @@ public static IResourceBuilder<T> AddInteractionCommands<T>(this IResourceBuilde
769767
return CommandResults.Canceled();
770768
}
771769

772-
var resourceLoggerService = commandContext.ServiceProvider.GetRequiredService<ResourceLoggerService>();
770+
var resourceLoggerService = commandContext.Services.GetRequiredService<ResourceLoggerService>();
773771
var logger = resourceLoggerService.GetLogger(commandContext.ResourceName);
774772

775773
foreach (var input in result.Data)
@@ -796,5 +794,3 @@ private static void RunInteractionWithDismissValues(string title, Func<bool?, st
796794
_ = action(false, $"{title} - ShowDismiss = false");
797795
}
798796
}
799-
800-
#pragma warning restore ASPIREINTERACTION001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.

playground/publishers/Publishers.AppHost/DistributedApplicationBuilderExtensions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
#pragma warning disable ASPIREPIPELINES001
5-
#pragma warning disable ASPIREINTERACTION001
65

76
using Aspire.Hosting.Pipelines;
87
using Microsoft.Extensions.DependencyInjection;

src/Aspire.Hosting.Azure.Kusto/AzureKustoBuilderExtensions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
#pragma warning disable AZPROVISION001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
5-
#pragma warning disable ASPIREINTERACTION001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
65

76
using Aspire.Hosting.ApplicationModel;
87
using Aspire.Hosting.Azure;

src/Aspire.Hosting.Azure/AzureEnvironmentResource.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#pragma warning disable ASPIREAZURE001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
55
#pragma warning disable ASPIREPIPELINES003 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
6-
#pragma warning disable ASPIREINTERACTION001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
76
#pragma warning disable ASPIREPIPELINES004 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
87

98
using System.Diagnostics.CodeAnalysis;

src/Aspire.Hosting.Azure/Provisioning/Internal/BaseProvisioningContextProvider.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#pragma warning disable ASPIREINTERACTION001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
21
#pragma warning disable ASPIREPIPELINES002 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
32

43
// Licensed to the .NET Foundation under one or more agreements.

src/Aspire.Hosting.Azure/Provisioning/Internal/PublishModeProvisioningContextProvider.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
#pragma warning disable ASPIREINTERACTION001
54
#pragma warning disable ASPIREPIPELINES002
65
#pragma warning disable ASPIREPIPELINES001
76

0 commit comments

Comments
 (0)