Skip to content

Extract IncrementalContext interface for processing and resolution - #3284

Open
RotBolt wants to merge 1 commit into
google:mainfrom
RotBolt:refactor/3028-incremental-context-interface
Open

RotBolt wants to merge 1 commit into
google:mainfrom
RotBolt:refactor/3028-incremental-context-interface

Conversation

@RotBolt

@RotBolt RotBolt commented Oct 29, 2026

Copy link
Copy Markdown

Summary

Implements the first step requested in #3028 (comment):

extracting the public API of IncrementalContextAA and IncrementalContextBase into an interface and replacing references to either of those with the interface

  • Introduce IncrementalContext for lifecycle, dirty-file calculation, output/cache updates, and lookup recording.
  • Have IncrementalContextBase implement the contract, with AA-specific operations supplied by IncrementalContextAA.
  • Change the resolver's context type and the processing lifecycle's local context type to the interface; the concrete AA class is referenced only at construction/inheritance sites.
  • Keep cache/tracker storage and protected logging helpers implementation details.
  • Preserve dumpLookupRecords on the contract for existing test/debug consumers rather than coupling them back to AA. Its replacement remains separate work under Tests depending on IncrementalContextAA.dumpLookupRecords #3019. recordLookupForGetAll is now an interface override instead of an internal concrete-class method.
  • Add interface-level lifecycle tests for incremental/non-incremental processing and exception propagation.

This is a behavior-preserving prerequisite refactor. It does not introduce the no-op context or change the incremental guards, resolver globals, or logging design. #3028 stays open for those follow-ups.

Validation

  • ./gradlew :kotlin-analysis-api:test --tests '*IncrementalContextTest' --tests '*testRecordJava*': 27 tests passed, including existing lookup-recording coverage in all four configurations.
  • ./gradlew :kotlin-analysis-api:test: 659 passed, 8 skipped, 0 failures/errors.
  • git diff --check

Refs #3028

Decouple resolution and processing from the concrete context before

introducing a no-op implementation. Preserve lookup tracing for google#3019.

Refs google#3028
@RotBolt

RotBolt commented Oct 29, 2026

Copy link
Copy Markdown
Author

@jaschdoc Could you please review this PR for the IncrementalContext interface extraction you requested in #3028? The full kotlin-analysis-api test task passes (659 passed, 8 skipped). The no-op implementation remains a follow-up after this first step is reviewed. Thank you!

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.

1 participant