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

Eliminate source-build prebuilts introduced by new test framework infrastructure #5519

Closed
MichaelSimons opened this issue Oct 27, 2022 · 9 comments
Assignees
Labels
triaged The issue was evaluated by the triage team, placed on correct area, next action defined.

Comments

@MichaelSimons
Copy link
Member

The changes introduced in #5399 brought in the following source-build prebuilts:

<UsageData>
  <ProjectDirectories>
    <Dir>src/</Dir>
    <Dir></Dir>
  </ProjectDirectories>
  <Usages>
    <Usage Id="Argon" Version="0.1.0" File="src/artifacts/obj/Microsoft.TemplateEngine.Authoring.CLI/project.assets.json" />
    <Usage Id="Argon" Version="0.1.0" File="src/artifacts/obj/Microsoft.TemplateEngine.Authoring.TemplateVerifier/project.assets.json" />
    <Usage Id="DiffEngine" Version="9.1.0" />
    <Usage Id="DiffEngine" Version="10.4.0" File="src/artifacts/obj/Microsoft.TemplateEngine.Authoring.CLI/project.assets.json" />
    <Usage Id="DiffEngine" Version="10.4.0" File="src/artifacts/obj/Microsoft.TemplateEngine.Authoring.TemplateVerifier/project.assets.json" />
    <Usage Id="DiffPlex" Version="1.7.1" File="src/artifacts/obj/Microsoft.TemplateEngine.Authoring.CLI/project.assets.json" />
    <Usage Id="DiffPlex" Version="1.7.1" File="src/artifacts/obj/Microsoft.TemplateEngine.Authoring.TemplateVerifier/project.assets.json" />
    <Usage Id="EmptyFiles" Version="2.8.0" />
    <Usage Id="EmptyFiles" Version="3.0.0" File="src/artifacts/obj/Microsoft.TemplateEngine.Authoring.CLI/project.assets.json" />
    <Usage Id="EmptyFiles" Version="3.0.0" File="src/artifacts/obj/Microsoft.TemplateEngine.Authoring.TemplateVerifier/project.assets.json" />
    <Usage Id="FluentAssertions" Version="6.8.0" File="src/artifacts/obj/Microsoft.TemplateEngine.Authoring.CLI/project.assets.json" />
    <Usage Id="FluentAssertions" Version="6.8.0" File="src/artifacts/obj/Microsoft.TemplateEngine.Authoring.TemplateVerifier/project.assets.json" IsDirectDependency="true" />
    <Usage Id="SimpleInfoName" Version="1.1.1" />
    <Usage Id="SimpleInfoName" Version="1.2.0" File="src/artifacts/obj/Microsoft.TemplateEngine.Authoring.CLI/project.assets.json" />
    <Usage Id="SimpleInfoName" Version="1.2.0" File="src/artifacts/obj/Microsoft.TemplateEngine.Authoring.TemplateVerifier/project.assets.json" />
    <Usage Id="System.CodeDom" Version="5.0.0" File="src/artifacts/obj/Microsoft.TemplateEngine.Authoring.CLI/project.assets.json" />
    <Usage Id="System.CodeDom" Version="5.0.0" File="src/artifacts/obj/Microsoft.TemplateEngine.Authoring.TemplateVerifier/project.assets.json" />
    <Usage Id="System.Configuration.ConfigurationManager" Version="4.4.0" />
    <Usage Id="System.Management" Version="5.0.0" File="src/artifacts/obj/Microsoft.TemplateEngine.Authoring.CLI/project.assets.json" />
    <Usage Id="System.Management" Version="5.0.0" File="src/artifacts/obj/Microsoft.TemplateEngine.Authoring.TemplateVerifier/project.assets.json" />
    <Usage Id="Verify" Version="17.0.0" />
    <Usage Id="Verify" Version="18.0.0-beta.31" File="src/artifacts/obj/Microsoft.TemplateEngine.Authoring.CLI/project.assets.json" />
    <Usage Id="Verify" Version="18.0.0-beta.31" File="src/artifacts/obj/Microsoft.TemplateEngine.Authoring.TemplateVerifier/project.assets.json" />
    <Usage Id="Verify.DiffPlex" Version="1.3.0" File="src/artifacts/obj/Microsoft.TemplateEngine.Authoring.CLI/project.assets.json" IsDirectDependency="true" />
    <Usage Id="Verify.DiffPlex" Version="1.3.0" File="src/artifacts/obj/Microsoft.TemplateEngine.Authoring.TemplateVerifier/project.assets.json" IsDirectDependency="true" />
    <Usage Id="Verify.Xunit" Version="18.0.0-beta.31" File="src/artifacts/obj/Microsoft.TemplateEngine.Authoring.CLI/project.assets.json" IsDirectDependency="true" />
    <Usage Id="Verify.Xunit" Version="18.0.0-beta.31" File="src/artifacts/obj/Microsoft.TemplateEngine.Authoring.TemplateVerifier/project.assets.json" IsDirectDependency="true" />
    <Usage Id="xunit.abstractions" Version="2.0.3" File="src/artifacts/obj/Microsoft.TemplateEngine.Authoring.CLI/project.assets.json" />
    <Usage Id="xunit.abstractions" Version="2.0.3" File="src/artifacts/obj/Microsoft.TemplateEngine.Authoring.TemplateVerifier/project.assets.json" />
    <Usage Id="xunit.extensibility.core" Version="2.4.2" File="src/artifacts/obj/Microsoft.TemplateEngine.Authoring.CLI/project.assets.json" />
    <Usage Id="xunit.extensibility.core" Version="2.4.2" File="src/artifacts/obj/Microsoft.TemplateEngine.Authoring.TemplateVerifier/project.assets.json" />
    <Usage Id="xunit.extensibility.execution" Version="2.4.2" File="src/artifacts/obj/Microsoft.TemplateEngine.Authoring.CLI/project.assets.json" />
    <Usage Id="xunit.extensibility.execution" Version="2.4.2" File="src/artifacts/obj/Microsoft.TemplateEngine.Authoring.TemplateVerifier/project.assets.json" />
  </Usages>
