-
Notifications
You must be signed in to change notification settings - Fork 772
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
Automate chat template .NET dependency updates #5946
base: main
Are you sure you want to change the base?
Conversation
<!-- We do this after the initial evaluation of this project file so all properties have been initialized. --> | ||
<_GeneratedContentRepoProperties> | ||
ArtifactsShippingPackagesDir=$(ArtifactsShippingPackagesDir); | ||
RepoPackageVersion=$(Version); |
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.
The ASP.NET Core repo does something more advanced than this for references to packages defined in the same repo (it runs an MSBuild task on each referenced project and extracts the actual package versions). However, when I collected a binlog, it revealed that all referenced packages had identical versions anyway. So, I've taken a simpler approach here and just used $(Version)
, because AFAICT it will be the same across all packages in this repo. If that assumption is wrong, or if someone thinks it would be more robust to do a different approach, I'd be happy to consider it.
<Error | ||
Condition="!Exists('${ArtifactsShippingPackagesDir}')" | ||
Text="Repo packages must be built locally before running this project. See src/ProjectTemplates/README.md for more info." /> |
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.
This is only here so that you don't get a cryptic NuGet error if you forget to generate M.E.AI
NuGet packages.
<packageSourceMapping> | ||
<packageSource key="local-shipping"> | ||
<package pattern="*" /> | ||
</packageSource> | ||
</packageSourceMapping> |
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.
This is required in order for the locally generated packages to get picked up during restore. I'm not 100% sure of the reason, but I think it's because the <packageSourceMapping>
declared in the repo's root NuGet.config
resulted in another package source getting used to resolve the Microsoft.Extensions.AI
package reference, even though that source doesn't have the correct version.
If the <packageSourceMapping>
element weren't required here, we could have removed this entire file and instead just modified <RestoreAdditionalProjectSources>
in the Directory.Build.targets.in
file.
**Note:** Since package versions don't change between local builds, it may be necessary to occasionally delete `Microsoft.Extensions.AI*` packages from your local nuget cache, especially if you're making changes to these packages. An example of how to do this in PowerShell is: | ||
```pwsh | ||
Remove-Item ~\.nuget\packages\microsoft.extensions.ai* -Recurse -Force | ||
``` |
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.
It's unfortunate that this is the case, but I'm not aware of a better alternative. Maybe we could create scripts that build/run the template using a local nuget package cache. The cache would get cleared (or partially cleared) when the build detects that local packages have been updated. But I'm not sure if the effort to create and maintain that infrastructure is worth it, and I'm inclined to keep things simple for now.
🎉 Good job! The coverage increased 🎉
Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=957249&view=codecoverage-tab |
<!-- Dependencies from https://github.com/dotnet/efcore --> | ||
<MicrosoftEntityFrameworkCoreSqliteVersion>9.0.2</MicrosoftEntityFrameworkCoreSqliteVersion> | ||
<!-- Dependencies from https://github.com/dotnet/arcade --> | ||
<MicrosoftDotNetBuildTasksTemplatingVersion>9.0.0-beta.25111.5</MicrosoftDotNetBuildTasksTemplatingVersion> |
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.
Note that these two dependencies are the only ones that will be automatically updated. Third party dependencies are put lower in this file (in the "Manual" group) and will need to be manually updated. And, of course, any template dependencies defined in the extensions repo (such as Microsoft.Extensions.AI
) inherit the repo-defined version and therefore implicitly stay up to date.
🎉 Good job! The coverage increased 🎉
Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=957975&view=codecoverage-tab |
This PR makes the following changes:
Microsoft.Extensions.AI*
packages.Versions.props
(just like other .NET dependencies).Fixes https://github.com/dotnet/ai-private-planning/issues/276
Microsoft Reviewers: Open in CodeFlow