Skip to content

Conversation

@aleksandar-apostolov
Copy link
Collaborator

Goal

Allow for more explicit API declaration from within core.

Implementation

Enable explicit-api=struct
Add new annotation
@StreamPublishedApi
remove @StreamCoreApi
Add a new lint check for @StreamPublishedApi

In a nutshell a public api in the core.api package has to be either @StreamPublishedApi (safe to expose) or @StreamInternalApi (unsafe to expose) and even if exposed by accident still requires opt in from integration side.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enables more explicit API declarations by implementing a structured approach to mark APIs as either safe to expose or internal-only. It introduces new annotation markers and a lint check to enforce proper API classification.

  • Remove @StreamCoreApi annotation and replace with @StreamPublishedApi and @StreamInternalApi
  • Enable explicit API mode in Kotlin compiler to require visibility modifiers
  • Add lint detector to enforce API annotation requirements

Reviewed Changes

Copilot reviewed 47 out of 48 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
build.gradle.kts Enable explicit API mode and update compiler opt-ins
StreamApiMarkers.kt Replace @StreamCoreApi with @StreamPublishedApi annotation
StreamApiExplicitMarkerDetector.kt New lint detector to enforce API annotation requirements
Multiple API files Replace @StreamCoreApi with @StreamInternalApi/@StreamPublishedApi and add public modifiers
lint.xml Update lint configuration for new API marker rule

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Collaborator

@gpunto gpunto left a comment

Choose a reason for hiding this comment

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

Looks good, just a few doubts

@aleksandar-apostolov aleksandar-apostolov merged commit 523e558 into develop Sep 1, 2025
4 checks passed
@aleksandar-apostolov aleksandar-apostolov deleted the explicit-api branch September 1, 2025 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:new-feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants