Initial migration service changes for assessment support (#1093)

* Migration service WIP 1

* Assessment DLLs

* WIP

* WIP 2

* Add migration nuget package

* WIP2

* Fix up assessment handler

* WIP

* Fix build scripts

* WIP

* Update Assessment references

* Fix metadata copy to work with publish
This commit is contained in:
Karl Burtram
2020-10-13 11:02:29 -07:00
committed by GitHub
parent 1ee0c1d09a
commit 1a0388c8cb
14 changed files with 1818 additions and 515 deletions

View File

@@ -0,0 +1,19 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.SqlServer.Management.Assessment;
namespace Microsoft.SqlTools.ServiceLayer.Migration.Contracts
{
/// <summary>
/// Describes an item returned by SQL Assessment RPC methods
/// </summary>
public class ImpactedObjectInfo
{
public string Name { get; set; }
public string ImpactDetail { get; set; }
public string ObjectType { get; set; }
}
}

View File

@@ -0,0 +1,78 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.SqlServer.Management.Assessment;
namespace Microsoft.SqlTools.ServiceLayer.Migration.Contracts
{
/// <summary>
/// Describes an item returned by SQL Assessment RPC methods
/// </summary>
public class MigrationAssessmentInfo
{
/// <summary>
/// Gets or sets assessment ruleset version.
/// </summary>
public string RulesetVersion { get; set; }
/// <summary>
/// Gets or sets assessment ruleset name
/// </summary>
public string RulesetName { 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; }
/// <summary>
/// Gets or sets check's ID.
/// </summary>
public string CheckId { get; set; }
/// <summary>
/// Gets or sets tags assigned to this item.
/// </summary>
public string[] Tags { get; set; }
/// <summary>
/// Gets or sets a display name for this item.
/// </summary>
public string DisplayName { get; set; }
/// <summary>
/// Gets or sets a brief description of the item's purpose.
/// </summary>
public string Description { get; set; }
/// <summary>
/// Gets or sets a <see cref="string"/> containing
/// an link to a page providing detailed explanation
/// of the best practice.
/// </summary>
public string HelpLink { get; set; }
/// <summary>
/// Gets or sets a <see cref="string"/> indicating
/// severity level assigned to this items.
/// Values are: "Information", "Warning", "Critical".
/// </summary>
public string Level { get; set; }
public string Message { get; set; }
public string AppliesToMigrationTargetPlatform { get; set; }
public string IssueCategory { get; set; }
public ImpactedObjectInfo[] ImpactedObjects { get; set; }
}
}

View File

@@ -0,0 +1,44 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using System.Collections.Generic;
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
namespace Microsoft.SqlTools.ServiceLayer.Migration.Contracts
{
public class MigrationAssessmentsParams
{
public string OwnerUri { get; set; }
}
public class MigrationAssessmentResult
{
/// <summary>
/// Gets the collection of assessment results.
/// </summary>
public List<MigrationAssessmentInfo> Items { get; } = new List<MigrationAssessmentInfo>();
/// <summary>
/// Gets or sets a value indicating
/// if assessment operation was successful.
/// </summary>
public bool Success { get; set; }
/// <summary>
/// Gets or sets an status message for the operation.
/// </summary>
public string ErrorMessage { get; set; }
}
/// <summary>
/// Retreive metadata for the table described in the TableMetadataParams value
/// </summary>
public class MigrationAssessmentsRequest
{
public static readonly
RequestType<MigrationAssessmentsParams, MigrationAssessmentResult> Type =
RequestType<MigrationAssessmentsParams, MigrationAssessmentResult>.Create("migration/getassessments");
}
}