Skip to content

Maintenance: Fix Common project dependency #339

Closed
@hjgraca

Description

@hjgraca

Summary

Utilities have a dependency on the AWS.Lambda.Powertools.Common project.
When the utility is compiled and packaged into a nuget package the AWS.Lambda.Powertools.Common is a dependency.
This behaviour is causing Diamond dependency issues in the project.
To address this we should copy the required files to each utility and make them completely isolated. This allows the client to not have to worry about dependencies between utilities and AWS.Lambda.Powertools.Common.
There is no need to delete the AWS.Lambda.Powertools.Common project but link the files in other projects, this will make it more readable in the solution explorer and makes maintenance easier because it's all in a single project.

Why is this needed?

When there is a change in the AWS.Lambda.Powertools.Common project and a utility requires those new changes the utility is packaged with a new version of AWS.Lambda.Powertools.Common.
But what happens if there are utilities with different versions of AWS.Lambda.Powertools.Common in the current project?
Nuget will use the lowest applicable version AWS.Lambda.Powertools.Common and ignore the new version, this behaviour will break the utility using the new version of AWS.Lambda.Powertools.Common.

Which area does this relate to?

Other

Solution

  • Remove dependency of AWS.Lambda.Powertools.Common project in all utilities
  • Create a Compile Include Link from AWS.Lambda.Powertools.Common files to all utilities csproj
    Pasted image 20230704131824
  • Add a reference to AspectInjector
    Pasted image 20230704115449
  • This will result in linked files in the Common folder of the utility project
    image

Acknowledgment

Metadata

Metadata

Assignees

Labels

area/commonCore Powertools utilityinternalMaintenance changes

Type

No type

Projects

Status

🏗 In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions