Skip to content

Add InternalAPIMarker annotation for internal API boundaries#230

Merged
twisti-dev merged 2 commits intoversion/1.21.11from
feat/internal-api-marker
Mar 5, 2026
Merged

Add InternalAPIMarker annotation for internal API boundaries#230
twisti-dev merged 2 commits intoversion/1.21.11from
feat/internal-api-marker

Conversation

@twisti-dev
Copy link
Contributor

This pull request introduces a new marker annotation for internal API boundaries and updates the project version. The main focus is on improving API visibility control for consumers by providing a standardized way to mark internal APIs.

API Visibility Improvements

  • Added the new InternalAPIMarker annotation class in surf-api-shared/surf-api-shared-public/src/main/kotlin/dev/slne/surf/surfapi/shared/api/annotation/InternalAPIMarker.kt, including documentation explaining its usage for marking internal API annotations.
  • Declared InternalAPIMarker as a public abstract interface annotation in the API definition file surf-api-shared/surf-api-shared-public/api/surf-api-shared-public.api.

Version Update

  • Updated the project version in gradle.properties from 1.21.11-2.59.4 to 1.21.11-2.60.0.

@twisti-dev twisti-dev self-assigned this Mar 5, 2026
Copilot AI review requested due to automatic review settings March 5, 2026 14:01
@twisti-dev twisti-dev merged commit 07afb0b into version/1.21.11 Mar 5, 2026
4 checks passed
@twisti-dev twisti-dev deleted the feat/internal-api-marker branch March 5, 2026 14:02
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

Introduces a new public marker annotation (InternalAPIMarker) intended to designate “internal API” opt-in annotations for improved visibility control in IDE tooling, and bumps the project version accordingly.

Changes:

  • Added InternalAPIMarker annotation with KDoc describing intended usage.
  • Updated the public API surface file (.api) to include the new annotation.
  • Bumped project version from 1.21.11-2.59.4 to 1.21.11-2.60.0.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
surf-api-shared/surf-api-shared-public/src/main/kotlin/dev/slne/surf/surfapi/shared/api/annotation/InternalAPIMarker.kt Adds the new marker annotation and its documentation.
surf-api-shared/surf-api-shared-public/api/surf-api-shared-public.api Declares the new annotation in the published API surface.
gradle.properties Updates the project version to reflect the API addition.

Comment on lines +15 to +17
* annotation class InternalSurfAPI
*
* @InternalSurfAPI
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

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

The KDoc example uses InternalSurfAPI, but the existing internal opt-in annotation in this repo is named InternalSurfApi. Using a different name in the example is confusing for consumers—either align the example with the actual InternalSurfApi name or make it a clearly generic placeholder name (e.g., InternalApi).

Suggested change
* annotation class InternalSurfAPI
*
* @InternalSurfAPI
* annotation class InternalSurfApi
*
* @InternalSurfApi

Copilot uses AI. Check for mistakes.
* fun internalFunction() { ... }
* ```
*/
@Target(AnnotationTarget.ANNOTATION_CLASS)
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

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

InternalAPIMarker currently uses the default annotation retention (RUNTIME). If this marker is only meant for IDE/static analysis, consider setting an explicit retention (typically AnnotationRetention.BINARY) to avoid carrying it into runtime reflection unnecessarily and to document the intended usage.

Suggested change
@Target(AnnotationTarget.ANNOTATION_CLASS)
@Target(AnnotationTarget.ANNOTATION_CLASS)
@Retention(AnnotationRetention.BINARY)

Copilot uses AI. Check for mistakes.
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.

2 participants