Skip to content

Promote coroutine API from experimental opt-in - #3803

Open
lsh1215 wants to merge 4 commits into
redis:mainfrom
lsh1215:2527-promote-coroutine-api
Open

lsh1215 wants to merge 4 commits into
redis:mainfrom
lsh1215:2527-promote-coroutine-api

Conversation

@lsh1215

@lsh1215 lsh1215 commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

Closes #2527

What changed

  • Promote Kotlin Coroutine APIs out of the experimental opt-in path by removing @ExperimentalLettuceCoroutinesApi from coroutine API declarations.
  • Keep ExperimentalLettuceCoroutinesApi for source compatibility, but mark it as deprecated so existing @OptIn(...) references can be removed by users.
  • Update the Kotlin coroutine API generator so regenerated coroutine interfaces do not reintroduce the marker import or annotation.
  • Remove the Lettuce coroutine marker opt-in from the Kotlin compiler configuration.
  • Update the Kotlin user guide so it no longer asks users to opt in to coroutine APIs.
  • Add regression tests covering the API surface, generator output, build configuration, docs, and retained/deprecated marker behavior.

Why

The issue states that the Coroutine API has matured enough to become a proper API. As long as public coroutine declarations and generated APIs carry @ExperimentalLettuceCoroutinesApi, users still need explicit opt-in. This removes that root cause while keeping the marker class available for compatibility.

Verification

JAVA_HOME=/Users/leesanghun/Library/Java/JavaVirtualMachines/ms-21.0.10/Contents/Home \
mvn -Dkotlin.compiler.incremental=false -DskipITs -DskipUnitTests=false \
  -Dtest=CoroutineApiGraduationUnitTests,CreateKotlinCoroutinesApiUnitTests test

Result:

Tests run: 6, Failures: 0, Errors: 0, Skipped: 0
BUILD SUCCESS

Also checked:

git diff --check upstream/main...HEAD

Note

Medium Risk
Wide public Kotlin API surface change with no runtime logic changes; risk is mainly consumer compile-time breakage if they relied on experimental warnings, mitigated by retaining the deprecated marker.

Overview
Graduates Lettuce’s Kotlin coroutine APIs so callers no longer need @OptIn(ExperimentalLettuceCoroutinesApi::class) or the -Xopt-in=io.lettuce.core.ExperimentalLettuceCoroutinesApi compiler flag.

@ExperimentalLettuceCoroutinesApi is removed from coroutine interfaces, implementations, extensions (coroutines(), multi DSL, ScanFlow), and cluster/sentinel APIs. The annotation class remains deprecated for source compatibility with existing @OptIn usage. The Kotlin Maven plugin no longer opts in to that marker; the user guide no longer describes coroutines as experimental.

The coroutine API generator stops importing and emitting @ExperimentalLettuceCoroutinesApi on generated interfaces. Regression tests guard Kotlin sources, pom.xml, docs, generator output, and deprecated marker behavior.

Reviewed by Cursor Bugbot for commit 4055418. Bugbot is set up for automated code reviews on this repo. Configure here.

@jit-ci

jit-ci Bot commented Jun 26, 2026

Copy link
Copy Markdown

Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset.

In case there are security findings, they will be communicated to you as a comment inside the PR.

Hope you’ll enjoy using Jit.

Questions? Comments? Want to learn more? Get in touch with us.

@lsh1215
lsh1215 marked this pull request as ready for review June 26, 2026 02:36
@a-TODO-rov

Copy link
Copy Markdown
Collaborator

Hey @lsh1215
Check my comment in the issue.
I will be putting this on hold.

@a-TODO-rov a-TODO-rov added the status: on-hold We cannot start working on this issue yet label Jun 26, 2026
@lsh1215

lsh1215 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the clarification, @a-TODO-rov.

That makes sense. I’ll keep this PR as a reference while the Reactive contract changes are in progress, and I’m happy to rebase/update it once those changes land for the next major version.

If you’d prefer to close this PR while the issue is on hold, that’s totally fine too. I can reopen or submit a fresh PR when the timing is right.

@a-TODO-rov

Copy link
Copy Markdown
Collaborator

Hey @lsh1215
I think time has come for this change.
Would you like to align it to the 8.0 version of Lettuce ?

lsh1215 commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for following up. I’ll update this PR for Lettuce 8.0 and run the relevant tests.

lsh1215 commented Nov 28, 2026

Copy link
Copy Markdown
Contributor Author

I’ve updated the PR for Lettuce 8.0, and all CI checks have passed. It’s ready for another look when you have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: on-hold We cannot start working on this issue yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Promote Coroutine extensions from experimental to proper API

2 participants