Skip to content

Split Version.props into Version.props and Version.Details.props#5067

Merged
dkurepa merged 18 commits intodotnet:mainfrom
dkurepa:dkurepa/VersionDetailsProps
Jul 25, 2025
Merged

Split Version.props into Version.props and Version.Details.props#5067
dkurepa merged 18 commits intodotnet:mainfrom
dkurepa:dkurepa/VersionDetailsProps

Conversation

@dkurepa
Copy link
Copy Markdown
Member

@dkurepa dkurepa commented Jul 21, 2025

Copilot AI review requested due to automatic review settings July 21, 2025 13:14
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

This PR introduces support for managing dependency properties in a new file called VersionDetailsProps as an alternative to the existing VersionProps file in the dependency management system. The change allows for better separation of concerns between manually managed properties and auto-generated ones.

Key changes:

  • Added support for generating and managing Version.Details.props files alongside existing version management files
  • Implemented validation to prevent property conflicts between VersionDetailsProps and VersionProps files
  • Updated dependency file management to optionally use the new props file when available

Reviewed Changes

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

Show a summary per file
File Description
src/Microsoft.DotNet.Darc/DarcLib/Helpers/VersionFiles.cs Added constant for new VersionDetailsProps file path
src/Microsoft.DotNet.Darc/DarcLib/Helpers/IDependencyFileManager.cs Updated interface to include optional parameter for VersionDetailsProps detection
src/Microsoft.DotNet.Darc/DarcLib/Helpers/DependencyFileManager.cs Implemented VersionDetailsProps generation and conditional dependency management logic
src/Maestro/Maestro.MergePolicies/VersionDetailsPropsMergePolicy.cs New merge policy to validate property separation between files
test/Microsoft.DotNet.DarcLib.Tests/Helpers/DependencyFileManagerTests.cs Added comprehensive tests for VersionDetailsProps functionality
test/Microsoft.DotNet.DarcLib.Tests/VirtualMonoRepo/VmrVersionFileMergerTests.cs Updated mock setups for new optional parameter
Comments suppressed due to low confidence (2)

test/Microsoft.DotNet.DarcLib.Tests/Helpers/DependencyFileManagerTests.cs:10

  • This appears to be an unused import that was removed. Consider verifying that FluentAssertions.Specialized is not needed elsewhere in the file before removing it.
using Microsoft.DotNet.DarcLib.Helpers;

src/Microsoft.DotNet.Darc/DarcLib/Helpers/DependencyFileManager.cs:749

  • [nitpick] Consider adding a blank line after the XML declaration for better readability, following the existing pattern in the method.
            {

@dkurepa dkurepa changed the title Version details props Split Version.props into Version.props and Version.Details.props Jul 21, 2025
string branch,
DependencyDetail dependency)
DependencyDetail dependency,
bool repoHasVersionDetailsProps)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

One issue with adding/removing individual dependencies like this is that we always have to load the xml from git, do our operation, and then regenerate the VersionDetailsProps. We should have something like RemoveDependenciesAsync that would only load the files once and only generate Version.Details.props once. I kind of feel like it'd be better to that in a separate PR

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Doesn't seem to be a huge deal. Since all additions and removals are committed separately anyway, re-reading files is not a bottleneck

@dkurepa dkurepa requested review from adamzip, mmitche and premun July 21, 2025 16:36
adamzip
adamzip previously approved these changes Jul 22, 2025
string branch,
DependencyDetail dependency)
DependencyDetail dependency,
bool repoHasVersionDetailsProps)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Doesn't seem to be a huge deal. Since all additions and removals are committed separately anyway, re-reading files is not a bottleneck

@dkurepa
Copy link
Copy Markdown
Member Author

dkurepa commented Jul 22, 2025

Doesn't seem to be a huge deal. Since all additions and removals are committed separately anyway, re-reading files is not a bottleneck

It's an IO operation that's happening a lot, and not just there, later we add all non excluded build dependencies, and there can be quite a lot of them.
Every time I run the service locally, it actually spends quite some time doing these operations, so I think it'll be a nice improvement

