mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-24 09:35:39 -05:00
Adding a flag for migration blocker flag in sql assessment and switching to new APIs (#1242)
* Adding a flag for migration blocker in sql assessment and switching to new APIs * Fixing var names
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
<PackageReference Update="Microsoft.Azure.Kusto.Data" Version="9.0.4" />
|
||||
<PackageReference Update="Microsoft.Azure.Kusto.Language" Version="9.0.4"/>
|
||||
<PackageReference Update="Microsoft.SqlServer.Assessment" Version="[1.0.305]" />
|
||||
<PackageReference Update="Microsoft.SqlServer.Migration.Assessment" Version="1.0.20210714.5" />
|
||||
<PackageReference Update="Microsoft.SqlServer.Migration.Assessment" Version="1.0.20210902.7" />
|
||||
<PackageReference Update="Microsoft.Azure.OperationalInsights" Version="1.0.0" />
|
||||
<PackageReference Update="Microsoft.CodeAnalysis.CSharp" Version="3.10.0" />
|
||||
<PackageReference Update="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="3.10.0" />
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -27,16 +27,10 @@ namespace Microsoft.SqlTools.ServiceLayer.Migration.Contracts
|
||||
/// </summary>
|
||||
public string RuleId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets assessed target's type.
|
||||
/// Supported values: 1 - server, 2 - database.
|
||||
/// </summary>
|
||||
public SqlObjectType TargetType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the assessed object's name.
|
||||
/// </summary>
|
||||
public string TargetName { get; set; }
|
||||
public string TargetType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the database name.
|
||||
@@ -89,5 +83,10 @@ namespace Microsoft.SqlTools.ServiceLayer.Migration.Contracts
|
||||
public string IssueCategory { get; set; }
|
||||
|
||||
public ImpactedObjectInfo[] ImpactedObjects { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// This flag is set if the assessment result is a blocker for migration to Target Platform.
|
||||
/// </summary>
|
||||
public bool DatabaseRestoreFails { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,10 +174,10 @@ namespace Microsoft.SqlTools.ServiceLayer.Migration
|
||||
internal async Task<MigrationAssessmentResult> GetAssessmentItems(string[] connectionStrings)
|
||||
{
|
||||
SqlAssessmentConfiguration.EnableLocalLogging = true;
|
||||
SqlAssessmentConfiguration.EnableReportCreation = true;
|
||||
SqlAssessmentConfiguration.AssessmentReportAndLogsRootFolderPath = Path.GetDirectoryName(Logger.LogFileFullPath);
|
||||
DmaEngine engine = new DmaEngine(connectionStrings);
|
||||
ISqlMigrationAssessmentModel contextualizedAssessmentResult = await engine.GetTargetAssessmentResultsList(System.Threading.CancellationToken.None);
|
||||
ISqlMigrationAssessmentModel contextualizedAssessmentResult = await engine.GetTargetAssessmentResultsListWithCheck(System.Threading.CancellationToken.None);
|
||||
engine.SaveAssessmentResultsToJson(contextualizedAssessmentResult, false);
|
||||
var server = (contextualizedAssessmentResult.Servers.Count > 0)? ParseServerAssessmentInfo(contextualizedAssessmentResult.Servers[0], engine): null;
|
||||
return new MigrationAssessmentResult()
|
||||
{
|
||||
@@ -246,25 +246,25 @@ namespace Microsoft.SqlTools.ServiceLayer.Migration
|
||||
{
|
||||
return assessmentResults.Select(r =>
|
||||
{
|
||||
var check = engine.GetRuleMetadata(r.FeatureId, r.AppliesToMigrationTargetPlatform);
|
||||
return new MigrationAssessmentInfo()
|
||||
{
|
||||
CheckId = check.Id,
|
||||
Description = check.Description,
|
||||
DisplayName = check.DisplayName,
|
||||
HelpLink = check.HelpLink,
|
||||
Level = check.Level.ToString(),
|
||||
TargetName = r.AppliesToMigrationTargetPlatform.ToString(),
|
||||
CheckId = r.Check.Id,
|
||||
Description = r.Check.Description,
|
||||
DisplayName = r.Check.DisplayName,
|
||||
HelpLink = r.Check.HelpLink,
|
||||
Level = r.Check.Level.ToString(),
|
||||
TargetType = r.TargetType.ToString(),
|
||||
DatabaseName = r.DatabaseName,
|
||||
ServerName = r.ServerName,
|
||||
Tags = check.Tags.ToArray(),
|
||||
Tags = r.Check.Tags.ToArray(),
|
||||
RulesetName = Engine.Configuration.DefaultRuleset.Name,
|
||||
RulesetVersion = Engine.Configuration.DefaultRuleset.Version.ToString(),
|
||||
RuleId = r.FeatureId.ToString(),
|
||||
Message = r.Message,
|
||||
AppliesToMigrationTargetPlatform = r.AppliesToMigrationTargetPlatform.ToString(),
|
||||
IssueCategory = r.IssueCategory.ToString(),
|
||||
ImpactedObjects = ParseImpactedObjects(r.ImpactedObjects)
|
||||
ImpactedObjects = ParseImpactedObjects(r.ImpactedObjects),
|
||||
DatabaseRestoreFails = r.DatabaseRestoreFails
|
||||
};
|
||||
}).ToArray();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user