Add queue hardening by modifying DeploymentJobTargets, DeploymentJobSteps, and DeploymentJobs tables
- Drop existing indexes on DeploymentJobTargets and DeploymentJobSteps - Alter Status column to nvarchar(450) in DeploymentJobTargets, DeploymentJobSteps, and DeploymentJobs - Add new columns: Finished, OutputMetadataJson, Started to DeploymentJobTargets; ErrorMessage, Finished, OutputMetadataJson, Started to DeploymentJobSteps; CorrelationId, HeartbeatAt, Priority, RowVersion, ScheduledAt, WorkerName to DeploymentJobs - Create new indexes for improved query performance - Add constraints to ensure OutputMetadataJson is valid JSON - Record migration in __EFMigrationsHistory
This commit is contained in:
@@ -12,6 +12,13 @@
|
||||
public string? ErrorMessage { get; set; }
|
||||
public string? MetadataJson { get; set; }
|
||||
public string? RuleSnapshotJson { get; set; }
|
||||
public Guid CorrelationId { get; set; }
|
||||
public int Priority { get; set; }
|
||||
public DateTime? ScheduledAt { get; set; }
|
||||
public DateTime? HeartbeatAt { get; set; }
|
||||
public string? WorkerName { get; set; }
|
||||
public string? LockedBy { get; set; }
|
||||
public DateTime? LockedUntil { get; set; }
|
||||
public ICollection<GetQueueJobTargetDto> Targets { get; set; } = new List<GetQueueJobTargetDto>();
|
||||
public ICollection<GetQueueJobStepDto> Steps { get; set; } = new List<GetQueueJobStepDto>();
|
||||
}
|
||||
|
||||
@@ -9,6 +9,11 @@
|
||||
public DateTime? Started { get; set; }
|
||||
public DateTime? Finished { get; set; }
|
||||
public string? ErrorMessage { get; set; }
|
||||
public Guid CorrelationId { get; set; }
|
||||
public int Priority { get; set; }
|
||||
public DateTime? ScheduledAt { get; set; }
|
||||
public DateTime? HeartbeatAt { get; set; }
|
||||
public string? WorkerName { get; set; }
|
||||
public int TargetCount { get; set; }
|
||||
public int SucceededTargetCount { get; set; }
|
||||
public int FailedTargetCount { get; set; }
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
public DateTime? ApprovedAt { get; set; }
|
||||
public string? ApprovedBy { get; set; }
|
||||
public string? ApprovalComment { get; set; }
|
||||
public DateTime? Started { get; set; }
|
||||
public DateTime? Finished { get; set; }
|
||||
public string? OutputMetadataJson { get; set; }
|
||||
public string? ErrorMessage { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
public string Status { get; set; } = string.Empty;
|
||||
public int Attempts { get; set; }
|
||||
public string? ErrorMessage { get; set; }
|
||||
public DateTime? Started { get; set; }
|
||||
public DateTime? Finished { get; set; }
|
||||
public string? OutputMetadataJson { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,29 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.SelfService.Portal.Core.API.Dto.DeploymentComposition.Add;
|
||||
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Dto.DeploymentBatch.Add
|
||||
{
|
||||
public class AddDeploymentBatchDto
|
||||
{
|
||||
[Column(Order = 1)]
|
||||
public Guid TemplateId { get; set; }
|
||||
public Guid? TemplateId { get; set; }
|
||||
|
||||
[Column(Order = 2)]
|
||||
public Guid? DeploymentRuleId { get; set; }
|
||||
public Guid? TemplateVersionId { get; set; }
|
||||
|
||||
[Column(Order = 3)]
|
||||
public string Status { get; set; } = string.Empty;
|
||||
public Guid? DeploymentRuleId { get; set; }
|
||||
|
||||
[Column(Order = 4)]
|
||||
public string Status { get; set; } = string.Empty;
|
||||
|
||||
[Column(Order = 5)]
|
||||
public ICollection<Guid>? TargetIds { get; set; }
|
||||
|
||||
[Column(Order = 6)]
|
||||
public ICollection<AddDeploymentTemplateSelectionDto>? TemplateSelections { get; set; }
|
||||
|
||||
[Column(Order = 7)]
|
||||
public ICollection<AddDeploymentTargetAssignmentDto>? TargetAssignments { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Microsoft.SelfService.Portal.Core.API.Dto.Deployment.Get;
|
||||
using Microsoft.SelfService.Portal.Core.API.Dto.Deployment.Get;
|
||||
using Microsoft.SelfService.Portal.Core.API.Dto.DeploymentComposition.Get;
|
||||
using Microsoft.SelfService.Portal.Core.API.Dto.Template.Get;
|
||||
|
||||
@@ -6,11 +6,13 @@ namespace Microsoft.SelfService.Portal.Core.API.Dto.DeploymentBatch.Get
|
||||
{
|
||||
public class GetDeploymentBatchDetailsDto : BaseDto
|
||||
{
|
||||
public Guid? TemplateId { get; set; }
|
||||
|
||||
public Guid? DeploymentRuleId { get; set; }
|
||||
|
||||
public string Status { get; set; } = string.Empty;
|
||||
|
||||
public GetTemplateDetailsDto Template { get; set; } = null!;
|
||||
public GetTemplateDetailsDto? Template { get; set; }
|
||||
|
||||
public ICollection<GetDeploymentDetailsDto> Deployments { get; set; } = new List<GetDeploymentDetailsDto>();
|
||||
public ICollection<GetDeploymentTemplateSelectionDto> TemplateSelections { get; set; } = new List<GetDeploymentTemplateSelectionDto>();
|
||||
@@ -18,4 +20,3 @@ namespace Microsoft.SelfService.Portal.Core.API.Dto.DeploymentBatch.Get
|
||||
public ICollection<GetDeploymentTargetAssignmentDto> TargetAssignments { get; set; } = new List<GetDeploymentTargetAssignmentDto>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,21 @@
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Dto.DeploymentBatch.Get
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Dto.DeploymentBatch.Get
|
||||
{
|
||||
public class GetDeploymentBatchDto : BaseDetailsDto
|
||||
{
|
||||
public Guid TemplateId { get; set; }
|
||||
public Guid? TemplateId { get; set; }
|
||||
|
||||
public Guid? DeploymentRuleId { get; set; }
|
||||
|
||||
public string Status { get; set; } = string.Empty;
|
||||
|
||||
public Guid? PrimaryTemplateVersionId { get; set; }
|
||||
|
||||
public string? PrimaryTemplateName { get; set; }
|
||||
|
||||
public string? PrimaryTemplateVersion { get; set; }
|
||||
|
||||
public int TemplateSelectionCount { get; set; }
|
||||
|
||||
public int TargetAssignmentCount { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user