Skip to content

feat: add joined at and avatar url for member list endpoint #1355

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

Merged
merged 1 commit into from
Apr 22, 2025

Conversation

khorshuheng
Copy link
Collaborator

@khorshuheng khorshuheng commented Apr 22, 2025

Add joined at and avatar url for member list and get member endpoint

Summary by Sourcery

Enhance workspace member endpoints by adding avatar URL and joined timestamp

New Features:

  • Add avatar URL retrieval for workspace members from user metadata
  • Include member's join timestamp in workspace member endpoints

Enhancements:

  • Update database queries to fetch additional member information
  • Modify data transfer objects to support new member attributes

Copy link

sourcery-ai bot commented Apr 22, 2025

Reviewer's Guide by Sourcery

This pull request enhances the member list and get member endpoints by adding 'joined at' and 'avatar url' fields. The changes involve updating SQL queries, data structures, and API response handling to include these new fields.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Updated SQL queries to include 'avatar_url' and 'created_at' fields.
  • Added 'af_user.metadata ->> 'icon_url' AS avatar_url' to the SELECT clause.
  • Added 'af_workspace_member.created_at' to the SELECT clause.
libs/database/src/workspace.rs
Modified API handlers to include 'avatar_url' and 'joined_at' in the response.
  • Updated 'get_workspace_members_handler' to map 'avatar_url' and 'joined_at' from member data.
  • Updated 'get_workspace_member_handler' to map 'avatar_url' and 'joined_at' from member_row data.
  • Updated 'get_workspace_member_v1_handler' to map 'avatar_url' and 'joined_at' from member_row data.
src/api/workspace.rs
Extended data structures to support 'avatar_url' and 'joined_at'.
  • Added 'avatar_url' and 'created_at' fields to 'AFWorkspaceMemberRow'.
  • Added 'joined_at' field to 'AFWorkspaceMember'.
libs/database/src/pg_row.rs
libs/database-entity/src/dto.rs
Updated SQLx query files to reflect new query changes.
  • Added new SQLx query files for updated queries.
  • Removed outdated SQLx query files.
.sqlx/query-5a138792392ddd8f7572b6fe08b6d52bd8deef885337099ab9b62d6b5f997efc.json
.sqlx/query-a527a90fcb69c58a5e711555b6ee56e7b92ceabe746279eccd7ae3e9fa918e96.json
.sqlx/query-d366aca6b187f086e5a8281081adec190bbb3cd5256c5a77ed321b99cd34bbbc.json
.sqlx/query-273cb2255ae88a24dde5e35228a6cfdb5b353e52120b0fa7addf72e539f97344.json
.sqlx/query-6f23cc00918d6c85f4b7cf71d9620a7428ebe59f0a383878b32e1abfe10dcbca.json
.sqlx/query-ee059aca8fba787658ad095f44bd0075aef1abc6eb0f34d11905765da9fd38e5.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @khorshuheng - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider adding a database migration to populate the icon_url metadata field for existing users.
  • It looks like the avatar_url field is being read from the metadata column, is there a reason it's not a dedicated column?
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@khorshuheng khorshuheng merged commit 4a0295c into main Apr 22, 2025
10 checks passed
@khorshuheng khorshuheng deleted the add-joined-at-and-avatar-url-for-member-list branch April 22, 2025 03:12
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.

1 participant