adamzip
adamzip previously approved these changes Jul 23, 2025
if (foundProperties.Count > 0)
{
StringBuilder str = new();
str.AppendLine("Properties from `VersionDetailsProps` should not be present in `VersionProps`.");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am not sure this is a valid check. I think we were saying we could now start pinning properties by overwriting them in Versions.props.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

why would we need to do that tho? We can just pin them in Version.Detail.xml or not have them there at all

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Michael Simons had a point where you don't want to set Pinned=True but still want to occasionally receive an update somehow. I don't remember how it went.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Okay, so we agreed that we can keep this but we will ignore a case where we override the property to empty

@adamzip adamzip self-requested a review July 23, 2025 15:31
Copy link
Copy Markdown
Member

@premun premun left a comment

Choose a reason for hiding this comment

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

@dkurepa will everything work even when updating dependencies via darc? Meaning - will it overwrite the new version file if it already exists?

@dkurepa
Copy link
Copy Markdown
Member Author

dkurepa commented Jul 24, 2025

@dkurepa will everything work even when updating dependencies via darc? Meaning - will it overwrite the new version file if it already exists?

It should work since it's using the AddDependencyAsync method that we're using in the service flows too. If Version.Details.props exists, it will get regenerated based on Version.Details.xml

@premun
Copy link
Copy Markdown
Member

premun commented Jul 24, 2025

It should work

Can you test it?

@akoeplinger
Copy link
Copy Markdown
Member

it means I need an updated darc right?

@dkurepa
Copy link
Copy Markdown
Member Author

dkurepa commented Jul 24, 2025

It should work

Can you test it?

sure, will do it

it means I need an updated darc right?

yes, if you use darc add-dependency/update-dependencies or the vmr flow commands

@akoeplinger
Copy link
Copy Markdown
Member

ok. people often run months old darc so that might be an issue. can we block/warn users with too-old darc?

@dkurepa
Copy link
Copy Markdown
Member Author

dkurepa commented Jul 24, 2025

ok. people often run months old darc so that might be an issue. can we block/warn users with too-old darc?

I don't think we can :/ all of these are just operations with your local files. Maybe if we made the files somehow unparseable for the older versions, but that doesn't sound like a great idea

@akoeplinger
Copy link
Copy Markdown
Member

all of these are just operations with your local files

update-dependencies will call the service to grab the build info, it could send along the current darc version in e.g. the User Agent. but this doesn't need to be solved here :)

@premun
Copy link
Copy Markdown
Member

premun commented Jul 25, 2025

I hope that if people run old darc locally and an unexpected bunch of changes appear in the Versions.props because it puts the props there, the dev either notices and if not and they even manage to check it in, it will show up in the codeflow PRs where the checks will fail once it dumps the duplicate props in the V.D.props?

@dkurepa
Copy link
Copy Markdown
Member Author

dkurepa commented Jul 25, 2025

It should work

Can you test it?

Tried it out, it works as expected in both cases (with and without Version.Details.props)

@dkurepa dkurepa merged commit 90f4ad8 into dotnet:main Jul 25, 2025
9 checks passed
dkurepa added a commit that referenced this pull request Oct 8, 2025
…ty attribute changes (#5346)

- [x] Review PR #5067 and #5209 changes to understand what was
implemented
- [x] Add section on Version.Details.props file
- [x] Document the SkipProperty attribute in Version.Details.xml
- [x] Document header generation behavior for repos with only
SkipProperty dependencies
- [x] Add examples showing proper configuration
- [x] Update index and references throughout the document
- [x] Build and test to ensure no syntax errors in documentation
- [x] Address review feedback: Remove "When to use SkipProperty" section
- [x] Address review feedback: Simplify migration steps

<!-- START COPILOT CODING AGENT SUFFIX -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>Update Darc.md documentation for Version.Details.props
and SkipProperty attribute changes</issue_title>
> <issue_description>Update the Darc.md documentation to reflect changes
implemented in the following PRs:
> - #5067
> - #5209
> 
> Key points to address:
> 
> 1. **Version.Details.props File**
>    - Describe the addition of the new `Version.Details.props` file.
>    - Document that if `Version.Details.props` exists, it will be used.
>    - Explain when and how this file is generated or consumed.
> 
> 2. **SkipProperty Attribute in Version.Details.xml**
> - Introduce and document the `SkipProperty` attribute that can be
added in `Version.Details.xml`.
>    - Describe its purpose and how it affects dependency management.
> 
> 3. **Other Relevant Changes**
> - Summarize any additional relevant changes from the referenced PRs,
such as header generation behavior for repos with only `SkipProperty`
dependencies.
> 
> Ensure examples and configuration/process details are clear for users
maintaining or integrating with Darc-managed
repositories.</issue_description>
> 
> ## Comments on the Issue (you are @copilot in this section)
> 
> <comments>
> </comments>
> 


</details>
Fixes #5345

<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: dkurepa <91743470+dkurepa@users.noreply.github.com>
Co-authored-by: Přemek Vysoký <premek.vysoky@microsoft.com>
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.

5 participants