</UsageData>

Doing a cursory investigation, it seems like at the prebuilts stem from the following three references that were added:

    <PackageReference Include="Verify.Xunit" />
    <PackageReference Include="Verify.DiffPlex" />
    <PackageReference Include="FluentAssertions" />

These external packages/dependencies are not part of the source-build graph, are therefore considered prebuilts, and are not allowed. Please review this guidance for adding new dependencies and the source-build considerations.

These will need to be addressed before .NET 8.0 Preview 1 can ship.

@MichaelSimons
Copy link
Member Author

cc @JanKrivanek

@mmitche
Copy link
Member

mmitche commented Oct 27, 2022

@JanKrivanek I think...

  • It may be that the Microsoft.TemplateEngine.Authoring.TemplateVerifier code should actually be in the test directories? Is this customer facing code or code used to test the template engine?
  • If it's not customer facing code, the packages should be marked as non shipping. The current shipping set of packages (would appear on nuget.org) is:
  <Package Id="Microsoft.TemplateEngine.Abstractions" Version="8.0.100-alpha.1.22526.2" NonShipping="false" />
  <Package Id="Microsoft.TemplateEngine.Authoring.CLI" Version="8.0.100-alpha.1.22526.2" NonShipping="false" />
  <Package Id="Microsoft.TemplateEngine.Authoring.Tasks" Version="8.0.100-alpha.1.22526.2" NonShipping="false" />
  <Package Id="Microsoft.TemplateEngine.Authoring.TemplateVerifier" Version="8.0.100-alpha.1.22526.2" NonShipping="false" />
  <Package Id="Microsoft.TemplateEngine.Core" Version="8.0.100-alpha.1.22526.2" NonShipping="false" />
  <Package Id="Microsoft.TemplateEngine.Core.Contracts" Version="8.0.100-alpha.1.22526.2" NonShipping="false" />
  <Package Id="Microsoft.TemplateEngine.Edge" Version="8.0.100-alpha.1.22526.2" NonShipping="false" />
  <Package Id="Microsoft.TemplateEngine.IDE" Version="8.0.100-alpha.1.22526.2" NonShipping="false" />
  <Package Id="Microsoft.TemplateEngine.Orchestrator.RunnableProjects" Version="8.0.100-alpha.1.22526.2" NonShipping="false" />
  <Package Id="Microsoft.TemplateEngine.TemplateLocalizer.Core" Version="8.0.100-alpha.1.22526.2" NonShipping="false" />
  <Package Id="Microsoft.TemplateEngine.Utils" Version="8.0.100-alpha.1.22526.2" NonShipping="false" />
  <Package Id="Microsoft.TemplateSearch.Common" Version="8.0.100-alpha.1.22526.2" NonShipping="false" />

Can you and @vlada-shubina verify that is the correct set?

@vlada-shubina
Copy link
Member

vlada-shubina commented Oct 31, 2022

@MichaelSimons @mmitche

  • Microsoft.TemplateEngine.Authoring.TemplateVerifier is customer facing code and should be released as NuGet package. It is part of authoring tools we offer for the templates. The set of shipping packages above is correct.
  • we can remove it from source build if the tools are not required in the source build, please confirm that.

@vlada-shubina
Copy link
Member

#5482 preliminary excludes the tools from source-build.
Only the packages that are part of .NET SDK / VS remain.

@MichaelSimons
Copy link
Member Author

we can remove it from source build if the tools are not required in the source build, please confirm that.

I think this is the right direction for source-build.

@mmitche - this "tooling" scenario is interesting to think about in the context of the Unified Build.

@JanKrivanek JanKrivanek added the triaged The issue was evaluated by the triage team, placed on correct area, next action defined. label Nov 1, 2022
@JanKrivanek
Copy link
Member

Asiging to @vlada-shubina as she is already addressing this.
Please reassign back if needed.

@vlada-shubina
Copy link
Member

Fixed in #5482

@mmitche
Copy link
Member

mmitche commented Nov 7, 2022

@vlada-shubina If this is a scenario that will ever be packaged in a source-built SDK, we'll probably need to remove the dependency on FluentAssertions, Verify.Xunit, etc. We can cross that bridge when it comes to it, if need be, but the safe bet is to try and avoid introducing new dependencies like these so we don't make more work for ourselves later.

Do we have to use these?

@vlada-shubina
Copy link
Member

The tooling is meant to tests the templates and essentially built on-top of Verify.Xunit and FluentAssertions. There is no way we can build it without it. I guess this tooling will have to stay outside source-build then. It is not planned to be a part of dotnet/sdk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged The issue was evaluated by the triage team, placed on correct area, next action defined.
Projects
Archived in project
Development

No branches or pull requests

4 participants