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

chore(civis): move configurations to envier #10969

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

mabdinur
Copy link
Contributor

@mabdinur mabdinur commented Oct 7, 2024

Motivation

  • Increase the adoption of envier in ddtrace products
  • Remove product specific configurations from the global config object

Changes

  • Moves newly added ci_visibility_log_level and test_session_name configurations from ddtrace.config to ddtrace.settings.civis.ci_config and ddtrace.settings.civis.test_config. Since support for ci_visibility_log_level and test_session_name is unreleased this is not a breaking change.
  • Moves all civis related attributes from ddtrace.config (the remaining configs are internal so this is not a breaking change)

Checklist

  • PR author has checked that all the criteria below are met
  • The PR description includes an overview of the change
  • The PR description articulates the motivation for the change
  • The change includes tests OR the PR description describes a testing strategy
  • The PR description notes risks associated with the change, if any
  • Newly-added code is easy to change
  • The change follows the library release note guidelines
  • The change includes or references documentation updates if necessary
  • Backport labels are set (if applicable)

Reviewer Checklist

  • Reviewer has checked that all the criteria below are met
  • Title is accurate
  • All changes are related to the pull request's stated goal
  • Avoids breaking API changes
  • Testing strategy adequately addresses listed risks
  • Newly-added code is easy to change
  • Release note makes sense to a user of the library
  • If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment
  • Backport labels are set in a manner that is consistent with the release branch maintenance policy

Copy link
Contributor

github-actions bot commented Oct 7, 2024

CODEOWNERS have been resolved as:

ddtrace/settings/civis.py                                               @DataDog/ci-app-libraries
.github/CODEOWNERS                                                      @DataDog/python-guild @DataDog/apm-core-python
ddtrace/internal/ci_visibility/recorder.py                              @DataDog/ci-app-libraries
ddtrace/internal/ci_visibility/utils.py                                 @DataDog/ci-app-libraries
ddtrace/internal/ci_visibility/writer.py                                @DataDog/ci-app-libraries
ddtrace/internal/telemetry/writer.py                                    @DataDog/apm-core-python
ddtrace/settings/config.py                                              @DataDog/python-guild @DataDog/apm-sdk-api-python
tests/ci_visibility/api_client/test_ci_visibility_api_client.py         @DataDog/ci-app-libraries
tests/ci_visibility/test_ci_visibility.py                               @DataDog/ci-app-libraries
tests/ci_visibility/util.py                                             @DataDog/ci-app-libraries
tests/telemetry/test_writer.py                                          @DataDog/apm-core-python
tests/utils.py                                                          @DataDog/python-guild

@mabdinur mabdinur force-pushed the munir/use-envier-for-civis branch 2 times, most recently from 2011ae5 to ccd6ebb Compare October 7, 2024 19:08
@datadog-dd-trace-py-rkomorn
Copy link

datadog-dd-trace-py-rkomorn bot commented Oct 7, 2024

Datadog Report

Branch report: munir/use-envier-for-civis
Commit report: 2c5c483
Test service: dd-trace-py

✅ 0 Failed, 1286 Passed, 0 Skipped, 13m 23.17s Total Time

@mabdinur
Copy link
Contributor Author

mabdinur commented Oct 7, 2024

TODO: fix how ci_vis configurations are mocked in tests

@pr-commenter
Copy link

pr-commenter bot commented Oct 7, 2024

Benchmarks

Benchmark execution time: 2024-10-09 06:35:11

Comparing candidate commit 2c5c483 in PR branch munir/use-envier-for-civis with baseline commit 0bf1fe9 in branch main.

Found 1 performance improvements and 0 performance regressions! Performance is the same for 372 metrics, 53 unstable metrics.

scenario:span-start

  • 🟩 max_rss_usage [-4.748MB; -4.652MB] or [-11.807%; -11.569%]

class CIVisConfig(En):
__prefix__ = "dd.civisibility"

_itr_enabled = En.v(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the underscore for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to keep this attriubte "internal" to keep things consistent with how this confiuration was previously defined. Not sure if this is the right approach

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the corresponding env var is "private" (i.e. has a _ prefix, then it should have the private=True kwarg (e.g.

). Then I think it's fine to keep the _ in here as well

Comment on lines 17 to 31
_agentless_enabled = En.v(
bool,
"agentless.enabled",
default=False,
help_type="Boolean",
help="Enable ....",
)

_agentless_url = En.v(
str,
"agentless.url",
default="",
help_type="String",
help="Enable ....",
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These could be grouped in a nested sub-class

ddtrace/settings/civis.py Outdated Show resolved Hide resolved
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.

2 participants