-
Notifications
You must be signed in to change notification settings - Fork 0
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
[ECO-4952] Start implementing room lifecycle spec #9
Conversation
This is based on [1] at b4a495e. It’s generated some questions, which I’ve asked on that PR. Note that the spec has been through a few revisions since I started implementing this; I’ve tried to keep everything in sync but some older stuff might still be accidentally there. I’ve implemented most of the specified behaviour for the ATTACH, DETACH, and RELEASE operations. I have not yet implemented RETRY since it’s quite different to those three and I wanted to get eyes on this first chunk of work; have created ably-labs#51 for implementing it. Of the operations that I have implemented, I have not implemented the following (this is accurately reflected by the @SPEC… tags in the tests): - Lifecycle behaviour that relates to another ongoing operation (created ably-labs#52) - Lifecycle behaviour relating to “transient disconnect timeouts” (created ably-labs#48) - Lifecycle behaviour that occurs “asynchronously” outside an operation (created ably-labs#50) - CHA-RL1g2, which refers to emitting “discontinuity events” which are a concept not yet implemented; this will come in ably-labs#53. The room lifecycle manager introduced by this commit is currently a standalone object, which is not integrated with the rest of the SDK. I’ve created ably-labs#47 for doing this integration work. The @SPEC… tags are based on the on the JS rules [2] @ 8c9ce8b, but I camel-cased them and also decided that: - if a test doesn't relate to a spec point, it doesn't need any markers - there should be a way to know that a spec point is tested across multiple tests - there should be a way of marking a spec point as implemented but not tested (so that can show up differently in reporting; important given that we’re also going to use this report as a to-do list of what still needs to be implemented) Part of ably-labs#28. [1] ably/specification#200 [2] https://github.com/ably/ably-js/blob/main/CONTRIBUTING.md#tests-alignment-with-the-ably-features-specification
This is a benchmark review for experiment This pull request was cloned from Experiment configurationreview_config:
# User configuration for the review
# - benchmark - use the user config from the benchmark reviews
# - <value> - use the value directly
user_review_config:
enable_ai_review: true
enable_rule_comments: false
enable_complexity_comments: false
enable_security_comments: false
enable_tests_comments: false
enable_comment_suggestions: false
enable_functionality_review: false
enable_pull_request_summary: false
enable_review_guide: true
enable_approvals: false
ai_review_config:
# The model responses to use for the experiment
# - benchmark - use the model responses from the benchmark reviews
# - llm - call the language model to generate responses
model_responses:
comments_model: benchmark
comment_area_model: benchmark
comment_validation_model: benchmark
comment_suggestion_model: benchmark
complexity_model: benchmark
functionality_model: benchmark
security_model: benchmark
tests_model: benchmark
pull_request_summary_model: benchmark
review_guide_model: llm
overall_comments_model: benchmark
# The pull request dataset to run the experiment on
pull_request_dataset:
- https://github.com/sourcery-ai/core/pull/4607
- https://github.com/sourcery-ai/core/pull/4631
- https://github.com/sourcery-ai/core/pull/4647
# CodeRabbit examples:
- https://github.com/2lambda123/-Orange-OpenSource-oorobot/pull/15
- https://github.com/2lambda123/galaxyproject-galaxy/pull/12
- https://github.com/a0v0/avtoolz/pull/79
- https://github.com/adityask98/Hotaru/pull/10
- https://github.com/agdas/vscode/pull/2
- https://github.com/agluszak/hirschgarten/pull/2
- https://github.com/alexsnow348/insightface/pull/46
- https://github.com/alikuxac/utilities/pull/10
- https://github.com/AlphaDev87/timba-api/pull/49
- https://github.com/AngeloTadeucci/Maple2/pull/239
- https://github.com/AngeloTadeucci/Maple2.File/pull/36
- https://github.com/AngeloTadeucci/Maple2/pull/233
# Examples where CodeRabbit does not generate diagrams
- https://github.com/baptisteArno/typebot.io/pull/1778
- https://github.com/btipling/foundations/pull/33
- https://github.com/btipling/foundations/pull/31
- https://github.com/chintu-777/jaeger/pull/1
- https://github.com/coji/remix-docs-ja/pull/55
- https://github.com/DaveMBush/SmartNgRX/pull/622
- https://github.com/DaveMBush/SmartNgRX/pull/481
- https://github.com/dkittle/party-connections/pull/6
- https://github.com/Drajad-Kusuma-Adi/onstudy-backend/pull/6
- https://github.com/imaami/libcanth/pull/2
# Requested by Tim
- https://github.com/2lambda123/-Orange-OpenSource-oorobot/pull/15
- https://github.com/2lambda123/galaxyproject-galaxy/pull/12
- https://github.com/a0v0/avtoolz/pull/79
- https://github.com/adityask98/Hotaru/pull/10
- https://github.com/agdas/vscode/pull/2
- https://github.com/agluszak/hirschgarten/pull/2
- https://github.com/4DNucleome/PartSeg/pull/1183
- https://github.com/ably/ably-cocoa/pull/1973
- https://github.com/ably-labs/ably-chat-swift/pull/54
- https://github.com/ably-labs/ably-chat-swift/pull/35
# Including database changes to evaluate entity-relationship diagrams
- https://github.com/sourcery-ai/core/pull/4579
# TODO: find some with Alembic
# Questions to ask to label the review comments
review_comment_labels: []
# - label: correct
# question: Is this comment correct?
# Benchmark reviews generated by running
# python -m scripts.experiment benchmark <experiment_name>
benchmark_reviews: []
|
Reviewer's Guide by SourceryThis pull request implements the initial room lifecycle management functionality for the Ably Chat SDK. It introduces a Sequence DiagramsRoom Lifecycle State DiagramstateDiagram-v2
[*] --> INITIALIZED
INITIALIZED --> ATTACHING: ATTACH
ATTACHING --> ATTACHED: Success
ATTACHING --> SUSPENDED: Failure (some contributors)
ATTACHING --> FAILED: Failure (critical)
ATTACHED --> DETACHING: DETACH
DETACHING --> DETACHED: Success
DETACHING --> FAILED: Failure
DETACHED --> ATTACHING: ATTACH
SUSPENDED --> ATTACHING: ATTACH
FAILED --> ATTACHING: ATTACH
INITIALIZED --> RELEASING: RELEASE
ATTACHED --> RELEASING: RELEASE
DETACHED --> RELEASING: RELEASE
SUSPENDED --> RELEASING: RELEASE
FAILED --> RELEASING: RELEASE
RELEASING --> RELEASED
RELEASED --> [*]
ATTACH Operation Sequence DiagramsequenceDiagram
participant C as Client
participant R as RoomLifecycleManager
participant CH as Contributor Channels
C->>R: performAttachOperation()
R->>R: Change status to ATTACHING
loop For each contributor
R->>CH: attach()
alt Success
CH-->>R: Success
else Failure
CH-->>R: Error
R->>R: Handle error (SUSPENDED/FAILED)
R-->>C: Throw error
end
end
R->>R: Change status to ATTACHED
R-->>C: Operation complete
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ruancomelli - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider refactoring some of the larger methods in RoomLifecycleManager (e.g., performDetachOperation and performReleaseOperation) into smaller, more focused functions to improve readability and maintainability.
- Add more documentation to the public interfaces of RoomLifecycleManager to provide better context for users of this code.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
Note: This is based on top of ably-labs#60; please review that one first.
This is based on ably/specification#200 at
b4a495e
. It’s generated some questions, which I’ve asked on that PR.Note that the spec has been through a few revisions since I started implementing this; I’ve tried to keep everything in sync but some older stuff might still be accidentally there.
I’ve implemented most of the specified behaviour for the
ATTACH
,DETACH
, andRELEASE
operations. I have not yet implementedRETRY
since it’s quite different to those three and I wanted to get eyes on this first chunk of work; have created ably-labs#51 for implementing it.Of the operations that I have implemented, I have not implemented the following (this is accurately reflected by the
@spec…
tags in the tests):RETRY
operation where spec says to ably-labs/ably-chat-swift#50)The room lifecycle manager introduced by this commit is currently a standalone object, which is not integrated with the rest of the SDK. I’ve created ably-labs#47 for doing this integration work.
The
@spec…
tags are based on the on the JS rules @8c9ce8b
, but I camel-cased them and also decided that:Part of ably-labs#28.
Summary by CodeRabbit
Summary by CodeRabbit
New Features
RoomLifecycleManager
to manage chat room contributor states effectively.SimpleClock
protocol to facilitate asynchronous task management in testing.RoomLifecycleContributorChannel
for testing purposes.Bug Fixes
Tests
RoomLifecycleManager
to ensure robust lifecycle management of chat rooms.