-
Notifications
You must be signed in to change notification settings - Fork 74
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
Propagate build info from BAR to VMR outputs #4192
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is much better and less invasive!
Just left some minor comments
src/Microsoft.DotNet.Darc/DarcLib/Helpers/VersionDetailsParser.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.Darc/Darc/Operations/VirtualMonoRepo/UpdateOperation.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.Darc/Darc/Operations/VirtualMonoRepo/UpdateOperation.cs
Outdated
Show resolved
Hide resolved
@@ -76,8 +76,7 @@ public async Task<ILocalGitRepo> PrepareVmrAsync( | |||
cancellationToken); | |||
|
|||
_vmrInfo.VmrPath = vmr.Path; | |||
await _dependencyTracker.InitializeSourceMappings(); | |||
_sourceManifest.Refresh(_vmrInfo.SourceManifestPath); | |||
await _dependencyTracker.RefreshMetadata(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you look in other usages of InitializeSourceMappings
whether they can also change to this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I saw we could use it almost everywhere, but it'd do some extra work that's not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be for the better if we just remove InitializeSourceMappings
and just have RefreshMetadata
(or maybe name it LoadMetadata
so that we can be always sure we load everything always (and in future, if we add more metadata for instance)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we will need to be able to override the sourceMappingPath
too
src/Microsoft.DotNet.Darc/DarcLib/VirtualMonoRepo/VmrForwardFlower.cs
Outdated
Show resolved
Hide resolved
var build = (await barClient.GetBuildsAsync(dependency.RepoUri, dependency.RepoUri)) | ||
.SingleOrDefault(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if FirstOrDefault
will be better than nothing. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FirstOrDefault
could be incorrect tho, in cases where we have multiple builds from the same commit. I'm not sure if we should try to get the newest build or do something like that tho. Currently, if this does happen, we'll still do the code flow, but won't have the OfficialBuildId, or the BarId. This could be a topic for the meeting on tuesday
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I somehow still think it's better to have an approximately good information than nothing since the OfficialBuildId
is required there for SB purposes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we don't get the TargetVersion
from BAR, I'll add back the method that we used to calculate the OfficialBuildId
in cases where we don't have it from BAR. Think that will be more accurate than a 50/50 if we get a correct Bar build or not. Also think some logging might be good here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for logging
src/Microsoft.DotNet.Darc/DarcLib/VirtualMonoRepo/VmrManagerBase.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When reviewing this, I realized a problem I should have probably thought about earlier.
When we will start synchronizing the VMR, the VMR sync pipeline will trigger at the same time as the official SDK pipeline. Which means the VMR sync will happen before a BAR ID for the official build is created. That means that no official build ID will be found for the uri/sha combination.
Let's talk about it tomorrow.
src/Microsoft.DotNet.Darc/DarcLib/Helpers/VersionDetailsParser.cs
Outdated
Show resolved
Hide resolved
@@ -76,8 +76,7 @@ public async Task<ILocalGitRepo> PrepareVmrAsync( | |||
cancellationToken); | |||
|
|||
_vmrInfo.VmrPath = vmr.Path; | |||
await _dependencyTracker.InitializeSourceMappings(); | |||
_sourceManifest.Refresh(_vmrInfo.SourceManifestPath); | |||
await _dependencyTracker.RefreshMetadata(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be for the better if we just remove InitializeSourceMappings
and just have RefreshMetadata
(or maybe name it LoadMetadata
so that we can be always sure we load everything always (and in future, if we add more metadata for instance)
@@ -76,8 +76,7 @@ public async Task<ILocalGitRepo> PrepareVmrAsync( | |||
cancellationToken); | |||
|
|||
_vmrInfo.VmrPath = vmr.Path; | |||
await _dependencyTracker.InitializeSourceMappings(); | |||
_sourceManifest.Refresh(_vmrInfo.SourceManifestPath); | |||
await _dependencyTracker.RefreshMetadata(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we will need to be able to override the sourceMappingPath
too
test/Microsoft.DotNet.Darc.VirtualMonoRepo.E2E.Tests/VmrBackflowTest.cs
Outdated
Show resolved
Hide resolved
var build = (await barClient.GetBuildsAsync(dependency.RepoUri, dependency.RepoUri)) | ||
.SingleOrDefault(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I somehow still think it's better to have an approximately good information than nothing since the OfficialBuildId
is required there for SB purposes.
…owTest.cs Co-authored-by: Přemek Vysoký <[email protected]>
Co-authored-by: Přemek Vysoký <[email protected]>
I think if I add the fallback mechanism for the OfficialBuildId, it will be good enough for now. The sdk repo won't have a build, so it won't have a BarId, but with the fallback I'll put back, it will have the official BuildId. And then other repos should be fine, because we'll find them recursively and find their bar builds. In case we don't it will still be at least as good as before |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nice!
#4166
#4165