-
Notifications
You must be signed in to change notification settings - Fork 200
[MSBUILD SDK] Add warning & fallback when restore hook not ran during build #3308
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
[MSBUILD SDK] Add warning & fallback when restore hook not ran during build #3308
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.
Pull request overview
Adds a build-time verification/fallback to ensure the generated inner extensions project has been restored, emitting a new SDK warning (AZFW0108) when the restore hook didn’t run.
Changes:
- Touches a restore marker during inner extension project restore and adds a build-time target to warn + run restore during build when the marker is missing/out-of-date.
- Introduces new warning AZFW0108 (resource +
LogMessage) and adds a corresponding rule doc. - Updates integration tests to validate the new restore marker behavior and adds a build scenario test.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| test/Azure.Functions.Sdk.Tests/Integration/SdkEndToEndTests.Restore.cs | Adds restore marker assertions and incremental timestamp expectations. |
| test/Azure.Functions.Sdk.Tests/Integration/SdkEndToEndTests.Build.cs | Adds a build test intended to cover the “missing restore hook” scenario. |
| src/Azure.Functions.Sdk/Targets/Extensions/Azure.Functions.Sdk.Extensions.targets | Touches marker on restore; adds _VerifyRestoredFunctionsExtensions build-time warning + fallback. |
| src/Azure.Functions.Sdk/Targets/Extensions/Azure.Functions.Sdk.Extensions.props | Defines marker path property for extensions restore verification. |
| src/Azure.Functions.Sdk/Strings.resx | Adds AZFW0108 warning text. |
| src/Azure.Functions.Sdk/LogMessage.cs | Registers Warning_ExtensionsNotRestored for FuncSdkLog. |
| docs/sdk-rules/AZFW0108.md | Adds documentation for the new AZFW0108 warning and mitigation steps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/Azure.Functions.Sdk/Targets/Extensions/Azure.Functions.Sdk.Extensions.targets
Outdated
Show resolved
Hide resolved
test/Azure.Functions.Sdk.Tests/Integration/SdkEndToEndTests.Build.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…om/Azure/azure-functions-dotnet-worker into jviau/msbuild-sdk/restore-fallback
Issue describing the changes in this PR
resolves #3307
Pull request checklist
release_notes.mdAdditional information
This PR adds a build-time check if the inner-project is generated, restored, and up-to-date for the build. A warning is emitted if not up to date and then the inner-build process is attempted at that time. On CI builds with no network access, it is expected for that fallback to fail. The fallback is primarily for local development.