Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: README trim and getting started guide #104

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

AndyTWF
Copy link
Collaborator

@AndyTWF AndyTWF commented Feb 20, 2025

This change includes:

  • Trimming the README to only include basic setup sections. This is because our website documentation is the source of truth for using Chat, so we're removing the extra information here to avoid duplication.
  • A getting started guide in the README, which provides some basic code to get users to sending their first message using Ably Chat. This will be replicated on the Website, in due course.

CHA-842
CHA-818

Summary by CodeRabbit

  • Documentation
    • Revised the user guide for clearer onboarding, including a more streamlined "Getting Started" section.
    • Simplified examples for initializing the chat client and sending messages.
    • Added a reference to the Ably Docs repository in the contributing guidelines.
  • New Features
    • Added an example demonstrating asynchronous messaging with Kotlin coroutines, including event logging for connection and message activities.
    • Introduced a new function: suspend fun getStartedWithChat().

We now treat our website documentation as the source-of-truth for docs, excluding inline documentation and comments.
This change trims the README to remove detailed implementation information.
Copy link

coderabbitai bot commented Feb 20, 2025

Walkthrough

The changes modify the README.md file to improve clarity and usability for new users. The section previously titled "Connections" has been renamed to "Getting Started," which now provides a streamlined introduction to initializing the Ably Chat client and sending a message. The updated example demonstrates the initialization of the Chat client, creation of a chat room, and sending of a message using Kotlin coroutines, along with print statements for logging. Additionally, a new exported function suspend fun getStartedWithChat() has been added.

Changes

File(s) Change Summary
README.md - Adjusted indentations for bullet points in the "Usage" section.
- Renamed "Connections" to "Getting Started" with restructured content.
- Simplified example for initializing the chat client, creating a chat room, and sending messages with Kotlin coroutines and print statements.
- Added new exported function suspend fun getStartedWithChat().
CONTRIBUTING.md - Introduced a new "Documentation" section referencing the Ably Docs repository.
- Updated the release process to include merging documentation PRs before changelog entries.
- Renumbered previous step 10 to step 11.

Possibly related PRs

  • [ECO-5105] docs: updated README.md #65: The changes in the main PR focus on restructuring and simplifying the README.md for better clarity and usability, while the retrieved PR involves extensive updates to the same file, enhancing its content and organization; thus, they are related.

Suggested reviewers

  • sacOO7

Poem

I'm hopping through code in a clear, starry night,
With coroutines dancing under soft moonlight.
My README shines bright with instructions so neat,
Every chat and message makes my heart skip a beat.
Here's to changes that cheer, from one rabbit to you—hip, hop, and woo! 🐇

🥕 Happy coding!


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7cb92dc and 4984a07.

📒 Files selected for processing (1)
  • CONTRIBUTING.md (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • CONTRIBUTING.md
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: coverage
  • GitHub Check: check

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

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

@AndyTWF AndyTWF marked this pull request as ready for review February 20, 2025 17:29
@AndyTWF AndyTWF requested review from ttypic and sacOO7 February 20, 2025 17:29
@github-actions github-actions bot temporarily deployed to staging/pull/104/dokka February 20, 2025 17:31 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

🧹 Nitpick comments (3)
README.md (3)

41-47: Enhance API Key Instructions Formatting
The nested bullet points under the "An Ably API key" section are clear and helpful. For improved readability and consistency, consider confirming that the indentation across these bullets aligns with your markdown style guide.


105-110: Streamlined "Getting Started" Section – Consider Kotlin Naming Conventions
The new "Getting Started" section is concise and effectively instructs users on initializing the Chat SDK. One minor suggestion: while the sample function is exported as SendChatMessage(), following Kotlin’s idiomatic naming (e.g., sendChatMessage()) would enhance consistency.


166-172: Specify Language for Fenced Code Block
A fenced code block displaying expected logcat output is missing an explicit language specifier. To adhere to markdown linting best practices (MD040), consider adding a language hint (e.g., plaintext):

-```
+```plaintext

This helps tools correctly format and highlight the block.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

166-166: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 71b20c4 and 75d4506.

📒 Files selected for processing (1)
  • README.md (2 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
README.md

166-166: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: check
  • GitHub Check: build
  • GitHub Check: coverage
🔇 Additional comments (1)
README.md (1)

113-161: Review Sample Code Implementation
The Kotlin code snippet clearly demonstrates initializing the Ably Realtime client, creating the Chat client, and managing room subscriptions with coroutines. The inline comments make the functionality easy to follow. For production-level guidance, you might add a note about disposing subscriptions or handling errors, but for a getting-started guide, the current implementation is acceptable.

Copy link

github-actions bot commented Feb 20, 2025

Code Coverage

Total Project Coverage 86.11%

@sacOO7
Copy link
Contributor

sacOO7 commented Feb 21, 2025

Apart from this, You might also like to update CONTRIBUTING.md, to add a release process step to update web docs for each release.

@github-actions github-actions bot temporarily deployed to staging/pull/104/dokka February 21, 2025 14:19 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

🧹 Nitpick comments (3)
README.md (3)

105-108: Enhance the "Getting Started" Section
The new "Getting Started" section offers a concise overview for initializing the Chat client and sending a message, which aligns with the PR objective to trim redundant details. It would be helpful to include a brief note that the provided code snippet must be executed within a coroutine scope to function correctly.


113-161: Review the SendChatMessage Function Implementation
The sample implementation of SendChatMessage clearly demonstrates how to initialize the Ably Realtime client, subscribe to connection and room status changes, send a message, and perform cleanup. For best practices in Kotlin, consider renaming the function to follow the lowerCamelCase convention (i.e. sendChatMessage). Additionally, you might want to mention that in a production environment, proper error handling and subscription cancellation would be necessary.

- suspend fun SendChatMessage() {
+ suspend fun sendChatMessage() {

166-173: Specify Fenced Code Block Language
The fenced code block displaying the sample log output does not currently include a language identifier. Adding one (for example, using ```text) will enhance readability and ensure compliance with markdown linting rules (MD040).

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

166-166: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 75d4506 and c7e858a.

📒 Files selected for processing (1)
  • README.md (2 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
README.md

166-166: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: check
  • GitHub Check: coverage
  • GitHub Check: build
🔇 Additional comments (2)
README.md (2)

41-47: Clarify API Key Setup Instructions
The added bullet points under the API key prerequisite improve clarity by guiding users on where to sign up, how to access the dashboard, and which capabilities they need. Ensure that the capability list remains in sync with the latest documentation on authentication capabilities.


177-180: Streamlined Documentation Section
The updated Documentation section now explicitly guides users to the complete documentation on the official Ably website, which aligns well with the PR’s goal to reduce duplication in the README. This is clear and concise.

@AndyTWF AndyTWF requested a review from sacOO7 February 21, 2025 14:22
@github-actions github-actions bot temporarily deployed to staging/pull/104/dokka February 21, 2025 14:24 Inactive
Copy link
Contributor

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

Since current kotlin web doc snippets are not in right format, I am reluctant to approve this PR for now.
I have created and self-assigned issue for this -> ably/docs#2440
Once related PR is merged, I will approve this PR right away.

@AndyTWF AndyTWF force-pushed the readme-trim-getting-started branch from a537285 to 715bef0 Compare February 25, 2025 08:25
@github-actions github-actions bot temporarily deployed to staging/pull/104/dokka February 25, 2025 08:27 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

🧹 Nitpick comments (2)
README.md (2)

121-121: Function Naming Convention
The sample function is named GetStartedWithChat(), which deviates from Kotlin’s idiomatic lowerCamelCase for function names. Consider renaming it to getStartedWithChat() to adhere to best practices.

Example diff:

- suspend fun GetStartedWithChat() {
+ suspend fun getStartedWithChat() {

167-174: Specify Language for Fenced Code Block
The fenced code block presenting the expected log output does not have a language specifier, which may impact syntax highlighting or markdown rendering in some tools. Consider adding a language tag (e.g., text) to the opening fence.

Example diff:

-```
+```text
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

167-167: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a537285 and 715bef0.

📒 Files selected for processing (2)
  • CONTRIBUTING.md (2 hunks)
  • README.md (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • CONTRIBUTING.md
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
README.md

167-167: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: build
  • GitHub Check: check
  • GitHub Check: coverage
🔇 Additional comments (4)
README.md (4)

41-47: Clarify Prerequisite Bullets
The additional instructions for signing up and configuring the API key (including required capabilities) enhance clarity for new users. Please verify that the indentation and formatting remain consistent with the rest of the document.


105-110: New "Getting Started" Section Introduction
The introductory text for the Getting Started section is concise and clearly sets upfront expectations for the tutorial. This aligns well with the PR’s objective to streamline the README.


112-163: Review of the Kotlin Code Sample
The provided Kotlin code sample effectively demonstrates the key steps: creating an Ably Realtime client, initializing the Chat client, subscribing to connection and message events, attaching a room, sending a message, and then cleaning up. The inline comments improve comprehension. Ensure that this sample is maintained as the API evolves.


178-181: Enhanced Documentation Section
The new "Documentation" section clearly directs users to the complete official documentation, addressing previous feedback about making the link more prominent.

This change adds a getting started guide to the README to guide users towards sending their first
message using Ably Chat.

This will eventually be replicated to the website dashboard.
@AndyTWF AndyTWF force-pushed the readme-trim-getting-started branch from 715bef0 to 308ba6f Compare February 25, 2025 09:05
@github-actions github-actions bot temporarily deployed to staging/pull/104/dokka February 25, 2025 09:07 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

🧹 Nitpick comments (1)
README.md (1)

112-163: Well-structured sample code for initializing and using Chat SDK.
The Kotlin code snippet in the getStartedWithChat() function is clear and demonstrates the essential steps:

  • Initialization of the Ably Realtime client with proper options.
  • Creation of the Chat client.
  • Subscription to connection and room status changes.
  • Sending a message and waiting using delay.

A couple of minor suggestions:

  • Consider adding a brief note or comment about unsubscribing from the listeners (i.e. connectionSubscription, roomSubscription, and messageSubscription) when used in a production context to prevent potential resource leaks.
  • Remember that since the function is suspend, it needs to be called from within a coroutine scope.

Overall, this snippet effectively meets the "getting started" objective.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 715bef0 and 308ba6f.

📒 Files selected for processing (2)
  • CONTRIBUTING.md (2 hunks)
  • README.md (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • CONTRIBUTING.md
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: coverage
  • GitHub Check: build
  • GitHub Check: check
🔇 Additional comments (4)
README.md (4)

41-47: Clear and concise prerequisite bullet points.
The added bullet items for signing up, using an API key, and ensuring the proper capabilities are set are clear and actionable. The formatting and content align well with the objective of streamlining the README for new users.


105-110: Effective "Getting Started" introduction section.
The new "Getting Started" title and the accompanying description clearly set the stage for a quick-start guide. This revised wording succinctly informs users of the expected outcome and guides them to follow the simple instructions.


165-174: Clear demonstration of expected log output.
The added section showing the logcat output helps set proper expectations for new users by illustrating what to look for. This reinforces the instructional aspect of the getting started guide.


178-180: Straightforward documentation call-to-action.
The updated "Documentation" section with a prominent link to the official Ably Chat SDK docs is concise and directs users to further details if needed. This change supports the goal to streamline content and avoid duplication with the website documentation.

@github-actions github-actions bot temporarily deployed to staging/pull/104/dokka February 26, 2025 13:21 Inactive
Copy link
Contributor

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

I have created PR to update web docs ably/docs#2448, once it's approved and merged, we can merge this 👍

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