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

feat: _hatsu.aliases top-level extension #36

Merged
merged 2 commits into from
May 14, 2024
Merged

Conversation

kwaa
Copy link
Member

@kwaa kwaa commented May 14, 2024

closed #15

Summary by CodeRabbit

  • New Features

    • Introduced support for user aliases across the application.
    • Added the ability to customize usernames with aliases in the JSON Feed Extension.
  • Documentation

    • Updated documentation to include the new aliases field in the JSON Feed Extension.

@kwaa kwaa added the enhancement New feature or request label May 14, 2024
@kwaa kwaa added this to the 0.2 [celluloid] milestone May 14, 2024
Copy link

coderabbitai bot commented May 14, 2024

Walkthrough

The changes introduce alias handling in the ApubUser and related structs. This involves adding an aliases field to UserHatsu and UserFeedHatsu, updating the into_json method in ApubUser to handle this new field, and documenting the aliases key in the JSON Feed Extension. The alterations ensure that aliases are properly managed and utilized across the application.

Changes

Files Change Summary
crates/apub/src/actors/db_user.rs Updated into_json method in ApubUser to handle aliases by cloning hatsu, extracting aliases, and setting defaults if necessary.
crates/db_schema/src/user.rs Added aliases field of type Option<String> to UserHatsu struct.
crates/feed/src/user_feed_hatsu.rs Added aliases field of type Option<String> to UserFeedHatsu and included it in conversion to DbUserHatsu.
docs/src/others/json-feed-extension.md Documented aliases key as an optional string field in the JSON Feed Extension.

Assessment against linked issues

Objective Addressed Explanation
Implement FEP-4adb, FEP-2c59 (#15)

In the code where aliases bloom,
New fields added, a brighter room.
JSON feeds now hold the key,
To names in shadows, set them free.
With every change, the system grows,
A rabbit's touch in every code that flows.


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

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

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

CodeRabbit Configration 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

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between ec17ccd and fa38aea.
Files selected for processing (4)
  • crates/apub/src/actors/db_user.rs (2 hunks)
  • crates/db_schema/src/user.rs (1 hunks)
  • crates/feed/src/user_feed_hatsu.rs (2 hunks)
  • docs/src/others/json-feed-extension.md (1 hunks)
Additional Context Used
LanguageTool (2)
docs/src/others/json-feed-extension.md (2)

Near line 13: To form a complete sentence, be sure to include a subject.
Context: ... to introduce this extension to humans. should be [https://github.com/importantimport/...


Near line 21: To form a complete sentence, be sure to include a subject.
Context: ... to introduce this extension to humans. should be [https://github.com/importantimport/...

Additional comments not posted (6)
crates/feed/src/user_feed_hatsu.rs (2)

15-15: Addition of the aliases field looks good and is consistent with the other optional fields in the struct.


46-46: The update to the into_db method correctly handles the new aliases field.

docs/src/others/json-feed-extension.md (1)

14-14: The addition of the aliases key to the top-level JSON Feed is consistent with the other optional fields and aligns with the objectives of the PR.

crates/db_schema/src/user.rs (1)

37-37: Addition of the aliases field looks good and is consistent with the other optional fields in the struct.

crates/apub/src/actors/db_user.rs (2)

114-119: The addition of logic to handle aliases in the into_json method correctly handles the new aliases field and ensures that default values are set if necessary.


144-148: The update to the construction of aliases and webfinger correctly uses the new logic for handling aliases and ensures that they are constructed correctly.

@kwaa kwaa merged commit ee7ae90 into main May 14, 2024
1 check passed
@kwaa kwaa deleted the feat/json-feed-hatsu-ext branch May 14, 2024 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement FEP-4adb, FEP-2c59
1 participant