Skip to content

Add BuildAll target, CodeQL update, and build cleanup#4290

Open
paulmedynski wants to merge 6 commits into
mainfrom
dev/paul/build-all
Open

Add BuildAll target, CodeQL update, and build cleanup#4290
paulmedynski wants to merge 6 commits into
mainfrom
dev/paul/build-all

Conversation

@paulmedynski
Copy link
Copy Markdown
Contributor

@paulmedynski paulmedynski commented May 14, 2026

Description

Add BuildAll target that builds all projects for all OS+TFM combinations. This makes it easy for devs to compile local changes and avoid surprises for the code that otherwise wouldn't be compiled due to their host OS.

Changes

  • Added BuildAll target in build.proj that builds all projects (tests, samples, tools) across OS+TFM combos.
  • Updated CodeQL workflow to use BuildAll for broader code coverage.
  • Added implicit usings to TestCommon project and removed unnecessary usings.
  • Removed obsolete ToolsVersion and DefaultTargets <Project> attributes.
  • Reduced build console noise from RepositoryInfo.targets.
  • Improved fidelity of build.proj messaging.

Split from #4259.

- Added BuildAll target that builds all projects for all OS+TFM combinations
- Updated CodeQL to use BuildAll target for broader code coverage
- Added TrimDocs condition to skip doc trimming during cross-builds
- Added implicit usings to Test.Common project
- Removed obsolete ToolsVersion and DefaultTargets Project attributes
- Reduced build console noise from RepositoryInfo.targets
- Removed obsolete ToolsVersion from ManualTesting.Tests.ruleset
- Added trailing newline to ManualTesting.Tests.ruleset
- Quoted project paths in BuildTests/BuildSamples/BuildTools targets
Copilot AI review requested due to automatic review settings May 14, 2026 13:15
@github-project-automation github-project-automation Bot moved this to To triage in SqlClient Board May 14, 2026
@paulmedynski paulmedynski added this to the 7.1.0-preview2 milestone May 14, 2026
@paulmedynski paulmedynski added the Area\Engineering Use this for issues that are targeted for changes in the 'eng' folder or build systems. label May 14, 2026
@paulmedynski paulmedynski moved this from To triage to In progress in SqlClient Board May 14, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new BuildAll orchestration target in build.proj and updates the CodeQL workflow to build more of the repository during analysis, alongside a handful of MSBuild/props cleanup and minor project tweaks.

Changes:

  • Introduces BuildAll (and supporting BuildTests/BuildSamples/BuildTools) and switches CodeQL to call it.
  • Adds a TrimDocs opt-out for ref-doc trimming to better support cross-build scenarios.
  • Cleans up legacy MSBuild ToolsVersion / DefaultTargets usage and reduces build log noise.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tools/targets/RepositoryInfo.targets Lowers message verbosity for translated repo URL logging.
tools/props/AssemblyRef.props Removes legacy <Project> attributes.
tools/props/AssemblyInfo.props Removes legacy <Project> attributes.
src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTesting.Tests.ruleset Removes obsolete ToolsVersion and normalizes file ending.
src/Microsoft.Data.SqlClient/tests/Common/Microsoft.Data.SqlClient.TestCommon.csproj Enables implicit usings for the shared test helper project.
src/Microsoft.Data.SqlClient/ref/Microsoft.Data.SqlClient.csproj Adds TrimDocs switch to optionally skip IntelliSense XML trimming.
src/Directory.Build.props Removes legacy <Project> attributes; clarifies versioning evaluation order.
build.proj Adds BuildAll + ancillary build targets and shared arg handling.
.github/workflows/codeql.yml Switches manual CodeQL build step to BuildAll.

Comment thread build.proj Outdated
Comment thread .github/workflows/codeql.yml
…is Linux.

- Removed unnecessary usings in TestCommon.
<AssemblyName>Microsoft.Data.SqlClient.TestCommon</AssemblyName>
<RootNamespace>Microsoft.Data.SqlClient.TestCommon</RootNamespace>

