Skip to content

[Commands API interface consistency #2] Remove generators - #3866

Open
uglide wants to merge 3 commits into
im/api-consistency-testsfrom
im/remove-api-generators
Open

[Commands API interface consistency #2] Remove generators#3866
uglide wants to merge 3 commits into
im/api-consistency-testsfrom
im/remove-api-generators

Conversation

@uglide

@uglide uglide commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Removes the template-based API interface generators now that consistency between the command interface flavors is enforced by the test suite from #3865 (this PR is stacked on it — its base is im/api-consistency-tests; rebase onto main after #3865 merges).

The generators had drifted from the committed interfaces — re-running them produced large, noisy diffs that silently changed the public API — and were no longer part of any workflow. The interfaces are now hand-edited source files; the consistency tests fail the build when a flavor is missed.

Changes

  • delete src/test/java/io/lettuce/apigenerator/ (9 classes) and src/main/templates/ (23 templates)
  • drop the javaparser-core test dependency and the templates entry of the formatter plugin
  • remove the api_generator test tag
  • strip the @generated by io.lettuce.apigenerator.* Javadoc markers from all 139 interface files — they referenced deleted classes and instructed readers not to hand-edit files that are now the source of truth (mechanical commit: one Javadoc line per file)
  • replace .agents/docs/code-generation.md with .agents/docs/api-consistency.md and update architecture.md, AGENTS.md and the adding-a-redis-command/writing-javadoc skills to describe the hand-edit-all-flavors workflow

No production code changes beyond the Javadoc marker removal.

Make sure that:

  • You have read the contribution guidelines.
  • You have created a feature request first to discuss your contribution intent. Please reference the feature request ticket number in the pull request.
  • You applied code formatting rules using the mvn formatter:format target. Don't submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.

🤖 Generated with Claude Code


Note

Low Risk
No command signatures or runtime behavior change—only dead generator removal and Javadoc marker cleanup, with contributor workflow fully redirected to the consistency test suite.

Overview
Removes the drift-prone JavaParser API generators and src/main/templates/, so sync/async/reactive/Kotlin/cluster command interfaces are treated as normal hand-edited sources. Parity across flavors is documented and enforced by the existing API consistency unit tests (from the stacked PR), not by regeneration.

Build/tooling: drops the javaparser-core test dependency and stops formatting src/main/templates in the formatter plugin; integration-testing docs no longer mention apigenerator/.

Public surface (Javadoc only): strips @generated by io.lettuce.apigenerator.* from ~139 command interface files so Javadoc no longer points at deleted generators or discourages hand edits.

Contributor docs: deletes .agents/docs/code-generation.md, adds .agents/docs/api-consistency.md, and updates architecture.md, AGENTS.md, and the adding-a-redis-command / writing-javadoc skills to the sync-first → mirror all flavors → run consistency tests workflow.

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

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

Copy link
Copy Markdown

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: b37a5c7fdc

ℹ️ 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".

Comment thread .agents/docs/architecture.md
Comment thread .agents/docs/api-consistency.md Outdated
Comment thread .agents/docs/api-consistency.md Outdated
@uglide uglide changed the title Remove generators [Commands API interface consistency #2] Remove generators Jul 28, 2026
@uglide
uglide force-pushed the im/remove-api-generators branch from b37a5c7 to ab6760c Compare July 28, 2026 16:33

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

Copy link
Copy Markdown

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: ab6760c67c

ℹ️ 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".

Comment thread .agents/skills/adding-a-redis-command/SKILL.md Outdated
Comment thread .agents/skills/adding-a-redis-command/SKILL.md Outdated
Comment thread .agents/docs/api-consistency.md
@uglide
uglide force-pushed the im/remove-api-generators branch from ab6760c to c8f7d34 Compare July 28, 2026 16:38

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

Copy link
Copy Markdown

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: c8f7d34679

ℹ️ 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".

Comment thread .agents/docs/api-consistency.md
Comment thread .agents/skills/writing-javadoc/SKILL.md Outdated
@uglide
uglide force-pushed the im/remove-api-generators branch 2 times, most recently from a75d0c8 to f7c122d Compare July 28, 2026 16:57
uglide and others added 3 commits July 28, 2026 19:10
The command interfaces are now hand-edited source files kept in
lockstep by the API consistency test suite; the generators had
drifted from the committed files (re-running them produced noisy,
API-changing diffs) and were no longer part of any workflow.

- delete src/test/java/io/lettuce/apigenerator and src/main/templates
- drop the javaparser-core test dependency and the templates entry of
  the formatter plugin
- remove the api_generator test tag
- replace .agents/docs/code-generation.md with
  .agents/docs/api-consistency.md and update architecture.md,
  AGENTS.md and the adding-a-redis-command/writing-javadoc skills to
  describe the hand-edit-all-flavors workflow

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The markers referenced the removed io.lettuce.apigenerator classes
and instructed readers not to hand-edit files that are now the
source of truth.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- architecture.md: drop the leftover claim that the sync interface is
  generated; it is a declaration implemented by the async-backed proxy
- api-consistency.md: describe builder coverage against each group's
  registered builder (module groups have dedicated builders), document
  that Kotlin scalar return types/nullability are not verified, and
  mention the parameter-signature and @deprecated parity checks
- adding-a-redis-command: keep the return-type mapping in its owner
  document instead of restating it, and rename the stale
  "checkpoint before generation" reference to "before mirroring"
- writing-javadoc: extend the mirroring checklist to the node-selection
  and Sentinel interfaces

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@uglide
uglide force-pushed the im/remove-api-generators branch from f7c122d to fab040a Compare July 28, 2026 17:12

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

Copy link
Copy Markdown

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: fab040ad66

ℹ️ 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".

Comment on lines +60 to +62
- across the Java flavors (async, reactive, node-selection, aggregates) the
suite also verifies **generic parameter signatures** (not just erased types)
and **`@Deprecated` parity** with the sync method.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Check varargs parity across Java flavors

When a hand-edited method uses varargs, the advertised parameter-signature check still accepts an array declaration in another flavor: foo(K... keys) and foo(K[] keys) have the same erased and generic reflection parameter type, while TypeSignatures never compares Method.isVarArgs(). This leaves the suite green even though callers can pass multiple arguments only to one flavor, so include varargs parity in each Java counterpart check.

AGENTS.md reference: AGENTS.md:L89-L93

Useful? React with 👍 / 👎.


Every command group (STRING, HASH, …) exists in up to six parallel interfaces —
sync, async, reactive, Kotlin coroutines, and the two cluster node-selection
flavors. All of them are **ordinary hand-edited source files**; there is no code

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Remove the remaining generated-shapes claim

Although this new paragraph correctly states that there is no code generation, the earlier sentence at line 40 still calls the flavors “independently generated shapes.” The previously reported bottom-of-file statement has been corrected, but this additional occurrence remains, so an agent reading this owner document still receives contradictory instructions about whether these interfaces are generated or hand-edited.

AGENTS.md reference: AGENTS.md:L89-L93

Useful? React with 👍 / 👎.

Comment on lines +106 to +107
**Then add the method + Javadoc to the sync interface**
`src/main/java/io/lettuce/core/api/sync/<Group>Commands.java`. The sync signature is

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Route Sentinel commands to the Sentinel API files

When the command belongs to SENTINEL, this new instruction points to the nonexistent core/api/sync/RedisSentinelCommands.java; that interface actually lives under core/sentinel/api/sync, and the later implementation steps likewise need SentinelCommandBuilder, RedisSentinelAsyncCommandsImpl, RedisSentinelReactiveCommandsImpl, and the Sentinel coroutine implementation rather than the core classes. Add an explicit Sentinel branch to this workflow so following it does not edit or create the wrong files.

AGENTS.md reference: AGENTS.md:L34-L36

Useful? React with 👍 / 👎.

Comment on lines +42 to +43
methods return `Flow<E>` (not suspend); deprecated and streaming-channel
methods are omitted. The suite verifies presence and the suspend/`Flow` shape

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Document the deprecated coroutine exceptions

The categorical statement that deprecated methods are omitted is false for flushallAsync, flushdbAsync, slaveof, slaveofNoOne, and slaves: KnownApiDeviations.COROUTINES_KEEP_DEPRECATED explicitly requires those methods to remain in the coroutine API, and they are currently declared there. Mention that registry exception here so maintainers do not remove these supported coroutine methods while applying the owner document's mapping rule.

AGENTS.md reference: AGENTS.md:L24-L29

Useful? React with 👍 / 👎.

Comment on lines +43 to +45
methods are omitted. The suite verifies presence and the suspend/`Flow` shape
only — scalar return types and nullability are **not** checked; review them by
hand.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Check Kotlin parameter-name parity

For Kotlin coroutine methods, parameter names are part of the callable source API because callers can use named arguments, but commandFunctions matches only the method name and erased parameter classes and verifyShape never compares parameter names. A hand-edited strlen(redisKey: K) therefore passes against sync strlen(key) while breaking existing calls such as strlen(key = value); enforce the source-level names or add this limitation to the explicit manual-review caveat.

AGENTS.md reference: AGENTS.md:L89-L93

Useful? React with 👍 / 👎.

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