-
Notifications
You must be signed in to change notification settings - Fork 35
chore: Fix examples projects to include projectreferences #1110
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
Conversation
- Move batch processing snippets from examples/BatchProcessing/snippets to docs/snippets/batch - Move idempotency snippets from examples/Idempotency/snippets to docs/snippets/idempotency - Update documentation references in batch-processing.md to point to new snippet locations - Update documentation references in idempotency.md to point to new snippet locations - Consolidate code examples in centralized docs directory for easier maintenance and access
- Update Amazon.Lambda.Core from 2.5.0 to 2.8.0 across documentation and examples - Convert AWS Lambda Powertools PackageReferences to ProjectReferences in AOT examples (Logging, Metrics, Tracing) - Update CI/CD workflow to handle both PackageReference updates and ProjectReference conversions - Consolidate ItemGroup elements in example project files for better organization - Update migration guide and AOT documentation with latest dependency versions - Align all example projects to use local project references instead of NuGet packages for development consistency
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
This PR updates example projects to use ProjectReference instead of PackageReference for local development, with a GitHub Actions workflow that automatically converts them back to PackageReference during CI/CD builds. This approach allows developers to work with the latest library code directly while ensuring CI tests use packaged versions.
Key changes:
- All example projects now reference Powertools libraries via
ProjectReferencewith relative paths - GitHub Actions workflow updated to detect and convert
ProjectReferencetoPackageReferenceduring builds - Documentation updated to reflect current package versions (Amazon.Lambda.Core 2.8.0)
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| examples/Tracing/src/HelloWorld/HelloWorld.csproj | Converted Logging and Tracing PackageReferences to ProjectReferences |
| examples/ServerlessApi/src/LambdaPowertoolsAPI/LambdaPowertoolsAPI.csproj | Converted Logging, Metrics, and Tracing PackageReferences to ProjectReferences |
| examples/Parameters/src/HelloWorld/HelloWorld.csproj | Converted Parameters PackageReference to ProjectReference |
| examples/Metrics/src/HelloWorld/HelloWorld.csproj | Converted Logging and Metrics PackageReferences to ProjectReferences |
| examples/Logging/src/HelloWorld/HelloWorld.csproj | Converted Logging PackageReference to ProjectReference |
| examples/Kafka/Protobuf/src/Protobuf.csproj | Converted Logging and Kafka.Protobuf PackageReferences to ProjectReferences |
| examples/Kafka/JsonClassLibrary/src/ProtoBufClassLibrary.csproj | Converted Logging and Kafka.Protobuf PackageReferences to ProjectReferences |
| examples/Kafka/Json/src/Json.csproj | Converted Logging and Kafka.Json PackageReferences to ProjectReferences |
| examples/Kafka/Avro/src/Avro.csproj | Converted Logging and Kafka.Avro PackageReferences to ProjectReferences |
| examples/Idempotency/src/HelloWorld/HelloWorld.csproj | Converted Idempotency and Logging PackageReferences to ProjectReferences |
| examples/BatchProcessing/src/HelloWorld/HelloWorld.csproj | Standardized ProjectReference formatting and added Logging ProjectReference |
| examples/AOT/AOT_Tracing/src/AOT_Tracing/AOT_Tracing.csproj | Converted Tracing PackageReference to ProjectReference |
| examples/AOT/AOT_Metrics/src/AOT_Metrics/AOT_Metrics.csproj | Converted Metrics PackageReference to ProjectReference |
| examples/AOT/AOT_Logging/src/AOT_Logging/AOT_Logging.csproj | Converted Logging PackageReference to ProjectReference |
| docs/migration-guide-v3.md | Updated Amazon.Lambda.Core version from 2.7.0 to 2.8.0 in migration examples |
| docs/getting-started/logger/aot.md | Updated Amazon.Lambda.Core version from 2.5.0 to 2.8.0 in AOT setup example |
| .github/workflows/publish-artifacts-examples-tests.yml | Added logic to convert ProjectReferences to PackageReferences during CI builds |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if grep -q "<ProjectReference.*$packageName.csproj" "$project"; then | ||
| echo " - Converting ProjectReference $packageName to PackageReference version $packageVersion" | ||
| # Remove the ProjectReference line | ||
| sed -i "/<ProjectReference.*$packageName.csproj/d" "$project" |
Copilot
AI
Jan 6, 2026
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 sed command that removes ProjectReference lines may leave behind empty ItemGroup tags. When a ProjectReference is removed with this pattern, if it's the last or only reference in an ItemGroup, the empty ItemGroup tags will remain in the .csproj file. While this won't cause build failures, it could lead to cluttered project files. Consider also removing empty ItemGroup blocks after deletion, or using a more comprehensive approach to handle the XML structure.
| sed -i "/<ProjectReference.*$packageName.csproj/d" "$project" | |
| sed -i "/<ProjectReference.*$packageName.csproj/d" "$project" | |
| # Remove any now-empty ItemGroup blocks left behind by the deleted ProjectReference | |
| sed -i ':a;N;$!ba;s/<ItemGroup>[[:space:]]*<\/ItemGroup>//g' "$project" |
Co-authored-by: Copilot <[email protected]> Signed-off-by: Henrique Graca <[email protected]>
|



Issue number: #1085
Summary
Changes
Update examples projects to use
projectreferenceThe
packagereferencewill be added on CI systems and replaceprojectreferenceUpdate GitHub Action to do that work
User experience
Checklist
Please leave checklist items unchecked if they do not apply to your change.
Is this a breaking change?
RFC issue number:
Checklist:
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.