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

chore(users): delete old worker code #1959

Open
wants to merge 1 commit into
base: 01-28-feat_user_migrate_pub_sub
Choose a base branch
from

Conversation

ABCxFF
Copy link
Contributor

@ABCxFF ABCxFF commented Jan 29, 2025

Changes

Copy link
Contributor Author

ABCxFF commented Jan 29, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add the label merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

cloudflare-workers-and-pages bot commented Jan 29, 2025

Deploying rivet with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6de4e36
Status: ✅  Deploy successful!
Preview URL: https://25cd0435.rivet.pages.dev
Branch Preview URL: https://01-29-chore-users-delete-old.rivet.pages.dev

View logs

@ABCxFF ABCxFF force-pushed the 01-28-feat_user_migrate_pub_sub branch from 55df57b to 369b249 Compare February 6, 2025 21:51
@ABCxFF ABCxFF force-pushed the 01-29-chore_users_delete_old_worker_code branch from d17acc2 to 967936e Compare February 6, 2025 21:51
@ABCxFF ABCxFF force-pushed the 01-28-feat_user_migrate_pub_sub branch from 369b249 to b3252bc Compare February 6, 2025 21:57
@ABCxFF ABCxFF force-pushed the 01-29-chore_users_delete_old_worker_code branch from 967936e to 8b00f39 Compare February 6, 2025 21:57
@ABCxFF ABCxFF force-pushed the 01-28-feat_user_migrate_pub_sub branch from b3252bc to e372d28 Compare February 10, 2025 18:53
@ABCxFF ABCxFF force-pushed the 01-29-chore_users_delete_old_worker_code branch from 8b00f39 to a082694 Compare February 10, 2025 18:53
@ABCxFF ABCxFF marked this pull request as ready for review February 10, 2025 18:57
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR removes old worker code and migrates user-related functionality to a pub/sub architecture. The changes primarily involve cleanup and removal of legacy code.

  • Removes entire user-identity and user-worker packages including operations for user creation, deletion, profile management, and token handling
  • Removes worker tests for user operations including admin promotion, party updates, team member removal, and presence updates
  • Updates import paths across multiple files by removing redundant leading double colons (::), making paths relative instead of absolute
  • Removes faker-user dependencies from various packages as part of consolidating fake data generation
  • Removes user-avatar-upload-complete operation and its associated tests, suggesting avatar functionality is being migrated

119 file(s) reviewed, 15 comment(s)
Edit PR Review Bot Settings | Greptile

@ABCxFF ABCxFF force-pushed the 01-28-feat_user_migrate_pub_sub branch from e372d28 to 51169c4 Compare February 10, 2025 23:08
@ABCxFF ABCxFF force-pushed the 01-29-chore_users_delete_old_worker_code branch from a082694 to 6de4e36 Compare February 10, 2025 23:08
@ABCxFF ABCxFF force-pushed the 01-28-feat_user_migrate_pub_sub branch from 51169c4 to 016e8f5 Compare February 14, 2025 14:31
@ABCxFF ABCxFF force-pushed the 01-29-chore_users_delete_old_worker_code branch from 6de4e36 to a69da5b Compare February 14, 2025 14:31
@ABCxFF
Copy link
Contributor Author

ABCxFF commented Feb 14, 2025

@greptileai

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Based on the provided context, I'll create a summary of the most recent changes that haven't been covered in previous reviews.

This PR continues the cleanup of old worker code and migration to pub/sub architecture, focusing on user-related functionality and code organization.

  • Removes all user worker event handlers (event_party_update.rs, event_team_member_remove.rs, etc.) that were responsible for user notifications and state updates
  • Removes the user profile validation operation (profile-validate) which handled display name, account number, and bio validation rules
  • Removes the email resolution functionality (resolve-email) that mapped email addresses to user IDs
  • Removes the team list operation (team-list) that was responsible for fetching and aggregating team membership information
  • Removes placeholder test files that were never implemented, suggesting a more focused testing approach in the new architecture

The changes appear thorough and consistent with the migration to pub/sub, though careful verification of the new implementation's functionality will be important.

119 file(s) reviewed, 28 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines 10 to 15
let identity = chirp_workflow::compat::op(
&ctx,
::user::ops::identity::get::Input {
user::ops::identity::get::Input {
user_ids: vec![user_id]
},
)
Copy link

Choose a reason for hiding this comment

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

style: consider using the op! macro here instead of chirp_workflow::compat::op for consistency with the rest of the codebase

Comment on lines 48 to 49
debug-email-res.workspace = true
user-identity-get.workspace = true

Copy link

Choose a reason for hiding this comment

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

style: Consider removing the extra blank line at the end of the file for consistency

Comment on lines 58 to 61
region-resolve-for-game.workspace = true
token-create.workspace = true
token-revoke.workspace = true
user-identity-get.workspace = true
rivet-config.workspace = true
Copy link

Choose a reason for hiding this comment

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

logic: Removing user-identity-get.workspace may break functionality that requires user identity verification in the matchmaker service. Verify that this dependency is not needed for any authentication or user validation flows.

Copy link

Choose a reason for hiding this comment

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

logic: The dev-dependencies on chirp-worker, chirp-workflow, and user suggest this package was used in testing. Check that any integration tests in other packages that depended on faker-user have been updated.

Copy link

Choose a reason for hiding this comment

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

style: Since this package is being removed from the workspace, ensure it's also removed from the workspace members list in the root Cargo.toml

Copy link

Choose a reason for hiding this comment

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

logic: the old code included cache purging for deleted users. Make sure this cache invalidation is still happening in the new implementation to prevent stale data

Copy link

Choose a reason for hiding this comment

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

style: the worker used batching for uploads (UPLOAD_BATCH_SIZE) and messages (MESSAGE_BATCH_SIZE) to handle large deletions efficiently. Ensure the new implementation has similar performance considerations

Copy link

Choose a reason for hiding this comment

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

logic: This worker was responsible for critical user profile updates. Before removing it, verify that equivalent functionality exists in the new pub/sub system, particularly the profile validation, cache purging, and analytics tracking.

Copy link

Choose a reason for hiding this comment

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

logic: The removal of this worker could break real-time party state synchronization if the replacement pub/sub system is not fully implemented. Party members may not receive updates about party changes.

Copy link

Choose a reason for hiding this comment

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

logic: This test was never implemented but its corresponding worker code in event_team_member_remove.rs still exists and handles team member removal events. Consider either implementing the test or removing the worker code as well if it's no longer needed.

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