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

Created New ManagedBatchParser project in .NetStandard #762

Closed
wants to merge 33 commits into from
Closed

Created New ManagedBatchParser project in .NetStandard #762

wants to merge 33 commits into from

Conversation

NiranjanVirtuosity
Copy link
Contributor

-- Solution Restructured.
-- Created ManagedBatchParser as a independent one.
-- Project referred as Nuget Package.

@coveralls
Copy link

coveralls commented Jan 4, 2019

Coverage Status

Coverage increased (+1.5%) to 73.692% when pulling 67c48db on NiranjanVirtuosity:master into 7cc2636 on Microsoft:master.

@Matteo-T
Copy link
Contributor

Matteo-T commented Jan 5, 2019

@NiranjanVirtuosity: is there a way to see the whole new solution? Could you just share it out so I can take a look? Or share your fork/branch perhaps?

Copy link
Member

@kburtram kburtram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please take a look at my comments. Particularly it looks like the resource strings haven't been split up properly.

<PreserveCompilationContext>true</PreserveCompilationContext>
<DebugType>portable</DebugType>
<PackageOutputPath>../../bin/nuget</PackageOutputPath>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what are these changes regarding packaging for? I assume creating a Nuget package. Are we publishing that now?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is the plan.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need to do this?

}
}


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know why the SQL Agent resource are in this file? The resource file should only contain the strings used by this project. Please update the resource files so (1) this project only contains it's resources and (2) the project this code was copied from no longer contains unused resources.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have optimized the String resource files by removing unused keys in Localization\SR.Strings. Now the Sr.cs files contain only needed strings used by the project.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NiranjanVirtuosity I can't see where you're removing the batch parser string resources from the ServiceLayer project. Should we do that as well if they are no longer needed there?

Copy link
Contributor Author

@NiranjanVirtuosity NiranjanVirtuosity Jan 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kburtram I have removed the unused strings from both ServiceLayer and ManagedBatchParser projects.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NiranjanVirtuosity hmm, I still see BatchParser_CommentNotTerminated in the ServiceLayer project in your PR. I'd expect this and other BatchParser string to be removed since they are now duplicated in the new project. Do you know why these strings need to be duplicated in both projects?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I removed those in serviceLayer now.

@kburtram
Copy link
Member

kburtram commented Jan 8, 2019

@NiranjanVirtuosity I see the code coverage number is dropped significantly by this PR. Please resolve this prior to merging. Likely you'll need to add the new assembly to the list of DLLs instrumented for the code coverage runs.

Copy link
Member

@kburtram kburtram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the CI builds are broken and the code coverage number is still way down. Also, please rename the new test project to have a more generic name so it could logically contain all batch parser tests.

using Xunit;
using Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode;
using ManagedBatchParserSr = Microsoft.SqlTools.ManagedBatchParser.SR;
namespace Microsoft.SqlTools.ManagedBatchParser.LocalizationTests
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please rename this project Microsoft.SqlTools.ManagedBatchParser.UnitTests or something like that so it is a bit more generic? I think having an entire project for a singles localization test is a bit overkill, so if you do need a new test project it should be able to contain all batch parser tests.

As a side note, this test doesn't look particularly useful, and I think it's just for code coverage purposes. If it doesn't impact the code coverage numbers, you might consider removing this test.

@@ -4,6 +4,6 @@
<clear />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks there are binary .nupkg files in this PR. These should be the build output from the projects, so I don't think they should be checked into the Git repository, unless I'm missing something.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nuget packages which were added in bin folder is a temporary solution to fix CI build issue. Once the Package get published it will be referred from Nuget.org

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NiranjanVirtuosity why are the projects using a binary PackageReference instead of a source ProjectReference? Typically code in the same solution would use a direct source reference.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a version conflict between the newly added ManagedBatchParser and these projects when we used project reference, So we decided to refer from NuGet.

<ItemGroup>
<PackageReference Include="Microsoft.SqlServer.SqlManagementObjects" Version="150.18040.0-preview" />
<PackageReference Include="System.Data.SqlClient" Version="4.6.0" />
<PackageReference Include="Microsoft.SqlTools.Hosting" Version="1.0.0" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this a package reference instead of a project reference?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a version conflict between the newly added ManagedBatchParser and these projects when we used project reference, So we decided to refer from NuGet.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, explain what the conflict is about...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is error we get, if we use project reference.
Error: CS0433: The type [''] exists in both 'Microsoft.SqlServer.Smo, Version=15.1.18040.0, Culture=neutral, PublishKeyToken=89845dcd8080cc91' and 'Microsoft.SqlServer.Smo, Version=15.1.16168.50, Culture=neutral, PublishKeyToken=89845dcd8080cc91' [*.csproj]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a binary reference isn't the way to go here. it will need to be constantly updated for one. I'm not sure the error, but it appears there is some type of inconsistent SMO references. Please refer to the other projects that are successfully referencing these projects using ProjectReference in this solution for examples.

@kburtram
Copy link
Member

@NiranjanVirtuosity based on the "improved" code coverage metric it appears the new project isn't being included in the code coverage runs (i.e., since there aren't any new tests the likely explanation for improved code coverage is less code being instrumented). It would be a good idea to add the new project into the code coverage test runs so that the metric is accurately captured.

@kburtram
Copy link
Member

@NiranjanVirtuosity please remove the binary Nuget packages from the PR prior to merging to master. They should no longer be needed. Also, do we still need to generate the nupkg files during the build for the hosting project? If so, why?

@@ -34,6 +33,7 @@
<ItemGroup>
<ProjectReference Include="../Microsoft.SqlTools.Hosting/Microsoft.SqlTools.Hosting.csproj" />
<ProjectReference Include="../Microsoft.SqlTools.Credentials/Microsoft.SqlTools.Credentials.csproj" />
<ProjectReference Include="..\Microsoft.SqlTools.ManagedBatchParser\Microsoft.SqlTools.ManagedBatchParser.csproj" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would appear that the convention is to use forward slashes. Pick one and sick with.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant both \ should become /

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I replaced those.

…viceLayer.csproj

--  <PackageOutputPath> ,<GeneratePackageOnBuild> removed from Hosting and ManagedBatchParser
@@ -67,6 +71,8 @@ SET SERVICECODECOVERAGE=FALSE

%CODECOVERAGETOOL% -mergeoutput -register:user -target:dotnet.exe -targetargs:"test %REPOROOT%\test\Microsoft.SqlTools.ServiceLayer.IntegrationTests\Microsoft.SqlTools.ServiceLayer.IntegrationTests.csproj %DOTNETCONFIG%" -oldstyle -filter:"+[Microsoft.SqlTools.*]* +[MicrosoftSqlToolsServiceLayer*]* +[MicrosoftSqlToolsCredentials*]* [Microsoft.SqlTools.*]* -[xunit*]* -[Microsoft.SqlTools.ServiceLayer.Test*]* -[Microsoft.SqlTools.ServiceLayer.*Test*]* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Agent.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.DisasterRecovery.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Profiler.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Admin.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Management.*" -output:coverage.xml -hideskipped:All -searchdirs:%REPOROOT%\test\Microsoft.SqlTools.ServiceLayer.IntegrationTests\bin\Debug\netcoreapp2.2

%CODECOVERAGETOOL% -mergeoutput -register:user -target:dotnet.exe -targetargs:"test %REPOROOT%\test\Microsoft.SqlTools.ManagedBatchParser.UnitTests\Microsoft.SqlTools.ManagedBatchParser.UnitTests.csproj %DOTNETCONFIG%" -oldstyle -filter:"+[Microsoft.SqlTools.*]* +[MicrosoftSqlToolsServiceLayer*]* +[MicrosoftSqlToolsCredentials*]* [Microsoft.SqlTools.*]* -[xunit*]* -[Microsoft.SqlTools.ServiceLayer.Test*]* -[Microsoft.SqlTools.ServiceLayer.*Test*]* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Agent.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.DisasterRecovery.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Profiler.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Admin.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Management.*" -output:coverage.xml -hideskipped:All -searchdirs:%REPOROOT%\test\Microsoft.SqlTools.ServiceLayer.IntegrationTests\bin\Debug\netcoreapp2.2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

searchdirs path should refer to Microsoft.SqlTools.ManagedBatchParser.UnitTests bin directory rather than IntegrationTests directory.

using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace DummyProject_13
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this DummyProject included in the PR?

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<CoverageSession xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Version="4.6.684.0">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this file being added? i.e., why do we need it checked in?

*.Designer.cs
/test/CodeCoverage/codecoverage - Copy.bat
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this line in the .gitignore? It doesn't seem like a general file name that will be in most peoples' workspaces.

@@ -12,7 +12,7 @@
<DefineConstants>$(DefineConstants);NETCOREAPP1_0;TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PreserveCompilationContext>true</PreserveCompilationContext>
<DebugType>portable</DebugType>
<DebugType>full</DebugType>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we checking in the .BAK files that get generated during code coverage runs. Please remove all extraneous content from the PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NiranjanVirtuosity: can you address these really old comments? Please, try to be diligent in what you submit. There seems to be quite a bit of junk in your commits...

@kburtram
Copy link
Member

@NiranjanVirtuosity it looks like the AppVeyor build failed on the latest iteration. I also left some new comments related to various extraneous content in current PR iteration that should be removed prior to merging.

@kburtram
Copy link
Member

kburtram commented Feb 8, 2019

We took this change in #774.

@kburtram kburtram closed this Feb 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants