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

Support listing content by status. #32

Merged
merged 4 commits into from
Jul 23, 2024
Merged

Conversation

jmoseley
Copy link
Contributor

@jmoseley jmoseley commented Jul 22, 2024

Summary by CodeRabbit

  • New Features

    • Introduced a new optional property to filter content by status, enhancing content management capabilities.
    • Updated content retrieval to support querying based on content status.
  • Bug Fixes

    • Enhanced test validations for content lifecycle transitions, ensuring accurate status representation.
  • Chores

    • Updated the application version to 0.0.6 to reflect recent changes and improvements.

@jmoseley jmoseley requested a review from EvanBoyle July 22, 2024 22:46
Copy link

coderabbitai bot commented Jul 22, 2024

Walkthrough

The recent changes enhance content management capabilities within the client interface, introducing the ability to filter content by its status. New properties and methods across several files improve querying and testing of content states. The version update reflects these modifications, signaling a progression toward a more robust content handling system.

Changes

File Change Summary
client.ts, content.ts Added ContentStatus import and optional status property for refined content queries and listing functionality.
content.test.ts Enhanced test suite with assertions for content status checks to validate state transitions (InReview, Approved, Published).
package.json Updated version number from "0.0.5" to "0.0.6" for new release indication.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant ContentService

    Client->>ContentService: Request content with status
    ContentService->>ContentService: Check if status is provided
    alt Status provided
        ContentService->>ContentService: Append status to query
    end
    ContentService->>Client: Return filtered content
Loading

🐇 In the garden of code, I hop with glee,
New statuses bloom, as bright as can be!
With each little change, our features grow wide,
A playful update, come take a ride!
Let's list and check, in a dance of delight,
Happy coding, dear friends, from morning till night! 🌼✨


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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.

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

Outside diff range, codebase verification and nitpick comments (1)
client.ts (1)

52-52: Issue Found: status property in ClientListContentOpts is not utilized.

The status property has been added to the ClientListContentOpts interface but is not utilized anywhere in the codebase. Ensure that this property is integrated and used correctly to filter content by status.

  • client.ts: status property is defined but not used in any operations.
Analysis chain

Interface change approved.

The addition of the status property to ClientListContentOpts enhances the flexibility of content listing operations.

Ensure that the new property is correctly integrated and used within the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the new `status` property in `ClientListContentOpts`.

# Test: Search for the usage of `ClientListContentOpts`. Expect: The new `status` property is being used correctly.
rg --type typescript -A 5 $'ClientListContentOpts'

Length of output: 84


Script:

#!/bin/bash
# Description: Verify the usage of the new `status` property in `ClientListContentOpts`.

# Test: Search for the usage of `ClientListContentOpts`. Expect: The new `status` property is being used correctly.
rg --type ts -A 5 $'ClientListContentOpts'

Length of output: 533


Script:

#!/bin/bash
# Description: Verify the usage of the new `status` property in `ClientListContentOpts`.

# Test: Search for the usage of `ClientListContentOpts` and the `status` property.
rg --type ts -A 5 'ClientListContentOpts' | rg 'status'

Length of output: 89

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9305641 and c416243.

Files selected for processing (4)
  • client.ts (2 hunks)
  • content.test.ts (1 hunks)
  • content.ts (2 hunks)
  • package.json (1 hunks)
Files skipped from review due to trivial changes (1)
  • package.json
Additional comments not posted (7)
client.ts (1)

6-6: Import statement change approved.

The addition of ContentStatus is necessary for the new status property in ClientListContentOpts.

content.test.ts (4)

287-291: Test assertions for InReview status approved.

The new assertions check the length of content lists returned by testClient.listContent for the InReview status, enhancing the robustness of the test.


296-300: Test assertions for Approved status approved.

The new assertions check the length of content lists returned by testClient.listContent for the Approved status, enhancing the robustness of the test.


306-310: Test assertions for Published status approved.

The new assertions check the length of content lists returned by testClient.listContent for the Published status, enhancing the robustness of the test.


315-319: Test assertions for unpublished content approved.

The new assertions check the length of content lists returned by testClient.listContent for unpublished content, enhancing the robustness of the test.

content.ts (2)

447-449: Method change approved.

The list method now incorporates the status option within its query parameters, enabling more refined content queries based on status.

Ensure that the new query parameter is correctly integrated and used within the method.

Verification successful

Verification successful.

The status query parameter is correctly integrated and used within the list method. This is confirmed by its usage in the test files, ensuring that the new functionality is being properly tested.

  • content.test.ts: Instances where the status query parameter is used in tests.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the new `status` query parameter in the `list` method.

# Test: Search for the usage of the `list` method. Expect: The new `status` query parameter is being used correctly.
rg --type typescript -A 5 $'list'

Length of output: 67


Script:

#!/bin/bash
# Description: Verify the usage of the new `status` query parameter in the `list` method.

# Test: Search for the usage of the `list` method. Expect: The new `status` query parameter is being used correctly.
rg --type ts -A 5 $'list'

Length of output: 8420


90-90: Type change approved.

The addition of the status property to ContentListOptions enhances the flexibility of content listing options.

Ensure that the new property is correctly integrated and used within the codebase.

Verification successful

The status property in ContentListOptions is correctly integrated and used within the codebase.

The search results confirm that the status property is utilized in various parts of the codebase, ensuring its proper integration and usage.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the new `status` property in `ContentListOptions`.

# Test: Search for the usage of `ContentListOptions`. Expect: The new `status` property is being used correctly.
rg --type typescript -A 5 $'ContentListOptions'

Length of output: 81


Script:

#!/bin/bash
# Description: Verify the usage of the new `status` property in `ContentListOptions`.

# Test: Search for the usage of `ContentListOptions`. Expect: The new `status` property is being used correctly.
rg --glob '*.ts' -A 5 'ContentListOptions'

Length of output: 508


Script:

#!/bin/bash
# Description: Verify the usage of the `status` property in `ContentListOptions`.

# Test: Search for the usage of `opts` within the function to check if the `status` property is being used.
rg --glob '*.ts' -A 10 'opts?.status'

Length of output: 4790

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between c416243 and 4b25c9f.

Files selected for processing (1)
  • content.test.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • content.test.ts

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 4b25c9f and b3c8174.

Files selected for processing (1)
  • content.test.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • content.test.ts

@jmoseley jmoseley merged commit ce05731 into main Jul 23, 2024
3 checks passed
@jmoseley jmoseley deleted the jeremy/list_content_by_status branch July 23, 2024 15:16
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