Split Version.props into Version.props and Version.Details.props#5067
Split Version.props into Version.props and Version.Details.props#5067dkurepa merged 18 commits intodotnet:mainfrom
Conversation
There was a problem hiding this comment.
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.propsfiles alongside existing version management files - Implemented validation to prevent property conflicts between
VersionDetailsPropsandVersionPropsfiles - 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.
{
| string branch, | ||
| DependencyDetail dependency) | ||
| DependencyDetail dependency, | ||
| bool repoHasVersionDetailsProps) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Doesn't seem to be a huge deal. Since all additions and removals are committed separately anyway, re-reading files is not a bottleneck
src/Maestro/Maestro.MergePolicies/VersionDetailsPropsMergePolicy.cs
Outdated
Show resolved
Hide resolved
| string branch, | ||
| DependencyDetail dependency) | ||
| DependencyDetail dependency, | ||
| bool repoHasVersionDetailsProps) |
There was a problem hiding this comment.
Doesn't seem to be a huge deal. Since all additions and removals are committed separately anyway, re-reading files is not a bottleneck
src/Maestro/Maestro.MergePolicies/VersionDetailsPropsMergePolicy.cs
Outdated
Show resolved
Hide resolved
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. |
src/Maestro/Maestro.MergePolicies/VersionDetailsPropsMergePolicy.cs
Outdated
Show resolved
Hide resolved
tools/ProductConstructionService.ReproTool/Operations/FlowCommitOperation.cs
Outdated
Show resolved
Hide resolved
src/Maestro/Maestro.MergePolicies/VersionDetailsPropsMergePolicy.cs
Outdated
Show resolved
Hide resolved
src/Maestro/Maestro.MergePolicies/VersionDetailsPropsMergePolicy.cs
Outdated
Show resolved
Hide resolved
src/Maestro/Maestro.MergePolicies/VersionDetailsPropsMergePolicy.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.Darc/DarcLib/Helpers/DependencyFileManager.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.Darc/DarcLib/Helpers/DependencyFileManager.cs
Outdated
Show resolved
Hide resolved
src/Maestro/Maestro.MergePolicies/VersionDetailsPropsMergePolicy.cs
Outdated
Show resolved
Hide resolved
| if (foundProperties.Count > 0) | ||
| { | ||
| StringBuilder str = new(); | ||
| str.AppendLine("Properties from `VersionDetailsProps` should not be present in `VersionProps`."); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
why would we need to do that tho? We can just pin them in Version.Detail.xml or not have them there at all
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Okay, so we agreed that we can keep this but we will ignore a case where we override the property to empty
It should work since it's using the |
Can you test it? |
|
it means I need an updated darc right? |
sure, will do it
yes, if you use darc |
|
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 |
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 :) |
|
I hope that if people run old darc locally and an unexpected bunch of changes appear in the |
Tried it out, it works as expected in both cases (with and without Version.Details.props) |
…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>
#4998