DataDog / datadog-ci-rb

Ruby library for Datadog Test Optimization
https://docs.datadoghq.com/tests/setup/ruby/?tab=cloudciprovideragentless
Other
11 stars 4 forks source link

[SDTEST-160] git commands telemetry #205

Closed anmarchenko closed 4 months ago

anmarchenko commented 4 months ago

What does this PR do? Adds telemetry metrics collection to git commands

Additional Notes This change caused curious fail: one must not access Telemetry when the library is initialized. We previously collected environment tags during the library initialization stage, which might include using git commands. I made the environment tags collection lazy, so it does not happen until at least one span is traced.

How to test the change? Unit tests are provided

codecov-commenter commented 4 months ago

Codecov Report

Attention: Patch coverage is 96.81529% with 5 lines in your changes missing coverage. Please review.

Project coverage is 98.83%. Comparing base (9cd40ca) to head (6002775).

Files Patch % Lines
lib/datadog/ci/git/local_repository.rb 91.80% 5 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## anmarchenko/telemetry_metrics_itr #205 +/- ## ===================================================================== - Coverage 98.86% 98.83% -0.04% ===================================================================== Files 249 251 +2 Lines 11279 11416 +137 Branches 503 509 +6 ===================================================================== + Hits 11151 11283 +132 - Misses 128 133 +5 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.