-
Notifications
You must be signed in to change notification settings - Fork 6
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
[CIVIS-3172] use repository name as default test service name #104
[CIVIS-3172] use repository name as default test service name #104
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #104 +/- ##
==========================================
- Coverage 99.15% 99.11% -0.05%
==========================================
Files 147 147
Lines 6289 6338 +49
Branches 264 269 +5
==========================================
+ Hits 6236 6282 +46
- Misses 53 56 +3 ☔ View full report in Codecov by Sentry. |
c1de6d6
to
357ca28
Compare
357ca28
to
0f28e32
Compare
@@ -21,7 +22,9 @@ class Settings < Datadog::CI::Contrib::Settings | |||
|
|||
option :service_name do |o| | |||
o.type :string | |||
o.default { Datadog.configuration.service_without_fallback || Ext::DEFAULT_SERVICE_NAME } | |||
o.default do | |||
Datadog.configuration.service_without_fallback || Utils::Git.repository_name || Ext::DEFAULT_SERVICE_NAME |
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 this come from a function provided by our CI gem's utils, instead of a per-framework "implementation"?
eg: Utils::Something.get_service_name()
?
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.
yes, I agree, the logic to look into Datadog.configuration and Utils::Git should be extracted, will do it
What does this PR do?
In order to simplify onboarding for new customers it provides better default service name when none is provided.
Additional Notes
How to test the change?
Unit tests are provided.
Example project without service name configured:
https://github.com/anmarchenko/sidekiq/tree/anmarchenko/datadog-ci-visibility
Service is set to repository name:
![image](https://private-user-images.githubusercontent.com/426400/296832736-3ac3ea10-ca0b-4e84-a845-48c1fc806319.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NjExMzIsIm5iZiI6MTczOTU2MDgzMiwicGF0aCI6Ii80MjY0MDAvMjk2ODMyNzM2LTNhYzNlYTEwLWNhMGItNGU4NC1hODQ1LTQ4YzFmYzgwNjMxOS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE0JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNFQxOTIwMzJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04YWFhYTIzZWE0YzliZGE4YjI3NDcyZTE5Yzg3YTVhMzUyNzc4MzI4MzA3YjExMTIzZTJhMTU1ZWNjOWJjMzhmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.VSdRDTnBv-fE445VEYSbGy37XOeYJd6BbLDkK9Izh4k)