- 
                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
Conversation
| Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@             Coverage Diff             @@
##           develop     #934      +/-   ##
===========================================
- Coverage    77.89%   77.88%   -0.01%     
===========================================
  Files          287      298      +11     
  Lines        11444    11440       -4     
  Branches      1346     1348       +2     
===========================================
- Hits          8914     8910       -4     
+ Misses        2099     2098       -1     
- Partials       431      432       +1     ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
 | 
…d add source generator tests
…nd related classes
… variable handling - Replace Microsoft.CodeAnalysis.Analyzers and CSharp with Microsoft.CodeAnalysis.Common in central package management and project files - Add Microsoft.CodeAnalysis.Common package reference to relevant projects - Remove unused source generator file reference from Kafka project - Refactor PowertoolsEnvironment to improve UA environment variable string construction and PTENV placement logic - Update UASetter test to use ITestOutputHelper and add assertions for PTENV position and output
…ate source generator output - Introduce EnvWrapper helper in each utility for setting execution environment - Update source generator to use EnvWrapper in generated module initializers - Add IncludeExecutionEnvironment property to project files for conditional EnvWrapper inclusion - Add Directory.Build.targets to automate EnvWrapper generation in Release builds
… check field in XRayRecorder
…nment variable and refine tests.
Signed-off-by: Henrique Graca <[email protected]>
…ors. remove dotnet8 conditional
…der for source output" This reverts commit 843a928.
This reverts commit 7d0b64d.
This reverts commit b008221.
…ls.SourceGenerator.Tests/AWS.Lambda.Powertools.SourceGenerator.Tests.csproj to include both: OutputItemType="Analyzer" - to enable the source generators ReferenceOutputAssembly="true" - to also load the actual assemblies at runtime
…WrapperTests for environment variable validation
| @@ -0,0 +1,42 @@ | |||
| <Project> | |||
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 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
| @@ -0,0 +1,18 @@ | |||
| using AWS.Lambda.Powertools.Common; | |||
|  | |||
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
| /// Cached runtime environment string | ||
| /// </summary> | ||
| private static readonly string CachedRuntimeEnvironment = $"PTENV/AWS_LAMBDA_DOTNET{Environment.Version.Major}"; | ||
| private static readonly string CachedRuntimeEnvironment = $"PTENV/{Environment.GetEnvironmentVariable(Constants.AwsExecutionEnvironmentVariableName)}"; | 
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.
Now we get the value from the Execution environemtn and not hardcoded to lambda
…y.Only one utility is present, first load wins
| 
 | 



Issue number: #933
Summary
Changes
This pull request introduces a new constant,
AWS_SDK_UA_APP_ID, to represent a unique application ID for the User-Agent header, replacing the previous use ofAWS_EXECUTION_ENVin the codebase. The changes involve updating constants, interfaces, implementations, and test cases to reflect this new environment variable.Global configuration with Module Initializers
All projects now have these two new internal classes
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.