From 560b882b77326b388848d97740492d96df3463c2 Mon Sep 17 00:00:00 2001 From: Jesper Thind Date: Tue, 13 Dec 2022 08:02:40 +0100 Subject: [PATCH] Fixed sc-2159 and sc-2158 --- src/Enterspeed.Cli/Commands/Deploy/ExtractCommand.cs | 5 +++-- src/Enterspeed.Cli/Commands/Tenant/SetActiveTenantCommand.cs | 4 ++-- src/Enterspeed.Cli/Enterspeed.Cli.csproj | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Enterspeed.Cli/Commands/Deploy/ExtractCommand.cs b/src/Enterspeed.Cli/Commands/Deploy/ExtractCommand.cs index 238a27f..26e36c2 100644 --- a/src/Enterspeed.Cli/Commands/Deploy/ExtractCommand.cs +++ b/src/Enterspeed.Cli/Commands/Deploy/ExtractCommand.cs @@ -90,14 +90,15 @@ public async Task InvokeAsync(InvocationContext context) private void ExtractSchema(GetMappingSchemaResponse schemaResponse) { + _deploymentPlanFileService.UpdateDeploymentPlan(schemaResponse.ViewHandle, schemaResponse.Version.Id.Version); + if (_schemaFileService.SchemaValid(schemaResponse.Version.Data, schemaResponse.ViewHandle)) { - _deploymentPlanFileService.UpdateDeploymentPlan(schemaResponse.ViewHandle, schemaResponse.Version.Id.Version); _logger.LogInformation($"Successfully extracted {schemaResponse.ViewHandle} and added it to the deployment plan"); } else { - _logger.LogWarning($"Use schema deploy for {schemaResponse.ViewHandle}, to update deploymentplan with versions on disk"); + _logger.LogWarning($"Schema on disk did not match deployed version. Use schema deploy for {schemaResponse.ViewHandle}, to update deploymentplan with versions on disk"); } } diff --git a/src/Enterspeed.Cli/Commands/Tenant/SetActiveTenantCommand.cs b/src/Enterspeed.Cli/Commands/Tenant/SetActiveTenantCommand.cs index 9aa1729..203dc34 100644 --- a/src/Enterspeed.Cli/Commands/Tenant/SetActiveTenantCommand.cs +++ b/src/Enterspeed.Cli/Commands/Tenant/SetActiveTenantCommand.cs @@ -10,7 +10,7 @@ public class SetActiveTenantCommand : Command { public SetActiveTenantCommand() : base(name: "set", "Set the active tenant") { - AddArgument(new Argument("id", "Id of the tenant") { }); + AddArgument(new Argument("id", "Id of the tenant") { Arity = ArgumentArity.ExactlyOne }); } public new class Handler : BaseCommandHandler, ICommandHandler @@ -37,7 +37,7 @@ public Task InvokeAsync(InvocationContext context) } var tenants = tenantIds.Select(TenantId.Parse); - var activeTenant = tenants.FirstOrDefault(x => x.TenantGuid == Id); + var activeTenant = tenants.FirstOrDefault(x => x.IdValue == Id); if (activeTenant == null) { _logger.LogError("Could not find tenant"); diff --git a/src/Enterspeed.Cli/Enterspeed.Cli.csproj b/src/Enterspeed.Cli/Enterspeed.Cli.csproj index 09f3368..f83125a 100644 --- a/src/Enterspeed.Cli/Enterspeed.Cli.csproj +++ b/src/Enterspeed.Cli/Enterspeed.Cli.csproj @@ -6,7 +6,7 @@ enable disable Enterspeed - 1.0.0-preview + 1.0.0-preview3 true