SymDB: Rename injectible/injectable Ruby identifiers to targetable#5692
Conversation
Renames the internal Ruby identifiers across SymbolDatabase from +injectible+ / +injectable+ to +targetable+. The wire format hash keys +has_injectible_lines+ and +injectible_lines+ are intentionally preserved in Scope#to_h for backend compatibility — only the Ruby identifiers change. Renamed identifiers: - Scope#injectible_lines (attr) → #targetable_lines - Scope#injectible_lines? → #targetable_lines? - Scope.new(injectible_lines:) keyword arg → (targetable_lines:) - Extractor::INJECTABLE_LINE_EVENTS constant → TARGETABLE_LINE_EVENTS - Extractor#extract_injectable_lines → #extract_targetable_lines - Extractor#build_injectable_ranges → #build_targetable_ranges - Local variables and comments using "injectable lines" / "injectible_lines" Preserved (wire format / backend contract): - :has_injectible_lines hash key in Scope#to_h output - :injectible_lines hash key in Scope#to_h output - All test assertions checking those keys Extracted from #5431 to keep the rename atomic and reviewable in isolation; the broader symbol-database upload work continues in #5431. Verification: - bundle exec rspec spec/datadog/symbol_database/scope_spec.rb \ spec/datadog/symbol_database/extractor_spec.rb \ spec/datadog/symbol_database/service_version_spec.rb → 164 examples, 0 failures - bundle exec steep check lib/datadog/symbol_database/scope.rb \ lib/datadog/symbol_database/extractor.rb → No type error detected. - bundle exec rake standard → clean Co-Authored-By: Claude <[email protected]>
Typing analysisNote: Ignored files are excluded from the next sections.
|
The +to_json produces valid JSON for complete Ruby payload+ test constructs +Datadog::SymbolDatabase::Symbol.new(...)+ but the spec file was missing +require 'datadog/symbol_database/symbol'+. The test passes in multi-file runs because other specs transitively load Symbol, but fails in isolation with: NameError: uninitialized constant Datadog::SymbolDatabase::Symbol Add the missing require so the spec is self-contained. Verification: - bundle exec rspec spec/datadog/symbol_database/service_version_spec.rb → 15 examples, 0 failures (now passes in isolation) - bundle exec rspec spec/datadog/symbol_database/service_version_spec.rb:142 → 1 example, 0 failures (the previously-failing test in isolation) Co-Authored-By: Claude <[email protected]>
Address review feedback: the rename in 7189e8f left a stale section header and a test fixture class name referencing the old "Injectable" identifier in extractor_spec.rb. The file create_test_file('targetable_test.rb', ...) was renamed but the class declared inside (ExtractAllInjectableTest) was not, leaving a confusing partial-rename trail. Renamed: - Section header: "Injectable lines unit tests" → "Targetable lines unit tests" - Test fixture class: ExtractAllInjectableTest → ExtractAllTargetableTest (declaration + 6 reference sites in describe 'extract_targetable_lines') Verified: 124 examples, 0 failures.
BenchmarksBenchmark execution time: 2026-05-06 19:49:56 Comparing candidate commit 7189e8f in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 45 metrics, 1 unstable metrics.
|
🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: b463ba2 | Docs | Datadog PR Page | Give us feedback! |
Fix three issues identified in di-pr-review: 1. extractor_spec.rb:1809 — class fixture name mismatch. `class ExtractAllInjectableTest` was the pre-rename name; the test references `ExtractAllTargetableTest` post-rename (#5692). The mismatch was introduced by `git merge --squash -X theirs`, which favored the branch's pre-rename version on conflict while the surrounding references use master's renamed version. Tests were unrunnable as written. Renamed the fixture class to match. 2. integration_spec.rb:90, 115 — code comments still said "Injectable lines" while referencing `targetable_lines` / `targetable_lines?` methods. Updated comments. 3. component.rb:52, 56 — added YARD docs for the class methods `uploaded_this_process?` and `mark_uploaded` for consistency with the rest of the file's documentation style. Not addressed (intentional): - Sleep usage in component_spec.rb — used for negative-assertion tests ("verify nothing happens given X seconds"). Comments justify duration; the cleanest deterministic alternative would require adding a "scheduler decision made" hook to production code, which is scope expansion beyond this PR. - Missing telemetry in component.rb / remote.rb rescue blocks — matches the established SymDB direction (#5693 explicitly removed telemetry from Extractor). Adding telemetry here would contradict the recent project decision.
Squashed rebase of #5431 (symbol-database-upload, 185 commits) onto current master, capturing only the unique work that hasn't been split out and merged via individual sub-PRs (#5618, #5670, #5692, Adds the wiring layer that ties together the data models, extractor, batcher, uploader, and transport that were merged separately: - Component class for symbol_database lifecycle management - Remote module for remote config integration - Component-initialize / integration / remote_config_integration tests - Top-level wiring in core/configuration/components.rb and core/remote/client/capabilities.rb - Settings registration in supported-configurations.json - Documentation updates in DynamicInstrumentation.md and GettingStarted.md Branch #5431 is left intact for reference; this is a fresh single-commit PR for review.
Fix three issues identified in di-pr-review: 1. extractor_spec.rb:1809 — class fixture name mismatch. `class ExtractAllInjectableTest` was the pre-rename name; the test references `ExtractAllTargetableTest` post-rename (#5692). The mismatch was introduced by `git merge --squash -X theirs`, which favored the branch's pre-rename version on conflict while the surrounding references use master's renamed version. Tests were unrunnable as written. Renamed the fixture class to match. 2. integration_spec.rb:90, 115 — code comments still said "Injectable lines" while referencing `targetable_lines` / `targetable_lines?` methods. Updated comments. 3. component.rb:52, 56 — added YARD docs for the class methods `uploaded_this_process?` and `mark_uploaded` for consistency with the rest of the file's documentation style. Not addressed (intentional): - Sleep usage in component_spec.rb — used for negative-assertion tests ("verify nothing happens given X seconds"). Comments justify duration; the cleanest deterministic alternative would require adding a "scheduler decision made" hook to production code, which is scope expansion beyond this PR. - Missing telemetry in component.rb / remote.rb rescue blocks — matches the established SymDB direction (#5693 explicitly removed telemetry from Extractor). Adding telemetry here would contradict the recent project decision.
Squashed rebase of #5431 (symbol-database-upload, 185 commits) onto current master, capturing only the unique work that hasn't been split out and merged via individual sub-PRs (#5618, #5670, #5692, Adds the wiring layer that ties together the data models, extractor, batcher, uploader, and transport that were merged separately: - Component class for symbol_database lifecycle management - Remote module for remote config integration - Component-initialize / integration / remote_config_integration tests - Top-level wiring in core/configuration/components.rb and core/remote/client/capabilities.rb - Settings registration in supported-configurations.json - Documentation updates in DynamicInstrumentation.md and GettingStarted.md Branch #5431 is left intact for reference; this is a fresh single-commit PR for review.
Fix three issues identified in di-pr-review: 1. extractor_spec.rb:1809 — class fixture name mismatch. `class ExtractAllInjectableTest` was the pre-rename name; the test references `ExtractAllTargetableTest` post-rename (#5692). The mismatch was introduced by `git merge --squash -X theirs`, which favored the branch's pre-rename version on conflict while the surrounding references use master's renamed version. Tests were unrunnable as written. Renamed the fixture class to match. 2. integration_spec.rb:90, 115 — code comments still said "Injectable lines" while referencing `targetable_lines` / `targetable_lines?` methods. Updated comments. 3. component.rb:52, 56 — added YARD docs for the class methods `uploaded_this_process?` and `mark_uploaded` for consistency with the rest of the file's documentation style. Not addressed (intentional): - Sleep usage in component_spec.rb — used for negative-assertion tests ("verify nothing happens given X seconds"). Comments justify duration; the cleanest deterministic alternative would require adding a "scheduler decision made" hook to production code, which is scope expansion beyond this PR. - Missing telemetry in component.rb / remote.rb rescue blocks — matches the established SymDB direction (#5693 explicitly removed telemetry from Extractor). Adding telemetry here would contradict the recent project decision.
What does this PR do?
Renames the internal Ruby identifiers across SymbolDatabase from
injectible/injectabletotargetable. The change is internal-only — the wire format hash keys (:has_injectible_lines,:injectible_lines) are intentionally preserved inScope#to_hfor backend compatibility.Renamed:
Scope#injectible_lines(attr) →#targetable_linesScope#injectible_lines?→#targetable_lines?Scope.new(injectible_lines:)keyword arg →(targetable_lines:)Extractor::INJECTABLE_LINE_EVENTSconstant →TARGETABLE_LINE_EVENTSExtractor#extract_injectable_lines→#extract_targetable_linesExtractor#build_injectable_ranges→#build_targetable_ranges"injectable lines"/"injectible_lines"textPreserved (wire format / backend contract):
:has_injectible_lineshash key inScope#to_houtput:injectible_lineshash key inScope#to_houtputMotivation:
Extracted from #5431 (in-progress symbol database upload work). Keeping the rename atomic and reviewable in isolation lets the broader work in #5431 continue without bundling unrelated identifier renames into a large PR.
Change log entry
None.
How to test the change?
Verification on this branch:
bundle exec steep check lib/datadog/symbol_database/scope.rb lib/datadog/symbol_database/extractor.rb— No type error detectedbundle exec rake standard— clean