<ImplicitUsings>enable</ImplicitUsings>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reduces 'using' noise.

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="Microsoft Managed Recommended Rules" Description="These rules focus on the most critical problems in your code, including potential security holes, application crashes, and other important logic and design errors. It is recommended to include this rule set in any custom rule set you create for your projects." ToolsVersion="Latest">
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ToolsVersion is an obsolete attribute we don't need any more.

Comment thread src/Directory.Build.props
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Only build.proj has a default target. Build doesn't exist here anyway, so this was just cruft.

<PropertyGroup>
<PowerShellCommand Condition="'$(OS)' == 'Windows_NT'">powershell.exe</PowerShellCommand>
<PowerShellCommand Condition="'$(OS)' != 'Windows_NT'">pwsh</PowerShellCommand>
<PowerShellCommand Condition="$([MSBuild]::IsOSPlatform('Windows'))">powershell.exe</PowerShellCommand>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

BuildAll sets $(OS) to whatever it wants, regardless of the actual host OS. This will be clobbered by @mdaigle 's pwsh tool changes anyway, so it's a temp fix.

Comment thread build.proj Outdated
<Target Name="Build" DependsOnTargets="BuildLogging;BuildAbstractions;BuildSqlClient;BuildAzure;BuildAkvProvider;BuildSqlServer" />

<!-- Build all projects in the repo, for all supported OS and TargetFramework combinations.-->
<Target Name="BuildAll" DependsOnTargets="Build;BuildTests;BuildSamples;BuildTools" />
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Devs can use this with local changes to be pretty confident they didn't break compilation, regardless of their host OS.

Comment thread build.proj
<!-- Build SqlClient UnitTests (project references only, no ReferenceType). -->
<Message Text=">>> Building SqlClient UnitTests for %(_OsValues.Identity)"/>
<Exec ConsoleToMsBuild="true"
Command="&quot;$(DotnetPath)dotnet&quot; build &quot;$(UnitTestsProjectPath)&quot; -p:Configuration=$(Configuration) -p:OS=%(_OsValues.Identity)" />
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

MSBuild performs one exec for each element in _OsValues, so this builds our Windows and Unix code.

Comment thread build.proj Outdated
Copilot AI review requested due to automatic review settings May 14, 2026 13:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Comment thread build.proj
Comment thread build.proj
</PropertyGroup>

<Message Text=">>> Building GenAPI project via command: '$(DotnetCommand)'"/>
<Message Importance="High" Text=">>> Building GenAPI project"/>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Now we can see what is happening without much verbosity, but we still get the details when asked for.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.14%. Comparing base (b700269) to head (b24e6ac).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4290      +/-   ##
==========================================
+ Coverage   66.04%   69.14%   +3.10%     
==========================================
  Files         275      271       -4     
  Lines       42976    67215   +24239     
==========================================
+ Hits        28383    46478   +18095     
- Misses      14593    20737    +6144     
Flag Coverage Δ
CI-SqlClient ?
PR-SqlClient-Project 69.14% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI review requested due to automatic review settings May 15, 2026 11:28
Comment thread .gitattributes
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Cleaned up a bunch of cruft from our git configuration files.

Comment thread .gitignore
**/notsupported/*.cs

# C# language server cache
*.lscache
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is new - the latest C# Dev Kit for VS Code produced a bunch of these cache files.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 19 changed files in this pull request and generated 2 comments.

Comment thread build.proj
Comment thread build.proj Outdated
@paulmedynski paulmedynski marked this pull request as ready for review May 15, 2026 16:35
@paulmedynski paulmedynski requested a review from a team as a code owner May 15, 2026 16:35
Copilot AI review requested due to automatic review settings May 15, 2026 16:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 19 changed files in this pull request and generated 1 comment.

Comment thread build.proj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area\Engineering Use this for issues that are targeted for changes in the 'eng' folder or build systems.

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

4 participants