Skip to content

Conversation

@hjgraca
Copy link
Contributor

@hjgraca hjgraca commented Jan 6, 2026

Please provide the issue number

Issue number: #1085

Summary

Changes

Update examples projects to use projectreference
The packagereference will be added on CI systems and replace projectreference
Update GitHub Action to do that work

User experience

Please share what the user experience looks like before and after this change

Checklist

Please leave checklist items unchecked if they do not apply to your change.

Is this a breaking change?

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

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.

fuguiKz and others added 5 commits January 6, 2026 12:06
- 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
Copilot AI review requested due to automatic review settings January 6, 2026 12:09
@boring-cyborg boring-cyborg bot added documentation Improvements or additions to documentation github-actions Changes in GitHub workflows internal Maintenance changes labels Jan 6, 2026
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 6, 2026
Copy link
Contributor

Copilot AI left a 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 ProjectReference with relative paths
  • GitHub Actions workflow updated to detect and convert ProjectReference to PackageReference during 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"
Copy link

Copilot AI Jan 6, 2026

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.

Suggested change
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"

Copilot uses AI. Check for mistakes.
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 6, 2026

@hjgraca hjgraca merged commit e99abe4 into develop Jan 6, 2026
7 checks passed
@hjgraca hjgraca deleted the chore/fix-release branch January 6, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation github-actions Changes in GitHub workflows internal Maintenance changes size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants