Skip to content

[Automated] Update API Surface Area #715

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 10, 2025
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 @@ -10,7 +10,7 @@ namespace Aspire.Hosting
{
public static partial class GolangAppHostingExtension
{
public static ApplicationModel.IResourceBuilder<ApplicationModel.GolangAppExecutableResource> AddGolangApp(this IDistributedApplicationBuilder builder, string name, string workingDirectory, string[]? args = null) { throw null; }
Copy link
Member

Choose a reason for hiding this comment

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

This is a breaking change.
To avoid this, we can add a new overload:

public static ApplicationModel.IResourceBuilder<ApplicationModel.GolangAppExecutableResource> AddGolangApp(this IDistributedApplicationBuilder builder, string name, string workingDirectory, string[]? args = null, string[]? buildTags = null) { throw null; }

And make the args parameter for the old API required.

public static ApplicationModel.IResourceBuilder<ApplicationModel.GolangAppExecutableResource> AddGolangApp(this IDistributedApplicationBuilder builder, string name, string workingDirectory,
 string[] args) { throw null; }

public static ApplicationModel.IResourceBuilder<ApplicationModel.GolangAppExecutableResource> AddGolangApp(this IDistributedApplicationBuilder builder, string name, string workingDirectory, string[]? args = null, string[]? buildTags = null) { throw null; }
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Aspire.Hosting
{
public static partial class McpInspectorResourceBuilderExtensions
{
public static ApplicationModel.IResourceBuilder<ApplicationModel.McpInspectorResource> AddMcpInspector(this IDistributedApplicationBuilder builder, string name, int clientPort = 6274, int serverPort = 6277) { throw null; }

public static ApplicationModel.IResourceBuilder<ApplicationModel.McpInspectorResource> WithMcpServer<TResource>(this ApplicationModel.IResourceBuilder<ApplicationModel.McpInspectorResource> builder, ApplicationModel.IResourceBuilder<TResource> mcpServer, bool isDefault = true, McpTransportType transportType = McpTransportType.StreamableHttp)
where TResource : ApplicationModel.IResourceWithEndpoints { throw null; }
}

public enum McpTransportType
{
StreamableHttp = 0,
Sse = 1
}
}

namespace Aspire.Hosting.ApplicationModel
{
public partial class McpInspectorResource : ExecutableResource
{
public const string ClientEndpointName = "client";
public const string InspectorVersion = "0.15.0";
public const string ServerProxyEndpointName = "server-proxy";
public McpInspectorResource(string name) : base(default!, default!, default!) { }

public EndpointReference ClientEndpoint { get { throw null; } }

public McpServerMetadata? DefaultMcpServer { get { throw null; } }

public System.Collections.Generic.IReadOnlyList<McpServerMetadata> McpServers { get { throw null; } }

public EndpointReference ServerProxyEndpoint { get { throw null; } }
}

public partial record McpServerMetadata(string Name, EndpointReference Endpoint, McpTransportType TransportType)
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Aspire.Hosting
{
public static partial class MinioBuilderExtensions
{
public static ApplicationModel.IResourceBuilder<ApplicationModel.MinioContainerResource> AddMinioContainer(this IDistributedApplicationBuilder builder, string name, ApplicationModel.IResourceBuilder<ApplicationModel.ParameterResource>? rootUser = null, ApplicationModel.IResourceBuilder<ApplicationModel.ParameterResource>? rootPassword = null, int? port = null) { throw null; }
Copy link
Member

Choose a reason for hiding this comment

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

This should be AddMinio, not AddMinioContainer, to be consistent with other resources like AddPostgres or AddOllama


public static ApplicationModel.IResourceBuilder<ApplicationModel.MinioContainerResource> WithDataBindMount(this ApplicationModel.IResourceBuilder<ApplicationModel.MinioContainerResource> builder, string source) { throw null; }

public static ApplicationModel.IResourceBuilder<ApplicationModel.MinioContainerResource> WithDataVolume(this ApplicationModel.IResourceBuilder<ApplicationModel.MinioContainerResource> builder, string? name = null) { throw null; }

public static ApplicationModel.IResourceBuilder<ApplicationModel.MinioContainerResource> WithHostPort(this ApplicationModel.IResourceBuilder<ApplicationModel.MinioContainerResource> builder, int? port) { throw null; }

public static ApplicationModel.IResourceBuilder<ApplicationModel.MinioContainerResource> WithPassword(this ApplicationModel.IResourceBuilder<ApplicationModel.MinioContainerResource> builder, ApplicationModel.IResourceBuilder<ApplicationModel.ParameterResource> password) { throw null; }

public static ApplicationModel.IResourceBuilder<ApplicationModel.MinioContainerResource> WithUserName(this ApplicationModel.IResourceBuilder<ApplicationModel.MinioContainerResource> builder, ApplicationModel.IResourceBuilder<ApplicationModel.ParameterResource> userName) { throw null; }
}
}

namespace Aspire.Hosting.ApplicationModel
{
public sealed partial class MinioContainerResource : ContainerResource, IResourceWithConnectionString, IResource, IManifestExpressionProvider, IValueProvider, IValueWithReferences
{
public MinioContainerResource(string name, ParameterResource rootUser, ParameterResource passwordParameter) : base(default!, default) { }

public ReferenceExpression ConnectionStringExpression { get { throw null; } }

public ParameterResource PasswordParameter { get { throw null; } }

public EndpointReference PrimaryEndpoint { get { throw null; } }

public ParameterResource RootUser { get { throw null; } set { } }
Copy link
Member

Choose a reason for hiding this comment

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

I don't like the Root part for RootUser. Is there a reason for this?


public System.Threading.Tasks.ValueTask<string?> GetConnectionStringAsync(System.Threading.CancellationToken cancellationToken = default) { throw null; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,28 @@ public static partial class NodeJSHostingExtensions

public static ApplicationModel.IResourceBuilder<NodeAppResource> AddYarnApp(this IDistributedApplicationBuilder builder, string name, string workingDirectory, string scriptName = "start", string[]? args = null) { throw null; }

public static ApplicationModel.IResourceBuilder<NodeAppResource> WithNpmPackageInstallation(this ApplicationModel.IResourceBuilder<NodeAppResource> resource, bool useCI = false, string[]? args = null) { throw null; }
public static ApplicationModel.IResourceBuilder<NodeAppResource> WithNpmPackageInstallation(this ApplicationModel.IResourceBuilder<NodeAppResource> resource, bool useCI = false, System.Action<ApplicationModel.IResourceBuilder<ApplicationModel.NpmInstallerResource>>? configureInstaller = null) { throw null; }

public static ApplicationModel.IResourceBuilder<NodeAppResource> WithPnpmPackageInstallation(this ApplicationModel.IResourceBuilder<NodeAppResource> resource, string[]? args = null) { throw null; }
public static ApplicationModel.IResourceBuilder<NodeAppResource> WithPnpmPackageInstallation(this ApplicationModel.IResourceBuilder<NodeAppResource> resource, System.Action<ApplicationModel.IResourceBuilder<ApplicationModel.PnpmInstallerResource>>? configureInstaller = null) { throw null; }

public static ApplicationModel.IResourceBuilder<NodeAppResource> WithYarnPackageInstallation(this ApplicationModel.IResourceBuilder<NodeAppResource> resource, string[]? args = null) { throw null; }
public static ApplicationModel.IResourceBuilder<NodeAppResource> WithYarnPackageInstallation(this ApplicationModel.IResourceBuilder<NodeAppResource> resource, System.Action<ApplicationModel.IResourceBuilder<ApplicationModel.YarnInstallerResource>>? configureInstaller = null) { throw null; }
}
Comment on lines +19 to +24
Copy link
Member

Choose a reason for hiding this comment

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

This is a breaking change. We should add a new API instead of changing the surfaces. We can deprecate the old ones.

Copy link
Member

Choose a reason for hiding this comment

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

Fundamentally, the whole install pipeline here is a breaking change as it's moving to using a resource that shows in the dashboard. Since the configureInstaller is a nullable additional argument, the likelihood of it impacting someone is pretty minimal, since they'd have to be invoking the method in a non-standard way.

Although the diff is showing a bit confusing as the args array wasn't present in 9.5 (https://github.com/CommunityToolkit/Aspire/blob/v9.5.0/src/CommunityToolkit.Aspire.Hosting.NodeJS.Extensions/api/CommunityToolkit.Aspire.Hosting.NodeJS.Extensions.cs#L19-L23), it was my first iteration on this change, which I merged, but then moved to using a callback for flexibility.

}

namespace Aspire.Hosting.ApplicationModel
{
public partial class NpmInstallerResource : ExecutableResource
{
public NpmInstallerResource(string name, string workingDirectory) : base(default!, default!, default!) { }
}

public partial class PnpmInstallerResource : ExecutableResource
{
public PnpmInstallerResource(string name, string workingDirectory) : base(default!, default!, default!) { }
}

public partial class YarnInstallerResource : ExecutableResource
{
public YarnInstallerResource(string name, string workingDirectory) : base(default!, default!, default!) { }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace CommunityToolkit.Aspire.Hosting.PowerShell
{
public static partial class DistributedApplicationBuilderExtensions
{
public static global::Aspire.Hosting.ApplicationModel.IResourceBuilder<PowerShellRunspacePoolResource> AddPowerShell(this global::Aspire.Hosting.IDistributedApplicationBuilder builder, string name, System.Management.Automation.PSLanguageMode languageMode = System.Management.Automation.PSLanguageMode.ConstrainedLanguage, int minRunspaces = 1, int maxRunspaces = 5) { throw null; }
}

public partial class PowerShellRunspacePoolResource : global::Aspire.Hosting.ApplicationModel.Resource, System.IDisposable, global::Aspire.Hosting.ApplicationModel.IResourceWithWaitSupport, global::Aspire.Hosting.ApplicationModel.IResource
{
public PowerShellRunspacePoolResource(string name, System.Management.Automation.PSLanguageMode languageMode = System.Management.Automation.PSLanguageMode.ConstrainedLanguage, int minRunspaces = 1, int maxRunspaces = 5) : base(default!) { }

public System.Management.Automation.PSLanguageMode LanguageMode { get { throw null; } }

public int MaxRunspaces { get { throw null; } }

public int MinRunspaces { get { throw null; } }

public System.Management.Automation.Runspaces.RunspacePool? Pool { get { throw null; } }

void System.IDisposable.Dispose() { }
}

public static partial class PowerShellRunspacePoolResourceBuilderExtensions
{
public static global::Aspire.Hosting.ApplicationModel.IResourceBuilder<PowerShellScriptResource> AddScript(this global::Aspire.Hosting.ApplicationModel.IResourceBuilder<PowerShellRunspacePoolResource> builder, string name, string script) { throw null; }

public static global::Aspire.Hosting.ApplicationModel.IResourceBuilder<PowerShellRunspacePoolResource> WithReference(this global::Aspire.Hosting.ApplicationModel.IResourceBuilder<PowerShellRunspacePoolResource> builder, global::Aspire.Hosting.ApplicationModel.IResourceBuilder<global::Aspire.Hosting.ApplicationModel.IResourceWithConnectionString> source, string? connectionName = null, bool optional = false) { throw null; }
}

public partial record PowerShellScriptArgsAnnotation(object[] Args) : global::Aspire.Hosting.ApplicationModel.IResourceAnnotation
{
}

public partial class PowerShellScriptResource : global::Aspire.Hosting.ApplicationModel.Resource, System.IDisposable, global::Aspire.Hosting.ApplicationModel.IResourceWithEnvironment, global::Aspire.Hosting.ApplicationModel.IResource, global::Aspire.Hosting.ApplicationModel.IResourceWithWaitSupport, global::Aspire.Hosting.ApplicationModel.IResourceWithArgs
{
public PowerShellScriptResource(string name, System.IO.FileInfo scriptFile, PowerShellRunspacePoolResource parent) : base(default!) { }

public PowerShellScriptResource(string name, System.Management.Automation.ScriptBlock script, PowerShellRunspacePoolResource parent) : base(default!) { }

public PowerShellRunspacePoolResource Parent { get { throw null; } }

public System.Threading.Tasks.Task<bool> BreakAsync() { throw null; }

public System.Threading.Tasks.Task StartAsync(Microsoft.Extensions.Logging.ILogger scriptLogger, global::Aspire.Hosting.ApplicationModel.ResourceNotificationService notificationService, System.Threading.CancellationToken cancellationToken = default) { throw null; }

void System.IDisposable.Dispose() { }
}

public static partial class PowerShellScriptResourceBuilderExtensions
{
public static global::Aspire.Hosting.ApplicationModel.IResourceBuilder<PowerShellScriptResource> WithArgs(this global::Aspire.Hosting.ApplicationModel.IResourceBuilder<PowerShellScriptResource> builder, params object[] args) { throw null; }
}

public partial record PowerShellVariableReferenceAnnotation<T>(string Name, T Value) : global::Aspire.Hosting.ApplicationModel.IResourceAnnotation, System.IEquatable<PowerShellVariableReferenceAnnotation<T>>
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ public static partial class SqlProjectBuilderExtensions
public static ApplicationModel.IResourceBuilder<ApplicationModel.SqlPackageResource<TPackage>> WithConfigureDacDeployOptions<TPackage>(this ApplicationModel.IResourceBuilder<ApplicationModel.SqlPackageResource<TPackage>> builder, System.Action<Microsoft.SqlServer.Dac.DacDeployOptions> configureDeploymentOptions)
where TPackage : IPackageMetadata { throw null; }

public static ApplicationModel.IResourceBuilder<ApplicationModel.SqlProjectResource> WithDacDeployOptions(this ApplicationModel.IResourceBuilder<ApplicationModel.SqlProjectResource> builder, string optionsPath) { throw null; }

public static ApplicationModel.IResourceBuilder<ApplicationModel.SqlPackageResource<TPackage>> WithDacDeployOptions<TPackage>(this ApplicationModel.IResourceBuilder<ApplicationModel.SqlPackageResource<TPackage>> builder, string optionsPath)
where TPackage : IPackageMetadata { throw null; }

public static ApplicationModel.IResourceBuilder<ApplicationModel.SqlProjectResource> WithDacpac(this ApplicationModel.IResourceBuilder<ApplicationModel.SqlProjectResource> builder, string dacpacPath) { throw null; }

public static ApplicationModel.IResourceBuilder<ApplicationModel.SqlPackageResource<TPackage>> WithDacpac<TPackage>(this ApplicationModel.IResourceBuilder<ApplicationModel.SqlPackageResource<TPackage>> builder, string dacpacPath)
Expand All @@ -55,6 +60,10 @@ public partial record ConfigureDacDeployOptionsAnnotation(System.Action<Microsof
{
}

public partial record DacDeployOptionsAnnotation(string OptionsPath) : IResourceAnnotation
{
}

public partial record DacpacMetadataAnnotation(string DacpacPath) : IResourceAnnotation
{
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace CommunityToolkit.Aspire.Minio.Client
{
public partial class HeaderAppInformation
{
public string AppName { get { throw null; } set { } }

public string AppVersion { get { throw null; } set { } }
}

public sealed partial class MinioClientSettings
{
public Microsoft.Extensions.DependencyInjection.ServiceLifetime ServiceLifetime;
public MinioCredentials? Credentials { get { throw null; } set { } }

public System.Uri? Endpoint { get { throw null; } set { } }

public bool SetTraceOn { get { throw null; } set { } }

public HeaderAppInformation? UserAgentHeaderInfo { get { throw null; } set { } }

public bool UseSsl { get { throw null; } set { } }
}

public partial class MinioCredentials
{
public string AccessKey { get { throw null; } set { } }

public string SecretKey { get { throw null; } set { } }
}
}

namespace Microsoft.Extensions.Hosting
{
public static partial class MinioClientBuilderExtensionMethods
{
public static void AddMinioClient(this IHostApplicationBuilder builder, string? connectionName = null, string? configurationSectionName = "Aspire:Minio:Client", System.Action<CommunityToolkit.Aspire.Minio.Client.MinioClientSettings>? configureSettings = null) { }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,39 @@ namespace Microsoft.Extensions.Hosting
{
public partial class AspireOllamaApiClientBuilder
{
public AspireOllamaApiClientBuilder(IHostApplicationBuilder hostBuilder, string serviceKey, bool disableTracing) { }
public AspireOllamaApiClientBuilder(IHostApplicationBuilder hostBuilder, object serviceKey, bool disableTracing) { }

public bool DisableTracing { get { throw null; } }

public IHostApplicationBuilder HostBuilder { get { throw null; } }

public string ServiceKey { get { throw null; } }
public object ServiceKey { get { throw null; } }
}

public static partial class AspireOllamaChatClientExtensions
{
public static AI.ChatClientBuilder AddChatClient(this AspireOllamaApiClientBuilder builder) { throw null; }

public static AI.ChatClientBuilder AddKeyedChatClient(this AspireOllamaApiClientBuilder builder, object serviceKey) { throw null; }

public static AI.ChatClientBuilder AddKeyedChatClient(this AspireOllamaApiClientBuilder builder) { throw null; }
}

public static partial class AspireOllamaEmbeddingGeneratorExtensions
{
public static AI.EmbeddingGeneratorBuilder<string, AI.Embedding<float>> AddEmbeddingGenerator(this AspireOllamaApiClientBuilder builder) { throw null; }

public static AI.EmbeddingGeneratorBuilder<string, AI.Embedding<float>> AddKeyedEmbeddingGenerator(this AspireOllamaApiClientBuilder builder, object serviceKey) { throw null; }

public static AI.EmbeddingGeneratorBuilder<string, AI.Embedding<float>> AddKeyedEmbeddingGenerator(this AspireOllamaApiClientBuilder builder) { throw null; }
}

public static partial class AspireOllamaSharpExtensions
{
public static AspireOllamaApiClientBuilder AddKeyedOllamaApiClient(this IHostApplicationBuilder builder, object serviceKey, CommunityToolkit.Aspire.OllamaSharp.OllamaSharpSettings settings) { throw null; }

public static AspireOllamaApiClientBuilder AddKeyedOllamaApiClient(this IHostApplicationBuilder builder, object serviceKey, string connectionName, System.Action<CommunityToolkit.Aspire.OllamaSharp.OllamaSharpSettings>? configureSettings = null) { throw null; }

public static AspireOllamaApiClientBuilder AddKeyedOllamaApiClient(this IHostApplicationBuilder builder, string connectionName, System.Action<CommunityToolkit.Aspire.OllamaSharp.OllamaSharpSettings>? configureSettings = null) { throw null; }

[System.Obsolete("This approach to registering IChatClient is deprecated, use AddKeyedOllamaApiClient().AddChatClient() instead.")]
Expand Down
Loading