Skip to content

Commit 110841b

Browse files
MackinnonBuckaaronpowellFullStackChefAlirexaa
authored
Update Aspire version to 9.2.0 (#627)
* Update Aspire version * Updating the version of the CT * Fixing ollama tests * Fixing test to match the updated Bicep output * Update ResourceCreationTests.cs Update tests to remove principal information * Populate redis password in dbgate * Fix redis-password tests * Fix test --------- Co-authored-by: Aaron Powell <[email protected]> Co-authored-by: Brett Smith <[email protected]> Co-authored-by: Alireza Baloochi <[email protected]>
1 parent b3d65b0 commit 110841b

File tree

10 files changed

+154
-150
lines changed

10 files changed

+154
-150
lines changed

Directory.Build.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<Nullable>enable</Nullable>
1313

1414
<AspireMajorVersion>9</AspireMajorVersion>
15-
<AspireVersion>$(AspireMajorVersion).1.0</AspireVersion>
15+
<AspireVersion>$(AspireMajorVersion).2.0</AspireVersion>
1616
<AspireAppHostSdkVersion>$(AspireVersion)</AspireAppHostSdkVersion>
1717
<AspNetCoreVersion>9.0.0</AspNetCoreVersion>
1818
<DotNetExtensionsVersion>9.0.4</DotNetExtensionsVersion>
@@ -37,8 +37,8 @@
3737

3838
<!-- Versioning -->
3939
<PropertyGroup>
40-
<ToolkitMinorVersion>3</ToolkitMinorVersion>
41-
<ToolkitPatchVersion>1</ToolkitPatchVersion>
40+
<ToolkitMinorVersion>4</ToolkitMinorVersion>
41+
<ToolkitPatchVersion>0</ToolkitPatchVersion>
4242
<ToolkitPreviewVersion>preview.1</ToolkitPreviewVersion>
4343

4444
<VersionPrefix>$(AspireMajorVersion).$(ToolkitMinorVersion).$(ToolkitPatchVersion)</VersionPrefix>

src/CommunityToolkit.Aspire.Hosting.Java/JavaAppHostingExtension.Executable.cs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,16 +107,18 @@ public static IResourceBuilder<JavaAppExecutableResource> WithMavenBuild(
107107
await BuildWithMaven(builder.Resource, context.ServiceProvider, context.CancellationToken, false).ConfigureAwait(false) ?
108108
new ExecuteCommandResult { Success = true } :
109109
new ExecuteCommandResult { Success = false, ErrorMessage = "Failed to build with Maven" },
110-
(context) => context.ResourceSnapshot.State switch
110+
new CommandOptions()
111111
{
112-
{ Text: "Stopped" } or
113-
{ Text: "Exited" } or
114-
{ Text: "Finished" } or
115-
{ Text: "FailedToStart" } => ResourceCommandState.Enabled,
116-
_ => ResourceCommandState.Disabled
117-
},
118-
iconName: "build"
119-
);
112+
IconName = "build",
113+
UpdateState = (context) => context.ResourceSnapshot.State switch
114+
{
115+
{ Text: "Stopped" } or
116+
{ Text: "Exited" } or
117+
{ Text: "Finished" } or
118+
{ Text: "FailedToStart" } => ResourceCommandState.Enabled,
119+
_ => ResourceCommandState.Disabled
120+
},
121+
});
120122

121123
return builder;
122124

src/CommunityToolkit.Aspire.Hosting.Ollama/OllamaResourceBuilderExtensions.Model.cs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,6 @@ private static IResourceBuilder<OllamaModelResource> AddModelResourceCommand(
145145
builder.WithCommand(
146146
name: name,
147147
displayName: displayName,
148-
updateState: context =>
149-
context.ResourceSnapshot.State?.Text == KnownResourceStates.Running ?
150-
ResourceCommandState.Enabled :
151-
ResourceCommandState.Disabled,
152148
executeCommand: async context =>
153149
{
154150
var modelResource = builder.Resource;
@@ -165,13 +161,19 @@ private static IResourceBuilder<OllamaModelResource> AddModelResourceCommand(
165161

166162
return await executeCommand(modelResource, ollamaClient, logger, notificationService, context.CancellationToken);
167163
},
168-
displayDescription: displayDescription,
169-
parameter: parameter,
170-
confirmationMessage: confirmationMessage,
171-
iconName: iconName,
172-
iconVariant: iconVariant,
173-
isHighlighted: isHighlighted
174-
);
164+
commandOptions: new()
165+
{
166+
Description = displayDescription,
167+
Parameter = parameter,
168+
ConfirmationMessage = confirmationMessage,
169+
IconName = iconName,
170+
IconVariant = iconVariant,
171+
IsHighlighted = isHighlighted,
172+
UpdateState = context =>
173+
context.ResourceSnapshot.State?.Text == KnownResourceStates.Running ?
174+
ResourceCommandState.Enabled :
175+
ResourceCommandState.Disabled,
176+
});
175177

176178
private static IResourceBuilder<OllamaModelResource> WithModelDownload(this IResourceBuilder<OllamaModelResource> builder)
177179
{

src/CommunityToolkit.Aspire.Hosting.Redis.Extensions/RedisBuilderExtensions.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,11 @@ private static void ConfigureDbGateContainer(EnvironmentCallbackContext context,
6464
{
6565

6666
// DbGate assumes Redis is being accessed over a default Aspire container network and hardcodes the resource address
67-
// This will need to be refactored once updated service discovery APIs are available
67+
var redisUrl = redisResource.PasswordParameter is not null ?
68+
$"redis://:{redisResource.PasswordParameter.Value}@{redisResource.Name}:{redisResource.PrimaryEndpoint.TargetPort}" : $"redis://{redisResource.Name}:{redisResource.PrimaryEndpoint.TargetPort}";
69+
6870
context.EnvironmentVariables.Add($"LABEL_redis{counter}", redisResource.Name);
69-
context.EnvironmentVariables.Add($"URL_redis{counter}", redisResource.ConnectionStringExpression);
71+
context.EnvironmentVariables.Add($"URL_redis{counter}", redisUrl);
7072
context.EnvironmentVariables.Add($"ENGINE_redis{counter}", "redis@dbgate-plugin-redis");
7173

7274
counter++;

src/CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects/SqlProjectBuilderExtensions.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,14 @@ internal static IResourceBuilder<TResource> InternalWithReference<TResource>(thi
215215
var service = context.ServiceProvider.GetRequiredService<SqlProjectPublishService>();
216216
await service.PublishSqlProject(builder.Resource, target.Resource, targetDatabaseName, context.CancellationToken);
217217
return new ExecuteCommandResult { Success = true };
218-
}, updateState: (context) => context.ResourceSnapshot?.State?.Text == KnownResourceStates.Finished ? ResourceCommandState.Enabled : ResourceCommandState.Disabled,
219-
displayDescription: "Redeploys the SQL Server Database Project to the target database.",
220-
iconName: "ArrowReset",
221-
iconVariant: IconVariant.Filled,
222-
isHighlighted: true);
218+
}, new CommandOptions()
219+
{
220+
Description = "Redeploys the SQL Server Database Project to the target database.",
221+
IconName = "ArrowReset",
222+
IconVariant = IconVariant.Filled,
223+
IsHighlighted = true,
224+
UpdateState = (context) => context.ResourceSnapshot?.State?.Text == KnownResourceStates.Finished ? ResourceCommandState.Enabled : ResourceCommandState.Disabled,
225+
});
223226

224227
return builder;
225228
}

0 commit comments

Comments
 (0)