Skip to content

Add typing for environment stats and LRUCache#5454

Draft
marcotc wants to merge 1 commit intomasterfrom
marcotc/type-core-env-misc
Draft

Add typing for environment stats and LRUCache#5454
marcotc wants to merge 1 commit intomasterfrom
marcotc/type-core-env-misc

Conversation

@marcotc
Copy link
Copy Markdown
Member

@marcotc marcotc commented Mar 13, 2026

What does this PR do?

Small type improvements for environment stat modules and LRUCache:

  • Environment::Socket#hostname: untyped::String
  • Environment::VMCache#available?: untypedbool?
  • Environment::YJIT#available?: untypedbool?
  • Utils::LRUCache: @store, [], []= use any (intentionally generic key-value cache)

How to test the change?

bundle exec steep check lib/datadog/core/utils/lru_cache.rb

Changelog

None.

- Socket#hostname: -> ::String (always returns gethostname string)
- VMCache#available?: untyped -> bool? (defined? returns String?)
- YJIT#available?: untyped -> bool? (defined? returns String?)
- LRUCache: store/[]/[]= use any (intentionally generic key-value cache)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@marcotc marcotc added the AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos label Mar 13, 2026
@github-actions
Copy link
Copy Markdown

👋 Hey @marcotc, please fill "Change log entry" section in the pull request description.

If changes need to be present in CHANGELOG.md you can state it this way

**Change log entry**

Yes. A brief summary to be placed into the CHANGELOG.md

(possible answers Yes/Yep/Yeah)

Or you can opt out like that

**Change log entry**

None.

(possible answers No/Nope/None)

Visited at: 2026-03-13 20:24:43 UTC

@github-actions
Copy link
Copy Markdown

Typing analysis

Note: Ignored files are excluded from the next sections.

Untyped methods

This PR clears 2 untyped methods. It increases the percentage of typed methods from 61.14% to 61.24% (+0.1%).

Untyped methods (+0-2)Cleared:
sig/datadog/core/utils/lru_cache.rbs:13
└── def []: (untyped key) -> untyped?
sig/datadog/core/utils/lru_cache.rbs:15
└── def []=: (untyped key, untyped value) -> untyped

Untyped other declarations

This PR clears 1 partially typed other declaration. It increases the percentage of typed other declarations from 77.13% to 77.19% (+0.06%).

Partially typed other declarations (+0-1)Cleared:
sig/datadog/core/utils/lru_cache.rbs:7
└── @store: ::Hash[untyped, untyped]

@datadog-datadog-prod-us1-2
Copy link
Copy Markdown

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 95.14% (-0.02%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: db9374d | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant