Skip to content

SymDB: Rename injectible/injectable Ruby identifiers to targetable#5692

Merged
p-datadog merged 3 commits into
masterfrom
symdb-rename-injectible-to-targetable
May 8, 2026
Merged

SymDB: Rename injectible/injectable Ruby identifiers to targetable#5692
p-datadog merged 3 commits into
masterfrom
symdb-rename-injectible-to-targetable

Conversation

@p-datadog

Copy link
Copy Markdown
Member

What does this PR do?

Renames the internal Ruby identifiers across SymbolDatabase from injectible / injectable to targetable. The change is internal-only — the wire format hash keys (:has_injectible_lines, :injectible_lines) are intentionally preserved in Scope#to_h for backend compatibility.

Renamed:

  • 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" text

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

Motivation:

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?

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

Verification on this branch:

  • 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

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]>
@p-datadog
p-datadog requested a review from a team as a code owner May 6, 2026 19:23
@p-datadog p-datadog 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 May 6, 2026
@dd-octo-sts

dd-octo-sts Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

Typing analysis

Note: Ignored files are excluded from the next sections.

steep:ignore comments

This PR introduces 1 steep:ignore comment, and clears 1 steep:ignore comment.

steep:ignore comments (+1-1)Introduced:
lib/datadog/symbol_database/scope.rb:89
Cleared:
lib/datadog/symbol_database/scope.rb:85

Untyped methods

This PR introduces 1 partially typed method, and clears 1 partially typed method.

Partially typed methods (+1-1)Introduced:
sig/datadog/symbol_database/scope.rbs:22
└── def initialize: (
        scope_type: String,
        ?name: String?,
        ?source_file: String?,
        ?start_line: Integer?,
        ?end_line: Integer?,
        ?targetable_lines: Array[Hash[::Symbol, Integer]]?,
        ?language_specifics: Hash[::Symbol, untyped]?,
        ?symbols: Array[Datadog::SymbolDatabase::Symbol]?,
        ?scopes: Array[Scope]?
      ) -> void
Cleared:
sig/datadog/symbol_database/scope.rbs:22
└── def initialize: (
        scope_type: String,
        ?name: String?,
        ?source_file: String?,
        ?start_line: Integer?,
        ?end_line: Integer?,
        ?injectible_lines: Array[Hash[::Symbol, Integer]]?,
        ?language_specifics: Hash[::Symbol, untyped]?,
        ?symbols: Array[Datadog::SymbolDatabase::Symbol]?,
        ?scopes: Array[Scope]?
      ) -> void

If you believe a method or an attribute is rightfully untyped or partially typed, you can add # untyped:accept on the line before the definition to remove it from the stats.

p-ddsign and others added 2 commits May 6, 2026 15:37
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.
@pr-commenter

pr-commenter Bot commented May 6, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-05-06 19:49:56

Comparing candidate commit 7189e8f in PR branch symdb-rename-injectible-to-targetable with baseline commit 65b7637 in branch master.

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

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

@datadog-prod-us1-6

datadog-prod-us1-6 Bot commented May 6, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 97.23% (-0.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: b463ba2 | Docs | Datadog PR Page | Give us feedback!

@ivoanjo ivoanjo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍 LGTM

@p-datadog
p-datadog merged commit 2280d85 into master May 8, 2026
415 of 416 checks passed
@p-datadog
p-datadog deleted the symdb-rename-injectible-to-targetable branch May 8, 2026 01:33
@dd-octo-sts dd-octo-sts Bot added this to the 2.33.0 milestone May 8, 2026
p-datadog pushed a commit that referenced this pull request May 8, 2026
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.
p-datadog pushed a commit that referenced this pull request May 11, 2026
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.
p-datadog pushed a commit that referenced this pull request May 11, 2026
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.
p-datadog pushed a commit that referenced this pull request May 11, 2026
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.
p-datadog pushed a commit that referenced this pull request May 11, 2026
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.
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.

4 participants