Skip to content

Conversation

Copy link

Copilot AI commented Oct 29, 2025

Add support for SQL SDK .sqlproj files in GitVersion's /updateprojectfiles command.

Changes

Core Logic (ProjectFileUpdater.cs)

  • Extended IsSupportedProjectFile to recognize .sqlproj extension
  • Updated CanUpdateProjectFile to accept Microsoft.Build.Sql SDK alongside Microsoft.NET.Sdk
  • Updated SDK validation error messages

Tests (ProjectFileUpdaterTests.cs)

  • Added Microsoft.Build.Sql test case to SDK validation tests
  • Converted UpdateProjectFileAddsVersionToFile to parameterized test covering both .NET and SQL projects

Documentation (arguments.md)

  • Updated /updateprojectfiles documentation to include .sqlproj

Example

<!-- SQL SDK projects are now supported -->
<Project Sdk="Microsoft.Build.Sql">
  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <Version>1.0.0</Version>
  </PropertyGroup>
</Project>

Running dotnet gitversion /updateprojectfiles will now update version properties (AssemblyVersion, FileVersion, InformationalVersion, Version) in .sqlproj files using the SQL SDK.

Note: Legacy SSDT .sqlproj files remain unsupported (they lack SDK-style project structure).

Fixes #4719

Original prompt

This section details on the original issue you should resolve

<issue_title>[ISSUE]: Add support for SQL SDK .sqlproj files</issue_title>
<issue_description>### Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

GitVersion package

GitVersion.Tool

GitVersion version

6.4.0

Operating system

Windows

What are you seeing?

With the release of the SDK for SQL projects, there is a need to be able to version SQL projects, especially when publishing database projects to NuGet. Currently, dotnet gitversion /updateprojectfiles skips .SQLPROJ files.

What is expected?

When running GitVersion locally or on a build server, dotnet gitversion /updateprojectfiles should update .sqlproj files when they are using the SQL SDK. Legacy SSDT project files should continue to be skipped.

Steps to Reproduce

  • Create a new SQL SDK project or open an existing project
  • Ensure GitVersion is updated
  • run dotnet gitversion /updateprojectfiles on the command line
  • Output is echoed to the terminal, but the .sqlproj file is unchanged

RepositoryFixture Test

No response

Output log or link to your CI build (if appropriate).

```</issue_description>

<agent_instructions>Make sure the tests are passing and the tests cover the new implementation</agent_instructions>

## Comments on the Issue (you are @copilot in this section)

<comments>
<comment_new><author>@arturcic</author><body>
@aidanblacklumeris are you in the position to work on that? I would guide you where to look in the codebase</body></comment_new>
</comments>

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add support for SQL SDK .sqlproj files Add support for SQL SDK .sqlproj files in /updateprojectfiles Oct 29, 2025
Copilot AI requested a review from arturcic October 29, 2025 12:53
Copilot finished work on behalf of arturcic October 29, 2025 12:53
Copy link
Member

Choose a reason for hiding this comment

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

@copilot revert this file change

Copilot finished work on behalf of arturcic October 29, 2025 14:01
@arturcic
Copy link
Member

@copilot squash commits into one commit, rebase onto main

Copy link
Author

Copilot AI commented Oct 29, 2025

@copilot squash commits into one commit, rebase onto main

I've squashed all commits into a single commit (1224c4b) and rebased onto main (724e5d5). However, I cannot force push from my environment due to authentication constraints. The squashed commit is ready locally with all changes combined. You may need to force push manually or I can provide the commit details for you to apply.

Copilot finished work on behalf of arturcic October 29, 2025 14:48
Adds support for updating SQL project files (.sqlproj)

This allows GitVersion to update AssemblyInfo files in SQL projects.
@arturcic arturcic force-pushed the copilot/add-sql-sdk-support branch from bb9ca7f to 12ac970 Compare October 29, 2025 14:50
@arturcic arturcic marked this pull request as ready for review October 29, 2025 14:50
Copilot AI review requested due to automatic review settings October 29, 2025 14:50
@arturcic arturcic added this to the 6.x milestone Oct 29, 2025
@arturcic arturcic enabled auto-merge October 29, 2025 14:52
@arturcic arturcic disabled auto-merge October 29, 2025 14:52
@sonarqubecloud
Copy link

Copy link

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

This PR adds support for Microsoft SQL Server Database Projects (.sqlproj files with Microsoft.Build.Sql SDK) to GitVersion's project file updater functionality.

Key changes:

  • Extended SDK validation to accept both Microsoft.NET.Sdk and Microsoft.Build.Sql SDKs
  • Added .sqlproj to the list of supported project file extensions
  • Updated error messages to reflect the newly supported SDK

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/GitVersion.Output/AssemblyInfo/ProjectFileUpdater.cs Extended SDK validation logic to support Microsoft.Build.Sql SDK and added .sqlproj to supported file extensions
src/GitVersion.Output.Tests/Output/ProjectFileUpdaterTests.cs Added test cases for Microsoft.Build.Sql SDK and refactored test to validate both .csproj and .sqlproj file support
docs/input/docs/usage/cli/arguments.md Updated documentation to include .sqlproj in the list of supported project file types

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@arturcic arturcic merged commit 35dcb69 into main Oct 29, 2025
95 checks passed
@arturcic arturcic deleted the copilot/add-sql-sdk-support branch October 29, 2025 15:21
@mergify
Copy link
Contributor

mergify bot commented Oct 29, 2025

Thank you @Copilot for your contribution!

@arturcic arturcic modified the milestones: 6.x, 6.5.0 Nov 5, 2025
@gittools-bot
Copy link
Contributor

🎉 This issue has been resolved in version 6.5.0 🎉
The release is available on:

Your GitReleaseManager bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ISSUE]: Add support for SQL SDK .sqlproj files

3 participants