chore(lint): remove migrated-path ignores from os-environ sg rules#17222
Draft
chore(lint): remove migrated-path ignores from os-environ sg rules#17222
Conversation
All `os.environ`/`os.getenv` usages in `ddtrace/` have been migrated to `ddtrace.internal.settings.env` via the split migration PRs: - apm-sdk-capabilities-python: #16724 - apm-core-python: #16725 - ci-app-libraries: #16726 - apm-idm-python (contrib): #16727 - asm-python: #17218 - ml-observability: #17219 - profiling-python: #17220 - data-streams-monitoring: #17221 This PR removes the "to be migrated" ignore lists, leaving only the permanent exceptions: - ddtrace/__init__.py — bootstrap: circular import with settings - ddtrace/internal/native/__init__.py — bootstrap: imported before settings Merge after all 8 migration PRs above are merged. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codeowners resolved as |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Final cleanup PR for the
os.environ→ddtrace.internal.settings.envmigration.Removes the
# --- Pre-existing os.environ usage (to be migrated in follow-up PRs) ---ignore lists from all 4 os-environ ast-grep rules, leaving only the two permanent bootstrap exceptions that can never be migrated due to circular imports.apm-sdk-capabilities-pythonapm-core-pythonci-app-librariesapm-idm-python(contrib)asm-pythonml-observabilityprofiling-pythondata-streams-monitoringPermanent exceptions retained:
ddtrace/__init__.py— bootstrap module, circular import with settingsddtrace/internal/native/__init__.py— bootstrap module, imported before settings is availableTesting
sg test)sg scanproduces no violations once all migration PRs are mergedRisks
None if merged after all migration PRs. Merging before will cause
ast-grep rulesCI failures on other PRs.Additional Notes
See #17149 for the
envMutableMapping design.