Skip to content
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-9333] support custom configuration tags supplied from the environment #166

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

anmarchenko
Copy link
Member

@anmarchenko anmarchenko commented Apr 24, 2024

What does this PR do?
There are some configurations that cannot be directly identified and reported automatically. For those cases, the user must provide the configuration details to the library so CI Visibility can properly identify them. These tags affect the test fingerprint. These custom configurations are passed via DD_TAGS with a test.configuration. prefix, that is, every test.configuration.* tag will be treated as a custom configuration.

We send these custom configurations when requesting library settings and skippable tests in data.attributes.configurations.custom field.

How to test the change?
Using anmarchenko/sidekiq

Test with custom configurations:
image

Logs when sending skippable request:

D, [2024-04-24T14:02:38.210618 #19229] DEBUG -- datadog: [datadog] (/Users/andrey.marchenko/p/datadog-ci-rb/lib/datadog/ci/itr/skippable.rb:71:in `fetch_skippable_tests') Fetching skippable tests with request: {"data":{"type":"test_params","attributes":{"test_level":"test","service":"sidekiq","env":"ci","repository_url":"git@github.com:anmarchenko/sidekiq.git","sha":"345a0d3c42d02b86fb2b9e590d70e6fe67da95a4","configurations":{"os.platform":"darwin23","os.architecture":"arm64","os.version":"23.4.0","runtime.name":"ruby","runtime.version":"3.3.0","custom":{"disk":"slow","memory":"low"}}}}}

Logs when sending settings request:

D, [2024-04-24T14:02:36.620087 #19229] DEBUG -- datadog: [datadog] (/Users/andrey.marchenko/p/datadog-ci-rb/lib/datadog/ci/transport/remote_settings_api.rb:65:in `fetch_library_settings') Fetching library settings with request: {"data":{"id":"d0bf8c94-c9c2-45e0-a317-088d1ca75b7f","type":"ci_app_test_service_libraries_settings","attributes":{"service":"sidekiq","env":"ci","repository_url":"git@github.com:anmarchenko/sidekiq.git","branch":"itr_test1","sha":"345a0d3c42d02b86fb2b9e590d70e6fe67da95a4","test_level":"test","configurations":{"os.platform":"darwin23","os.architecture":"arm64","os.version":"23.4.0","runtime.name":"ruby","runtime.version":"3.3.0","custom":{"disk":"slow","memory":"low"}}}}}

@codecov-commenter
Copy link

codecov-commenter commented Apr 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.06%. Comparing base (f0592d1) to head (a1f0eb7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #166   +/-   ##
=======================================
  Coverage   99.06%   99.06%           
=======================================
  Files         196      196           
  Lines        9377     9419   +42     
  Branches      407      409    +2     
=======================================
+ Hits         9289     9331   +42     
  Misses         88       88           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@anmarchenko anmarchenko marked this pull request as ready for review April 24, 2024 12:05
@anmarchenko anmarchenko requested review from a team as code owners April 24, 2024 12:05
@anmarchenko anmarchenko force-pushed the anmarchenko/custom_configuration_tags branch from f7e5581 to a1f0eb7 Compare April 24, 2024 12:17
@anmarchenko anmarchenko merged commit f042dc4 into main Apr 25, 2024
26 checks passed
@anmarchenko anmarchenko deleted the anmarchenko/custom_configuration_tags branch April 25, 2024 08:12
@github-actions github-actions bot added this to the 1.0 milestone Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants