Skip to content

Conversation

@ttypic
Copy link
Contributor

@ttypic ttypic commented Aug 14, 2025

live-objects can be used both with ably-java and ably-android, making dependency compileOnly we prevent adding specific module (ably-java or ably-android) to the classpath

Summary by CodeRabbit

  • Chores
    • Adjusted an internal module to be compile-time only, reducing runtime dependencies and improving isolation.
    • Enabled that module on the test classpath so tests continue to run unchanged.
    • No changes to functionality, public APIs, or user experience.

@coderabbitai
Copy link

coderabbitai bot commented Aug 14, 2025

Walkthrough

Changed Gradle dependency scope in live-objects/build.gradle.kts: replaced implementation(project(":java")) with compileOnly(project(":java")) and added testImplementation(project(":java")). No code or API signatures were modified.

Changes

Cohort / File(s) Summary
Gradle dependency scope
live-objects/build.gradle.kts
Replaced implementation(project(":java")) with compileOnly(project(":java")) and added testImplementation(project(":java")), removing :java from the main runtime classpath while keeping it for compilation and tests.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

I nibbled on deps with delicate care,
Moved runtime crumbs out of the lair.
Compile-time carrots still in sight,
Tests get treats by moonlight.
Thump-thump! The build hops light and fair. 🥕🐇

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/fix-dependency-resolution

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@ttypic ttypic requested a review from sacOO7 August 14, 2025 12:32
@github-actions github-actions bot temporarily deployed to staging/pull/1149/features August 14, 2025 12:32 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1149/javadoc August 14, 2025 12:34 Inactive
…ive-objects` module

live-objects can be used both with ably-java and ably-android, making dependency `compileOnly` we prevent adding specific module (ably-java or ably-android) to the classpath
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
live-objects/build.gradle.kts (1)

18-21: Adding testImplementation(:java) is correct to keep tests green

This keeps the test compile/runtime classpaths intact while keeping the main artifact agnostic. Good call.

Optionally, consider adding a CI job that exercises the test suite against the Android artifact too (e.g., via dependency substitution) to ensure ongoing compatibility with both distributions.

I can propose a Gradle substitution snippet or a matrix plan for CI that runs tests once with :java and once with the published ably-android artifact. Want me to draft it?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these settings in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between af5d7a3 and 1781304.

📒 Files selected for processing (1)
  • live-objects/build.gradle.kts (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: sacOO7
PR: ably/ably-java#1137
File: live-objects/src/test/kotlin/io/ably/lib/objects/unit/type/livemap/LiveMapManagerTest.kt:6-6
Timestamp: 2025-08-07T07:17:33.340Z
Learning: In the ably-java LiveObjects test code, there are extension properties defined in TestHelpers.kt that provide access to private fields of classes for testing purposes. For example, `internal var DefaultLiveMap.LiveMapManager: LiveMapManager` allows tests to access the private `liveMapManager` field. These extension imports (like `import io.ably.lib.objects.unit.LiveMapManager`) should not be removed as they are necessary for test functionality and are not conflicting imports.
Learnt from: sacOO7
PR: ably/ably-java#1148
File: lib/src/main/java/io/ably/lib/objects/ObjectsHelper.java:0-0
Timestamp: 2025-08-14T10:43:48.143Z
Learning: In the ably-java codebase, some "LiveObjectsPlugin" references in log messages, Javadoc, build files, and workflows are intentionally retained due to ongoing internal technical debate about isolating API naming from product naming, as discussed in LODR-033. These are not considered incomplete refactoring work but deliberate exceptions to the broader effort to eliminate "liveobject" keyword usage.
📚 Learning: 2025-08-07T07:17:33.340Z
Learnt from: sacOO7
PR: ably/ably-java#1137
File: live-objects/src/test/kotlin/io/ably/lib/objects/unit/type/livemap/LiveMapManagerTest.kt:6-6
Timestamp: 2025-08-07T07:17:33.340Z
Learning: In the ably-java LiveObjects test code, there are extension properties defined in TestHelpers.kt that provide access to private fields of classes for testing purposes. For example, `internal var DefaultLiveMap.LiveMapManager: LiveMapManager` allows tests to access the private `liveMapManager` field. These extension imports (like `import io.ably.lib.objects.unit.LiveMapManager`) should not be removed as they are necessary for test functionality and are not conflicting imports.

Applied to files:

  • live-objects/build.gradle.kts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: check-realtime
  • GitHub Check: check-liveobjects
  • GitHub Check: check-realtime-okhttp
  • GitHub Check: check-rest
  • GitHub Check: check-rest-okhttp
  • GitHub Check: check (29)
  • GitHub Check: check (21)
  • GitHub Check: check (24)
  • GitHub Check: check (19)
  • GitHub Check: check
  • GitHub Check: build

Copy link
Collaborator

@sacOO7 sacOO7 left a comment

Choose a reason for hiding this comment

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

Makes sense to add ably-java and ably-android as a compile-time dep.

@sacOO7
Copy link
Collaborator

sacOO7 commented Aug 14, 2025

Btw, how do we make sure ably-java/ably-android version in sync with liveobjects module

@ttypic ttypic merged commit 2c36548 into main Aug 15, 2025
13 checks passed
@ttypic ttypic deleted the chore/fix-dependency-resolution branch August 15, 2025 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants