Adding Enricher for Azure Pipelines#1675
Merged
patriksvensson merged 3 commits intospectreconsole:mainfrom Nov 4, 2024
Merged
Conversation
patriksvensson
requested changes
Nov 4, 2024
| { | ||
| if (environmentVariables.TryGetValue("TF_BUILD", out var value)) | ||
| { | ||
| return value?.Equals("true", StringComparison.OrdinalIgnoreCase) ?? false; |
Contributor
There was a problem hiding this comment.
No need to check if it's true or not here. A simple !string.IsNullOrWhitespace should suffice.
Contributor
Author
There was a problem hiding this comment.
Just for clarity we don't need to use the if statement on the TryGet since in the case of the variable not being present environmentValue will be the default value for a string, so the null the check will return true, thus the method will return false.
patriksvensson
requested changes
Nov 4, 2024
|
|
||
| return false; | ||
| environmentVariables.TryGetValue("TF_BUILD", out var environmentValue); | ||
| return string.IsNullOrWhiteSpace(environmentValue); |
Contributor
There was a problem hiding this comment.
This expression needs to be inverted, otherwise the enricher will always be enabled.
Contributor
Author
There was a problem hiding this comment.
Should be updated with the inversion!
patriksvensson
approved these changes
Nov 4, 2024
Contributor
|
Merged! Thank you for your contribution. Much appreciated! 👍 |
This was referenced Jul 22, 2025
This was referenced Jul 30, 2025
This was referenced Jan 7, 2026
This was referenced Jan 14, 2026
This was referenced Jan 21, 2026
This was referenced Jan 29, 2026
This was referenced Feb 6, 2026
This was referenced Feb 16, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
fixes #1666
Changes
Added an enricher with same settings as GitHub Actions, looks for TF_BUILD, used Variables as reference. This will be set to true in build tasks.
Please upvote 👍 this pull request if you are interested in it.