Skip to content

[ECO-5383][LiveObjects] Enable maven publish#1143

Merged
sacOO7 merged 2 commits intomainfrom
fix/local-maven-publish
Aug 8, 2025
Merged

[ECO-5383][LiveObjects] Enable maven publish#1143
sacOO7 merged 2 commits intomainfrom
fix/local-maven-publish

Conversation

@sacOO7
Copy link
Collaborator

@sacOO7 sacOO7 commented Aug 7, 2025

Related to #1094

Summary by CodeRabbit

  • Documentation

    • Added instructions for publishing the library to a local Maven repository and configuring projects to use it.
  • Chores

    • Updated build configuration to skip signing artifacts when publishing locally.
    • Enabled Maven Publish plugin for the live-objects module.

@coderabbitai
Copy link

coderabbitai bot commented Aug 7, 2025

Warning

Rate limit exceeded

@sacOO7 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 54 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 9c120a0 and c75fb05.

📒 Files selected for processing (1)
  • CONTRIBUTING.md (1 hunks)

Walkthrough

The changes introduce instructions for publishing to a local Maven repository in the documentation, update the build configuration to skip signing when publishing locally, and add the Maven Publish plugin to the live-objects module’s build script. No changes to public APIs or exported entities are present.

Changes

Cohort / File(s) Change Summary
Documentation: Local Maven Publishing
CONTRIBUTING.md
Added a section detailing how to publish the library to the local Maven repository and configure projects to use it.
Build Logic: Conditional Signing
build.gradle.kts
Modified Maven publishing configuration to skip signing artifacts when publishing to the local Maven repository.
Module Build: Maven Publish Plugin
live-objects/build.gradle.kts
Added the Maven Publish plugin to the live-objects module’s build script.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant Gradle
    participant Local Maven Repo

    Developer->>Gradle: Run ./gradlew publishToMavenLocal
    Gradle->>Gradle: Detects publishToMavenLocal task
    Gradle-->>Gradle: Skips signing step
    Gradle->>Local Maven Repo: Publishes artifact locally
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Assessment against linked issues

Objective Addressed Explanation
Setup web docs for LiveObject (ECO-5383)
Locally test Maven publishing and APIs (ECO-5383)

Poem

A rabbit hops with nimble feet,
To Maven Local, what a treat!
Docs are clear, the build is neat,
Signing skipped for local feat.
With every publish, joy anew—
The code and docs now hop for you!
🐇✨

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/local-maven-publish

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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
  • 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 src/utils.ts and explain its main purpose.
    • @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 comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

Documentation and Community

  • 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.

@github-actions github-actions bot temporarily deployed to staging/pull/1143/features August 7, 2025 12:10 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1143/javadoc August 7, 2025 12:13 Inactive
@sacOO7 sacOO7 force-pushed the fix/local-maven-publish branch from f96e5d1 to 3c4413e Compare August 7, 2025 12:37
@github-actions github-actions bot temporarily deployed to staging/pull/1143/features August 7, 2025 12:38 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1143/javadoc August 7, 2025 12:40 Inactive
@sacOO7 sacOO7 force-pushed the fix/local-maven-publish branch from 3c4413e to a2ef7b9 Compare August 7, 2025 12:42
@github-actions github-actions bot temporarily deployed to staging/pull/1143/features August 7, 2025 12:42 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1143/javadoc August 7, 2025 12:45 Inactive
@sacOO7 sacOO7 changed the title Enable local maven publish [ECO-5383][LiveObjects] Enable maven publish Aug 8, 2025
@sacOO7 sacOO7 marked this pull request as ready for review August 8, 2025 11:08
@sacOO7 sacOO7 requested a review from ttypic August 8, 2025 11:08
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: 0

🧹 Nitpick comments (4)
build.gradle.kts (1)

33-40: Harden local-publish detection and add a property-based opt-out for signing

Use endsWith("ToMavenLocal") to precisely match publish-to-local tasks and support a -PskipSigning override. This is also configuration-cache friendly via providers.

-            // Check if we're running a local publish task
-            val isLocalPublish = gradle.startParameter.taskNames.any {
-                it.contains("publishToMavenLocal") || it.contains("ToMavenLocal")
-            }
-
-            if (!isLocalPublish) {
-                signAllPublications()
-            }
+            // Skip signing when publishing to Maven Local or when explicitly requested via -PskipSigning=true
+            val skipSigning = gradle.startParameter.taskNames.any { task ->
+                task.endsWith("ToMavenLocal")
+            } || providers.gradleProperty("skipSigning")
+                .map { it.toBoolean() }
+                .orElse(false)
+                .get()
+
+            if (!skipSigning) {
+                signAllPublications()
+            }
CONTRIBUTING.md (3)

50-63: Clarify module-specific publish command and repository resolution order

  • Consider adding the module-scoped task to publish only LiveObjects.
  • Note that mavenLocal() should typically precede mavenCentral() so locally built artifacts take precedence.
 To publish the library to your local Maven repository, you can use the following command:
 
-```bash
-./gradlew publishToMavenLocal
-```
+    ./gradlew publishToMavenLocal
+
+Alternatively, to publish only the LiveObjects module:
+
+    ./gradlew :live-objects:publishToMavenLocal
@@
-To use the locally published library in your project, you can add the following dependency in your `build.gradle` file:
+To use the locally published library in your project, add the following repository in your `build.gradle` file (place `mavenLocal()` before `mavenCentral()` for resolution precedence):
 
-```groovy
-repositories {
-    mavenLocal()
-}
-```
+    repositories {
+        mavenLocal()
+        mavenCentral()
+    }

53-55: Fix markdownlint MD046: use indented code blocks (not fenced)

Switch the fenced block to an indented block to match the rest of this doc and satisfy the linter.

-```bash
-./gradlew publishToMavenLocal
-```
+    ./gradlew publishToMavenLocal

56-62: Fix MD046 and wording: it’s a “repository”, not a “dependency”

Align with project style (indented blocks) and correct wording.

-To use the locally published library in your project, you can add the following dependency in your `build.gradle` file:
+To use the locally published library in your project, add the following repository in your `build.gradle` file:
 
-```groovy
-repositories {
-    mavenLocal()
-}
-```
+    repositories {
+        mavenLocal()
+    }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c4f1f1c and a2ef7b9.

📒 Files selected for processing (3)
  • CONTRIBUTING.md (1 hunks)
  • build.gradle.kts (1 hunks)
  • live-objects/build.gradle.kts (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: sacOO7
PR: ably/ably-java#1092
File: live-objects/src/test/kotlin/io/ably/lib/objects/TestUtils.kt:48-61
Timestamp: 2025-06-03T09:15:18.827Z
Learning: User sacOO7 prefers simple test utilities without extensive error handling, believing tests should fail fast if incorrect field/method names are used rather than having defensive programming.
📚 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
📚 Learning: 2025-06-05T10:27:53.946Z
Learnt from: sacOO7
PR: ably/ably-java#1095
File: gradle/libs.versions.toml:24-26
Timestamp: 2025-06-05T10:27:53.946Z
Learning: The ably-java project prefers to use the latest available versions of testing dependencies (including pre-release versions) when they contain relevant bug fixes, rather than sticking strictly to stable releases.

Applied to files:

  • CONTRIBUTING.md
🪛 markdownlint-cli2 (0.17.2)
CONTRIBUTING.md

53-53: Code block style
Expected: indented; Actual: fenced

(MD046, code-block-style)


58-58: Code block style
Expected: indented; Actual: fenced

(MD046, code-block-style)

🔇 Additional comments (1)
live-objects/build.gradle.kts (1)

6-6: LGTM: Publishing plugin applied at module level

This enables publishToMavenLocal for live-objects as intended. Ensure group/version are set (likely via root) for consistent coordinates.

@github-actions github-actions bot temporarily deployed to staging/pull/1143/features August 8, 2025 11:21 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1143/javadoc August 8, 2025 11:23 Inactive
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 (2)
CONTRIBUTING.md (2)

62-62: Typo: it’s a repositories block, not a dependency

This sentence refers to adding a repository, not a dependency.

-- To use the locally published library in your project, you can add the following dependency in your `build.gradle` file:
+- To use the locally published library in your project, add the following to the `repositories` block in your build script:

69-71: Add troubleshooting tips for mavenLocal precedence and stale artifacts

Practical tips help avoid common pitfalls when switching resolution to mavenLocal.

 - Note - Place `mavenLocal()` before `mavenCentral()` for resolution precedence.
 
+Troubleshooting:
+- If your build still pulls from Maven Central, run with `--refresh-dependencies`.
+- If a stale local artifact is being used, delete it from `~/.m2/repository/io/ably/...` or bump the library version (for example, append `-SNAPSHOT`) before publishing.
+- If you changed other modules that `live-objects` depends on, publish them too (or run `./gradlew publishToMavenLocal` at the repo root).
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a2ef7b9 and d6b0632.

📒 Files selected for processing (1)
  • CONTRIBUTING.md (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: sacOO7
PR: ably/ably-java#1092
File: live-objects/src/test/kotlin/io/ably/lib/objects/TestUtils.kt:48-61
Timestamp: 2025-06-03T09:15:18.827Z
Learning: User sacOO7 prefers simple test utilities without extensive error handling, believing tests should fail fast if incorrect field/method names are used rather than having defensive programming.
📚 Learning: 2025-06-05T10:27:53.946Z
Learnt from: sacOO7
PR: ably/ably-java#1095
File: gradle/libs.versions.toml:24-26
Timestamp: 2025-06-05T10:27:53.946Z
Learning: The ably-java project prefers to use the latest available versions of testing dependencies (including pre-release versions) when they contain relevant bug fixes, rather than sticking strictly to stable releases.

Applied to files:

  • CONTRIBUTING.md
📚 Learning: 2025-06-06T09:28:12.298Z
Learnt from: sacOO7
PR: ably/ably-java#1095
File: live-objects/src/test/kotlin/io/ably/lib/objects/integration/setup/IntegrationTest.kt:87-89
Timestamp: 2025-06-06T09:28:12.298Z
Learning: The Sandbox.kt file in ably-java live-objects module already has comprehensive HTTP retry mechanism using HttpRequestRetry with 5 retries, exponential backoff, and automatic retry on non-success responses and timeout exceptions.

Applied to files:

  • CONTRIBUTING.md
🪛 markdownlint-cli2 (0.17.2)
CONTRIBUTING.md

53-53: Code block style
Expected: indented; Actual: fenced

(MD046, code-block-style)


58-58: Code block style
Expected: indented; Actual: fenced

(MD046, code-block-style)


64-64: Code block style
Expected: indented; Actual: fenced

(MD046, code-block-style)

⏰ 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: build
  • GitHub Check: check-rest-okhttp
  • GitHub Check: check-liveobjects
  • GitHub Check: check-realtime
  • GitHub Check: check-realtime-okhttp
  • GitHub Check: check-rest
  • GitHub Check: check (24)
  • GitHub Check: check (21)
  • GitHub Check: check (29)
  • GitHub Check: check (19)
  • GitHub Check: check
🔇 Additional comments (1)
CONTRIBUTING.md (1)

50-60: No extra flag needed—signing is auto-skipped for local publishes
The root build.gradle.kts already checks for publishToMavenLocal in gradle.startParameter.taskNames (isLocalPublish) and wraps the signing { … } block inside if (!isLocalPublish), so running ./gradlew publishToMavenLocal bypasses signing without any additional properties or flags.

  • File: build.gradle.kts, lines 33–38

No further changes required.

@sacOO7 sacOO7 force-pushed the fix/local-maven-publish branch from d6b0632 to 9c120a0 Compare August 8, 2025 11:29
@github-actions github-actions bot temporarily deployed to staging/pull/1143/features August 8, 2025 11:29 Inactive
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: 0

♻️ Duplicate comments (1)
CONTRIBUTING.md (1)

63-67: Fix markdownlint MD046: use indented code block (not fenced) for consistency

Replace the fenced block with an indented code block to match the doc’s prevailing style and keep lint green.

-```groovy
-repositories {
-    mavenLocal()
-}
-```
+    repositories {
+        mavenLocal()
+    }
🧹 Nitpick comments (2)
CONTRIBUTING.md (2)

61-61: Wording: “dependency” → “repository”

This line introduces a repositories block, not a dependency. Update for accuracy.

-- To use the locally published library in your project, you can add the following dependency in your `build.gradle` file:
+- To use the locally published library in your project, add the following repository in your `build.gradle` file:

50-59: Optional: Add a short note that signing is skipped for mavenLocal

This aligns the docs with the build change that conditionally skips signing for local publishing, avoiding confusion.

 To publish the library to your local Maven repository, you can use the following command:

     ./gradlew publishToMavenLocal

+Note: Publishing to mavenLocal skips signing (pre-configured in the build), so no signing setup is required for local testing.
 
 Alternatively, to publish only the specific (LiveObjects) module:
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d6b0632 and 9c120a0.

📒 Files selected for processing (1)
  • CONTRIBUTING.md (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: sacOO7
PR: ably/ably-java#1106
File: live-objects/src/main/kotlin/io/ably/lib/objects/serialization/Serialization.kt:25-29
Timestamp: 2025-06-23T14:18:25.315Z
Learning: In the ably-java codebase, the DefaultLiveObjectSerializer class methods like writeMsgpackArray will have their type signatures updated to be non-nullable since the calling sites ensure objects are never null when passed to these methods.
Learnt from: sacOO7
PR: ably/ably-java#1092
File: live-objects/src/test/kotlin/io/ably/lib/objects/TestUtils.kt:48-61
Timestamp: 2025-06-03T09:15:18.827Z
Learning: User sacOO7 prefers simple test utilities without extensive error handling, believing tests should fail fast if incorrect field/method names are used rather than having defensive programming.
📚 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:

  • CONTRIBUTING.md
📚 Learning: 2025-06-05T10:27:53.946Z
Learnt from: sacOO7
PR: ably/ably-java#1095
File: gradle/libs.versions.toml:24-26
Timestamp: 2025-06-05T10:27:53.946Z
Learning: The ably-java project prefers to use the latest available versions of testing dependencies (including pre-release versions) when they contain relevant bug fixes, rather than sticking strictly to stable releases.

Applied to files:

  • CONTRIBUTING.md
📚 Learning: 2025-06-06T09:28:12.298Z
Learnt from: sacOO7
PR: ably/ably-java#1095
File: live-objects/src/test/kotlin/io/ably/lib/objects/integration/setup/IntegrationTest.kt:87-89
Timestamp: 2025-06-06T09:28:12.298Z
Learning: The Sandbox.kt file in ably-java live-objects module already has comprehensive HTTP retry mechanism using HttpRequestRetry with 5 retries, exponential backoff, and automatic retry on non-success responses and timeout exceptions.

Applied to files:

  • CONTRIBUTING.md
🪛 markdownlint-cli2 (0.17.2)
CONTRIBUTING.md

63-63: Code block style
Expected: indented; Actual: fenced

(MD046, code-block-style)

⏰ 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 (24)
  • GitHub Check: check (29)
  • GitHub Check: check (19)
  • GitHub Check: check (21)
  • GitHub Check: check-rest-okhttp
  • GitHub Check: check-realtime
  • GitHub Check: check
  • GitHub Check: check-rest
  • GitHub Check: check-liveobjects
  • GitHub Check: check-realtime-okhttp
  • GitHub Check: build

Copy link
Contributor

@ttypic ttypic left a comment

Choose a reason for hiding this comment

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

LGTM

Base automatically changed from feature/liveobjects-realtime-write-api-refactored to main August 8, 2025 14:24
@sacOO7 sacOO7 merged commit 631a5dc into main Aug 8, 2025
13 checks passed
@sacOO7 sacOO7 deleted the fix/local-maven-publish branch August 8, 2025 14:24
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.

2 participants