Skip to content

Move CodeGeneratorRequestWriter to ToolBase#944

Merged
alexander-yevsyukov merged 17 commits into
masterfrom
claude/cool-lamport-rnwzpu
Jun 11, 2026
Merged

Move CodeGeneratorRequestWriter to ToolBase#944
alexander-yevsyukov merged 17 commits into
masterfrom
claude/cool-lamport-rnwzpu

Conversation

@alexander-yevsyukov

@alexander-yevsyukov alexander-yevsyukov commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Closes #938.

io.spine.code.proto.CodeGeneratorRequestWriter is protoc-plugin tooling, not runtime API: its only consumers are the protoc-plugin entry points of the Compiler and ProtoTap. It moves to the tool-base module of ToolBase as io.spine.tools.code.proto.CodeGeneratorRequestWriter via SpineEventEngine/tool-base#181.

Changes

  • Remove CodeGeneratorRequestWriter and its spec from base.
  • Bump version → 2.0.0-SNAPSHOT.410 (next multiple of 10 — removing public API is a breaking change).
  • A minor wording fix in the FileName.nameWithExtension() doc.

Notes

History

This PR briefly also carried the MessageFile → CoreJvmCompiler move (#941, originally #944's own scope, with #943 merged in). That move has been reverted on this branch; io.spine.base.MessageFile, its test, and the FileName/FieldDeclaration internals are back to their master state. The adoption in CoreJvmCompiler (SpineEventEngine/core-jvm-compiler#92) is being reverted separately.

🤖 Generated with Claude Code

claude added 8 commits June 10, 2026 03:21
The class is protoc-plugin tooling, not runtime API: its only consumers
are the protoc-plugin entry points of the Compiler and ProtoTap. It
moves to the `tool-base` module of ToolBase as
`io.spine.tools.code.proto.CodeGeneratorRequestWriter`.

`CodeGeneratorRequestParsingSpec` and `CodeGeneratorRequestsJavaSpec`
stay because they test the `io.spine.type` parsing API, which remains
in `base`.

See #938
The enum encodes a code-generation file-naming convention
(`commands.proto`, `events.proto`, `rejections.proto`) and its only
consumer across the organisation is `CoreJvmCompilerSettings` in
CoreJvmCompiler, where it now lives as
`io.spine.tools.core.jvm.MessageFile`.

The usages internal to `base` are refactored to do without the enum:
 - `FileName` now checks the conventional suffixes directly.
 - `FieldDeclaration.isCommandsFile()` uses `FileName.isCommands()`.

The unit test moves to CoreJvmCompiler along with the enum, so
`MessageFileTest` and its test-only proto file are removed here.

See #941.

https://claude.ai/code/session_01RoCv4qxE8c32kPMLWVKw9M
No dependency changed in this branch; the project version strings in
the reports are brought in line with `2.0.0-SNAPSHOT.405`.

https://claude.ai/code/session_01RoCv4qxE8c32kPMLWVKw9M
@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.04%. Comparing base (5cf8aa6) to head (b6a777a).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #944      +/-   ##
==========================================
- Coverage   94.06%   94.04%   -0.03%     
==========================================
  Files         193      192       -1     
  Lines        4164     4149      -15     
  Branches      339      339              
==========================================
- Hits         3917     3902      -15     
  Misses        147      147              
  Partials      100      100              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alexander-yevsyukov alexander-yevsyukov self-assigned this Jun 10, 2026
@alexander-yevsyukov alexander-yevsyukov moved this to 🏗 In progress in v2.0 Jun 10, 2026
…laude/cool-lamport-rnwzpu

# Conflicts:
#	docs/dependencies/dependencies.md
#	docs/dependencies/pom.xml
#	version.gradle.kts
@alexander-yevsyukov alexander-yevsyukov changed the title Move MessageFile to CoreJvmCompiler Move MessageFile to CoreJvmCompiler and CodeGeneratorRequestWriter to ToolBase Jun 10, 2026
@alexander-yevsyukov alexander-yevsyukov marked this pull request as ready for review June 10, 2026 18:20
Copilot AI review requested due to automatic review settings June 10, 2026 18:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 removes compile-time/protoc-plugin tooling from the runtime base artifact by relocating MessageFile to CoreJvmCompiler and CodeGeneratorRequestWriter to ToolBase, and updates the snapshot version accordingly to reflect breaking public API removals.

Changes:

  • Remove io.spine.base.MessageFile from base and refactor internal suffix checks to use FileName directly.
  • Remove io.spine.code.proto.CodeGeneratorRequestWriter (and its spec) from base, as it’s protoc-plugin tooling now hosted in ToolBase.
  • Bump project version to 2.0.0-SNAPSHOT.410 and align dependency report version strings.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
version.gradle.kts Bumps published snapshot version to 2.0.0-SNAPSHOT.410 (breaking change).
docs/dependencies/pom.xml Aligns generated dependency POM version with the new snapshot version.
docs/dependencies/dependencies.md Updates dependency report headers to the new snapshot version.
base/src/main/java/io/spine/code/proto/FileName.java Removes dependency on MessageFile and inlines conventional *.proto suffix constants.
base/src/main/java/io/spine/code/proto/FieldDeclaration.java Replaces MessageFile usage with FileName.from(file).isCommands().
base/src/main/java/io/spine/base/MessageFile.java Removed from runtime base API surface.
base/src/test/java/io/spine/base/MessageFileTest.java Removed (test migrated to the new owning repo per PR description).
base/src/test/proto/spine/test/base/message_file_test_events.proto Removed (only used by the removed MessageFileTest).
base/src/main/kotlin/io/spine/code/proto/CodeGeneratorRequestWriter.kt Removed from base (moved to ToolBase per PR description).
base/src/test/kotlin/io/spine/code/proto/CodeGeneratorRequestWriterSpec.kt Removed along with the moved writer.
.agents/tasks/move-message-file-to-core-jvm-compiler.md Adds agent task tracking documentation for the work.
.agents/tasks/938-move-codegen-request-writer.md Adds agent task tracking documentation for the work.

@alexander-yevsyukov alexander-yevsyukov marked this pull request as draft June 10, 2026 19:39
alexander-yevsyukov and others added 2 commits June 10, 2026 20:41
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@alexander-yevsyukov alexander-yevsyukov changed the title Move MessageFile to CoreJvmCompiler and CodeGeneratorRequestWriter to ToolBase Move CodeGeneratorRequestWriter to ToolBase Jun 10, 2026
@alexander-yevsyukov alexander-yevsyukov marked this pull request as ready for review June 10, 2026 20:06
Copilot AI review requested due to automatic review settings June 10, 2026 20:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 24 out of 27 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • .idea/misc.xml: Language not supported

@alexander-yevsyukov alexander-yevsyukov merged commit 30e55d0 into master Jun 11, 2026
9 checks passed
@alexander-yevsyukov alexander-yevsyukov deleted the claude/cool-lamport-rnwzpu branch June 11, 2026 08:57
@github-project-automation github-project-automation Bot moved this from 🏗 In progress to ✅ Done in v2.0 Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Move work with CodeGeneratorRequest to ToolBase

4 participants