Skip to content

Conversation

UdeshyaDhungana
Copy link
Contributor

No description provided.

Copy link

coderabbitai bot commented Jul 15, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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.
    • @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 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.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

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 generate sequence diagram to generate a sequence diagram of the changes in 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.

@UdeshyaDhungana UdeshyaDhungana changed the title - Add course definitions for Redis/Pub-Sub stages Course definitions for Redis/Pub-Sub stages Jul 15, 2025
@@ -3878,3 +3878,40 @@ stages:
name: "Blocking retrieval with timeout"
difficulty: medium
marketing_md: In this stage, you will add support for a non-zero timeout duration for the `BLPOP` command.

# Pub-Sub
- slug: "mx3"
Copy link
Member

Choose a reason for hiding this comment

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

We'll need to add the extension above to the extensions key too btw

@@ -0,0 +1,51 @@
In this stage, you’ll add support for the `SUBSCRIBE` command.

### The `SUBSCRIBE` Command
Copy link
Member

Choose a reason for hiding this comment

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

Not really reviewing these, assuming they're the same as slab for now

@UdeshyaDhungana
Copy link
Contributor Author

  • Split stage 3 of pubsub
  • We test the modified behavior of ping in a separate stage as per the feedback


- slug: "lf1"
primary_extension_slug: "pub-sub"
name: "Change PING behavior"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
name: "Change PING behavior"
name: "PING in subscribed mode"


The tester will then send a series of commands, which might be allowed or un-allowed for subscribed mode.

For un-allowed command (like `SET`, `GET`, and `ECHO`) the tester will verify that your server responds with the following error:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
For un-allowed command (like `SET`, `GET`, and `ECHO`) the tester will verify that your server responds with the following error:
For un-allowed commands (like `SET`, `GET`, and `ECHO`) the tester will verify that your server responds with the following error:


The tester only verifies that error message starts with "Can't execute '<command_name>'", so you're free to use a flexible error message and not stick to the exact format that Redis uses.

For `SUBSCRIBE` command, the tester will verify that the response is its usual response.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
For `SUBSCRIBE` command, the tester will verify that the response is its usual response.
For the `SUBSCRIBE` command, the tester will verify that the response is its usual response.

- `Can't execute 'set' in subscribed mode`
- `can't execute 'SET' when one or more subscriptions exist`

- In this stage, you'll only need to handle responding with errors in case of `SET`, `GET`, and `ECHO` commands. We will get to modifying the response of `PING` command in Subscribed mode in the next stage.
Copy link
Member

Choose a reason for hiding this comment

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

We don't mention that PING has a different response at all, so this note could be confusing to users. Let's instead mention just that fact:

- In subscribed mode, `PING` has a different response (it doesn't respond with `+PONG\r\n`). We'll get to this in later stages. 

@@ -0,0 +1,38 @@
In this stage, you'll add support for modifying the response of `PING` command in the subscribed mode.

### Subscribe Mode (Modification of `PING`)
Copy link
Member

@rohitpaulk rohitpaulk Jul 16, 2025

Choose a reason for hiding this comment

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

Suggested change
### Subscribe Mode (Modification of `PING`)
### `PING` in subscribed mode

@@ -0,0 +1,38 @@
In this stage, you'll add support for modifying the response of `PING` command in the subscribed mode.
Copy link
Member

@rohitpaulk rohitpaulk Jul 16, 2025

Choose a reason for hiding this comment

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

Suggested change
In this stage, you'll add support for modifying the response of `PING` command in the subscribed mode.
In this stage, you'll add support for responding to `PING` when a client is in subscribed mode.


### Subscribe Mode (Modification of `PING`)

If a ping command is issued from a client after it enters the subscribed mode, the server does not respond with `+PONG\r\n`, which is the usual response of `PING` command. Instead, the response is a RESP-Array of two elements
Copy link
Member

@rohitpaulk rohitpaulk Jul 16, 2025

Choose a reason for hiding this comment

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

Suggested change
If a ping command is issued from a client after it enters the subscribed mode, the server does not respond with `+PONG\r\n`, which is the usual response of `PING` command. Instead, the response is a RESP-Array of two elements
If a ping command is issued from a client after it enters subscribed mode, Redis does not respond with the usual response (`+PONG\r\n`). Instead it responds with a RESP array of two elements:

pong\r\n
$0\r\n
\r\n
```
Copy link
Member

Choose a reason for hiding this comment

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

We should also test PING from a regular client after this to ensure the behaviour only changes for subscribed clients and not others.

Copy link
Member

@rohitpaulk rohitpaulk left a comment

Choose a reason for hiding this comment

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

Added notes specifically for the subscribed mode & ping stage - good to go once those are addressed!

@UdeshyaDhungana UdeshyaDhungana merged commit b490b42 into main Jul 17, 2025
33 checks passed
@UdeshyaDhungana UdeshyaDhungana deleted the pub-sub branch July 17, 2025 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants