Skip to content

Fix Temporal resolver never reaching the concrete implementation#687

Open
thejesh23 wants to merge 1 commit into
tirth8205:mainfrom
thejesh23:fix/crg-002
Open

Fix Temporal resolver never reaching the concrete implementation#687
thejesh23 wants to merge 1 commit into
tirth8205:mainfrom
thejesh23:fix/crg-002

Conversation

@thejesh23

Copy link
Copy Markdown

Linked issue

Closes #685

What & why

resolve_temporal_calls() builds implementors keyed by the bare interface name (Java INHERITS.target_qualified is bare) but looked it up with interface_qual, the fully-qualified name. Because interface_qual is always the qualified form, implementors.get(interface_qual, []) always returned [], the len(impls) == 1 branch was dead, and every Temporal stub call resolved to the interface method instead of the unique concrete implementation. callers_of() and impact analysis through the real implementation returned nothing.

This looks up implementors with the bare interface name — matching how it is keyed, and how the sibling Spring resolver already works.

How it was tested

uv run pytest tests/test_multilang.py -q -k Temporal   # 14 passed
uv run pytest tests/ --tb=short -q   # 1961 passed (1 pre-existing Windows/py3.14 failure, unrelated)
uv run ruff check code_review_graph/
uv run mypy code_review_graph/temporal_resolver.py --ignore-missing-imports --no-strict-optional   # Success

New test (fails on main, passes here):

  • test_multilang.py::TestTemporalResolver::test_resolved_target_is_concrete_impl_not_interface — asserts a single-implementor stub call resolves to PaymentActivityImpl.charge, not the interface PaymentActivity.charge.

Checklist

  • Tests added for new functionality
  • All tests pass: uv run pytest tests/ --tb=short -q (one pre-existing, unrelated Windows/py3.14 failure)
  • Linting passes: uv run ruff check code_review_graph/
  • Type checking passes: uv run mypy code_review_graph/temporal_resolver.py --ignore-missing-imports --no-strict-optional
  • Lines are at most 100 characters
  • Docs updated where behavior changed (explanatory comment at the fix site)

resolve_temporal_calls() builds 'implementors' keyed by the bare interface
name (INHERITS.target_qualified is bare for Java) but looked it up with
'interface_qual', the fully-qualified name. Because interface_qual is always
the qualified form, the lookup always returned [], the 'len(impls) == 1'
branch was dead, and every Temporal stub call resolved to the interface
method instead of the unique concrete implementation. callers_of() and
impact analysis through the real impl therefore returned nothing.

Look up 'implementors' with the bare interface name (matching how it is
keyed, and how the sibling Spring resolver works).

Adds a test asserting a single-implementor stub call resolves to
PaymentActivityImpl.charge, not the interface PaymentActivity.charge.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Temporal resolver never reaches the concrete implementation (resolves to the interface)

1 participant