Skip to content

Maintenance: Fix Common project dependency #339

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

Closed
1 task done
hjgraca opened this issue Jul 4, 2023 · 0 comments · Fixed by #340
Closed
1 task done

Maintenance: Fix Common project dependency #339

hjgraca opened this issue Jul 4, 2023 · 0 comments · Fixed by #340
Assignees
Labels
area/common Core Powertools utility internal Maintenance changes

Comments

@hjgraca
Copy link
Contributor

hjgraca commented Jul 4, 2023

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

@hjgraca hjgraca added internal Maintenance changes triage Pending triage from maintainers labels Jul 4, 2023
@hjgraca hjgraca self-assigned this Jul 4, 2023
@hjgraca hjgraca moved this to 🏗 In progress in Powertools for AWS Lambda (.NET) Jul 4, 2023
@hjgraca hjgraca added area/common Core Powertools utility and removed triage Pending triage from maintainers labels Jul 4, 2023
@hjgraca hjgraca linked a pull request Jul 6, 2023 that will close this issue
7 tasks
@github-actions github-actions bot added the pending-release Fix or implementation already in dev waiting to be released label Sep 13, 2023
@hjgraca hjgraca removed the pending-release Fix or implementation already in dev waiting to be released label Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/common Core Powertools utility internal Maintenance changes
Projects
Status: 🏗 In progress
1 participant