Skip to content

Improve ComparatorRegistry API (reified helpers as members)#952

Merged
alexander-yevsyukov merged 12 commits into
masterfrom
improve-comparator-registry-api
Jul 14, 2026
Merged

Improve ComparatorRegistry API (reified helpers as members)#952
alexander-yevsyukov merged 12 commits into
masterfrom
improve-comparator-registry-api

Conversation

@alexander-yevsyukov

@alexander-yevsyukov alexander-yevsyukov commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Improves the ComparatorRegistry API and folds in the routine build/dependency
maintenance that accumulated on the branch. As requested, all commits on the
branch are included
in this PR.

What changed

API / code

  • ComparatorRegistry — the four reified inline helpers (register,
    get, find, contains) move from top-level extension functions into
    members of the ComparatorRegistry object, alongside their Class-based
    counterparts. Call syntax is unchanged (e.g. ComparatorRegistry.get<Foo>()).
    Because these helpers are inline, removing the old top-level forms is
    effectively binary-safe for already-compiled callers.
  • Indentrepeat and atLevel likewise move from extension functions
    to members. This also fixes a latent bug in the old repeat: it guarded
    require(size >= 0) (always true, since size > 0 is enforced at
    construction) and interpolated $size instead of the argument; the member
    now validates and reports the argument n.

Dependencies / build

  • Bump Jackson2.22.1.
  • Bump ErrorProne2.42.0 — pinned as the last release compatible with
    Java 17 (2.43.0 requires JDK 21).
  • Update the config submodule and sync the distributed buildSrc
    (Kover/coverage configuration, dependency local objects).
  • Regenerate the dependency reports under docs/dependencies/.

Versioning

  • Bump the project version 2.0.0-SNAPSHOT.4232.0.0-SNAPSHOT.424.

Commits

Meaningful:

  • Bump version -> 2.0.0-SNAPSHOT.424
  • Transform extension functions in to members (Indent)
  • Bump Jackson -> 2.22.1
  • Constrain reified register to Any; fix get KDoc grammar (review follow-up)
  • Bump ErrorProne -> 2.42.0

Routine sync: Update config ×2, Update dependency report(s) ×4.

Validation

The local pre-PR checklist ran green on the ComparatorRegistry / Indent
changes: ./gradlew build dokkaGenerate on JDK 17 — PASS (incl. the Kover
coverage gate and Dokka link resolution); reviewers spine-code-review
APPROVE, kotlin-engineer / review-docs APPROVE WITH CHANGES, no
Must-fix. The later dependency bumps (Jackson, ErrorProne) and review
follow-ups are covered by CI on the branch head.

Notes for reviewers

  • Review follow-ups applied (ae91fe61a7): ComparatorRegistry.register
    is now <reified T : Any> (matching its siblings), and the relocated get()
    KDoc grammar ("no a comparator" → "no comparator") is corrected.
  • Indent binary compatibility (decided): dropping the non-inline
    IndentKt.repeat/atLevel facade is a binary break for pre-compiled callers.
    Accepted as intentional for the 2.0.0 major line — SNAPSHOTs don't promise
    cross-version binary compatibility.
  • Open nit: Indent.atLevel(l: Int) uses a single-letter parameter;
    level would read better.

Copilot AI review requested due to automatic review settings July 14, 2026 17:05
@alexander-yevsyukov alexander-yevsyukov moved this to 🏗 In progress in v2.0 Jul 14, 2026
@alexander-yevsyukov alexander-yevsyukov self-assigned this Jul 14, 2026
@alexander-yevsyukov alexander-yevsyukov moved this from 🏗 In progress to In Review in v2.0 Jul 14, 2026

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 refines the public API of ComparatorRegistry (and Indent) by relocating reified helper functions into their owning types, while also rolling in routine version/dependency/report updates and some build/coverage tooling maintenance.

Changes:

  • Move reified ComparatorRegistry helpers (register/get/find/contains) from top-level extensions into ComparatorRegistry members.
  • Move Indent.repeat / Indent.atLevel from extensions into Indent members (and correct the argument validation/message).
  • Bump published snapshot version and refresh dependency versions/reports (including Jackson 2.22.1).

Reviewed changes

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

Show a summary per file
File Description
version.gradle.kts Bumps versionToPublish snapshot.
docs/dependencies/pom.xml Updates generated dependency POM versions (incl. Jackson, Spine artifacts).
docs/dependencies/dependencies.md Regenerates dependency/license report with updated versions/timestamp.
buildSrc/src/main/kotlin/io/spine/gradle/testing/TestKitCoverage.kt Refactors agent coordinate usage for TestKit coverage wiring.
buildSrc/src/main/kotlin/io/spine/gradle/testing/SpineCompilerCoverage.kt Adds new helper to capture JaCoCo exec data from forked Spine Compiler JVMs.
buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/SiblingCoverage.kt Adjusts visibility/API to share the “consumes binary reports” predicate.
buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/KoverConfig.kt Extends root Kover aggregation to include additional exec data sources and updates Gradle dependency notation.
buildSrc/src/main/kotlin/io/spine/dependency/test/Jacoco.kt Centralizes JaCoCo agent coordinates as Jacoco.agent.
buildSrc/src/main/kotlin/io/spine/dependency/local/Validation.kt Updates local dependency version constant.
buildSrc/src/main/kotlin/io/spine/dependency/local/ToolBase.kt Updates local dependency version constants.
buildSrc/src/main/kotlin/io/spine/dependency/local/Time.kt Updates local dependency version constant.
buildSrc/src/main/kotlin/io/spine/dependency/local/Logging.kt Updates local dependency version constant.
buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJvm.kt Updates local dependency version constant.
buildSrc/src/main/kotlin/io/spine/dependency/local/Compiler.kt Updates fallback compiler versions.
buildSrc/src/main/kotlin/io/spine/dependency/local/Base.kt Updates local dependency versions used for build/script alignment.
buildSrc/src/main/kotlin/io/spine/dependency/lib/Jackson.kt Bumps Jackson version to 2.22.1.
base/src/main/kotlin/io/spine/string/Indent.kt Moves repeat/atLevel into Indent and fixes validation bug.
base/src/main/kotlin/io/spine/compare/ComparatorRegistry.kt Moves reified helper functions into ComparatorRegistry as members.
.idea/misc.xml Removes committed IDEA project-local settings file.
.gitignore Stops re-including .idea/misc.xml and adds ignores for Claude Code local files/dirs.
.claude/settings.json Updates Claude Code settings (plans directory and allowed actions).
Files not reviewed (1)
  • .idea/misc.xml: Generated file

Comment thread base/src/main/kotlin/io/spine/compare/ComparatorRegistry.kt Outdated
Comment thread base/src/main/kotlin/io/spine/compare/ComparatorRegistry.kt Outdated
Copilot AI review requested due to automatic review settings July 14, 2026 17:08

@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: 19f296753b

ℹ️ 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/Indent.kt

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 18 out of 22 changed files in this pull request and generated 3 comments.

Files not reviewed (1)
  • .idea/misc.xml: Generated file

Comment thread base/src/main/kotlin/io/spine/compare/ComparatorRegistry.kt Outdated
Comment thread base/src/main/kotlin/io/spine/compare/ComparatorRegistry.kt Outdated
Comment thread base/src/main/kotlin/io/spine/string/Indent.kt Outdated
Address Copilot review on PR #952: constrain `register<reified T>` to `<reified T : Any>` to match `get`/`find`/`contains` (a class literal requires a non-null type), and fix "no a comparator" -> "no comparator" in both `get` overloads.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 14, 2026 17:13

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 18 out of 22 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • .idea/misc.xml: Generated file

Copilot AI review requested due to automatic review settings July 14, 2026 17:19

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 19 out of 23 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • .idea/misc.xml: Generated file

Copilot AI review requested due to automatic review settings July 14, 2026 17:25

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 19 out of 23 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • .idea/misc.xml: Generated file

@alexander-yevsyukov alexander-yevsyukov merged commit 3c8533f into master Jul 14, 2026
11 checks passed
@alexander-yevsyukov alexander-yevsyukov deleted the improve-comparator-registry-api branch July 14, 2026 17:33
@github-project-automation github-project-automation Bot moved this from In Review to ✅ Done in v2.0 Jul 14, 2026
@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 42.85714% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.02%. Comparing base (c324bc7) to head (62e6bc2).
⚠️ Report is 13 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #952   +/-   ##
=======================================
  Coverage   94.02%   94.02%           
=======================================
  Files         192      192           
  Lines        4187     4187           
  Branches      346      345    -1     
=======================================
  Hits         3937     3937           
  Misses        149      149           
  Partials      101      101           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants