generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 33
chore: update environment variable references to use AWS_SDK_UA_APP_ID #934
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
Merged
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
88fdaa3
feat: update environment variable references to use AWS_SDK_UA_APP_ID
hjgraca d0c3a26
Merge branch 'develop' into chore/ua-change-env
hjgraca d593cbb
on sourcegenerator per project
hjgraca c1927d6
chore: update execution environment setter to support utility name an…
hjgraca 65cfe37
chore: remove SetExecutionEnvironment from PowertoolsConfigurations a…
hjgraca 5a17bdf
chore: update CodeAnalysis dependency usage and refine UA environment…
hjgraca ac4fa6f
chore: refactor UA environment initialization with EnvWrapper and upd…
hjgraca a13b8d0
chore: update UA app ID test to reflect new environment variable order
hjgraca ec06192
chore: remove obsolete execution environment setter and update Lambda…
hjgraca 2c6e7a2
chore: add explicit namespace declarations to UA source generators fo…
hjgraca 067e9d8
chore: update UA environment handling to use dynamic execution enviro…
hjgraca 247a23a
Merge branch 'develop' into chore/ua-change-env
hjgraca b6531b3
chore: remove IPowertoolsConfigurations dependency from batch process…
hjgraca 843a928
chore: update UASourceGenerator to register compilation provider for …
hjgraca b008221
chore: initialize module initializers
hjgraca 7d0b64d
chore: add UASourceGenerator analyzer to project files
hjgraca 494775a
Revert "chore: update UASourceGenerator to register compilation provi…
hjgraca 55e7b8c
Revert "chore: add UASourceGenerator analyzer to project files"
hjgraca fe51661
Revert "chore: initialize module initializers"
hjgraca c4f5561
updated the project references in libraries/tests/AWS.Lambda.Powertoo…
hjgraca fe6b07d
Force loading of all the assemblies by accessing their types
hjgraca 51eda50
add fallback
hjgraca 182630d
using reflection
hjgraca ebc4cc1
replace source generator with module initializer
hjgraca 6fdfccc
add module initializers for AWS Lambda Powertools libraries with envi…
hjgraca d5906e7
add XML documentation for EnvWrapper class and its method. remove bui…
hjgraca da79060
remove IncludeExecutionEnvironment property from project files
hjgraca 9eeb52f
cleanup
hjgraca b9e95ce
add MSBuild targets for auto-initializers in AWS Lambda Powertools li…
hjgraca f587b0f
refactor tests for MSBuild auto-initialization and improve logging
hjgraca 92316fd
add MSBuild targets for auto-initializers in Kafka libraries
hjgraca f16d005
remove SetExecutionEnvironment calls from various classes and add Env…
hjgraca 5cddf03
update environment variable prefix from PTENV to PTEnv for consistenc…
hjgraca 531eb6a
add test coverage, for insert before ptenv
hjgraca File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
libraries/src/AWS.Lambda.Powertools.BatchProcessing/Internal/EnvWrapper.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| using AWS.Lambda.Powertools.Common; | ||
|
|
||
| namespace AWS.Lambda.Powertools.BatchProcessing.Internal | ||
| { | ||
| /// <summary> | ||
| /// Wrapper class to set the execution environment | ||
| /// </summary> | ||
| public static class EnvWrapper | ||
| { | ||
| /// <summary> | ||
| /// Sets the execution environment | ||
| /// </summary> | ||
| public static void SetExecutionEnvironment() | ||
| { | ||
| PowertoolsEnvironment.Instance.SetExecutionEnvironment(typeof(EnvWrapper)); | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...AWS.Lambda.Powertools.BatchProcessing/build/AWS.Lambda.Powertools.BatchProcessing.targets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| <Project> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Each project with have a targets file - this file is executed by MsBuild, the builder and compiled with the code that references our Nuget packages, making it possible to run this on adding Powertools nuget to a project |
||
|
|
||
| <!-- Automatically inject a module initializer for the BatchProcessing library --> | ||
| <Target Name="InjectBatchProcessingAutoInitializer" BeforeTargets="BeforeCompile"> | ||
|
|
||
| <!-- Generate the C# content directly --> | ||
| <PropertyGroup> | ||
| <GeneratedFileContent>// Generated by AWS Lambda Powertools Auto-Initializer | ||
| using System.Runtime.CompilerServices%3B | ||
|
|
||
| internal static class PowertoolsBatchProcessingAutoInitializer | ||
| { | ||
| [ModuleInitializer] | ||
| internal static void Initialize() | ||
| { | ||
| try | ||
| { | ||
| // Force load the Powertools assembly by calling its initialization method | ||
| AWS.Lambda.Powertools.BatchProcessing.Internal.EnvWrapper.SetExecutionEnvironment()%3B | ||
| } | ||
| catch | ||
| { | ||
| // Ignore errors - the assembly might not be available in all scenarios | ||
| } | ||
| } | ||
| }</GeneratedFileContent> | ||
| </PropertyGroup> | ||
|
|
||
| <!-- Write the generated file --> | ||
| <WriteLinesToFile | ||
| File="$(IntermediateOutputPath)PowertoolsBatchProcessingAutoInitializer.g.cs" | ||
| Lines="$(GeneratedFileContent)" | ||
| Overwrite="true" /> | ||
|
|
||
| <!-- Include the generated file in compilation --> | ||
| <ItemGroup> | ||
| <Compile Include="$(IntermediateOutputPath)PowertoolsBatchProcessingAutoInitializer.g.cs" /> | ||
| </ItemGroup> | ||
|
|
||
| </Target> | ||
|
|
||
| </Project> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Each project has an eventwrapper class