Skip to content

Add TemplateString and Placeholder#927

Merged
alexander-yevsyukov merged 15 commits into
masterfrom
template-string
May 15, 2026
Merged

Add TemplateString and Placeholder#927
alexander-yevsyukov merged 15 commits into
masterfrom
template-string

Conversation

@alexander-yevsyukov
Copy link
Copy Markdown
Contributor

This PR adds Protobuf-based TemplateString type and relevant Placeholder interface to io.spine.string package of Spine Base. Previously, these types were adopted in Validation, and we want these types be available to other purposes related to working with formatted messages. Releated general extensions to TemplateString were added too.

Other notable changes

  • config was updated.

alexander-yevsyukov and others added 4 commits May 13, 2026 19:34
Introduces `spine.string.TemplateString` Protobuf message together with the
`Placeholder` interface and `TemplateString` Kotlin extensions in
`io.spine.string` package. These are general-purpose string manipulation
utilities adapted from the Validation library.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copy link
Copy Markdown
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 introduces a Protobuf-based TemplateString message and a companion Placeholder Kotlin interface in io.spine.string, plus extension functions (format, formatUnsafe, checkPlaceholdersHasValue, extractPlaceholders) and tests. Alongside it, the PR pulls in a sizable config refresh covering Gradle 9.5.1 wrapper, dependency version bumps (Compiler, ToolBase, Time, TestLib, Logging, CoreJvm, Validation, Base, Dokka 2.2.0, Kotest 6.1.11, Shadow 9.4.1), publishing/POM/license-report relocation under docs/dependencies/, refactored ShadowJar and SpinePublishing setup, regenerated pom.xml, and many .agents skill additions/updates.

Changes:

  • Add TemplateString proto + Placeholder interface and Kotlin extensions with tests.
  • Bump project version to 2.0.0-SNAPSHOT.388 and refresh config (dependencies, Gradle wrapper, publishing/report tooling, agent skills).
  • Move generated dependency reports under docs/dependencies/ and adjust LicenseReporter/PomGenerator accordingly.

Reviewed changes

Copilot reviewed 64 out of 68 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
version.gradle.kts Bump to SNAPSHOT.388.
gradlew, gradlew.bat, gradle/wrapper/gradle-wrapper.properties Update wrapper to 9.5.1 with regenerated scripts.
docs/dependencies/pom.xml New generated POM under the relocated reports directory.
buildSrc/src/test/kotlin/io/spine/gradle/report/license/DependencyReportOutputTest.kt New tests for the relocated report outputs.
buildSrc/src/test/kotlin/io/spine/gradle/publish/SpinePublishingTest.kt Use the new extensionName constant.
buildSrc/src/test/kotlin/io/spine/gradle/docs/UpdatePluginVersionTest.kt Add @DisplayName, drop unused import.
buildSrc/src/main/kotlin/kmp-module.gradle.kts, jvm-module.gradle.kts Force Jackson/Kotlin BOM in resolution strategy; drop Kotest datatest.
buildSrc/src/main/kotlin/io/spine/gradle/report/pom/PomGenerator.kt Write pom.xml to docs/dependencies.
buildSrc/src/main/kotlin/io/spine/gradle/report/license/Paths.kt, LicenseReporter.kt New outputFile helper writing reports under docs/dependencies.
buildSrc/src/main/kotlin/io/spine/gradle/publish/SpinePublishing.kt Expose extensionName; tweak artifactId builder.
buildSrc/src/main/kotlin/io/spine/gradle/publish/PublicationHandler.kt New artifactId derivation handling KMP suffixes; license distribution set to repo.
buildSrc/src/main/kotlin/io/spine/gradle/publish/ShadowJarExts.kt Replace service-file enumeration with setup() + dedup logic.
buildSrc/src/main/kotlin/io/spine/gradle/ProjectExtensions.kt Doc tweak.
buildSrc/src/main/kotlin/io/spine/gradle/github/pages/UpdateGitHubPages.kt Remove TODO and dead commented block.
buildSrc/src/main/kotlin/io/spine/gradle/docs/UpdatePluginVersion.kt Escape plugin id in regex.
buildSrc/src/main/kotlin/io/spine/dependency/test/Kotest.kt Bump to 6.1.11; restructure deprecations; add common.
buildSrc/src/main/kotlin/io/spine/dependency/local/*.kt Bump local Spine dependency versions and align artifact names.
buildSrc/src/main/kotlin/io/spine/dependency/lib/JetBrainsAnnotations.kt Replace prior LicenseReport declaration with new JetBrainsAnnotations object.
buildSrc/src/main/kotlin/io/spine/dependency/build/Dokka.kt Bump to 2.2.0; use Spine.toolsGroup.
buildSrc/build.gradle.kts Drop license-report plugin from buildSrc; bump Dokka, Shadow, license-report; add JUnit/Kotest test versions.
base/src/test/kotlin/io/spine/string/TemplateStringExtsSpec.kt New tests for TemplateString extensions.
base/src/main/proto/spine/string/template_string.proto New TemplateString Protobuf type.
base/src/main/kotlin/io/spine/string/TemplateStringExts.kt New Kotlin extensions (format, formatUnsafe, checkPlaceholdersHasValue, extractPlaceholders).
base/src/main/kotlin/io/spine/string/Placeholder.kt New Placeholder interface.
.junie/, .idea/, .gitignore, .github/workflows/*, .agents/** Misc agent and CI/workflow renames; add new .agents skills (bump-version, bump-gradle, move-files, update-copyright, java-to-kotlin).
Files not reviewed (1)
  • .idea/inspectionProfiles/Project_Default.xml: Language not supported
Comments suppressed due to low confidence (1)

buildSrc/src/main/kotlin/io/spine/dependency/lib/JetBrainsAnnotations.kt:42

  • Reusing a single file (JetBrainsAnnotations.kt) to wholesale replace the previous LicenseReport declaration is confusing in history: the old object lived in package io.spine.dependency.build and the new one lives in io.spine.dependency.lib. While the old LicenseReport is no longer referenced, mixing a delete-and-rename with a package change in the same file makes the diff harder to review and breaks git-blame/log tracking. Consider deleting LicenseReport.kt and adding JetBrainsAnnotations.kt as a separate new file under io/spine/dependency/lib/.

Comment thread docs/dependencies/pom.xml
Comment thread buildSrc/build.gradle.kts Outdated
Comment thread buildSrc/src/main/kotlin/io/spine/dependency/test/Kotest.kt
Comment thread base/src/main/kotlin/io/spine/string/Placeholder.kt Outdated
Comment thread base/src/main/kotlin/io/spine/string/TemplateStringExts.kt
Copy link
Copy Markdown

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

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

ℹ️ 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 base/src/main/kotlin/io/spine/string/TemplateStringExts.kt Outdated
Copy link
Copy Markdown
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

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

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

Comment thread docs/dependencies/pom.xml
@alexander-yevsyukov alexander-yevsyukov merged commit 13f7d8f into master May 15, 2026
8 checks passed
@alexander-yevsyukov alexander-yevsyukov deleted the template-string branch May 15, 2026 20:53
Copy link
Copy Markdown
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

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

Files not reviewed (1)
  • .idea/inspectionProfiles/Project_Default.xml: Language not supported
Comments suppressed due to low confidence (1)

buildSrc/src/main/kotlin/io/spine/dependency/lib/JetBrainsAnnotations.kt:42

  • The file declares package io.spine.dependency.lib, but it lives under io/spine/dependency/lib/JetBrainsAnnotations.kt only if it was moved. The diff header shows JetBrainsAnnotations.kt, but the previous content in the diff was for LicenseReport in io.spine.dependency.build — please verify the file path matches the new package and that the previous LicenseReport definitions have been preserved (or intentionally removed) elsewhere, since the diff is effectively replacing one type with another in the same physical file.

//
// Example usage:
// template_string = "My dog's name is ${dog.name}."
// placeholder_values = { "dog.name": "Fido" }
Comment thread docs/dependencies/pom.xml
Comment on lines +35 to +132
<version>null</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
<version>null</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-guava</artifactId>
<version>null</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jdk8</artifactId>
<version>null</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>null</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>33.5.0-jre</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>4.34.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java-util</artifactId>
<version>4.34.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-kotlin</artifactId>
<version>4.34.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.spine</groupId>
<artifactId>spine-logging</artifactId>
<version>2.0.0-SNAPSHOT.417</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.spine</groupId>
<artifactId>spine-reflect</artifactId>
<version>2.0.0-SNAPSHOT.200</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-bom</artifactId>
<version>2.3.20</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
<version>2.3.20</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>2.3.20</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlinx</groupId>
<artifactId>kotlinx-coroutines-bom</artifactId>
<version>1.10.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jspecify</groupId>
<artifactId>jspecify</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-kotlin</artifactId>
<version>null</version>
<scope>runtime</scope>

/**
* The Compiler belongs to the `tools` group.
* The Compiler belongs the `tools` group.
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.

3 participants