refactor: make global config an `AttrDict`
This change refactors the global configuration object to be a subclass of the AttrDict object. The latter has also been refactored to allow more reliable attribute access in both an object and dict-like fashion. The DefaultAttrDict subclass of AttrDict has also been added to provide an analogue of defaultdict. The API of the global configuration class has been enlarged with a method that allows registering sub-configuration items for components using a namespace mechanism. This allows for the whole configuration to be reached from a single object while keeping coupling between components as loose as possible.
Checklist
- [ ] Added to the correct milestone.
- [ ] Tests provided or description of manual testing performed is included in the code or PR.
- [ ] Library documentation is updated.
- [ ] Corp site documentation is updated (link to the PR).
For the time being we can take the "component" bit out and keep the rest of the changes
Discussed offline to remove the component change here and focus this refactor on not subclassing dict.
Codecov Report
Merging #3698 (bd4cacb) into 1.x (5731586) will decrease coverage by
0.02%. The diff coverage is54.92%.
@@ Coverage Diff @@
## 1.x #3698 +/- ##
==========================================
- Coverage 77.51% 77.49% -0.03%
==========================================
Files 664 664
Lines 51039 51074 +35
==========================================
+ Hits 39565 39579 +14
- Misses 11474 11495 +21
| Impacted Files | Coverage Δ | |
|---|---|---|
| ddtrace/internal/safety.py | 0.00% <0.00%> (ø) |
|
| tests/internal/test_safety.py | 0.00% <0.00%> (ø) |
|
| ddtrace/internal/utils/attrdict.py | 100.00% <100.00%> (ø) |
|
| ddtrace/settings/config.py | 91.52% <100.00%> (-0.22%) |
:arrow_down: |
| ddtrace/settings/integration.py | 92.72% <100.00%> (ø) |
|
| tests/tracer/test_settings.py | 98.26% <100.00%> (+<0.01%) |
:arrow_up: |
:mega: Codecov can now indicate which changes are the most critical in Pull Requests. Learn more
@P403n1x87 this pull request is now in conflict 😩
@P403n1x87 this pull request is now in conflict 😩
This PR has been open for almost a year, and last changes were from 9 months ago. Closing for now, @P403n1x87 feel free to resolve conflicts and re-open!