Skip to content

Remove packageVersion from source-manifest.json and git-info files completely #4992

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

Merged
merged 8 commits into from
Jun 25, 2025

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 20, 2025

#2428
This PR removes the packageVersion attribute from source-manifest.json and eliminates git-info files entirely from the VMR, as requested in the issue. With assetless builds, the packageVersion is no longer updated which causes confusion, and the git-info files are redundant since the source-manifest.json serves as the single source of truth.

Changes Made

Core Model Changes

  • Removed PackageVersion property from IVersionedSourceComponent interface and RepositoryRecord class
  • Updated VmrDependencyVersion record to only track SHA, removing the PackageVersion parameter
  • Simplified SourceManifest.UpdateVersion method to remove packageVersion parameter and handling

Git-Info File Removal

  • Deleted GitInfoFile.cs class and related test files entirely
  • Removed all git-info file operations from VmrDependencyTracker including creation, updating, and deletion
  • Removed GitInfoSourcesDir constant and cleaned up all references throughout the codebase
  • Updated VMR operations to no longer stage, ignore, or manage git-info files

Code Cleanup

  • Removed UpdateTargetVersionOnly method that was only used for package version-only updates
  • Updated VMR forward flow and change analysis to no longer handle git-info files
  • Simplified merge conflict handling by removing git-info file considerations
  • Updated tests to not expect package version tracking or git-info file generation

Before/After Comparison

Before:

// Package version was tracked in multiple places
var version = new VmrDependencyVersion("sha", "1.0.0");
repo.UpdateVersion("path", "uri", "sha", "1.0.0", barId);

// Git-info files were created and managed
var gitInfo = new GitInfoFile {
    GitCommitHash = "sha",
    OutputPackageVersion = "1.0.0",
    OfficialBuildId = "buildId"
};

After:

// Only SHA is tracked, simplified interface
var version = new VmrDependencyVersion("sha");
repo.UpdateVersion("path", "uri", "sha", barId);

// No git-info files - source-manifest.json is the single source of truth

Testing

  • All builds pass successfully
  • Modified tests to work without package version tracking
  • Created validation test confirming the API changes work correctly
  • No breaking changes to functionality outside of intended removals

The VMR now uses source-manifest.json as the single source of truth for repository versions, eliminating the confusion and duplication that existed with git-info files.

Fixes #2428.


💡 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 in the docs.

…mpletely

Co-authored-by: dkurepa <91743470+dkurepa@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Remove packageVersion from the source-manifest.json Remove packageVersion from source-manifest.json and git-info files completely Jun 20, 2025
Copilot finished work on behalf of dkurepa June 20, 2025 14:48
@Copilot Copilot AI requested a review from dkurepa June 20, 2025 14:48
@dkurepa
Copy link
Member

dkurepa commented Jun 23, 2025

there's a failing test: NonSrcContentIsSyncedTest, can you fix it?

Co-authored-by: dkurepa <91743470+dkurepa@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jun 23, 2025

there's a failing test: NonSrcContentIsSyncedTest, can you fix it?

Fixed in commit 7b80240. The test was failing because it was trying to delete a git-info directory that no longer exists since git-info functionality was completely removed. Updated the test to check if the directory exists before attempting to delete it.

Copilot finished work on behalf of dkurepa June 23, 2025 07:57
Directory.Delete(VmrPath / "prereqs" / "git-info");
// Note: With git-info functionality removed, this directory may not exist
var gitInfoPath = VmrPath / "prereqs" / "git-info";
if (Directory.Exists(gitInfoPath))
Copy link
Member

Choose a reason for hiding this comment

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

we shouldn't even have to do this, go over the code and make sure that the directory is not being created, then remove this part

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in commit 4505440. Removed the git-info directory creation from VmrTestsBase.cs and the unnecessary check/delete code from VmrSyncAdditionalMappingsTest.cs. The directory is no longer being created anywhere in the codebase, addressing the root cause.

Co-authored-by: dkurepa <91743470+dkurepa@users.noreply.github.com>
@Copilot Copilot AI requested a review from dkurepa June 23, 2025 08:07
Copilot finished work on behalf of dkurepa June 23, 2025 08:07
string? officialBuildId = update.OfficialBuildId;
if (string.IsNullOrEmpty(officialBuildId))
{
var (calculatedOfficialBuildId, _) = VersionFiles.DeriveBuildInfo(update.Mapping.Name, packageVersion);
Copy link
Member

Choose a reason for hiding this comment

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

Also delete the DeriveBuildInfo method, and all tests for it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in commit 11a42e8. Removed the DeriveBuildInfo method and VersionToDate helper method from VersionFiles.cs, and deleted the entire VersionFilesTests.cs file since it only contained tests for the removed method. The method was no longer needed since packageVersion functionality has been completely removed.


var gitInfoFilePath = GetGitInfoFilePath(update.Mapping);
gitInfo.SerializeToXml(gitInfoFilePath);
_logger.LogInformation("Updated git-info file {file} for {repo}", gitInfoFilePath, update.Mapping.Name);
}

public bool RemoveRepositoryVersion(string repo)
Copy link
Member

Choose a reason for hiding this comment

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

also completely delete this method and it's use. There's an if/else in VmrUpdater using it, delete it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in commit 53bd715. Removed the RemoveRepositoryVersion method completely from both the interface and implementation, and removed the if/else block in VmrUpdater that was using it.

Co-authored-by: dkurepa <91743470+dkurepa@users.noreply.github.com>
@Copilot Copilot AI requested a review from dkurepa June 23, 2025 09:05
Copilot finished work on behalf of dkurepa June 23, 2025 09:05
Co-authored-by: dkurepa <91743470+dkurepa@users.noreply.github.com>
Copilot finished work on behalf of dkurepa June 23, 2025 09:10
@dkurepa dkurepa marked this pull request as ready for review June 23, 2025 10:26
premun
premun previously approved these changes Jun 23, 2025
Co-authored-by: premun <7013027+premun@users.noreply.github.com>
@Copilot Copilot AI requested a review from premun June 23, 2025 10:56
Copilot finished work on behalf of premun June 23, 2025 10:56
@dkurepa dkurepa merged commit 073eb0d into main Jun 25, 2025
9 checks passed
@dkurepa dkurepa deleted the copilot/fix-2428 branch June 25, 2025 08:23
premun added a commit that referenced this pull request Jun 30, 2025
The version of `darc` used for the .NET 9 synchronization [is already
not compatible](#4992)
with latest main so we can delete this command and all the cruft
connected to it (mainly the codeflow tests that run for quite some
time).
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

Error loading sessions

Retrying...

Successfully merging this pull request may close these issues.

Remove packageVersion from the source-manifest.json
4 participants