Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add has error property in response #2074

Merged
merged 2 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/PortingAssistant.Client.Analysis/AnalysisHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,7 @@ private ProjectAnalysisResult AnalyzeProject(
ExternalReferences = analyzer.ProjectResult.ExternalReferences,
ProjectCompatibilityResult = compatibilityResults,
LinesOfCode = analyzer.ProjectResult.LinesOfCode,
HasCompatibilityCheckingError = compatibilityCheckerResponse.HasCompatibilityCheckingError // compatibilityCheckerResponse Error
};
}
catch (Exception ex)
Expand Down Expand Up @@ -653,8 +654,8 @@ private CompatibilityCheckerResponse MergeRecommendationResultToPackageAnalysisR
{
foreach (var packageRecommend in compatibilityCheckerResponse.PackageRecommendationResults)
{
if (packageRecommend.Value?.Recommendations != null &&
compatibilityCheckerResponse.PackageAnalysisResults.ContainsKey(packageRecommend.Key) &&
if (packageRecommend.Value?.Recommendations != null && compatibilityCheckerResponse.PackageAnalysisResults!= null
&& compatibilityCheckerResponse.PackageAnalysisResults.ContainsKey(packageRecommend.Key) &&
compatibilityCheckerResponse.PackageAnalysisResults[packageRecommend.Key].Recommendations == null
)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,9 @@ public SolutionAnalysisResult GenerateSolutionAnalysisResult(string solutionFile
{
FailedProjects = failedProjects,
SolutionDetails = solutionDetails,
ProjectAnalysisResults = projectAnalysisResults
ProjectAnalysisResults = projectAnalysisResults,
HasCompatibilityCheckingError = projectAnalysisResults.Any(c=>c.HasCompatibilityCheckingError) //if any project has compatibilityCheckerResponse Error
};
}
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class ProjectAnalysisResult : ProjectDetails, IDisposable
public VisualBasicRootNodes VisualBasicProjectRules { get; set; }
public ExternalReferences ExternalReferences { get; set; }
public ProjectCompatibilityResult ProjectCompatibilityResult { get; set; }

public bool HasCompatibilityCheckingError { get; set; } //GetCompatibilityResponse HasError
public void Dispose()
{
Errors = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ public class SolutionAnalysisResult
public List<ProjectAnalysisResult> ProjectAnalysisResults { get; set; }
public List<string> FailedProjects { get; set; }
public List<string> Errors { get; set; } //Solution errors; solution file errors etc.
public bool HasCompatibilityCheckingError { get; set; } //GetCompatibilityResponse HasError for any project
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class RecommendationOnlyResponse
public Language Language { get; set; }
public Dictionary<PackageVersionPair, AnalysisResult> PackageRecommendationResults { get; set; }
public Dictionary<PackageVersionPair, Dictionary<string, AnalysisResult>> ApiRecommendationResults { get; set; }

public bool HasCompatibilityCheckingError { get; set; } = false;
public Recommendations? GetRecommendationsForPackage(PackageVersionPair pkgVersionPair)
{
if (PackageRecommendationResults == null
Expand Down
Loading