Skip to content

NoOpImplementation improvements [1/3] Support for nested interfaces#3468

Merged
satween merged 2 commits into
developfrom
tvaleev/feature/add-noop-generation-support-for-nested
May 25, 2026
Merged

NoOpImplementation improvements [1/3] Support for nested interfaces#3468
satween merged 2 commits into
developfrom
tvaleev/feature/add-noop-generation-support-for-nested

Conversation

@satween
Copy link
Copy Markdown
Contributor

@satween satween commented May 22, 2026

What does this PR do?

Extends the NoOp code generator to handle interfaces declared as nested types
inside other classes or interfaces. The processor now uses toClassName() from
kotlinpoet-ksp for supertypes and introduces noOpName() to concatenate
enclosing class names (e.g. Outer.InnerNoOpOuterInner), avoiding
collisions. Also fixes return-type and property-initializer resolution for nested
interface types, and guards local interface declarations with isLocal() to
prevent IllegalArgumentException.

Motivation

The processor previously used ClassName(packageName, interfaceName) for the
supertype, which produced incorrect references for nested types and crashed on
local interface declarations. Annotated nested interfaces are a valid pattern in
the SDK's public API surface.

Additional Notes

Tests added for annotated nested interfaces, both-sides annotation, and nested
return types. Stacked with a follow-up PR that adds a visibility guard for
private/protected nested interfaces.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

### What does this PR do?

Extends the NoOp code generator to handle interfaces declared as nested types
inside other classes or interfaces. The processor now uses `toClassName()` from
kotlinpoet-ksp for supertypes and introduces `noOpName()` to concatenate
enclosing class names (e.g. `Outer.Inner` → `NoOpOuterInner`), avoiding
collisions. Also fixes return-type and property-initializer resolution for nested
interface types, and guards local interface declarations with `isLocal()` to
prevent `IllegalArgumentException`.

### Motivation

The processor previously used `ClassName(packageName, interfaceName)` for the
supertype, which produced incorrect references for nested types and crashed on
local interface declarations. Annotated nested interfaces are a valid pattern in
the SDK's public API surface.

### Additional Notes

Tests added for annotated nested interfaces, both-sides annotation, and nested
return types. Stacked with a follow-up PR that adds a visibility guard for
private/protected nested interfaces.

### Review checklist (to be filled by reviewers)

- [ ] Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
- [ ] Make sure you discussed the feature or bugfix with the maintaining team in an Issue
- [ ] Make sure each commit and the PR mention the Issue number (cf the [CONTRIBUTING](../CONTRIBUTING.md) doc)
Copy link
Copy Markdown
Contributor Author

satween commented May 22, 2026

@satween satween changed the title Add NoOp generation support for nested interfaces NoOpImplementation improvements [1/2]Add NoOp generation support for nested interfaces May 22, 2026
@satween satween changed the title NoOpImplementation improvements [1/2]Add NoOp generation support for nested interfaces NoOpImplementation improvements [1/2] Support for nested interfaces May 22, 2026
@datadog-datadog-prod-us1

This comment has been minimized.

Rename BothAnnotatedNested.kt → Outer2.kt and InnerAnnotated.kt → Outer.kt
to match the top-level class names they contain, as required by the
standard:filename / MatchingDeclarationName rule. Update test parameter
strings accordingly.
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.22%. Comparing base (7bba71a) to head (3358f54).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3468      +/-   ##
===========================================
+ Coverage    72.21%   72.22%   +0.01%     
===========================================
  Files          964      964              
  Lines        35554    35554              
  Branches      5922     5922              
===========================================
+ Hits         25673    25678       +5     
- Misses        8263     8267       +4     
+ Partials      1618     1609       -9     

see 35 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@satween satween marked this pull request as ready for review May 22, 2026 19:41
@satween satween requested review from a team as code owners May 22, 2026 19:41
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3358f540e9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@satween satween merged commit 69dcbcd into develop May 25, 2026
28 checks passed
@satween satween deleted the tvaleev/feature/add-noop-generation-support-for-nested branch May 25, 2026 12:52
@satween satween changed the title NoOpImplementation improvements [1/2] Support for nested interfaces NoOpImplementation improvements [1/3] Support for nested interfaces May 25, 2026
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.

4 participants