-
Notifications
You must be signed in to change notification settings - Fork 140
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
[CI Visibility] - Find .git folder when using GetFrom method as a fallback #5425
[CI Visibility] - Find .git folder when using GetFrom method as a fallback #5425
Conversation
{ | ||
if (gitDirectory == null) | ||
{ | ||
return new GitInfo(); | ||
gitInfo = new GitInfo(); |
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.
Should we not create a new one here? Or if we do want to always, just move gitInfo = new ();
to the top of the method, before the if
gitInfo = new GitInfo(); | |
gitInfo = default; |
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.
changed that method in ce8fd1a
// Return the partial gitInfo instance with the initial source root | ||
return gitInfo; |
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.
Hmmm, that's pretty unusual pattern for a TryGet*
method 🤔 I would assume that if TryGetFrom
returns false
, the output variable is not valid to use. Maybe we should rename it to TryPopulateFrom
and pass in the gitInfo
as a variable instead? 🤔 Doesn't really matter, this just looks "wrong" to me 🤷♂️
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.
fair, let me change that
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.
done in ce8fd1a
Datadog ReportBranch report: ✅ 0 Failed, 334504 Passed, 1513 Skipped, 42m 10.19s Wall Time |
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing the following branches/commits: Execution-time benchmarks measure the whole time it takes to execute a program. And are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are shown in red. The following thresholds were used for comparing the execution times:
Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard. Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph). gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5425) - mean (73ms) : 64, 82
. : milestone, 73,
master - mean (72ms) : 63, 81
. : milestone, 72,
section CallTarget+Inlining+NGEN
This PR (5425) - mean (1,022ms) : 1000, 1045
. : milestone, 1022,
master - mean (1,022ms) : 1004, 1040
. : milestone, 1022,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5425) - mean (110ms) : 106, 114
. : milestone, 110,
master - mean (109ms) : 106, 112
. : milestone, 109,
section CallTarget+Inlining+NGEN
This PR (5425) - mean (742ms) : 727, 757
. : milestone, 742,
master - mean (744ms) : 730, 758
. : milestone, 744,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5425) - mean (94ms) : 89, 98
. : milestone, 94,
master - mean (93ms) : 89, 96
. : milestone, 93,
section CallTarget+Inlining+NGEN
This PR (5425) - mean (697ms) : 676, 718
. : milestone, 697,
master - mean (698ms) : 683, 713
. : milestone, 698,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5425) - mean (188ms) : 185, 192
. : milestone, 188,
master - mean (187ms) : 183, 191
. : milestone, 187,
section CallTarget+Inlining+NGEN
This PR (5425) - mean (1,106ms) : 1084, 1127
. : milestone, 1106,
master - mean (1,099ms) : 1075, 1124
. : milestone, 1099,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5425) - mean (275ms) : 268, 282
. : milestone, 275,
master - mean (270ms) : 267, 274
. : milestone, 270,
section CallTarget+Inlining+NGEN
This PR (5425) - mean (898ms) : 879, 917
. : milestone, 898,
master - mean (889ms) : 869, 909
. : milestone, 889,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5425) - mean (261ms) : 258, 265
. : milestone, 261,
master - mean (259ms) : 252, 266
. : milestone, 259,
section CallTarget+Inlining+NGEN
This PR (5425) - mean (880ms) : 857, 902
. : milestone, 880,
master - mean (874ms) : 858, 891
. : milestone, 874,
|
Benchmarks Report for tracer 🐌Benchmarks for #5425 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.ActivityBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Fewer allocations 🎉
|
Benchmark | Base Allocated | Diff Allocated | Change | Change % |
---|---|---|---|---|
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 | 41.96 KB | 41.63 KB | -336 B | -0.80% |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | WriteAndFlushEnrichedTraces |
net6.0 | 576μs | 1.35μs | 5.22μs | 0.548 | 0 | 0 | 41.84 KB |
master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 650μs | 943ns | 3.53μs | 0.331 | 0 | 0 | 41.96 KB |
master | WriteAndFlushEnrichedTraces |
net472 | 871μs | 4.33μs | 19.4μs | 8.08 | 2.55 | 0.425 | 53.21 KB |
#5425 | WriteAndFlushEnrichedTraces |
net6.0 | 537μs | 789ns | 2.95μs | 0.536 | 0 | 0 | 41.69 KB |
#5425 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 672μs | 1.01μs | 3.91μs | 0.338 | 0 | 0 | 41.63 KB |
#5425 | WriteAndFlushEnrichedTraces |
net472 | 861μs | 3.1μs | 12μs | 8.28 | 2.48 | 0.414 | 53.24 KB |
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | ExecuteNonQuery |
net6.0 | 1.13μs | 0.664ns | 2.48ns | 0.0113 | 0 | 0 | 800 B |
master | ExecuteNonQuery |
netcoreapp3.1 | 1.59μs | 0.427ns | 1.54ns | 0.0104 | 0 | 0 | 800 B |
master | ExecuteNonQuery |
net472 | 1.81μs | 0.399ns | 1.54ns | 0.121 | 0 | 0 | 762 B |
#5425 | ExecuteNonQuery |
net6.0 | 1.17μs | 0.732ns | 2.84ns | 0.0115 | 0 | 0 | 800 B |
#5425 | ExecuteNonQuery |
netcoreapp3.1 | 1.5μs | 0.872ns | 3.38ns | 0.0105 | 0 | 0 | 800 B |
#5425 | ExecuteNonQuery |
net472 | 1.83μs | 0.875ns | 3.03ns | 0.121 | 0 | 0 | 762 B |
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | CallElasticsearch |
net6.0 | 1.3μs | 0.503ns | 1.88ns | 0.0143 | 0 | 0 | 1.02 KB |
master | CallElasticsearch |
netcoreapp3.1 | 1.6μs | 0.481ns | 1.8ns | 0.0138 | 0 | 0 | 1.02 KB |
master | CallElasticsearch |
net472 | 2.6μs | 1.47ns | 5.48ns | 0.164 | 0 | 0 | 1.04 KB |
master | CallElasticsearchAsync |
net6.0 | 1.46μs | 0.873ns | 3.27ns | 0.0138 | 0 | 0 | 1 KB |
master | CallElasticsearchAsync |
netcoreapp3.1 | 1.68μs | 0.739ns | 2.86ns | 0.0142 | 0 | 0 | 1.07 KB |
master | CallElasticsearchAsync |
net472 | 2.66μs | 1.52ns | 5.7ns | 0.172 | 0 | 0 | 1.09 KB |
#5425 | CallElasticsearch |
net6.0 | 1.42μs | 1.04ns | 4.01ns | 0.0142 | 0 | 0 | 1.02 KB |
#5425 | CallElasticsearch |
netcoreapp3.1 | 1.57μs | 2.32ns | 9ns | 0.0141 | 0 | 0 | 1.02 KB |
#5425 | CallElasticsearch |
net472 | 2.49μs | 1.16ns | 4.51ns | 0.164 | 0 | 0 | 1.04 KB |
#5425 | CallElasticsearchAsync |
net6.0 | 1.39μs | 1.63ns | 6.29ns | 0.014 | 0 | 0 | 1 KB |
#5425 | CallElasticsearchAsync |
netcoreapp3.1 | 1.77μs | 0.742ns | 2.87ns | 0.0148 | 0 | 0 | 1.07 KB |
#5425 | CallElasticsearchAsync |
net472 | 2.68μs | 1.43ns | 5.53ns | 0.172 | 0 | 0 | 1.09 KB |
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | ExecuteAsync |
net6.0 | 1.33μs | 1.33ns | 5.15ns | 0.0128 | 0 | 0 | 944 B |
master | ExecuteAsync |
netcoreapp3.1 | 1.82μs | 0.765ns | 2.86ns | 0.0126 | 0 | 0 | 944 B |
master | ExecuteAsync |
net472 | 1.96μs | 0.502ns | 1.88ns | 0.144 | 0 | 0 | 907 B |
#5425 | ExecuteAsync |
net6.0 | 1.34μs | 0.388ns | 1.5ns | 0.0134 | 0 | 0 | 944 B |
#5425 | ExecuteAsync |
netcoreapp3.1 | 1.67μs | 1.1ns | 4.28ns | 0.0127 | 0 | 0 | 944 B |
#5425 | ExecuteAsync |
net472 | 1.95μs | 0.99ns | 3.83ns | 0.144 | 0 | 0 | 907 B |
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | SendAsync |
net6.0 | 4.09μs | 1.77ns | 6.62ns | 0.0295 | 0 | 0 | 2.18 KB |
master | SendAsync |
netcoreapp3.1 | 5.05μs | 1.98ns | 7.4ns | 0.0354 | 0 | 0 | 2.71 KB |
master | SendAsync |
net472 | 7.69μs | 1.95ns | 7.3ns | 0.485 | 0 | 0 | 3.07 KB |
#5425 | SendAsync |
net6.0 | 4.14μs | 2.17ns | 8.4ns | 0.0292 | 0 | 0 | 2.18 KB |
#5425 | SendAsync |
netcoreapp3.1 | 5.14μs | 0.963ns | 3.6ns | 0.0359 | 0 | 0 | 2.71 KB |
#5425 | SendAsync |
net472 | 7.63μs | 3.03ns | 10.9ns | 0.486 | 0 | 0 | 3.07 KB |
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | EnrichedLog |
net6.0 | 1.6μs | 0.901ns | 3.49ns | 0.0235 | 0 | 0 | 1.68 KB |
master | EnrichedLog |
netcoreapp3.1 | 2.25μs | 1.05ns | 3.94ns | 0.023 | 0 | 0 | 1.68 KB |
master | EnrichedLog |
net472 | 2.7μs | 0.736ns | 2.55ns | 0.255 | 0 | 0 | 1.61 KB |
#5425 | EnrichedLog |
net6.0 | 1.49μs | 0.87ns | 3.26ns | 0.0238 | 0 | 0 | 1.68 KB |
#5425 | EnrichedLog |
netcoreapp3.1 | 2.17μs | 1.1ns | 4.11ns | 0.0222 | 0 | 0 | 1.68 KB |
#5425 | EnrichedLog |
net472 | 2.58μs | 2.11ns | 7.91ns | 0.255 | 0 | 0 | 1.61 KB |
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | EnrichedLog |
net6.0 | 112μs | 86.6ns | 336ns | 0.0565 | 0 | 0 | 4.26 KB |
master | EnrichedLog |
netcoreapp3.1 | 117μs | 103ns | 398ns | 0.0589 | 0 | 0 | 4.26 KB |
master | EnrichedLog |
net472 | 146μs | 83ns | 311ns | 0.66 | 0.22 | 0 | 4.45 KB |
#5425 | EnrichedLog |
net6.0 | 112μs | 79ns | 296ns | 0.0558 | 0 | 0 | 4.26 KB |
#5425 | EnrichedLog |
netcoreapp3.1 | 119μs | 279ns | 1.08μs | 0.0588 | 0 | 0 | 4.26 KB |
#5425 | EnrichedLog |
net472 | 147μs | 123ns | 475ns | 0.662 | 0.221 | 0 | 4.45 KB |
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | EnrichedLog |
net6.0 | 3.02μs | 1.18ns | 4.56ns | 0.0319 | 0 | 0 | 2.24 KB |
master | EnrichedLog |
netcoreapp3.1 | 4.15μs | 1.86ns | 6.97ns | 0.0293 | 0 | 0 | 2.24 KB |
master | EnrichedLog |
net472 | 5.03μs | 1.84ns | 7.11ns | 0.324 | 0 | 0 | 2.05 KB |
#5425 | EnrichedLog |
net6.0 | 3.09μs | 0.708ns | 2.65ns | 0.0309 | 0 | 0 | 2.24 KB |
#5425 | EnrichedLog |
netcoreapp3.1 | 4.23μs | 1.69ns | 6.1ns | 0.0301 | 0 | 0 | 2.24 KB |
#5425 | EnrichedLog |
net472 | 4.86μs | 2.62ns | 10.1ns | 0.325 | 0 | 0 | 2.05 KB |
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | SendReceive |
net6.0 | 1.51μs | 0.833ns | 3.12ns | 0.0165 | 0 | 0 | 1.19 KB |
master | SendReceive |
netcoreapp3.1 | 1.81μs | 0.705ns | 2.64ns | 0.0163 | 0 | 0 | 1.19 KB |
master | SendReceive |
net472 | 2.29μs | 1.22ns | 4.56ns | 0.19 | 0 | 0 | 1.2 KB |
#5425 | SendReceive |
net6.0 | 1.44μs | 0.554ns | 2.07ns | 0.0166 | 0 | 0 | 1.19 KB |
#5425 | SendReceive |
netcoreapp3.1 | 1.84μs | 1.82ns | 6.79ns | 0.0164 | 0 | 0 | 1.19 KB |
#5425 | SendReceive |
net472 | 2.23μs | 1.37ns | 5.14ns | 0.19 | 0 | 0 | 1.2 KB |
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | EnrichedLog |
net6.0 | 2.63μs | 0.715ns | 2.58ns | 0.0224 | 0 | 0 | 1.58 KB |
master | EnrichedLog |
netcoreapp3.1 | 3.97μs | 1.31ns | 4.92ns | 0.022 | 0 | 0 | 1.63 KB |
master | EnrichedLog |
net472 | 4.56μs | 2.37ns | 9.16ns | 0.319 | 0 | 0 | 2.02 KB |
#5425 | EnrichedLog |
net6.0 | 2.81μs | 1.24ns | 4.82ns | 0.0226 | 0 | 0 | 1.58 KB |
#5425 | EnrichedLog |
netcoreapp3.1 | 4.18μs | 1.6ns | 6ns | 0.0207 | 0 | 0 | 1.63 KB |
#5425 | EnrichedLog |
net472 | 4.44μs | 2.31ns | 8.95ns | 0.321 | 0 | 0 | 2.02 KB |
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StartFinishSpan |
net6.0 | 543ns | 0.926ns | 3.47ns | 0.00789 | 0 | 0 | 568 B |
master | StartFinishSpan |
netcoreapp3.1 | 744ns | 1.51ns | 5.85ns | 0.00758 | 0 | 0 | 568 B |
master | StartFinishSpan |
net472 | 742ns | 1.34ns | 5.19ns | 0.0902 | 0 | 0 | 570 B |
master | StartFinishScope |
net6.0 | 589ns | 0.77ns | 2.88ns | 0.00948 | 0 | 0 | 688 B |
master | StartFinishScope |
netcoreapp3.1 | 832ns | 4.19ns | 18.7ns | 0.00914 | 0 | 0 | 688 B |
master | StartFinishScope |
net472 | 976ns | 2.66ns | 10.3ns | 0.103 | 0 | 0 | 650 B |
#5425 | StartFinishSpan |
net6.0 | 544ns | 0.649ns | 2.43ns | 0.00803 | 0 | 0 | 568 B |
#5425 | StartFinishSpan |
netcoreapp3.1 | 693ns | 3.02ns | 11.7ns | 0.00741 | 0 | 0 | 568 B |
#5425 | StartFinishSpan |
net472 | 797ns | 1.46ns | 5.66ns | 0.0905 | 0.000393 | 0 | 570 B |
#5425 | StartFinishScope |
net6.0 | 592ns | 1.13ns | 4.37ns | 0.00975 | 0 | 0 | 688 B |
#5425 | StartFinishScope |
netcoreapp3.1 | 796ns | 1.65ns | 6.4ns | 0.00913 | 0 | 0 | 688 B |
#5425 | StartFinishScope |
net472 | 961ns | 1.64ns | 6.34ns | 0.103 | 0 | 0 | 650 B |
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | RunOnMethodBegin |
net6.0 | 674ns | 0.877ns | 3.16ns | 0.00948 | 0 | 0 | 688 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 957ns | 3.5ns | 13.6ns | 0.00927 | 0 | 0 | 688 B |
master | RunOnMethodBegin |
net472 | 1.05μs | 2.65ns | 10.3ns | 0.103 | 0 | 0 | 650 B |
#5425 | RunOnMethodBegin |
net6.0 | 750ns | 1.17ns | 4.54ns | 0.00962 | 0 | 0 | 688 B |
#5425 | RunOnMethodBegin |
netcoreapp3.1 | 954ns | 2.02ns | 7.82ns | 0.00921 | 0 | 0 | 688 B |
#5425 | RunOnMethodBegin |
net472 | 1.04μs | 1.79ns | 6.94ns | 0.103 | 0 | 0 | 650 B |
Summary of changes
This PR changes the behavior of
GitInfo.GetFrom
to have a fallback when the current folder provided doesn't contain git information.Reason for change
There's a case when we can provide only the current folder from a target project and we need to support looking at the
.git
folder given that target project folderImplementation details
We only look for the parent .git folder when we cannot parse the current provided folder.